|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.swing.customattribute.ItemListAttribute
ItemListAttribute
: An attribute with a list of possible values. The editor is a combobox. A generator key can be set in the constructor. The string representation is determined by calling toString() on the objectstringRepresentation that is passed to the constructor.
| Constructor Summary | |
ItemListAttribute(java.lang.Object[] items,
java.lang.String name,
java.lang.Object value,
java.lang.String generatorKey,
java.lang.Object stringRepresentation)
Constructor |
|
| Method Summary | |
java.lang.Object |
clone()
Clones this attribute. |
java.lang.Object |
cloneValue()
Clones this attribute's value. |
Constraint |
getConstraint()
Returns the root of the constraint tree. |
CustomAttributeEditor |
getEditor()
Method getEditor returns an instance of a
CustomAttributeEditor which the
AttributeTree will use to allow users to edit this
attribute. |
java.lang.String |
getGeneratorKey()
Returns a String which will be used as key to retrieve the
generator for this CustomAttribute. |
java.lang.String |
getName()
Returns the Attribute name. |
CustomAttributeRenderer |
getRenderer()
Returns an instance of a CustomAttributeRenderer which
the AttributeTree uses to render values of this
attribute. |
java.lang.String |
getStringRepresentation()
Returns a String representation for the value of this
attribute, which will be used to create an instance
of this attribute via the CustomAttributeGenerator. |
AttributeType |
getType()
Returns the current value's type. |
java.lang.Object |
getValue()
Returns the Attribute value. |
boolean |
isMutable()
Returns the mutable flag that indicates whether the attribute is mutable or immutable. |
java.lang.Object |
newValueInstance()
Creates a new instance of the value part of the CustomAttribute. |
void |
setConstraint(Constraint constraint)
Sets the root of the constraint tree. |
void |
setMutable(boolean mutable)
Sets the mutable flag that indicates whether the attribute is mutable or immutable. |
void |
setName(java.lang.String name)
Sets the name of this attribute. |
void |
setValue(java.lang.Object value)
Sets the Attribute value. |
boolean |
useDefaultEditor()
If the CustomAttribute does not implement its own editor, it
can use the default editors if the value is one of the recognized types
(e.g. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ItemListAttribute(java.lang.Object[] items,
java.lang.String name,
java.lang.Object value,
java.lang.String generatorKey,
java.lang.Object stringRepresentation)
items - The possible valuesname - The namevalue - The current valuegeneratorKey - The generator keystringRepresentation - The method toString() of this object is used
to determine the string representation that
is stored to file| Method Detail |
public CustomAttributeEditor getEditor()
CustomAttributegetEditor returns an instance of a
CustomAttributeEditor which the
AttributeTree will use to allow users to edit this
attribute. The method returns null if no such editor exists
and the attribute is not editable or the default editor should be used.
getEditor in interface CustomAttributeCustomAttributeEditor for this attribute.public boolean useDefaultEditor()
CustomAttributeCustomAttribute does not implement its own editor, it
can use the default editors if the value is one of the recognized types
(e.g. String, Integer, etc.)
useDefaultEditor in interface CustomAttributeCustomAttribute.getEditor() returns nullpublic CustomAttributeRenderer getRenderer()
CustomAttributeCustomAttributeRenderer which
the AttributeTree uses to render values of this
attribute. The method returns null if no such renderer
exists and the default renderer should be used. A renderer is required
if the Attribute cannot be rendered by the
standard renderer of the Table.
getRenderer in interface CustomAttributeCustomAttributeRenderer for this attribute.public java.lang.String getStringRepresentation()
CustomAttributeString representation for the value of this
attribute, which will be used to create an instance
of this attribute via the CustomAttributeGenerator.
getStringRepresentation in interface CustomAttributeString representation of this attribute.public java.lang.String getGeneratorKey()
CustomAttributeString which will be used as key to retrieve the
generator for this CustomAttribute. Applications should use
this key to provide a registry-alike mechanism to obtain generators.
getGeneratorKey in interface CustomAttributeString usable as a key for this attribute.public java.lang.Object newValueInstance()
CustomAttributeCustomAttribute. This is needed when instances of this
Attribute need to be added and an instance of the value part is required.
newValueInstance in interface CustomAttributeObject for the value part of this attribute.public void setName(java.lang.String name)
CustomAttribute
setName in interface CustomAttributename - String for the new name.public AttributeType getType()
Attribute
getType in interface Attributepublic java.lang.String getName()
AttributeAttribute name.
getName in interface Attributepublic java.lang.Object getValue()
AttributeAttribute value.
getValue in interface Attribute
public void setValue(java.lang.Object value)
throws IllegalValueException,
ConstraintViolationException
AttributeAttribute value.
setValue in interface Attributevalue - the new value of the attribute.
IllegalValueException - if the attribute value is invalid.
ConstraintViolationException - thrown if the constraint of this
attribute does not permit setting the new value.
public java.lang.Object cloneValue()
throws java.lang.CloneNotSupportedException
Attribute
cloneValue in interface Attributejava.lang.CloneNotSupportedException - may be thrown
if invoking this method on the value is not allowed or supported.public boolean isMutable()
Attribute
isMutable in interface Attributetrue, if it is mutable; false, if
it is immutable.public void setMutable(boolean mutable)
Attribute
setMutable in interface Attributemutable - the new value of the mutable flag.public void setConstraint(Constraint constraint)
Restrictable
setConstraint in interface Restrictableconstraint - the root of the constraint treepublic Constraint getConstraint()
Restrictable
getConstraint in interface Restrictable
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
AttributeString instances are immutable. The value of the attribute is
copied by means of the clone method of
Object.
clone in interface Attributejava.lang.CloneNotSupportedException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||