com.tensegrity.generic.attribute
Interface CustomAttribute

All Superinterfaces:
Attribute, java.lang.Cloneable, Restrictable
All Known Implementing Classes:
DirectoryLocationAttribute, FormatAttribute, HRefAttribute, ItemListAttribute

public interface CustomAttribute
extends Attribute

The CustomAttribute interface is an extension of the Attribute interface and defines the methods a class implementation has to provide for persistence and use in an AttributeEditor. A CustomAttribute is used whenever special data (of different types than the basic types String, Integer, etc.) is stored as a value in the attribute or when the behavior or look in an AttributeEditor should be modified by a custom renderer or editor.

These methods are used to define the look and feel of the CustomAttribute when used in an AttributeEditor:

These methods define how to serialize and rebuild instances of a concrete CustomAttribute implementation:

Version:
$Id: CustomAttribute.java,v 1.16 2005/10/24 13:36:15 KevinCVS Exp $
Author:
Gilles Iachelini, Burkhard Wick

Method Summary
 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.
 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.
 java.lang.Object newValueInstance()
          Deprecated. Not called anymore, use Attribute.cloneValue() instead!
 void setName(java.lang.String name)
          Deprecated. Not called anymore, attribute instances must not change their name after creation
 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 interface com.tensegrity.generic.attribute.Attribute
clone, cloneValue, getName, getType, getValue, isMutable, setMutable, setValue
 
Methods inherited from interface com.tensegrity.generic.constraint.Restrictable
getConstraint, setConstraint
 

Method Detail

getEditor

public CustomAttributeEditor getEditor()
Method getEditor 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.

Returns:
a CustomAttributeEditor for this attribute.

Find more information in the class documentation


useDefaultEditor

public 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. String, Integer, etc.)

Returns:
true to use the default editors if the method getEditor() returns null

Find more information in the class documentation


getRenderer

public CustomAttributeRenderer getRenderer()
Returns an instance of a CustomAttributeRenderer 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.

Returns:
a CustomAttributeRenderer for this attribute.

Find more information in the class documentation


getStringRepresentation

public 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.

Returns:
a String representation of this attribute.

Find more information in the class documentation


getGeneratorKey

public java.lang.String getGeneratorKey()
Returns a String 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.

Returns:
a String usable as a key for this attribute.

Find more information in the class documentation


newValueInstance

public java.lang.Object newValueInstance()
Deprecated. Not called anymore, use Attribute.cloneValue() instead!

Creates a new instance of the value part of the CustomAttribute. This is needed when instances of this Attribute need to be added and an instance of the value part is required.

Returns:
an Object for the value part of this attribute.

setName

public void setName(java.lang.String name)
Deprecated. Not called anymore, attribute instances must not change their name after creation

Sets the name of this attribute.

Parameters:
name - String for the new name.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.