Class BundleNavigationNodeController

    • Constructor Detail

      • BundleNavigationNodeController

        public BundleNavigationNodeController()
    • Method Detail

      • selected

        public void selected​(Tree tree,
                             java.util.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
      • captureOpenedTreeitem

        public void captureOpenedTreeitem​(org.zkoss.zul.Treeitem treeitem)
      • getOpenedPath

        public java.util.List<java.util.List<java.lang.Integer>> getOpenedPath()
      • showNodeActions

        public void showNodeActions​(Tree tree,
                                    java.util.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,
                        java.lang.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.
      • getMoveItemModalDialog

        public static org.zkoss.zul.Window getMoveItemModalDialog​(Tree tree,
                                                                  TypedObject typedObject,
                                                                  TypedObject targetNodeObj,
                                                                  BundleNavigationService bundleNavigationService)
        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
        bundleNavigationService -
        Returns:
        - dialog window
      • add

        public void add​(Tree tree,
                        java.lang.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
      • isBundleTemplateDeletable

        protected boolean isBundleTemplateDeletable​(BundleTemplateModel templateModel)
      • 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 java.util.Set<TypedObject> extractSelectedItem​(java.util.Set<org.zkoss.zul.Treeitem> selectedItems)
      • getOpenedNodes

        protected java.util.List<java.util.List<java.lang.Integer>> getOpenedNodes​(Tree tree,
                                                                                   int depth)
      • openCreatedNode

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

        protected java.util.List<java.lang.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​(java.util.List<org.zkoss.zul.Treeitem> treeitems,
                                                               TypedObject selectedItem)
        Returns:
        treeitem to be selected, null if nothing found
      • restoreOpenedState

        protected void restoreOpenedState​(Tree tree,
                                          java.util.List<java.util.List<java.lang.Integer>> openedNodes)
        Restores opened state
      • openPath

        protected void openPath​(Tree tree,
                                java.util.List<java.lang.Integer> path)
        Opens specified path
      • setBundleNavigationService

        public void setBundleNavigationService​(BundleNavigationService bundleNavigationService)
      • customAction

        public java.lang.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)
      • refresh

        public void refresh​(Tree tree,
                            java.util.List<java.util.List<java.lang.Integer>> openedNodes)
      • detachDialog

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

        protected ModelService getModelService()
      • getTypeService

        protected TypeService getTypeService()
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • setSystemService

        public void setSystemService​(SystemService systemService)
      • setModelService

        public void setModelService​(ModelService modelService)
      • getNavigationNodeWizardId

        public java.lang.String getNavigationNodeWizardId()
      • setNavigationNodeWizardId

        public void setNavigationNodeWizardId​(java.lang.String navigationNodeWizardId)
      • setSynchronizationService

        public void setSynchronizationService​(SynchronizationService synchronizationService)
      • getRelatedResourceWizardId

        public java.lang.String getRelatedResourceWizardId()
      • setRelatedResourceWizardId

        public void setRelatedResourceWizardId​(java.lang.String relatedResourceWizardId)
      • addProductsToNode

        public void addProductsToNode​(BundleTemplateModel bundleTemplateModel,
                                      java.util.Collection<TypedObject> typedProductsToAdd)
        Adds new or existing products to the product list of a bundletemplate.
        Parameters:
        bundleTemplateModel -
        typedProductsToAdd -
      • setBundleTemplateService

        public void setBundleTemplateService​(BundleTemplateService bundleTemplateService)
      • setFlexibleSearchService

        public void setFlexibleSearchService​(FlexibleSearchService flexibleSearchService)