com.tensegrity.gui.swt.control.attributetree
Class AttributeTableItem

java.lang.Object
  extended bycom.tensegrity.gui.swt.control.attributetree.AttributeTableItem

public class AttributeTableItem
extends java.lang.Object

This class represents a table entry which usually wraps an Attribute.

Version:
$Id: AttributeTableItem.java,v 1.6 2005/06/14 09:37:24 ArndHouben Exp $
Author:
Arnd Houben

Constructor Summary
AttributeTableItem(java.lang.String path, Attribute attribute, int orderID)
          Constructor which creates a new AttributeTableItem instance with the given parent path, attribute and order id.
 
Method Summary
 void addChildItem(AttributeTableItem item)
          Adds further items to this AttributeTableItem
 boolean equals(java.lang.Object o)
           
 Attribute getAttribute()
          Returns the corresponding attribute
 AttributeTableItem[] getChildren()
          Get all referecend AttributeTableItems.
 java.lang.String getFullPath()
          Returns the full path to the attribute this item relates to.
 java.lang.String getName()
          Returns the attribute name or an empty string if no attribute is defined.
 int getOrderID()
          Returns the order id of this item.
 AttributeTableItem getParent()
          Returns the parent AttributeTableItem.
 java.lang.String getParentName()
          Returns the name of the parent attribute, within an AttributeSet, which contains this attribute.
 java.lang.String getPath()
          Returns the path to the parent attribute this item relates to.
 boolean hasChildren()
          Checks if this AttributeTableItem has child items
 int hashCode()
           
 boolean isCategory()
          Checks if this AttributeTableItem represents a category attribute
 boolean isInUndefinedState()
          Returns true if the item is in an undefined state, i.e. at least two attributes within a multiselection have the same value
 boolean isReadOnly()
          Signals if the corresponding attribute can be changed or not.
 void setInUndefinedState(boolean isInUndefinedState)
          Sets the undefined state of the AttributeTableItem.
 void setParent(AttributeTableItem item)
          Sets the parent AttributeTableItem
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeTableItem

public AttributeTableItem(java.lang.String path,
                          Attribute attribute,
                          int orderID)
Constructor which creates a new AttributeTableItem instance with the given parent path, attribute and order id.
Note: the last entry in path and the parent attribute name do not need to be equal!! E.g. in cases of subset attributes the parent name is the subset attribute whereas the path points to the corresponding top level attribute.

Parameters:
path - path to the parent attribute
attribute - attribute to store
orderID - an id for sorting usage
Method Detail

getOrderID

public final int getOrderID()
Returns the order id of this item.

Returns:
order id which can be used to implement sorting

addChildItem

public final void addChildItem(AttributeTableItem item)
Adds further items to this AttributeTableItem

Parameters:
item - an item which is a child of this AttributeTableItem

getAttribute

public final Attribute getAttribute()
Returns the corresponding attribute

Returns:
the wrapped Attribute instance

getChildren

public final AttributeTableItem[] getChildren()
Get all referecend AttributeTableItems.

Returns:
an array of AttributeTableItems

getName

public final java.lang.String getName()
Returns the attribute name or an empty string if no attribute is defined.

Returns:
attribute name or an empty string

getPath

public final java.lang.String getPath()
Returns the path to the parent attribute this item relates to.

Returns:
the path to the related parent attribute or an empty String in case of a top level attribute.

getFullPath

public final java.lang.String getFullPath()
Returns the full path to the attribute this item relates to. Note that the full path includes the attribute name

Returns:
the full path of the related attribute

getParentName

public final java.lang.String getParentName()
Returns the name of the parent attribute, within an AttributeSet, which contains this attribute.

Returns:
the parent name of this AttributeTableItem or an empty String if it is a top level item, i.e. the item has no parent

hasChildren

public final boolean hasChildren()
Checks if this AttributeTableItem has child items

Returns:
true if this AttributeTableItem has children, false otherwise

setParent

public final void setParent(AttributeTableItem item)
Sets the parent AttributeTableItem

Parameters:
item - the parent item of this AttributeTableItem

getParent

public final AttributeTableItem getParent()
Returns the parent AttributeTableItem.

Returns:
parent item or null in case of the root item

isReadOnly

public final boolean isReadOnly()
Signals if the corresponding attribute can be changed or not.

Returns:
true if the attribute is not mutable, false otherwise

toString

public java.lang.String toString()

isInUndefinedState

public final boolean isInUndefinedState()
Returns true if the item is in an undefined state, i.e. at least two attributes within a multiselection have the same value

Returns:
true if the item state is undefined, false otherwise

setInUndefinedState

public final void setInUndefinedState(boolean isInUndefinedState)
Sets the undefined state of the AttributeTableItem. This is needed for multiselection.

Parameters:
isInUndefinedState - the new undefined state. Specify true to indicate that this AttributeTableItem is in an undefined state, false otherwise

isCategory

public final boolean isCategory()
Checks if this AttributeTableItem represents a category attribute

Returns:
true if the corresponding atttribute is of type category, false otherwise

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()


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