|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.nodes.Children org.openide.nodes.Children.Array
Implements the storage of node children by an array. Each new child is added at the end of the array. The nodes are returned in the order they were inserted.
Normally you will simply create an instance of
Children.Array
and add some nodes to it.
If you expect the child nodes to change dynamically,
Children.Keys
is preferable.
Nested Class Summary |
Nested classes inherited from class org.openide.nodes.Children |
Children.Array, Children.Keys, Children.Map, Children.SortedArray, Children.SortedMap |
Field Summary | |
protected Collection |
nodes
vector of added children |
Fields inherited from class org.openide.nodes.Children |
LEAF, MUTEX |
Constructor Summary | |
|
Children.Array()
Constructs a new array children without any assigned collection. |
protected |
Children.Array(Collection c)
Constructs a new list and allows a subclass to provide its own implementation of Collection to store
data in. |
Method Summary | |
boolean |
add(Node[] arr)
Add nodes this container. |
Object |
clone()
Clones all nodes that are contained in the children list. |
protected Collection |
initCollection()
Allow subclasses to create a collection, the first time the children are used. |
protected void |
refresh()
This method can be called by subclasses that directly modify the nodes collection to update the state of the nodes appropriatelly. |
boolean |
remove(Node[] arr)
Remove nodes from the list. |
Methods inherited from class org.openide.nodes.Children |
addNotify, findChild, getNode, getNodes, getNodes, getNodesCount, isInitialized, nodes, removeNotify |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Collection nodes
Constructor Detail |
protected Children.Array(Collection c)
Collection
to store
data in. The collection should be empty and should not
be directly accessed in any way after creation.
c
- collection to store data inpublic Children.Array()
Method Detail |
public Object clone()
protected Collection initCollection()
The current implementation returns ArrayList.
protected final void refresh()
public boolean add(Node[] arr)
Children
false
to signal that the addition has not been successful.
This method should be implemented by subclasses to filter some nodes, etc.
arr
- set of nodes to add to the list
true
if successfully addedpublic boolean remove(Node[] arr)
Children
arr
- nodes to be removed
true
if the nodes could be removed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |