|
||||||||||
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.loaders.DataObjectFilter
Supports working with a set of filters defined by data objects.
Provides a keyed list of children
taken from a DataFolder
.
An instance of this filter in its default settings
accepts all DataObject
s.
Additional specific filters can be added to this filter with putFilter(java.lang.Class, java.lang.Object)
to filter particular kinds of data objects.
Also it is possible to registering filter editor classes and to obtain them, so as to allow modifications to the filter by the user.
The effect of this filter is that:
ElementCookie
will be shown as the
sole child for their key.
ElementCookie
will not be shown
directly; rather their "elements parent" will be consulted. By default
all the children it provides will be spliced into the children list
keyed by the data object.
ElementCookie
-enabled children will be filtered
before being used as the children for a key; the filter used will be applied
to a copy of the elements parent node, so that it may handle the filter
logic. Filters may be added according to the type of the filter, which
is specified by a filter representation class.
Inner classes inherited from class org.openide.nodes.Children |
Children.Array, Children.Keys, Children.Map, Children.SortedArray, Children.SortedMap |
Fields inherited from class org.openide.nodes.Children.Array |
nodes |
Fields inherited from class org.openide.nodes.Children |
LEAF, MUTEX |
Constructor Summary | |
DataObjectFilter()
Create a new filter which will accept all data objects. |
|
DataObjectFilter(Class[] representationClasses)
Create a new filter which will accept given set of data objects. |
|
DataObjectFilter(DataFolder dataFolder)
Create a new filter which will accept all data objects in a given folder. |
Method Summary | |
void |
addLoader(Class representationClass)
Permit a representation class of data object to be shown (after appropriate filtering). |
protected void |
addNotify()
Called when children are first asked for nodes. |
protected Node[] |
createNodes(Object key)
Create children for a data-object key. |
DataFolder |
getDataFolder()
Get the folder this support is attached to. |
static Class |
getFilterClass(Class representationClass)
Get the filter class currently registered for a data object representation class. |
void |
putFilter(Class filterClass,
Object filter)
Add a filter for a certain type of data object. |
static void |
registerFilterClass(Class representationClass,
Class filterClass)
Register a new filter type for a given type of data object. |
void |
removeLoader(Class representationClass)
Prevent a representation class of data object from being show at all. |
protected void |
removeNotify()
Called when the list of nodes for this children object is no longer needed by the IDE. |
void |
setDataFolder(DataFolder f)
Attach the support to a different folder. |
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 |
findChild, getNode, getNodes, getNodesCount, isInitialized, nodes |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DataObjectFilter(Class[] representationClasses)
representationClasses
- representation classes of data objects to be shownpublic DataObjectFilter()
public DataObjectFilter(DataFolder dataFolder)
dataFolder
- the folder to filterMethod Detail |
public static void registerFilterClass(Class representationClass, Class filterClass)
representationClass
- the designated super class of all data objects that can use
this filterfilterClass
- the class of a filter to use for such data objectsFilterCookie.getFilterClass()
public static Class getFilterClass(Class representationClass)
null
public void putFilter(Class filterClass, Object filter)
filterClass
- the representation class this filter belongs tofilter
- the filter to use for all data objects requesting this type of filter,
via FilterCookie.getFilterClass()
. May be null
to remove.public void addLoader(Class representationClass)
removeLoader(java.lang.Class)
.representationClass
- the data object representation classpublic void removeLoader(Class representationClass)
representationClass
- the data object representation classDataLoader.getRepresentationClass()
public void setDataFolder(DataFolder f)
f
- the new folderpublic DataFolder getDataFolder()
protected 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)
ElementCookie
is provided, then the proxy node's children
are used for this node's children (for this key), after possible filtering
based on the current filters
.
If ElementCookie
is not provided, then
(a copy of) this data's object's delegate node is used as the sole child
for this key.createNodes
in class Children.Keys
key
- a DataObject
to create representative children for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |