com.levigo.util.swing.flextree
Interface DynamicTreeModule.TreeCallback

Enclosing interface:
DynamicTreeModule

public static interface DynamicTreeModule.TreeCallback

DynamicTreeModule.TreeCallbacks can be used by DynamicTreeModules to request refreshes of the tree in response to changes to domain data. For each TreePath the DynamicTreeModule is supplied with a separate DynamicTreeModule.TreeCallback which targets the path's scope. Depending on the requirements, a refresh may only target a node's derived properties like labels or icons but also contributed children etc. Furthermore, a change may require a refresh of child nodes as well. For each situation the correct DynamicTreeModule.TreeCallback must be used. The following table gives an overview of this interface's methods and their effects:

Method Properties Refresh Child Contributions Refresh Scope
nodeRefreshRequired() yes no only current node
childrenRefreshRequired() children only no all immediate children of current node
childrenRefreshRequired(Collection) children only no children of current node corresponding to the given domain objects
subtreeRefreshRequired() children only no all descendants of the current node
subtreeRefreshRequired(Collection) children only no descendants of current node corresponding to the given domain objects
fullRefreshRequired() yes yes current node and all descendants


Method Summary
 void childrenRefreshRequired()
          Receive notification that the domain object or data that the target node represents changed in some way that makes it necessary to update the derived properties of all immediate children of the target node that have been contributed by the current module.
 void childrenRefreshRequired(Collection<? extends Object> domainObjects)
          Receive notification that a collection of domain objects or data that the target node represents changed in some way that makes it necessary to update the derived properties of all immediate children of the target node that have been contributed by the current module.
 void fullRefreshRequired()
          Receive notification that the domain object or data that the target node represents changed in some way that makes it necessary to update the derived properties of all nodes within the sub-tree starting at the target node.
 void nodeRefreshRequired()
          Receive notification that the domain object or data that the target node represents changed in some way that makes it necessary to update the node's derived properties.
 void subtreeRefreshRequired()
          Receive notification that the domain object or data that the target node represents changed in some way that makes it necessary to update the derived properties of all nodes within the sub-tree starting at the target node.
 void subtreeRefreshRequired(Collection<? extends Object> domainObjects)
          Receive notification that a collection of domain objects or data that the target node represents changed in some way that makes it necessary to update the derived properties of all nodes within the sub-tree starting at the target node.
 

Method Detail

nodeRefreshRequired

void nodeRefreshRequired()
Receive notification that the domain object or data that the target node represents changed in some way that makes it necessary to update the node's derived properties. In general, the node will re-query all modules for their contribution to the node's appearance.


childrenRefreshRequired

void childrenRefreshRequired()
Receive notification that the domain object or data that the target node represents changed in some way that makes it necessary to update the derived properties of all immediate children of the target node that have been contributed by the current module.


childrenRefreshRequired

void childrenRefreshRequired(Collection<? extends Object> domainObjects)
Receive notification that a collection of domain objects or data that the target node represents changed in some way that makes it necessary to update the derived properties of all immediate children of the target node that have been contributed by the current module. The refresh will be restricted to those descendant nodes associated with one of the given domain objects.


subtreeRefreshRequired

void subtreeRefreshRequired()
Receive notification that the domain object or data that the target node represents changed in some way that makes it necessary to update the derived properties of all nodes within the sub-tree starting at the target node. The refresh will be restricted to those branches that have been contributed by the current module.


subtreeRefreshRequired

void subtreeRefreshRequired(Collection<? extends Object> domainObjects)
Receive notification that a collection of domain objects or data that the target node represents changed in some way that makes it necessary to update the derived properties of all nodes within the sub-tree starting at the target node. The refresh will be restricted to those descendant nodes associated with one of the given domain objects and the branches that have been contributed by the current module.


fullRefreshRequired

void fullRefreshRequired()
Receive notification that the domain object or data that the target node represents changed in some way that makes it necessary to update the derived properties of all nodes within the sub-tree starting at the target node. In contrast to all other methods of DynamicTreeModule.TreeCallback, this call will cause a re-query of the child list from TreeContentProvider.getChildren(TreePath) enabling a TreeContentProvider to provide dynamic children without maintaining a dynamic child list. Additionally, all nodes within the subtree will be refreshed irrespective of the module that has contributed them. Please note that this call may incur significant processing cost. Its use must therefore be restricted to those rare cases when it is absolutely required. In general, it is preferable to use one of the other *RefreshRequired(...) methods instead.



Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.