Package com.im.ijc.core.api.nodes
Class NodesConfig
- java.lang.Object
-
- com.im.ijc.core.api.nodes.NodesConfig
-
public final class NodesConfig extends java.lang.Object
UNSTABLE API!Represents root of TreeView node structure. Created in order to show different view tree of
DFItem
s.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLeafType(java.lang.Class<?> leafType)
Register the leafType class to leaf nodes.org.openide.nodes.Node
createNode(java.lang.Object key)
Creates node for key.org.openide.nodes.Node
createRootNode()
Creates root node of treeView.java.util.List<?>
getChildrenKeys(java.lang.Object parent)
Default implementation of creating parameters for ChildrenKeys of nodes.FilterMapping
getFilterMapping(java.lang.Class<?> type)
Get customizer to customize key (actions,...).java.util.Set<java.lang.Class<?>>
getLeafTypes()
Get leaf nodes.static NodesConfig
newInstance(java.lang.Object item)
Use this method to create new instance.void
removeLeafType(java.lang.Class<?> leafType)
Unregister the leafType from leaf nodes.void
setNodesFactory(NodesFactory nodesFactory)
Allows to customize Children for different nodes.void
setShowChildren(boolean b)
Show only root node.
-
-
-
Method Detail
-
newInstance
public static NodesConfig newInstance(java.lang.Object item)
Use this method to create new instance.- Parameters:
item
- The root key- Returns:
- new instance of NodesConfig
-
createRootNode
public org.openide.nodes.Node createRootNode()
Creates root node of treeView.- Returns:
- The root node
-
getFilterMapping
public FilterMapping getFilterMapping(java.lang.Class<?> type)
Get customizer to customize key (actions,...).- Parameters:
type
- The key type (e.g. DFDataTree.class)- Returns:
- The customizer
-
setShowChildren
public void setShowChildren(boolean b)
Show only root node.- Parameters:
b
- show children on true
-
setNodesFactory
public void setNodesFactory(NodesFactory nodesFactory)
Allows to customize Children for different nodes.- Parameters:
nodesFactory
- NodesFactory instance.
-
createNode
public org.openide.nodes.Node createNode(java.lang.Object key)
Creates node for key. SeesetNodesFactory(com.im.ijc.core.api.nodes.NodesFactory)
to customize view.- Parameters:
key
- The key from Children.Keys- Returns:
- The new node
-
getLeafTypes
public java.util.Set<java.lang.Class<?>> getLeafTypes()
Get leaf nodes.- Returns:
- get types without children.
-
addLeafType
public void addLeafType(java.lang.Class<?> leafType)
Register the leafType class to leaf nodes. It means that node with this type doesn't have leaf node (e.g. field node doesn't need children).- Parameters:
leafType
- Node with this type doesn't have children.
-
removeLeafType
public void removeLeafType(java.lang.Class<?> leafType)
Unregister the leafType from leaf nodes. A node with leafType type shows '+' symbol in tree view.- Parameters:
leafType
- Node with this type can have children.
-
getChildrenKeys
public java.util.List<?> getChildrenKeys(java.lang.Object parent)
Default implementation of creating parameters for ChildrenKeys of nodes.- Parameters:
parent
- object associated to the node.- Returns:
- The list of parameters for Children.Keys.setKeys(...)
-
-