public class OutlineModule extends Object implements TreeContentProvider, TreeIconProvider, TreeLabelProvider, TreeSelectionHandler, DynamicTreeModule, PageViewModule
Outline
s into a flex tree. In order for an
Outline
to be shown, it must become part of the tree in one of the following ways:
Document
within the tree using
Outlines.attach(Outline, PropertiesProvider)
and use one of the default outline types or
a custom type passed to the constructor OutlineModule(String...)
. Outlines
registered with a Document
are discovered dynamically, even after a tree node visualizing
the document has become visible.
PropertiesProvider
within the tree using
Outlines.attach(Outline, PropertiesProvider)
and use one of the default outline types or
a custom type passed to the constructor OutlineModule(String...)
. Outlines
registered in that way are not discovered dynamically and need a node refresh of the
PropertiesProvider
-implementing node to become visible.
OutlineNode
s contributed by other modules.
However, those trees will not be dynamic and thus not pick up changes to the tree made after the
the nodes have become visible.DynamicTreeModule.TreeCallback
Constructor and Description |
---|
OutlineModule() |
OutlineModule(String... outlineType) |
Modifier and Type | Method and Description |
---|---|
protected void |
executeInstructions(TreePath path,
FlexibleTree flexTree,
OutlineNode<?> on) |
EventList<? extends Object> |
getChildren(TreePath treePath)
Returns a
EventList containing all the contents (children) for the last tree path
component of given tree path. |
Icon |
getIcon(TreePath treePath) |
boolean |
hasChildren(TreePath treePath)
Determines whether the last tree path component can have children.
|
void |
pathDeselected(TreePath path,
FlexibleTree flexTree,
boolean wasLeadSelectionPath) |
void |
pathSelected(TreePath path,
FlexibleTree flexTree,
boolean isLeadSelection) |
Disposable |
registerTreeCallback(TreePath treePath,
DynamicTreeModule.TreeCallback callback)
This method is called in order to supply the tree module with a
DynamicTreeModule.TreeCallback for the
given treePath. |
void |
setPageView(PageView view) |
void |
updateLabel(TreePath treePath,
StyledDocument doc) |
protected void |
updateLabelAttributes(SimpleAttributeSet as,
OutlineNode<?> n,
String description) |
public OutlineModule()
public OutlineModule(String... outlineType)
outlineType
- type of outline to be displayed. For default types, see constants in
Outline
Outlines.TYPE_EMBEDDED_OUTLINE
,
Outlines.TYPE_INDEX_OUTLINE
,
Outlines.TYPE_CUSTOM_OUTLINE
public Icon getIcon(TreePath treePath)
getIcon
in interface TreeIconProvider
public boolean hasChildren(TreePath treePath)
TreeContentProvider
true
is returned from a call to this method, it is still
allowed to return null
or an empty list from calls to
TreeContentProvider.getChildren(TreePath)
.hasChildren
in interface TreeContentProvider
treePath
- to analysetrue
if the last tree path component can have children, otherwise
false
.public EventList<? extends Object> getChildren(TreePath treePath)
TreeContentProvider
EventList
containing all the contents (children) for the last tree path
component of given tree path. If no children should be contributed (neither now, nor in the
future) this method should return null
.getChildren
in interface TreeContentProvider
treePath
- to supply children forEventList
of children or null
.public void updateLabel(TreePath treePath, StyledDocument doc) throws BadLocationException
updateLabel
in interface TreeLabelProvider
BadLocationException
protected void updateLabelAttributes(SimpleAttributeSet as, OutlineNode<?> n, String description)
public void pathSelected(TreePath path, FlexibleTree flexTree, boolean isLeadSelection)
pathSelected
in interface TreeSelectionHandler
protected void executeInstructions(TreePath path, FlexibleTree flexTree, OutlineNode<?> on)
public void pathDeselected(TreePath path, FlexibleTree flexTree, boolean wasLeadSelectionPath)
pathDeselected
in interface TreeSelectionHandler
public void setPageView(PageView view)
setPageView
in interface PageViewModule
public Disposable registerTreeCallback(TreePath treePath, DynamicTreeModule.TreeCallback callback)
DynamicTreeModule
DynamicTreeModule.TreeCallback
for the
given treePath. Using this callback the module can notify the FlexTree, that the object or
data, that the node for the given path represents, changed in some way, that makes it necessary
to update the node's derived properties.
This method may return an instance of Disposable
, called upon the disposal of the
representation node. This mechanism is used to properly shut down any listeners set up to
bridge changes from some domain object to the DynamicTreeModule.TreeCallback
. Supplying a
Disposable
isn't mandatory, however. If some other mechanism for de-registration is
applied (e.g. soft-references), implementors may return null
.registerTreeCallback
in interface DynamicTreeModule
treePath
- path to the domain object which this callback is supplied fornull
, if the disposal is implemented by other means (e.g. a soft
reference).Copyright © 2024 levigo holding gmbh. All rights reserved.