Class TreeControllerWrapper<T>
- java.lang.Object
-
- de.hybris.platform.cockpit.components.mvc.tree.TreeControllerWrapper<T>
-
- All Implemented Interfaces:
SelectableComponent<Tree,org.zkoss.zul.Treeitem,T>
,TreeController<T>
- Direct Known Subclasses:
PositionAwareTreeControllerWrapper
public class TreeControllerWrapper<T> extends java.lang.Object implements TreeController<T>
Default Tree Controller Wrapper Implementation. Note:
This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped controller object.
-
-
Field Summary
Fields Modifier and Type Field Description protected TreeController<T>
controller
-
Constructor Summary
Constructors Constructor Description TreeControllerWrapper(TreeController<T> controllerToWrap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Tree tree, java.lang.Object object, T target)
Adds given object as a child of 'target' node (by default as last child), if null then new object is createdvoid
add(Tree tree, java.lang.Object object, T target, int index)
Adds given object as a child of 'target' node, if null then new object is createdT
create(Tree tree, T target)
Creates new object as a child of 'target' nodeT
create(Tree tree, T target, int index)
Creates new object as a child of 'target' nodejava.lang.Object
customAction(Tree tree, org.zkoss.zk.ui.event.Event event, T node)
If some custom actions were added to the tree, this method will be called for each of themvoid
delete(Tree tree, T node)
Deletes given nodevoid
doubleClicked(Tree tree, T node)
Called when given node was double clicked in treejava.util.Set<T>
getSelected()
void
move(Tree tree, T node, T target, boolean addAsChild)
Moves given node in place of 'target' node.void
selected(Tree tree, java.util.Set<org.zkoss.zul.Treeitem> selectedItems)
Called every time the tree node was selected
-
-
-
Field Detail
-
controller
protected final TreeController<T> controller
-
-
Constructor Detail
-
TreeControllerWrapper
public TreeControllerWrapper(TreeController<T> controllerToWrap)
-
-
Method Detail
-
add
public void add(Tree tree, java.lang.Object object, T target)
Description copied from interface:TreeController
Adds given object as a child of 'target' node (by default as last child), if null then new object is created- Specified by:
add
in interfaceTreeController<T>
- Parameters:
tree
- after successful addition, tree will be notified to update itselfobject
- e.g. the dragged component which contains something to add to the 'target' node, null indicates that new object shall be created or anything elsetarget
- that will have 'object' added.
-
add
public void add(Tree tree, java.lang.Object object, T target, int index)
Description copied from interface:TreeController
Adds given object as a child of 'target' node, if null then new object is created- Specified by:
add
in interfaceTreeController<T>
- Parameters:
tree
- after successful addition, tree will be notified to update itselfobject
- e.g. the dragged component which contains something to add to the 'target' node, or anything elsetarget
- that will have 'object' added.index
- at which the 'object' will be added within 'target' child set
-
create
public T create(Tree tree, T target)
Description copied from interface:TreeController
Creates new object as a child of 'target' node- Specified by:
create
in interfaceTreeController<T>
- Parameters:
tree
- after successful creation, tree will be notified to update itselftarget
- that will have new 'object' added.- Returns:
- created object
-
create
public T create(Tree tree, T target, int index)
Description copied from interface:TreeController
Creates new object as a child of 'target' node- Specified by:
create
in interfaceTreeController<T>
- Parameters:
tree
- after successful creation, tree will be notified to update itselftarget
- that will have new 'object' added.index
- at which the new 'object' will be added within 'target' child set- Returns:
- created object
-
customAction
public java.lang.Object customAction(Tree tree, org.zkoss.zk.ui.event.Event event, T node)
Description copied from interface:TreeController
If some custom actions were added to the tree, this method will be called for each of them- Specified by:
customAction
in interfaceTreeController<T>
- Parameters:
tree
- to play with if necessaryevent
- original event that was sent when custom action button was clickednode
- from selected tree item- Returns:
- whatever you implement
-
delete
public void delete(Tree tree, T node)
Description copied from interface:TreeController
Deletes given node- Specified by:
delete
in interfaceTreeController<T>
- Parameters:
tree
- after successful deletion, tree will be notified to update itselfnode
- to delete
-
doubleClicked
public void doubleClicked(Tree tree, T node)
Description copied from interface:TreeController
Called when given node was double clicked in tree- Specified by:
doubleClicked
in interfaceTreeController<T>
- Parameters:
tree
- to play with after whatever was donenode
- which was double clicked
-
getSelected
public java.util.Set<T> getSelected()
- Specified by:
getSelected
in interfaceSelectableComponent<Tree,org.zkoss.zul.Treeitem,T>
- Returns:
- currently selected set of items
-
move
public void move(Tree tree, T node, T target, boolean addAsChild)
Description copied from interface:TreeController
Moves given node in place of 'target' node.- Specified by:
move
in interfaceTreeController<T>
- Parameters:
tree
- after successful movement, tree will be notified to update itselfnode
- to be movedtarget
- node to be shifted. In place of this 'target' node the 'node' will be moved.addAsChild
- flag indicating whether node should be added as a child or not.
-
selected
public void selected(Tree tree, java.util.Set<org.zkoss.zul.Treeitem> selectedItems)
Description copied from interface:SelectableComponent
Called every time the tree node was selected- Specified by:
selected
in interfaceSelectableComponent<Tree,org.zkoss.zul.Treeitem,T>
- Parameters:
tree
- in case an update is neededselectedItems
- set of currently selected items
-
-