org.argouml.uml.ui.foundation.core
Class UMLStructuralFeatureTypeComboBoxModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by org.argouml.uml.ui.UMLComboBoxModel2
          extended by org.argouml.uml.ui.foundation.core.UMLStructuralFeatureTypeComboBoxModel
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.swing.ComboBoxModel, javax.swing.event.PopupMenuListener, javax.swing.ListModel, TargetListener
Direct Known Subclasses:
UMLAssociationEndTypeComboBoxModel, UMLParameterTypeComboBoxModel

public class UMLStructuralFeatureTypeComboBoxModel
extends UMLComboBoxModel2

The combobox model for the type belonging to some attribute.

Since:
Nov 2, 2002
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.argouml.uml.ui.UMLComboBoxModel2
buildingModel, CLEARED
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
UMLStructuralFeatureTypeComboBoxModel()
          Constructor for UMLStructuralFeatureTypeComboBoxModel.
 
Method Summary
protected  void addOtherModelEventListeners(java.lang.Object newTarget)
          This function allows subclasses to listen to more modelelements.
protected  void buildMinimalModelList()
          Build the minimal number of items in the model for the edit box to be populated.
protected  void buildModelList()
          Builds the list of elements and sets the selectedIndex to the currently selected item if there is one.
protected  java.lang.Object getSelectedModelElement()
          Gets the modelelement that is selected in the UML model.
protected  boolean isLazy()
           
protected  boolean isValidElement(java.lang.Object element)
          Returns true if the given element is valid.
 void modelChanged(UmlChangeEvent evt)
          If the property that this comboboxmodel depicts is changed in the UML model, this method will make sure that the changes will be done in the combobox-model equally.
protected  void removeOtherModelEventListeners(java.lang.Object oldTarget)
          This function allows subclasses to listen to more modelelements.
 
Methods inherited from class org.argouml.uml.ui.UMLComboBoxModel2
addAll, addElement, contains, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getChangedElement, getElementAt, getIndexOf, getName, getPropertySetName, getSelectedItem, getSize, getTarget, isClearable, isFireListEvents, isValidEvent, popupMenuCanceled, popupMenuWillBecomeInvisible, popupMenuWillBecomeVisible, propertyChange, removeAll, removeAllElements, removeElement, setElements, setFireListEvents, setModelInvalid, setSelectedItem, setTarget, targetAdded, targetRemoved, targetSet
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
 

Constructor Detail

UMLStructuralFeatureTypeComboBoxModel

public UMLStructuralFeatureTypeComboBoxModel()
Constructor for UMLStructuralFeatureTypeComboBoxModel.

Method Detail

isValidElement

protected boolean isValidElement(java.lang.Object element)
Description copied from class: UMLComboBoxModel2
Returns true if the given element is valid.

It is valid if it may be added to the list of elements.

Specified by:
isValidElement in class UMLComboBoxModel2
Parameters:
element - the given element
Returns:
true if the given element is valid

buildModelList

protected void buildModelList()
Description copied from class: UMLComboBoxModel2
Builds the list of elements and sets the selectedIndex to the currently selected item if there is one. Called from targetChanged every time the target of the proppanel is changed.

Specified by:
buildModelList in class UMLComboBoxModel2

buildMinimalModelList

protected void buildMinimalModelList()
Description copied from class: UMLComboBoxModel2
Build the minimal number of items in the model for the edit box to be populated. By default this calls buildModelList but it can be overridden in subclasses to delay population of the list till the list is displayed.

If this lazy list building is used, do call setModelInvalid() here!

Overrides:
buildMinimalModelList in class UMLComboBoxModel2

isLazy

protected boolean isLazy()
Overrides:
isLazy in class UMLComboBoxModel2

getSelectedModelElement

protected java.lang.Object getSelectedModelElement()
Description copied from class: UMLComboBoxModel2
Gets the modelelement that is selected in the UML model. For example, say that this ComboBoxmodel contains all namespaces (as in UMLNamespaceComboBoxmodel) , this method should return the namespace that owns the target then.

Specified by:
getSelectedModelElement in class UMLComboBoxModel2
Returns:
Object

addOtherModelEventListeners

protected void addOtherModelEventListeners(java.lang.Object newTarget)
Description copied from class: UMLComboBoxModel2
This function allows subclasses to listen to more modelelements. The given target is guaranteed to be a UML modelelement.

Overrides:
addOtherModelEventListeners in class UMLComboBoxModel2
Parameters:
newTarget - the UML modelelement

removeOtherModelEventListeners

protected void removeOtherModelEventListeners(java.lang.Object oldTarget)
Description copied from class: UMLComboBoxModel2
This function allows subclasses to listen to more modelelements. The given target is guaranteed to be a UML modelelement.

Overrides:
removeOtherModelEventListeners in class UMLComboBoxModel2
Parameters:
oldTarget - the UML modelelement

modelChanged

public void modelChanged(UmlChangeEvent evt)
Description copied from class: UMLComboBoxModel2
If the property that this comboboxmodel depicts is changed in the UML model, this method will make sure that the changes will be done in the combobox-model equally.

TODO: This function is not yet completely written!

Overrides:
modelChanged in class UMLComboBoxModel2
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook