com.tensegrity.gui.swing.customattribute
Class DirectoryLocationAttribute

java.lang.Object
  extended bycom.tensegrity.gui.swing.customattribute.DirectoryLocationAttribute
All Implemented Interfaces:
Attribute, java.lang.Cloneable, CustomAttribute, Restrictable

public class DirectoryLocationAttribute
extends java.lang.Object
implements CustomAttribute

Class DirectoryLocationAttribute implements the CustomAttribute interface to create an Attribute which represents a Directory Location in a FileSystem. Thus the DirectoryLocationEditor opens a FileChooser and the DirectoryLocationRenderer is a simple Label.

Version:
$Id: DirectoryLocationAttribute.java,v 1.7 2005/03/18 08:47:30 BurkhardWick Exp $
Author:
Gilles Iachelini

Constructor Summary
DirectoryLocationAttribute()
          Creates a new DirectoryLocationAttribute with UNKNOWN as location.
 
Method Summary
 java.lang.Object clone()
          Clones this attribute.
 java.lang.Object cloneValue()
          Returns a new String instance with the internal location as value.
 Constraint getConstraint()
          Does nothing and returns null.
 CustomAttributeEditor getEditor()
          Returns an instance of the DirectoryLocationEditor.
 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 name.
 CustomAttributeRenderer getRenderer()
          Returns the DirectoryLocationRenderer.
 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.String getTitle()
          Returns a descriptive title for this Attribute.
 AttributeType getType()
          Returns a new instance of FileAttributeTypeConstant.
 java.lang.Object getValue()
          Returns the location.
 boolean isMutable()
          Returns the mutable flag.
 java.lang.Object newValueInstance()
          Creates a copy of the this attributes location.
 void setConstraint(Constraint constraint)
          Ignored.
 void setMutable(boolean mutable)
          Sets the mutable flag.
 void setName(java.lang.String name)
          Sets the name.
 void setValue(java.lang.Object value)
          Sets the location string of this attribute.
 java.lang.String toString()
           
 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, wait, wait, wait
 

Constructor Detail

DirectoryLocationAttribute

public DirectoryLocationAttribute()
Creates a new DirectoryLocationAttribute with UNKNOWN as location.

Method Detail

getEditor

public CustomAttributeEditor getEditor()
Returns an instance of the DirectoryLocationEditor.

Specified by:
getEditor in interface CustomAttribute
Returns:
a CustomAttributeEditor for this attribute.
See Also:
CustomAttribute.getEditor()

setValue

public void setValue(java.lang.Object value)
Sets the location string of this attribute.

Specified by:
setValue in interface Attribute
Parameters:
value - the new value of the attribute.
See Also:
Attribute.setValue(Object)

getValue

public java.lang.Object getValue()
Returns the location.

Specified by:
getValue in interface Attribute
Returns:
the value of this attribute.
See Also:
Attribute.getValue()

getRenderer

public CustomAttributeRenderer getRenderer()
Returns the DirectoryLocationRenderer.

Specified by:
getRenderer in interface CustomAttribute
Returns:
a CustomAttributeRenderer for this attribute.
See Also:
CustomAttribute.getRenderer()

newValueInstance

public java.lang.Object newValueInstance()
Creates a copy of the this attributes location.

Specified by:
newValueInstance in interface CustomAttribute
Returns:
an Object for the value part of this attribute.
See Also:
CustomAttribute.newValueInstance()

getTitle

public java.lang.String getTitle()
Returns a descriptive title for this Attribute.

Returns:
the title of this attribute as String. Hardwired to DirectoryLocation Attribute.

getName

public java.lang.String getName()
Returns the name.

Specified by:
getName in interface Attribute
Returns:
String

setName

public void setName(java.lang.String name)
Sets the name.

Specified by:
setName in interface CustomAttribute
Parameters:
name - The name to set

getStringRepresentation

public java.lang.String getStringRepresentation()
Description copied from interface: CustomAttribute
Returns a String representation for the value of this attribute, which will be used to create an instance of this attribute via the CustomAttributeGenerator.

Specified by:
getStringRepresentation in interface CustomAttribute
Returns:
a String representation of this attribute.

cloneValue

public java.lang.Object cloneValue()
                            throws java.lang.CloneNotSupportedException
Returns a new String instance with the internal location as value.

Specified by:
cloneValue in interface Attribute
Returns:
a deep copy of this attribute's value.
Throws:
java.lang.CloneNotSupportedException - may be thrown if invoking this method on the value is not allowed or supported.
See Also:
Attribute.cloneValue()

getType

public AttributeType getType()
Returns a new instance of FileAttributeTypeConstant.

Specified by:
getType in interface Attribute
Returns:
the type of the current value.
See Also:
Attribute.getType()

isMutable

public boolean isMutable()
Returns the mutable flag.

Specified by:
isMutable in interface Attribute
Returns:
true, if it is mutable; false, if it is immutable.
See Also:
Attribute.isMutable()

setMutable

public void setMutable(boolean mutable)
Sets the mutable flag.

Specified by:
setMutable in interface Attribute
Parameters:
mutable - the new value of the mutable flag.
See Also:
Attribute.setMutable(boolean)

getConstraint

public Constraint getConstraint()
Does nothing and returns null.

Specified by:
getConstraint in interface Restrictable
Returns:
the root of the constraint tree
See Also:
Restrictable.getConstraint()

setConstraint

public void setConstraint(Constraint constraint)
Ignored. Does nothing.

Specified by:
setConstraint in interface Restrictable
Parameters:
constraint - the root of the constraint tree
See Also:
Restrictable.setConstraint(com.tensegrity.generic.constraint.Constraint)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: Attribute
Clones this attribute. The name of the attribute is not deep-copied, as String instances are immutable. The value of the attribute is copied by means of the clone method of Object.

Specified by:
clone in interface Attribute
Throws:
java.lang.CloneNotSupportedException

getGeneratorKey

public java.lang.String getGeneratorKey()
Description copied from interface: CustomAttribute
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.

Specified by:
getGeneratorKey in interface CustomAttribute
Returns:
a String usable as a key for this attribute.

toString

public java.lang.String toString()

useDefaultEditor

public boolean useDefaultEditor()
Description copied from interface: CustomAttribute
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.)

Specified by:
useDefaultEditor in interface CustomAttribute
Returns:
true to use the default editors if the method CustomAttribute.getEditor() returns null


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