|
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
org.openide.nodes.Children.Keys<T>
public abstract static class Children.Keys<T>
Implements an array of child nodes associated nonuniquely with keys and sorted by these keys.
There is a method
that should for each
key create an array of nodes that represents the key.
This class is preferable to Children.Array
because
Typical usage:
createNodes(T)
to create some nodes
(usually exactly one) per key.
Children.addNotify()
to compute a set of keys
and set it using setKeys(Collection)
.
The collection may be ordered.
Children.removeNotify()
to just call
setKeys
on Collections.EMPTY_SET
.
setKeys
with the new set of keys. Children.Keys
will
be smart and calculate exactly what it needs to do effficiently.
refreshKey(T)
. Usually this is not necessary.
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 |
---|
Fields inherited from class org.openide.nodes.Children.Array |
---|
nodes |
Fields inherited from class org.openide.nodes.Children |
---|
LEAF, MUTEX |
Constructor Summary | |
---|---|
Children.Keys()
|
Method Summary | |
---|---|
boolean |
add(Node[] arr)
Deprecated. Do not use! Just call setKeys(Collection) with a larger set. |
Object |
clone()
Special handling for clonning. |
protected abstract Node[] |
createNodes(T key)
Create nodes for a given key. |
protected void |
destroyNodes(Node[] arr)
Called when the nodes have been removed from the children. |
protected void |
refreshKey(T key)
Refresh the child nodes for a given key. |
boolean |
remove(Node[] arr)
Deprecated. Do not use! Just call setKeys(Collection) with a smaller set. |
protected void |
setBefore(boolean b)
Set whether new nodes should be added to the beginning or end of sublists for a given key. |
protected void |
setKeys(Collection<? extends T> keysSet)
Set new keys for this children object. |
protected void |
setKeys(T[] keys)
Set keys for this list. |
Methods inherited from class org.openide.nodes.Children.Array |
---|
initCollection, refresh |
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 |
Constructor Detail |
---|
public Children.Keys()
Method Detail |
---|
public Object clone()
clone
in class Children.Array
@Deprecated public boolean add(Node[] arr)
setKeys(Collection)
with a larger set.
Children
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.
add
in class Children.Array
arr
- set of nodes to add to the list
true
if successfully added@Deprecated public boolean remove(Node[] arr)
setKeys(Collection)
with a smaller set.
Children
remove
in class Children.Array
arr
- nodes to be removed
true
if the nodes could be removedprotected final void refreshKey(T key)
key
- the key to refreshprotected final void setKeys(Collection<? extends T> keysSet)
keysSet
- the keys for the nodes (collection of any objects)protected final void setKeys(T[] keys)
keys
- the keys for the nodessetKeys(Collection)
protected final void setBefore(boolean b)
b
- true
if the children should be added beforeprotected abstract Node[] createNodes(T key)
key
- the key
protected void destroyNodes(Node[] arr)
Current implementation notifies all listeners on the nodes that nodes have been deleted.
arr
- array of deleted nodes
|
org.openide.nodes 7.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |