Class TreeControllerMock

java.lang.Object
de.hybris.platform.cockpit.zk.mock.test.TreeControllerMock
All Implemented Interfaces:
SelectableComponent<Tree,org.zkoss.zul.Treeitem,Object>, TreeController<Object>

public class TreeControllerMock extends Object implements TreeController<Object>
Just an empty mock, see DummyZKTest
  • Constructor Details

    • TreeControllerMock

      public TreeControllerMock()
  • Method Details

    • getSelected

      public Set<Object> getSelected()
      Specified by:
      getSelected in interface SelectableComponent<Tree,org.zkoss.zul.Treeitem,Object>
      Returns:
      currently selected set of items
    • selected

      public void selected(Tree tree, Set selectedItems)
      Description copied from interface: SelectableComponent
      Called every time the tree node was selected
      Specified by:
      selected in interface SelectableComponent<Tree,org.zkoss.zul.Treeitem,Object>
      Parameters:
      tree - in case an update is needed
      selectedItems - set of currently selected items
    • move

      public void move(Tree tree, Object node, Object target, boolean addAsChild)
      Description copied from interface: TreeController
      Moves given node in place of 'target' node.
      Specified by:
      move in interface TreeController<Object>
      Parameters:
      tree - after successful movement, tree will be notified to update itself
      node - to be moved
      target - 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.
    • add

      public void add(Tree tree, Object object, Object 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 interface TreeController<Object>
      Parameters:
      tree - after successful addition, tree will be notified to update itself
      object - e.g. the dragged component which contains something to add to the 'target' node, or anything else
      target - that will have 'object' added.
      index - at which the 'object' will be added within 'target' child set
    • add

      public void add(Tree tree, Object object, Object 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 interface TreeController<Object>
      Parameters:
      tree - after successful addition, tree will be notified to update itself
      object - e.g. the dragged component which contains something to add to the 'target' node, null indicates that new object shall be created or anything else
      target - that will have 'object' added.
    • create

      public Object create(Tree tree, Object target)
      Description copied from interface: TreeController
      Creates new object as a child of 'target' node
      Specified by:
      create in interface TreeController<Object>
      Parameters:
      tree - after successful creation, tree will be notified to update itself
      target - that will have new 'object' added.
      Returns:
      created object
    • create

      public Object create(Tree tree, Object target, int index)
      Description copied from interface: TreeController
      Creates new object as a child of 'target' node
      Specified by:
      create in interface TreeController<Object>
      Parameters:
      tree - after successful creation, tree will be notified to update itself
      target - that will have new 'object' added.
      index - at which the new 'object' will be added within 'target' child set
      Returns:
      created object
    • delete

      public void delete(Tree tree, Object node)
      Description copied from interface: TreeController
      Deletes given node
      Specified by:
      delete in interface TreeController<Object>
      Parameters:
      tree - after successful deletion, tree will be notified to update itself
      node - to delete
    • doubleClicked

      public void doubleClicked(Tree tree, Object node)
      Description copied from interface: TreeController
      Called when given node was double clicked in tree
      Specified by:
      doubleClicked in interface TreeController<Object>
      Parameters:
      tree - to play with after whatever was done
      node - which was double clicked
    • customAction

      public Object customAction(Tree tree, org.zkoss.zk.ui.event.Event event, Object 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 interface TreeController<Object>
      Parameters:
      tree - to play with if necessary
      event - original event that was sent when custom action button was clicked
      node - from selected tree item
      Returns:
      whatever you implement