Package com.agiletec.aps.system.common.tree

Examples of com.agiletec.aps.system.common.tree.ITreeNode


    return SUCCESS;
  }

  @Override
  public ITreeNode getShowableTree() {
    ITreeNode node = null;
    try {
      ITreeNode allowedTree = this.getAllowedTreeRootNode();
      node = this.getPageActionHelper().getShowableTree(this.getTreeNodesToOpen(), allowedTree, this.getNodeGroupCodes());
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getShowableTree");
    }
    return node;
View Full Code Here


    return node;
  }

  @Override
  public ITreeNode getAllowedTreeRootNode() {
    ITreeNode node = null;
    try {
      node = this.getPageActionHelper().getAllowedTreeRoot(this.getNodeGroupCodes());
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getAllowedTreeRootNode");
    }
View Full Code Here

    List<String> nodesToRemove = new ArrayList<String>();
    Iterator<String> requredFacetIterator = requiredFacets.iterator();
    ITreeNodeManager facetManager = this.getFacetManager();
    while (requredFacetIterator.hasNext()) {
      String reqNode = (String) requredFacetIterator.next();
      ITreeNode parent = facetManager.getNode(reqNode).getParent();
      if (this.isChildOf(parent, selectedNode)) nodesToRemove.add(reqNode);
    }
    for (int i=0; i<nodesToRemove.size(); i++) {
      String nodeToRemove = nodesToRemove.get(i);
      requiredFacets.remove(nodeToRemove);
View Full Code Here

   */
  protected boolean isChildOf(ITreeNode nodeToCheck, String codeForCheck) {
    if (nodeToCheck.getCode().equals(codeForCheck)) {
      return true;
    }
    ITreeNode parentFacet = nodeToCheck.getParent();
    if (null != parentFacet && !parentFacet.getCode().equals(parentFacet.getParent().getCode())) {
      return this.isChildOf(parentFacet, codeForCheck);
    }
    return false;
  }
View Full Code Here

    List<ITreeNode> roots = this.getFacetRoots(reqCtx);
    if (null == roots) return null;
    List<ITreeNode> finalNodes = this.getFinalNodes(requiredFacets);
    List<FacetBreadCrumbs> breadCrumbs = new ArrayList<FacetBreadCrumbs>();
    for (int i=0; i<finalNodes.size(); i++) {
      ITreeNode requiredNode = finalNodes.get(i);
      for (int j = 0; j < roots.size(); j++) {
        ITreeNode root = roots.get(j);
        if (this.isChildOf(requiredNode, root.getCode())) {
          breadCrumbs.add(new FacetBreadCrumbs(requiredNode.getCode(), root.getCode(), this.getFacetManager()));
        }
      }
    }
    return breadCrumbs;
  }
View Full Code Here

   * Remove node parent
   * @param nodeFromAnalize
   * @param requiredFacetsCopy
   */
  private void removeParentOf(String nodeFromAnalize, List<String> requiredFacetsCopy) {
    ITreeNode nodeFrom = this.getFacetManager().getNode(nodeFromAnalize);
    List<String> nodesToRemove = new ArrayList<String>();
    Iterator<String> requiredFacetIterator = requiredFacetsCopy.iterator();
    while (requiredFacetIterator.hasNext()) {
      String reqNode = (String) requiredFacetIterator.next();
      if (!nodeFromAnalize.equals(reqNode) && this.isChildOf(nodeFrom, reqNode)) {
View Full Code Here

  protected List<ITreeNode> getFacetRoots(String facetRootNodesParam) {
    List<ITreeNode> nodes = new ArrayList<ITreeNode>();
    String[] facetCodes = facetRootNodesParam.split(",");
    for (int j = 0; j < facetCodes.length; j++) {
      String facetCode = facetCodes[j].trim();
      ITreeNode node = this.getFacetManager().getNode(facetCode);
      if (null != node) {
        nodes.add(node);
      }
    }
    return nodes;
View Full Code Here

  private boolean isSelectedOneChild() {
    ITreeNodeManager facetManager = super.getFacetManager();
    List<String> requiredFacets = this.getRequiredFacets();
    for (int i=0; i<requiredFacets.size(); i++) {
      String requiredFacet = requiredFacets.get(i);
      ITreeNode facet = facetManager.getNode(requiredFacet);
      if (null != facet) {
        boolean check = this.checkSelectChild(facet, this.getFacetNodeCode());
        if (check) return true;
      }
    }
View Full Code Here

   */
  private boolean checkSelectChild(ITreeNode facet, String codeForCheck) {
    if (facet.getCode().equals(codeForCheck)) {
      return true;
    }
    ITreeNode parentFacet = facet.getParent();
    if (null != parentFacet && !parentFacet.getCode().equals(parentFacet.getParent().getCode())) {
      return this.checkSelectChild(parentFacet, codeForCheck);
    }
    return false;
  }
View Full Code Here

   * Returns true if a parent is selected
   * @return true if a parent is selected
   */
  private boolean isParentSeleted() {
    ITreeNodeManager facetManager = super.getFacetManager();
    ITreeNode facet = facetManager.getNode(this.getFacetNodeCode());
    ITreeNode parent = facet.getParent();
    return this.getRequiredFacets().contains(parent.getCode());
  }
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.common.tree.ITreeNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.