Class NavigationNodeController

java.lang.Object
de.hybris.platform.cmscockpit.navigationnode.browserarea.tree.NavigationNodeController
All Implemented Interfaces:
SelectableComponent<Tree,org.zkoss.zul.Treeitem,TypedObject>, PositionAwareTreeController<TypedObject>, TreeController<TypedObject>

public class NavigationNodeController extends Object implements PositionAwareTreeController<TypedObject>
Controller of 'navigation node' tree, see related class: NavigationNodeBrowserModel
Spring Bean ID:
navigationNodeController
  • Constructor Details

    • NavigationNodeController

      public NavigationNodeController()
  • Method Details

    • selected

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

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

      protected void showNodeActions(Tree tree, Set<org.zkoss.zul.Treeitem> selectedItems)
      Shows actions next to selected row and hides actions from previously selected row
    • create

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

      public TypedObject create(Tree tree, TypedObject target, int index)
      Description copied from interface: TreeController
      Creates new object as a child of 'target' node
      Specified by:
      create in interface TreeController<TypedObject>
      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
    • add

      public void add(Tree tree, Object object, TypedObject 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<TypedObject>
      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.
    • move

      public void move(Tree tree, TypedObject node, TypedObject target, boolean addAsChild)
      Description copied from interface: TreeController
      Moves given node in place of 'target' node.
      Specified by:
      move in interface TreeController<TypedObject>
      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.
    • move

      public void move(Tree tree, TypedObject node, TypedObject target, boolean addAsChild, boolean append)
      Description copied from interface: PositionAwareTreeController
      Moves given node in place of 'target' node.
      Specified by:
      move in interface PositionAwareTreeController<TypedObject>
      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.
      append - if true the element will be placed after (addAsChild false) or in the very end (addAsChild true)
    • getMoveItemModalDialog

      public static org.zkoss.zul.Window getMoveItemModalDialog(Tree tree, TypedObject typedObject, TypedObject targetNodeObj, CMSNavigationService cmsNavigationService)
      Returns window dialog with options when dropping content page. Also handles click events.
      Parameters:
      tree - to find selected node
      typedObject - to move/copy
      targetNodeObj - - target node over which content page is dropped
      cmsNavigationService -
      Returns:
      - dialog window
    • add

      public void add(Tree tree, Object object, TypedObject 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<TypedObject>
      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
    • delete

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

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

      protected Set<TypedObject> extractSelectedItem(Set<org.zkoss.zul.Treeitem> selectedItems)
    • getOpenedNodes

      protected List<List<Integer>> getOpenedNodes(Tree tree, int depth)
    • openCreatedNode

      public void openCreatedNode(Tree tree, TypedObject typedObject, boolean addAsAChild)
    • getPathToRoot

      protected List<Integer> getPathToRoot(org.zkoss.zul.Treeitem treeItem)
    • restoreSelectionState

      protected void restoreSelectionState(Tree tree)
      Restores whatever was selected (before tree invalidation etc) Call it after tree open state is restored see restoreOpenedState(Tree, List) because only opened nodes are search through.
    • searchForSelectedNode

      protected org.zkoss.zul.Treeitem searchForSelectedNode(List<org.zkoss.zul.Treeitem> treeitems, TypedObject selectedItem)
      Returns:
      treeitem to be selected, null if nothing found
    • restoreOpenedState

      protected void restoreOpenedState(Tree tree, List<List<Integer>> openedNodes)
      Restores opened state
    • openPath

      protected void openPath(Tree tree, List<Integer> path)
      Opens specified path
    • getCmsNavigationService

      public CMSNavigationService getCmsNavigationService()
    • setCmsNavigationService

      public void setCmsNavigationService(CMSNavigationService navigationNodeService)
    • getSyncJobs

      protected List<SyncItemJobModel>[] getSyncJobs(ListViewAction.Context context)
    • customAction

      public Object customAction(Tree tree, org.zkoss.zk.ui.event.Event event, TypedObject 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<TypedObject>
      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
    • sendUpdateEvents

      protected void sendUpdateEvents(Tree tree, TypedObject node)
    • refresh

      public void refresh(Tree tree)
    • detachDialog

      protected void detachDialog(org.zkoss.zul.Window dialog)
    • getModelService

      protected ModelService getModelService()
    • getTypeService

      protected TypeService getTypeService()
    • getSystemService

      protected SystemService getSystemService()
    • getSynchronizationService

      protected SynchronizationService getSynchronizationService()
    • setTypeService

      public void setTypeService(TypeService typeService)
    • setSystemService

      public void setSystemService(SystemService systemService)
    • setModelService

      public void setModelService(ModelService modelService)
    • getNavigationNodeWizardId

      public String getNavigationNodeWizardId()
    • setNavigationNodeWizardId

      public void setNavigationNodeWizardId(String navigationNodeWizardId)
    • setSynchronizationService

      public void setSynchronizationService(SynchronizationService synchronizationService)
    • getRelatedResourceWizardId

      public String getRelatedResourceWizardId()
    • setRelatedResourceWizardId

      public void setRelatedResourceWizardId(String relatedResourceWizardId)