org.argouml.uml.ui
Class UMLComboBoxEntry

java.lang.Object
  extended byorg.argouml.uml.ui.UMLComboBoxEntry
All Implemented Interfaces:
Comparable

public class UMLComboBoxEntry
extends Object
implements Comparable

A combobox entry. TODO: What is a Phantom element? Document it.


Field Summary
private  String displayName
          display name will be the same as shortName unless there is a name collision
private  Object element
           
private  String longName
          longName is composed of an identifier and a name as in Class: String
private  Profile profile
           
private  String shortName
           
private  boolean thisIsAPhantom
          i am not quite sure what isPhantom means, it may be that it is an entry that is not in the model list...pjs
 
Constructor Summary
UMLComboBoxEntry(Object modelElement, Profile theProfile, boolean isPhantom)
          The constructor.
 
Method Summary
 void checkCollision(String before, String after)
          If one of the given names equals the "short name", then we'll display the longname.
 int compareTo(Object other)
           
private static Object findNamespace(Object phantomNS, Object targetModel)
           
 Object getElement(Object targetModel)
           
 String getLongName()
           
 String getShortName()
           
 boolean isPhantom()
           
 void nameChanged(Object modelElement)
           
 void setElement(Object modelElement, boolean isPhantom)
           
 String toString()
           
 void updateName()
          Generate a string representatation of the UML modelelement of this combobox element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

element

private Object element

shortName

private String shortName

longName

private String longName
longName is composed of an identifier and a name as in Class: String


profile

private Profile profile

displayName

private String displayName
display name will be the same as shortName unless there is a name collision


thisIsAPhantom

private boolean thisIsAPhantom
i am not quite sure what isPhantom means, it may be that it is an entry that is not in the model list...pjs

Constructor Detail

UMLComboBoxEntry

public UMLComboBoxEntry(Object modelElement,
                        Profile theProfile,
                        boolean isPhantom)
The constructor.

Parameters:
modelElement - the model element that this combobox entry represents
theProfile - the profile according which the textual representatation of the modelelement is generated
isPhantom - true if this is a phantom element
Method Detail

toString

public String toString()
See Also:
Object.toString()

updateName

public void updateName()
Generate a string representatation of the UML modelelement of this combobox element.


checkCollision

public void checkCollision(String before,
                           String after)
If one of the given names equals the "short name", then we'll display the longname.

Parameters:
before - the first given name
after - the 2nd given name

getShortName

public String getShortName()
Returns:
the short name of the modelelement

getLongName

public String getLongName()
Returns:
the long name of the modelelement

findNamespace

private static Object findNamespace(Object phantomNS,
                                    Object targetModel)

getElement

public Object getElement(Object targetModel)
Parameters:
targetModel - the UML Model that contains the modelelement
Returns:
the modelelement represented by this combobox item

setElement

public void setElement(Object modelElement,
                       boolean isPhantom)
Parameters:
modelElement - the modelelement represented by this combobox item
isPhantom - true if this is a phantom element

compareTo

public int compareTo(Object other)
Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)

nameChanged

public void nameChanged(Object modelElement)
Parameters:
modelElement - the modelelement that has its name changed

isPhantom

public boolean isPhantom()
Returns:
true if this is a phantom element


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook