All Packages Class Hierarchy This Package Previous Next Index
Interface uhr.core.structure.Container
- public interface Container
- extends Node
This defines a container type of Node in a System Tree of Nodes.
Containers hold zero or more child nodes.
The root Node in a System Tree is aways a container.
A container cannot contain itself.
-
ALL_BRANCH_EVENTS
- The event type to listen to all events in this node and all
nodes beneath it.
-
ALL_NODE_EVENTS
- The event type to listen to all events in just this node.
-
addListener(int,
ContainerListener)
- Adds the listener for the eventType.
-
appendChild(Node)
- Appends the child node after the last index.
-
appendPart(String,
Object, boolean)
- Appends the part after the last index and returns the new node
the part is in.
-
enumerateChildNames()
- Returns an Enumeration of all child node names in the node, in
order.
-
findPart(String)
- Finds and returns the named part.
-
fireSemanticEvent(String)
- This is a handy dandy way for parts to notify each other of
purly semantic events.
-
getChild(String)
- Returns the named child node or null if not found.
-
getChildAt(int)
- Returns the child node at the specified index.
-
getChildCount()
- Returns the number of nodes in the cell.
-
getChildPart(String)
- Returns the part in the child node with partName or null if not found.
-
insertChildBefore(Node,
Node)
- Inserts the child node before the nodeBefore, which must be in
the Node.
-
listTree(boolean,
boolean)
- Returns a String representing nodes in the the System Tree.
-
removeAllChildren()
- Removes all child nodes from the node.
-
removeChild(Node)
- Removes the child node.
-
removeListener(int,
ContainerListener)
- Removes the listener for the eventType.
ALL_NODE_EVENTS
public static final int ALL_NODE_EVENTS
- The event type to listen to all events in just this node.
ALL_BRANCH_EVENTS
public static final int ALL_BRANCH_EVENTS
- The event type to listen to all events in this node and all
nodes beneath it. If this is the root node then you
are listening to all node events in the tree.
addListener
public abstract void addListener(int eventType,
ContainerListener listener)
- Adds the listener for the eventType. This approach allows a fine
grained design of what events are subscribable without lots of
extra event methods.
- Parameters:
- eventType - the event type constant. This must be
ALL_NODE_EVENTS or ALL_BRANCH_EVENTS.
- listener - the listener for the eventType.
- Throws: IllegalArgumentException
- if an invalid eventType.
removeListener
public abstract void removeListener(int eventType,
ContainerListener listener)
- Removes the listener for the eventType.
- Parameters:
- eventType - the event type constant. This must be
ALL_NODE_EVENTS or ALL_BRANCH_EVENTS.
- listener - the listener for the eventType.
- Throws: IllegalArgumentException
- if an invalid eventType.
fireSemanticEvent
public abstract void fireSemanticEvent(String name)
- This is a handy dandy way for parts to notify each other of
purly semantic events. This method fires a ContainerEvent of type
ContainerEvent.SEMANTIC with the semantic event name property equal
to the provided name.
- Parameters:
- name - the name of the semantic event.
appendPart
public abstract Node appendPart(String partName,
Object part,
boolean isContainer)
- Appends the part after the last index and returns the new node
the part is in. This method is preferred to
appendChild(Node node) because it configures the
created node perfectly every time.
- Parameters:
- partName - the name of the part, which is the name of the node.
- part - the part to append.
- isContainer - true if the parts is a container, false if not.
- Returns:
- the new node the part is in.
- Throws: IllegalStateException
- if duplicate partName.
appendChild
public abstract void appendChild(Node node)
- Appends the child node after the last index. Throws an
IllegalStateException if the node has a duplicate name.
- Parameters:
- node - the node to append.
insertChildBefore
public abstract void insertChildBefore(Node node,
Node nodeBefore)
- Inserts the child node before the nodeBefore, which must be in
the Node. Throws an IllegalStateException if the nodeBefore
is not found or the node has a duplicate name.
- Parameters:
- node - the node to insert.
- nodeBefore - the node to insert before.
removeAllChildren
public abstract void removeAllChildren()
- Removes all child nodes from the node.
removeChild
public abstract Node removeChild(Node node)
- Removes the child node. Returns the node removed or null if none.
- Parameters:
- node - the node to remove.
getChildCount
public abstract int getChildCount()
- Returns the number of nodes in the cell. We use the
Bean Spec method name style rather than size().
- Returns:
- the number of nodes in the cell.
getChildAt
public abstract Node getChildAt(int index)
- Returns the child node at the specified index.
- Parameters:
- index - the index of interest.
- Returns:
- the node at the index.
- Throws: ArrayIndexOutOfBoundsException
- if invalid index.
enumerateChildNames
public abstract Enumeration enumerateChildNames()
- Returns an Enumeration of all child node names in the node, in
order.
- Returns:
- the node names in the container.
getChild
public abstract Node getChild(String nodeName)
- Returns the named child node or null if not found.
- Parameters:
- nodeName - the name of the node to retrieve.
- Returns:
- the node with the nodeName or null if not found..
getChildPart
public abstract Object getChildPart(String partName)
- Returns the part in the child node with partName or null if not found.
- Parameters:
- nodeName - the name of the part to retrieve.
- Returns:
- the part with the nodeName or null if not found..
listTree
public abstract String listTree(boolean startAtRoot,
boolean includeHidden)
- Returns a String representing nodes in the the System Tree.
Format is one line per node with indentation. This
is for developement use.
- Parameters:
- startAtRoot - true to start at the root or false to
start at this node.
- includeHidden - true to include hidden nodes or false
to not include them.
- Returns:
- a String representing the System Tree.
findPart
public abstract Object findPart(String partName)
- Finds and returns the named part.
See full documentation.
- Parameters:
- partName - the name of the part to find.
- Returns:
- the part with the partName.
All Packages Class Hierarchy This Package Previous Next Index