public class TreeLayoutObserver
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TreeLayoutObserver.TreeListener
A superclass for listeners that can be added to this observer to get
notification whenever the tree structure changes.
|
static class |
TreeLayoutObserver.TreeNode
Represents a node in a tree structure and stores all information related
to it.
|
static class |
TreeLayoutObserver.TreeNodeFactory
TreeLayoutObserver uses instance of this class to create
instances of TreeLayoutObserver.TreeNode. |
| Constructor and Description |
|---|
TreeLayoutObserver(ILayoutContext context,
TreeLayoutObserver.TreeNodeFactory nodeFactory)
Constructs a new
TreeLayoutObserver for observing the given
ILayoutContext. |
| Modifier and Type | Method and Description |
|---|---|
void |
addTreeListener(TreeLayoutObserver.TreeListener listener)
Adds a listener that will be informed about changes in tree structure.
|
TreeLayoutObserver.TreeNode |
getSuperRoot()
Returns Super Root, that is an artificial node being a common parent for
all nodes in observed tree structure.
|
TreeLayoutObserver.TreeNode |
getTreeNode(INodeLayout node)
Returns a
TreeLayoutObserver.TreeNode related to given node layout. |
void |
recomputeTree()
Recomputes all the information about the tree structure (the same effect
as creating new
TreeLayoutObserver). |
void |
removeTreeListener(TreeLayoutObserver.TreeListener listener)
Removes a listener from list of listener to be informed about changes in
tree structure.
|
void |
stop()
Stops this observer from listening to changes in observed layout context.
|
public TreeLayoutObserver(ILayoutContext context, TreeLayoutObserver.TreeNodeFactory nodeFactory)
TreeLayoutObserver for observing the given
ILayoutContext. The given TreeLayoutObserver.TreeNodeFactory will be used
for the construction of TreeLayoutObserver.TreeNodes. If no factory is supplied, the
TreeLayoutObserver.TreeNodeFactory will be used.context - The ILayoutContext that is observed.nodeFactory - The TreeLayoutObserver.TreeNodeFactory to use.public void recomputeTree()
TreeLayoutObserver).public void stop()
recomputeTree() is called.public TreeLayoutObserver.TreeNode getSuperRoot()
public TreeLayoutObserver.TreeNode getTreeNode(INodeLayout node)
TreeLayoutObserver.TreeNode related to given node layout. If such a
TreeNode doesn't exist, it's created.node - The INodeLayout for which to return the corresponding
TreeLayoutObserver.TreeNode.TreeLayoutObserver.TreeNode related to the given
INodeLayout or a newly created one in case there was no
related TreeLayoutObserver.TreeNode before.public void addTreeListener(TreeLayoutObserver.TreeListener listener)
listener - listener to addpublic void removeTreeListener(TreeLayoutObserver.TreeListener listener)
listener - listener to removeCopyright (c) 2014 itemis AG and others. All rights reserved.