|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openide.nodes.Children | +--org.openide.nodes.Children.Array | +--org.openide.nodes.Children.Keys | +--org.openide.src.nodes.SourceChildren
Normal implementation of children for source element nodes.
Ordering and filtering of the children can be customized
using SourceElementFilter
.
FilterCookie
is implemented to provide a means
for user customization of the filter.
The child list listens to changes in the source element, as well as the filter, and automatically updates itself as appropriate.
A child factory can be used to cause the children list to create
non-default
child nodes, if desired, both at the time of the creation
of the children list, and when new children are added.
The children list may be unattached to any source element temporarily, in which case it will have no children (except possibly an error indicator).
Inner classes inherited from class org.openide.nodes.Children |
Children.Array, Children.Keys, Children.Map, Children.SortedArray, Children.SortedMap |
Field Summary | |
protected SourceElement |
element
The element whose subelements are represented. |
protected ElementNodeFactory |
factory
Factory for obtaining class nodes. |
protected SourceElementFilter |
filter
Filter for elements. |
Fields inherited from class org.openide.nodes.Children.Array |
nodes |
Fields inherited from class org.openide.nodes.Children |
LEAF, MUTEX |
Constructor Summary | |
SourceChildren()
Create a children list with the default factory and no attached source element. |
|
SourceChildren(ElementNodeFactory factory)
Create a children list with no attached source element. |
|
SourceChildren(ElementNodeFactory factory,
SourceElement element)
Create a children list. |
|
SourceChildren(SourceElement element)
Create a children list with the default factory. |
Method Summary | |
protected void |
addNotify()
Called when children are first asked for nodes. |
protected Node[] |
createNodes(Object key)
Create nodes for a given key. |
Node |
findChild(String name)
Find a child node by name. |
SourceElement |
getElement()
Get the currently attached source element. |
Object |
getFilter()
Get the current filter. |
Class |
getFilterClass()
Get the declared filter (super-)class. |
protected void |
removeNotify()
Called when the list of nodes for this children object is no longer needed by the IDE. |
void |
setElement(SourceElement element)
Set a new source element to get information about children from. |
void |
setFilter(Object filter)
Set the current filter. |
Methods inherited from class org.openide.nodes.Children.Keys |
add, clone, destroyNodes, refreshKey, remove, setBefore, setKeys, setKeys |
Methods inherited from class org.openide.nodes.Children.Array |
initCollection, refresh |
Methods inherited from class org.openide.nodes.Children |
getNode, getNodes, getNodesCount, isInitialized, nodes |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SourceElement element
protected SourceElementFilter filter
null
, in which case
modifier filtering is disabled, and ordering may be reset to the default order.protected ElementNodeFactory factory
Constructor Detail |
public SourceChildren()
public SourceChildren(SourceElement element)
element
- source element to attach to, or null
public SourceChildren(ElementNodeFactory factory)
factory
- a factory for creating childrenpublic SourceChildren(ElementNodeFactory factory, SourceElement element)
factory
- a factory for creating childrenelement
- source element to attach to, or null
Method Detail |
public Class getFilterClass()
FilterCookie
getFilterClass
in interface FilterCookie
org.openide.cookies.FilterCookie
null
if no filter is currently in usepublic Object getFilter()
FilterCookie
getFilter
in interface FilterCookie
org.openide.cookies.FilterCookie
null
if none is currently in usepublic void setFilter(Object filter)
FilterCookie
setFilter
in interface FilterCookie
org.openide.cookies.FilterCookie
filter
- the filter, or null
if none should be usedprotected void addNotify()
Children
Children.Keys
etc.).addNotify
in class Children
org.openide.nodes.Children
Children.isInitialized()
protected void removeNotify()
Children
Children.Keys
etc.).removeNotify
in class Children
protected Node[] createNodes(Object key)
Children.Keys
createNodes
in class Children.Keys
org.openide.nodes.Children.Keys
key
- the keypublic Node findChild(String name)
Children
Normally the list of nodes should have been computed by the time this returns,
but see Children.getNodes()
for an important caveat as to why this may not
be doing what you want and what to do instead.
findChild
in class Children
org.openide.nodes.Children
name
- (code) name of child node to find or null
if any arbitrary child may
be returnednull
if it could not be foundpublic SourceElement getElement()
null
if unattachedpublic void setElement(SourceElement element)
element
- the new element, or null
to detach
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |