Examples of TreeNode


Examples of org.openbravo.model.ad.utility.TreeNode

        repairReferences.add(bob);
      }
    }
    for (BaseOBObject objectToRepair : repairReferences) {
      if (objectToRepair instanceof TreeNode) {
        final TreeNode tn = (TreeNode) objectToRepair;
        final Entity entity = ModelProvider.getInstance().getEntityFromTreeType(
            tn.getTree().getTypeArea());
        if (entity == null) {
          if (ir.getWarningMessages() == null) {
            ir.setWarningMessages("Imported tree nodes belong to a tree with a tree type "
                + tn.getTree().getTypeArea() + " which is not related to any entity.");
          } else {
            ir.setWarningMessages(ir.getWarningMessages()
                + "\nImported tree nodes belong to a tree with a tree type "
                + tn.getTree().getTypeArea() + " which is not related to any entity.");
          }
          continue;
        }
      }
      for (Property p : PrimitiveReferenceHandler.getInstance().getPrimitiveReferences(
View Full Code Here

Examples of org.primefaces.model.TreeNode

    String selectionParam = clientId + "_selection";
   
    if(params.containsKey(clientId) && params.containsKey(rowKeyParam) && params.containsKey(actionParam)) {
      String rowKey = params.get(rowKeyParam);
      String event = params.get(actionParam);
      TreeNode root = (TreeNode) tree.getValue();
      TreeNode currentNode = treeExplorer.findTreeNode(rowKey, new TreeModel(root));
     
      switch(TreeNodeEvent.valueOf(event)) {
        case SELECT:
          tree.queueEvent(new NodeSelectEvent(tree, currentNode));
        break;
       
        case EXPAND:
          currentNode.setExpanded(true);
          tree.queueEvent(new NodeExpandEvent(tree, currentNode));
        break;

        case COLLAPSE:
          currentNode.setExpanded(false);
          tree.queueEvent(new NodeCollapseEvent(tree, currentNode));
        break;
      }
    }
   
    //Selection
    if(params.containsKey(selectionParam)) {
      String selectedNodesValue = params.get(selectionParam);
      boolean isSingle = tree.getSelectionMode().equalsIgnoreCase("single");
     
      if(selectedNodesValue.equals("")) {
        if(isSingle)
          tree.setSelection(null);
        else
          tree.setSelection(new TreeNode[0]);
      }
      else {
        String[] selectedRowKeys = selectedNodesValue.split(",");
        TreeModel model = new TreeModel((TreeNode) tree.getValue());
       
        if(isSingle) {
          TreeNode selectedNode = treeExplorer.findTreeNode(selectedRowKeys[0], model);
          tree.setSelection(selectedNode);
         
        } else {
          TreeNode[] selectedNodes = new TreeNode[selectedRowKeys.length];
View Full Code Here

Examples of org.python.pydev.core.structure.TreeNode

        } else if (element instanceof IWorkingSet) {
            parent = ResourcesPlugin.getWorkspace().getRoot();

        } else if (element instanceof TreeNode) {
            TreeNode treeNode = (TreeNode) element;
            return treeNode.getParent();
        }

        if (parent == null) {
            parent = super.getParent(element);
        }
View Full Code Here

Examples of org.richfaces.model.TreeNode

    private void createTree() {
        this.root = new TreeNodeImpl();
        Map<ServerPluginType, List<PluginKey>> types = serverPluginsBean.getInstalledServerPluginsGroupedByType();

        for (ServerPluginType type : types.keySet()) {
            TreeNode typeNode = createTypeNode(type, types.get(type));

            if (typeNode != null) {
                typeNode.setParent(root);
                root.addChild(type, typeNode);
            }
        }
    }
View Full Code Here

Examples of org.tree.entity.TreeNode

    if (nodes == null || nodes.size() == 0) {
      return null;
    }
    html.append("<ul>");
    for (int i = 0; nodes != null && i < nodes.size(); i++) {
      TreeNode treeNode = nodes.get(i);

      // htmlsrc
      html.append("<li");
     
      if (this.isLeaf(tree,treeNode)) {// 叶子
        if(i == nodes.size() -1){//last
          this.prepareAttribute(html, "class","last");
        }
      } else {// 父节点
        if(i == nodes.size() -1){//last
          this.prepareAttribute(html, "class","closed lastclosed");
        }else{
          this.prepareAttribute(html, "class","closed");
        }
        this.prepareAttribute(html, TreeService.TREE_PARENTID_VAR,tree.getId());
      }

      // params
      Map<String, Object> allParam = new HashMap<String, Object>();
      if (parameters != null) {
        allParam.putAll(parameters);
      }
      Map<String, String> treeNodeParameters = treeNode.getParameters();
      if (treeNodeParameters != null) {
        allParam.putAll(treeNodeParameters);
      }
      allParam.remove(TreeService.TREE_ID_VAR);
      allParam.remove(TreeService.TREE_PARENTID_VAR);
      prepareParameters(html, allParam);

      // url
      if (treeNode.getUrl() != null) {
        this.prepareAttribute(html, "url", treeNode.getUrl());
      }

      // otherAttributes
      Map<String, String> attributes = treeNode.getAttributes();
      if (attributes != null) {
        Iterator<String> attributeKeys = treeNode.getAttributes()
            .keySet().iterator();
        while (attributeKeys.hasNext()) {
          String att = attributeKeys.next();
          prepareAttribute(html, att, treeNode.getAttributes().get(
              att));
        }
      }
      // end otherAttributes
     
      // end <li>
      html.append(" >");
     
      // span
      if (this.isLeaf(tree,treeNode)) {
        html.append("<span class='file'>");
      }else{
        if(i == nodes.size() -1){//last folder
          html.append("<div class='hit closed-hit lastclosed-hit' onclick='$att(this);'></div>");
        }else{
          html.append("<div class='hit closed-hit' onclick='$att(this);'></div>");
        }
        html.append("<span class='folder' onclick='$att(this);'>");
      }
      // a
      html.append("<a href='javascript:void(0);' onclick='$atc(this)'>");
      html.append(StringEscapeUtils.escapeHtml(treeNode.getText()));
      html.append("</a>");
      html.append("</span>");
      //end  </li>
      html.append("</li>");
View Full Code Here

Examples of org.w3c.tools.widgets.TreeNode

    }

    public void insertNode(RemoteResourceWrapper father,
         RemoteResourceWrapper son,
         String name) {
  TreeNode fatherNode;
  boolean ic = false;

  if(father == null)
      System.out.println("Error null father");
  fatherNode = getNode(father);
  if(fatherNode.getChildren() == TreeNode.NOCHILD)
      return;
 
  if (fatherNode == null)
      return; // this should never happen, but...
  try {
View Full Code Here

Examples of org.wso2.carbon.registry.common.ui.utils.TreeNode

    }
    public TreeNode buildTree() throws Exception{
        String schemaName = RegistryUtils.getResourceName(schemaPath);
        List<String> attributeList = new ArrayList<String>();
        attributeList.add(SchemaConstants.NAME);
        TreeNode root = new TreeNode(TreeNodeBuilderUtil.generateKeyName(SchemaConstants.SCHEMA, schemaName));
        /* Adding namespace information in to the tree struction */
        addSchemaDataToTreeWithHyperlink(SchemaConstants.XPATH_TARGETNAMESPACE,
                SchemaConstants.TARGETNAMESPACE, root,
                schemaElement, false);
        /* Adding Elements*/
 
View Full Code Here

Examples of org.zaval.awt.peer.TreeNode

       if ( e.target == delDialog && e.arg instanceof Button &&
             ((Button)e.arg).getLabel().equals( DELETE_BUTTONS[0])){
          String key = tree.getSelectedText();
          if ( key != null ){
             isDirty = true;
             TreeNode tn = tree.getNode( wasSelectedKey );
             if ( tn != null ) tn = tn.parent;
             tree.remove( key );
             adjustIndicator( tn );
             tree.repaint();

             bundle.getBundle().removeKeysBeginningWith(key);

             wasSelectedKey = null;
             setTranslations();
          }
       }
       if ( e.target == delDialog && e.arg instanceof Button &&
             ((Button)e.arg).getLabel().equals( DELETE_BUTTONS[1])){
          String key = tree.getSelectedText();
          if ( key != null ){
             isDirty = true;
             TreeNode tn = tree.getNode( wasSelectedKey );
             if(tree.enumChild(tn) == null || tree.enumChild(tn).length == 0){
               if ( tn != null ) tn = tn.parent;
               tree.remove( key );
               adjustIndicator( tn );
               tree.repaint();
View Full Code Here

Examples of pivot.wtk.content.TreeNode

        this.treeView = treeView;
        this.path = path;

        // Get the data being edited
        List<?> treeData = treeView.getTreeData();
        TreeNode nodeData = (TreeNode)Sequence.Tree.get(treeData, path);

        // Get the node bounds
        Bounds nodeBounds = treeView.getNodeBounds(path);
        int nodeIndent = treeView.getNodeIndent(path.getLength());
        nodeBounds.x += nodeIndent;
        nodeBounds.width -= nodeIndent;

        // Render the node data
        TreeViewNodeRenderer nodeRenderer = (TreeViewNodeRenderer)treeView.getNodeRenderer();
        nodeRenderer.render(nodeData, treeView, false, false,
            TreeView.NodeCheckState.UNCHECKED, false, false);
        nodeRenderer.setSize(nodeBounds.width, nodeBounds.height);

        // Get the text bounds
        Bounds textBounds = nodeRenderer.getTextBounds();

        if (textBounds != null) {
            textInput = new TextInput();
            Insets padding = (Insets)textInput.getStyles().get("padding");

            // Calculate the bounds of what we're editing
            Bounds editBounds = new Bounds(nodeBounds);
            editBounds.x += textBounds.x - (padding.left + 1);
            editBounds.width -= textBounds.x;
            editBounds.width += (padding.left + 1);

            // Scroll to make the text as visible as possible
            treeView.scrollAreaToVisible(editBounds.x, editBounds.y,
                textBounds.width + padding.left + 1, editBounds.height);

            // Constrain the bounds by what is visible through Viewport ancestors
            editBounds = treeView.getVisibleArea(editBounds.x, editBounds.y,
                editBounds.width, editBounds.height);

            textInput.setText(nodeData.getText());
            textInput.setPreferredWidth(editBounds.width);
            textInput.getComponentKeyListeners().add(textInputKeyHandler);

            popup = new Window(textInput);
            popup.getWindowStateListeners().add(popupStateHandler);
View Full Code Here

Examples of symantec.itools.awt.TreeNode

                if (restrict) {
                    // new mode is more restrictive; delete undesired children
                    for (int j=0; j<linkarray.length; ++j) {
                        if (!shouldDisplay (linkarray[j].getStatus())) {
                            TreeNode child = findNode (linkarray[j]);
                            if (child != null)
                                remove (child);
                        }
                    }
                }
                else {
                    // new mode is less restrictive; add children
                    for (int j=0; j<linkarray.length; ++j) {
                        update (linkarray[j]); // update() will check shouldDisplay()
                    }
                }
            }
           
            TreeNode c = n.getChild();
            if (c != null)
                reFilter (c, restrict);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.