project35.mda.model
Class RecordNameProvider

java.lang.Object
  extended by project35.mda.model.RecordNameProvider
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
RecordModel, RecordModelReference

public abstract class RecordNameProvider
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

base class which encapsulates methods common to both record models and record model references


Copyright (c) 2008 Kevin Garwood for Project35. The original code was developed by Kevin Garwood for the University of Manchester. Revisions have been made for Project35, a project that is independent of that institution. This code is licensed under the Academic Free License version 3.0. The code attribution for the original code is included here:

Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.


Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
protected  ListFieldModel containingListModel
           
protected  java.lang.String instanceIdentifier
           
protected  boolean isVisible
           
protected  java.lang.String toolTipText
           
protected  boolean useInstanceIdentifier
           
 
Constructor Summary
RecordNameProvider()
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener changeListener)
          adds change listener.
 void clearChangeListeners()
          removes list of change listeners
abstract  java.lang.Object clone()
           
abstract  java.lang.String computeDisplayName()
           
 void fireChangeEvent(ChangeObject changeObject)
           
 java.util.ArrayList getChangeListeners()
          change listeners for this record.
 ListFieldModel getContainingListModel()
           
abstract  java.lang.String getDisplayName()
           
 RecordModel getParentRecordModel()
           
abstract  java.lang.String getRecordClassName()
           
 java.lang.String getToolTip()
           
 void informListenersOfChildCreation()
          method used to inform listeners of child creation
 void informListenersOfDestruction()
          method used to inform listeners of child being deleted
 void informListenersOfGainedFocus()
          method used to inform listeners that the record has gained focus this method is invoked when edit button in list field is pressed.
 boolean isVisible()
           
protected  void notifyListeners(int changeType)
           
 void removeChangeListener(javax.swing.event.ChangeListener changeListener)
          Since I'm making the search results 'live', I'm going to need this
 void setChangeListener(javax.swing.event.ChangeListener changeListener)
           
 void setChangeListeners(java.util.ArrayList changeListeners)
          sets the list of change listeners that watch this record model
 void setContainingListModel(ListFieldModel containingListModel)
          sets the list field that contains this model.
 void setInstanceIdentifier(java.lang.String instanceIdentifier)
          this is an identifier supplied by the parent record.
 void setIsVisible(boolean isVisible)
           
 void setToolTipText(java.lang.String toolTipText)
           
 void setUseInstanceIdentifier(boolean useInstanceIdentifier)
           
abstract  void updateDisplayName()
           
 boolean useInstanceIdentifier()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

containingListModel

protected ListFieldModel containingListModel

instanceIdentifier

protected java.lang.String instanceIdentifier

useInstanceIdentifier

protected boolean useInstanceIdentifier

toolTipText

protected java.lang.String toolTipText

isVisible

protected boolean isVisible
Constructor Detail

RecordNameProvider

public RecordNameProvider()
Method Detail

isVisible

public boolean isVisible()

getToolTip

public java.lang.String getToolTip()

getRecordClassName

public abstract java.lang.String getRecordClassName()

getDisplayName

public abstract java.lang.String getDisplayName()

getChangeListeners

public java.util.ArrayList getChangeListeners()
change listeners for this record. The primary change listener is project35.view.NavigationTree but is generalised to accommodate a list


getParentRecordModel

public RecordModel getParentRecordModel()

getContainingListModel

public ListFieldModel getContainingListModel()

useInstanceIdentifier

public boolean useInstanceIdentifier()

setIsVisible

public void setIsVisible(boolean isVisible)

setToolTipText

public void setToolTipText(java.lang.String toolTipText)

setUseInstanceIdentifier

public void setUseInstanceIdentifier(boolean useInstanceIdentifier)

setInstanceIdentifier

public void setInstanceIdentifier(java.lang.String instanceIdentifier)
this is an identifier supplied by the parent record. It is used to help give the record model a unique display name should it not contain enough useful display name components to distinguish it in a list from other components


setContainingListModel

public void setContainingListModel(ListFieldModel containingListModel)
sets the list field that contains this model. if the model is the root item, then the list model would be null

Parameters:
containingListModel - the list field that contains this record

updateDisplayName

public abstract void updateDisplayName()

computeDisplayName

public abstract java.lang.String computeDisplayName()

clearChangeListeners

public void clearChangeListeners()
removes list of change listeners


addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener changeListener)
adds change listener. Typically this is going to be project35.view.NavigationTree, but the class has been generalised to accept more than one kind of listener


setChangeListener

public void setChangeListener(javax.swing.event.ChangeListener changeListener)

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener changeListener)
Since I'm making the search results 'live', I'm going to need this

Parameters:
changeListener - - listener to remove if it is registered

setChangeListeners

public void setChangeListeners(java.util.ArrayList changeListeners)
sets the list of change listeners that watch this record model


informListenersOfChildCreation

public void informListenersOfChildCreation()
method used to inform listeners of child creation


informListenersOfDestruction

public void informListenersOfDestruction()
method used to inform listeners of child being deleted


informListenersOfGainedFocus

public void informListenersOfGainedFocus()
method used to inform listeners that the record has gained focus this method is invoked when edit button in list field is pressed.


notifyListeners

protected void notifyListeners(int changeType)

fireChangeEvent

public void fireChangeEvent(ChangeObject changeObject)

clone

public abstract java.lang.Object clone()
Overrides:
clone in class java.lang.Object