You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



All Packages  This Package  Class Hierarchy  Class Search  Index

Interface grendel.widgets.TreeTableDataModel

The TreeTableDataModel interface is used to mediate between the underlying data store and the TreeTable. The interface supports two major mechanisms for retrieving tree data: as enumerations or by getting the first child/getting the next sibling of a node. The model only needs to implement one. After initially setting the data model for the TreeTable, the model should notify listeners of changes using the TreeTableModelListener interface.

See Also: TreeTable, TreeTableModelListener


public interface  TreeTableDataModel
{
          // Methods 14
     public abstract void addTreeTableModelListener(TreeTableModelListener);
     public abstract Object getChild(Object);
     public abstract Enumeration getChildren(Object);
     public abstract Object getData(Object, Object);
     public abstract Icon getIcon(Object);
     public abstract Object getNextSibling(Object);
     public abstract Icon getOverlayIcon(Object);
     public abstract Object getRoot();
     public abstract boolean isCollapsed(TreePath);
     public abstract boolean isLeaf(Object);
     public abstract void removeTreeTableModelListener(TreeTableModelListener);
     public abstract void setCollapsed(TreePath, boolean);
     public abstract void setData(Object, Object, Object);
     public abstract boolean showRoot();
}



Methods


showRoot

   public abstract boolean showRoot() 

Indicates whether the root node is visible. An invisible root node should not have siblings.

Returns:
true if the root node should be displayed.


getChildren

   public abstract Enumeration getChildren(Object aNode) 

Retrieves the children of a given node. If aNode is null then the enumeration returned should represent the nodes at the root level. An implementation that supports this method does not need to implement the getRoot(), getChild() or getNextSibling() methods (they can return null).

Returns:
An enumeration of objects representing the children of the given node.

See Also: getRoot, getChild, getNextSibling



getRoot

   public abstract Object getRoot() 

Retrieves the root node of the tree. An implementation that supports this method should implement the getChild() and getNextSibling() methods and does not need to implement the getChildren() method (it can return null).

Returns:
An object representing the root of the data model being displayed.

See Also: getChildren, getChild, getNextSibling



getChild

   public abstract Object getChild(Object aNode) 

Retrieves the first child of the given node. Should return null if the node has no children. An implementation that supports this method should implement the getRoot() and getNextSibling() methods and does not need to implement the getChildren() method (it can return null).

Returns:
An object representing the first child of the given node.

See Also: getChildren, getRoot, getNextSibling



getNextSibling

   public abstract Object getNextSibling(Object aNode) 

Retrieves the next sibling of the given node. Should return null if the node has no next sibling. An implementation thatsupports this method should implement the getChild() and getNextSibling() methods and does not need to implement the getChildren() method (it can return null).

Returns:
An object representing the next sibing of the given node.

See Also: getChildren, getRoot, getChild



isLeaf

   public abstract boolean isLeaf(Object aNode) 

Indicates whether the given node is a leaf. The values returned by isLeaf() and getChild() or getChildren() should be consistant.

Returns:
true if the given node is a leaf.


isCollapsed

   public abstract boolean isCollapsed(TreePath aPath) 

Indicates whether the given node is collapsed.

Returns:
true if the given node is collapsed.


setCollapsed

   public abstract void setCollapsed(TreePath aPath, 
                                     boolean aCollapsed) 

Method to set the collapsed state of a node.



getData

   public abstract Object getData(Object aNode, 
                                  Object aID) 

Retrieves the data for the given node at the column with the given id. The data will be passed on to the CellRenderer of the column for rendering.

Returns:
An Object representing the data at the given column for the given node.

See Also: CellRenderer, Column



setData

   public abstract void setData(Object aNode, 
                                Object aID, 
                                Object aValue) 

Method for setting the data for the given node at the column with the given id. The data is retrieved from the CellEditor of the column.

See Also: CellEditor, Column



getIcon

   public abstract Icon getIcon(Object aNode) 

Retrieves an icon representing the given node. The return value can be null if no icon is to be drawn.

Returns:
An Icon representing the given node.


getOverlayIcon

   public abstract Icon getOverlayIcon(Object aNode) 

Retrieves an icon representing a modified state for a given node. The return value can be null if no overlay icon is to be drawn. The overlay icon should be transparent and the same size as the returned icon.

Returns:
An Icon representing the given node state.

See Also: getIcon



addTreeTableModelListener

   public abstract void addTreeTableModelListener(TreeTableModelListener aListener) 

Adds a TreeTableModelListener.



removeTreeTableModelListener

   public abstract void removeTreeTableModelListener(TreeTableModelListener aListener) 

Removes a TreeTableModelListener.



All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4