|
org.openide.nodes 7.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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.
Directly subclassing this class is discouraged.
Children.Keys
is preferable.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.openide.nodes.Children |
---|
Children.Array, Children.Keys<T>, Children.Map<T>, Children.SortedArray, Children.SortedMap<T> |
Field Summary | |
---|---|
protected Collection<Node> |
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<Node> 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 to this container but do not call this method. |
Object |
clone()
Clones all nodes that are contained in the children list. |
protected Collection<Node> |
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<Node> nodes
Constructor Detail |
---|
protected Children.Array(Collection<Node> 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<Node> initCollection()
The current implementation returns ArrayList.
protected final void refresh()
public boolean add(Node[] arr)
Children
Children.Keys.setKeys(java.util.Collection extends T>)
instead.
The parent node of these nodes
is changed to the parent node of this list. Each node can be added
only once. If there is some reason a node cannot be added, for example
if the node expects only a special type of subnodes, the method should
do nothing and return 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
|
org.openide.nodes 7.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |