ilog.views.appframe.docview.project
Interface IlvDataContainer

All Known Implementing Classes:
IlvDefaultDataContainer, IlvProjectDataContainer, IlvWorkspaceDataContainer

public interface IlvDataContainer

Defines objects that contain hierarchical data.

See Also:
IlvProjectDocument

Field Summary
static String NODE_TITLE_PROPERTY
          Bound property name for the title of a node.
 
Method Summary
 boolean acceptChild(Object parent, String category)
          Determines whether the specified parent node can have a child added with the specified category.
 void addDataContainerListener(DataContainerListener listener)
          Adds the specified data container listener to receive data container events from this container.
 boolean canRemove(Object parent, Object node)
          Determines whether the specified node can be removed from this data container.
 String getCategory(Object node)
          Returns the category of the node.
 Object getChildAt(Object parent, int index)
          Returns the child node at the specified index in the child array of the parent node.
 int getChildCount(Object parent)
          Returns the number of children of the parent node.
 int getIndexOfChild(Object parent, Object child)
          Returns the index of the child node in the child array of the parent node.
 Object getNodeProperty(Object node, String propertyName)
          Returns the value of the node property with the specified propertyName.
 Object getParent(Object node)
          Returns the parent node of the specified node.
 String getTitle(Object node)
          Returns the title of the specified node.
 void insertNode(Object parent, Object node, int index)
          Inserts the specified node among the children of the specified parent node at a specified position.
 void removeDataContainerListener(DataContainerListener listener)
          Removes the specified data container listener, so that it no longer receives data container events from the data container.
 boolean removeNode(Object parent, Object node)
          Removes the specified node from the list of child nodes of the specified parent node.
 void setNodeProperty(Object node, String propertyName, Object value)
          Sets a new value to the property of the specified node with the specified propertyName.
 void setTitle(Object node, String title)
          Sets a title for the specified node.
 

Field Detail

NODE_TITLE_PROPERTY

static final String NODE_TITLE_PROPERTY
Bound property name for the title of a node.

See Also:
Constant Field Values
Method Detail

getParent

Object getParent(Object node)
Returns the parent node of the specified node.

Parameters:
node - The node to retrieve the parent from.
Returns:
The parent node or null if the specified node is a root node.

getChildAt

Object getChildAt(Object parent,
                  int index)
Returns the child node at the specified index in the child array of the parent node.

Parameters:
parent - The parent node to add a child to.
index - The index of the node to return.
Returns:
The child node. If parent is null, the root node at the specified index will be returned.
See Also:
getChildCount(java.lang.Object)

getChildCount

int getChildCount(Object parent)
Returns the number of children of the parent node. If parent is null, it will return the number of root nodes.

See Also:
getChildAt(java.lang.Object, int)

getIndexOfChild

int getIndexOfChild(Object parent,
                    Object child)
Returns the index of the child node in the child array of the parent node.

Parameters:
parent - The parent node.
child - The child node.
Returns:
The index of the child node.

getTitle

String getTitle(Object node)
Returns the title of the specified node. The implementation method should return the value of the NODE_TITLE_PROPERTY of the specified node.

Parameters:
node - The node to get the title of.
Returns:
The title of the specified node.
See Also:
setTitle(java.lang.Object, java.lang.String), getNodeProperty(java.lang.Object, java.lang.String)

setTitle

void setTitle(Object node,
              String title)
Sets a title for the specified node. The NODE_TITLE_PROPERTY of the node must be set to the specified title.

Parameters:
node - The node to set the title to.
title - The new title of the node.
See Also:
getTitle(java.lang.Object), setNodeProperty(java.lang.Object, java.lang.String, java.lang.Object)

getNodeProperty

Object getNodeProperty(Object node,
                       String propertyName)
Returns the value of the node property with the specified propertyName.

Parameters:
node - The node to get the property value from.
propertyName - The name of the property to return the value from.
Returns:
The node property.
See Also:
setNodeProperty(java.lang.Object, java.lang.String, java.lang.Object)

setNodeProperty

void setNodeProperty(Object node,
                     String propertyName,
                     Object value)
Sets a new value to the property of the specified node with the specified propertyName.
A NodePropertyChangeEvent is triggered to notify of this node property change.

Parameters:
node - The node to change the property of.
propertyName - The name of the property to change the value of.
value - The new value of the property.
See Also:
getNodeProperty(java.lang.Object, java.lang.String)

getCategory

String getCategory(Object node)
Returns the category of the node. Categories of nodes group nodes with the same logical type. For example, the same icons are used to represent nodes with the same category in an IlvExplorerView.

Parameters:
node - The node to get a category from.
Returns:
The category of the node.

insertNode

void insertNode(Object parent,
                Object node,
                int index)
Inserts the specified node among the children of the specified parent node at a specified position.

Parameters:
parent - The node to insert a new child node in.
node - The new node to insert.
index - Specifies the position at which to insert the node. If equal to -1, the node will be added at the last position of the child array of the parent.
See Also:
removeNode(java.lang.Object, java.lang.Object)

removeNode

boolean removeNode(Object parent,
                   Object node)
Removes the specified node from the list of child nodes of the specified parent node.

Parameters:
parent - The node to remove a child node from.
node - The node to remove.
Returns:
true if the node was previously added to data container as a child of the parent; false otherwise.
See Also:
insertNode(java.lang.Object, java.lang.Object, int), canRemove(java.lang.Object, java.lang.Object)

acceptChild

boolean acceptChild(Object parent,
                    String category)
Determines whether the specified parent node can have a child added with the specified category.

Parameters:
parent - The parent node.
category - The category of nodes to add.
Returns:
true if the parent accepts a node with the specified category as a child; false otherwise.

canRemove

boolean canRemove(Object parent,
                  Object node)
Determines whether the specified node can be removed from this data container.

Parameters:
parent - The parent node of the specified node - can be null.
node - The node to remove.
Returns:
true if the node can be removed; false otherwise.
See Also:
removeNode(java.lang.Object, java.lang.Object)

addDataContainerListener

void addDataContainerListener(DataContainerListener listener)
Adds the specified data container listener to receive data container events from this container.
If listener is null, no exception will be thrown and no action will be performed.

Parameters:
listener - The data container listener to add.
See Also:
removeDataContainerListener(ilog.views.appframe.docview.project.DataContainerListener)

removeDataContainerListener

void removeDataContainerListener(DataContainerListener listener)
Removes the specified data container listener, so that it no longer receives data container events from the data container. If listener is null, no exception will be thrown and no action will be performed.

Parameters:
listener - The data container listener to remove.
See Also:
addDataContainerListener(ilog.views.appframe.docview.project.DataContainerListener)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.