public class DocumentStateModule extends Object implements TreeIconProvider, DynamicTreeModule
FlexibleTree
this module provides an icon for instances of Document
. The
icon indicates the current Document.State
of the given Document
. When its Document.State
is
Document.BasicState.LOADING
, an animated spinning wheel icon is displayed; otherwise a normal
(static) Document
icon is displayed.DynamicTreeModule.TreeCallback
Constructor and Description |
---|
DocumentStateModule() |
Modifier and Type | Method and Description |
---|---|
Icon |
getIcon(TreePath treePath) |
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. |
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).public Icon getIcon(TreePath treePath)
getIcon
in interface TreeIconProvider
Copyright © 2024 levigo holding gmbh. All rights reserved.