|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openide.nodes.Children
Container for array of nodes.
Can be associated
with a node and then
all children in the array have that node set as a parent, and this list
will be returned as the node's children.
Probably you want to subclass Children.Keys
.
Subclassing Children
directly is not recommended.
Inner Class Summary | |
static class |
Children.Array
Implements the storage of node children by an array. |
static class |
Children.Keys
Implements an array of child nodes associated nonuniquely with keys and sorted by these keys. |
static class |
Children.Map
Implements the storage of node children by a map. |
static class |
Children.SortedArray
Maintains a list of children sorted by the provided comparator in an array. |
static class |
Children.SortedMap
Maintains a list of children sorted by the provided comparator in a map. |
Field Summary | |
static Children |
LEAF
The object representing an empty set of children. |
static Mutex |
MUTEX
Lock for access to hierarchy of all node lists. |
Constructor Summary | |
Children()
Constructor. |
Method Summary | |
abstract boolean |
add(Node[] nodes)
Add nodes this container. |
protected void |
addNotify()
Called when children are first asked for nodes. |
protected Object |
clone()
Handles clonning in the right way, that can be later extended by subclasses. |
Node |
findChild(String name)
Find a child node by name. |
protected Node |
getNode()
Get the parent node of these children. |
Node[] |
getNodes()
Get a (sorted) array of nodes in this list. |
int |
getNodesCount()
Get the number of nodes in the list. |
protected boolean |
isInitialized()
Method that can be used to test whether the children content has ever been used or it is still not initalized. |
Enumeration |
nodes()
Get the nodes as an enumeration. |
abstract boolean |
remove(Node[] nodes)
Remove nodes from the list. |
protected void |
removeNotify()
Called when last children nodes disappeared. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Mutex MUTEX
All operations on the hierarchy of nodes (add, remove, etc.) are
done in the Mutex.writeAccess(org.openide.util.Mutex.Action)
method of this lock, so if someone
needs for a certain amount of time to forbid modification,
he can execute his code in Mutex.readAccess(org.openide.util.Mutex.Action)
.
public static final Children LEAF
Constructor Detail |
public Children()
Method Detail |
protected final Node getNode()
null
if there is none yetprotected Object clone() throws CloneNotSupportedException
clone
in class Object
public abstract boolean add(Node[] nodes)
false
to signal that the addition has not been successful.
This method should be implemented by subclasses to filter some nodes, etc.
nodes
- set of nodes to add to the listtrue
if successfully addedpublic abstract boolean remove(Node[] nodes)
nodes
- nodes to be removedtrue
if the nodes could be removedpublic final Enumeration nodes()
Node
spublic Node findChild(String name)
name
- (system) name of child node to find or null if any child can
be returnednull
if it could not be foundprotected final boolean isInitialized()
public final Node[] getNodes()
public final int getNodesCount()
protected void addNotify()
protected void removeNotify()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |