Examples of ITreeNode


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

Examples of eu.scape_project.planning.model.tree.ITreeNode

     */
    public void expandNode(ITreeNode node) {
        if (node == null) {
            return;
        }
        ITreeNode parent = node.getParent();
        if (parent != null) {
            if (!isNodeExpanded(parent)) {
                expandNode(parent);
            }
        }
View Full Code Here

Examples of fr.soleil.comete.definition.widget.util.ITreeNode

                    currentNodes[0].addNodes(data);
                    isModified = true;
                }
            }
            else {
                ITreeNode rootNode = getRootNode();
                if (rootNode != null) {
                    if (useChildren) {
                        isModified = addChildrenNodes(rootNode, data);
                    }
                    else {
                        rootNode.addNodes(data);
                        isModified = true;
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.directory.ldapstudio.schemas.view.views.wrappers.ITreeNode

     *      the Schema Element
     */
    private void linkViewWithEditor( SchemaElement schemaElement )
    {
        StructuredSelection structuredSelection = null;
        ITreeNode wrapper = null;

        if ( schemaElement instanceof AttributeType )
        {
            wrapper = new AttributeTypeWrapper( ( AttributeType ) schemaElement, null );
            structuredSelection = new StructuredSelection( wrapper );

            view.getViewer().setSelection( structuredSelection, true );
        }
        else if ( schemaElement instanceof ObjectClass )
        {
            wrapper = new ObjectClassWrapper( ( ObjectClass ) schemaElement, null );
            structuredSelection = new StructuredSelection( wrapper );
        }
        else
        {
            return;
        }

        Object foundItem = view.getViewer().testFindItem( wrapper );
        if ( foundItem != null ) // The node we are looking for is already loaded in the TreeViewer
        {
            view.getViewer().setSelection( structuredSelection, true );
        }
        else
        // The node we are looking for is not yet loaded in the TreeViewer, we have to find and load it.
        {
            ITreeNode foundElement = view.findElementInTree( wrapper );

            if ( foundElement != null )
            {
                expandFromTopToBottom( foundElement );
                view.getViewer().setSelection( structuredSelection );
View Full Code Here

Examples of org.apache.tapestry.contrib.tree.model.ITreeNode

  /**
   * @see org.apache.tapestry.contrib.tree.model.ITreeDataModel#getChildCount(Object)
   */
  public int getChildCount(Object objParent) {
    ITreeNode objParentNode = (ITreeNode)objParent;
   
    return objParentNode.getChildCount();
  }
View Full Code Here

Examples of org.erlide.tracing.core.mvc.model.treenodes.ITreeNode

    // functions creating nodes

    private ITreeNode processDropTrace(final OtpErlangTuple tuple) {
        final OtpErlangLong amount = (OtpErlangLong) tuple.elementAt(1);
        final ITreeNode node = new TreeNode("Dropped traces: " + amount.longValue(),
                Activator.getImage(Images.DROP_NODE));
        return node;
    }
View Full Code Here

Examples of org.erlide.tracing.core.mvc.model.treenodes.ITreeNode

    }

    private ITreeNode createProcessNode(final String label,
            final OtpErlangObject erlangObject) {
        final StringBuilder builder = new StringBuilder();
        ITreeNode functionNode = null;
        ITreeNode nameNode = null;
        ITreeNode pidNode = null;
        ITreeNode processNodeNode = null;

        if (erlangObject instanceof OtpErlangTuple) {
            // tuple: {Pid(), Initial_call()|Registered_name(), Node()} |
            // {Registered_name, Node()}
            final OtpErlangTuple processTuple = (OtpErlangTuple) erlangObject;
            int index = 0;

            // pid
            OtpErlangPid pid = null;
            if (processTuple.arity() == 3) {
                // {Pid(), Initial_call()|Registered_name(), Node()}
                pid = (OtpErlangPid) processTuple.elementAt(INDEX_PROCESS_PID);
                pidNode = new TreeNode("pid: " + pid2Str(pid),
                        Activator.getImage(Images.INFO_NODE));
            } else {
                index = 1;// tuple doesn't contain Pid element
            }

            final OtpErlangObject info = processTuple.elementAt(INDEX_PROCESS_INFO
                    - index);

            // process node
            final OtpErlangObject processNode = processTuple.elementAt(INDEX_PROCESS_NODE
                    - index);
            processNodeNode = new TreeNode("node: " + processNode,
                    Activator.getImage(Images.INFO_NODE));

            if (info instanceof OtpErlangTuple) {
                // initial call
                functionNode = createFunctionNode("initial call:", info);
                functionNode.setImage(Activator.getImage(Images.INFO_NODE));
                if (pid != null) {
                    builder.append(pid2Str(pid));
                } else {
                    builder.append(lastFunctionDescription);
                }
            } else {
                // registered name
                nameNode = new TreeNode("name: " + info,
                        Activator.getImage(Images.INFO_NODE));
                builder.append(info.toString());
            }
            builder.append(" (").append(processNode).append(")");
        } else if (erlangObject instanceof OtpErlangPid) {
            // Pid
            final OtpErlangPid pid = (OtpErlangPid) erlangObject;
            pidNode = new TreeNode("pid: " + pid2Str(pid),
                    Activator.getImage(Images.INFO_NODE));
            processNodeNode = new TreeNode("node: " + pid.node(),
                    Activator.getImage(Images.INFO_NODE));
            builder.append(pid2Str(pid)).append(" (").append(pid.node()).append(")");
        } else {
            // Atom (registered name)
            nameNode = new TreeNode("name: " + erlangObject,
                    Activator.getImage(Images.INFO_NODE));
            builder.append(erlangObject.toString());
        }

        final ITreeNode node = new TreeNode();
        if (pidNode != null) {
            node.addChildren(pidNode);
        }
        if (nameNode != null) {
            node.addChildren(nameNode);
        }
        if (processNodeNode != null) {
            node.addChildren(processNodeNode);
        }
        if (functionNode != null) {
            node.addChildren(functionNode);
        }

        lastProcessDescription = builder.toString();
        node.setLabel(label + lastProcessDescription);

        return node;
    }
View Full Code Here

Examples of org.erlide.tracing.core.mvc.model.treenodes.ITreeNode

        return node;
    }

    private ITreeNode createFunctionNode(final String label,
            final OtpErlangObject erlangObject) {
        final ITreeNode node = new TreeNode();
        if (erlangObject instanceof OtpErlangTuple) {
            final OtpErlangTuple functionTuple = (OtpErlangTuple) erlangObject;
            final OtpErlangAtom moduleName = (OtpErlangAtom) functionTuple
                    .elementAt(INDEX_FUNCTION_MODULE);
            final OtpErlangAtom functionName = (OtpErlangAtom) functionTuple
                    .elementAt(INDEX_FUNCTION_NAME);

            // args or arity node
            final TreeNode argsNode = new TreeNode();
            argsNode.setImage(Activator.getImage(Images.INFO_NODE));
            final OtpErlangObject arityOrArgs = functionTuple
                    .elementAt(INDEX_FUNCTION_ARGS);
            int arityValue = -1;
            if (arityOrArgs instanceof OtpErlangList) {
                // last element is a list of arguments
                final OtpErlangList arguments = (OtpErlangList) arityOrArgs;
                final StringBuilder builder = new StringBuilder("arguments: ");
                for (int i = 1; i < arguments.arity(); i++) {
                    builder.append(arguments.elementAt(i)).append(", ");
                }
                arityValue = arguments.arity() - 1;
                argsNode.setLabel(builder.substring(0, builder.length() - 2));
            } else {
                // last element is arity
                try {
                    if (functionTuple.elementAt(INDEX_FUNCTION_ARGS) instanceof OtpErlangInt) {
                        arityValue = ((OtpErlangInt) functionTuple
                                .elementAt(INDEX_FUNCTION_ARGS)).intValue();
                    } else {
                        arityValue = (int) ((OtpErlangLong) functionTuple
                                .elementAt(INDEX_FUNCTION_ARGS)).longValue();
                    }
                    argsNode.setLabel("arity: " + arityValue);
                } catch (final OtpErlangRangeException e) {
                    ErlLogger.error(e);
                }
            }

            // module name node
            final TreeNode moduleNameNode = new ModuleNode(moduleName.atomValue());
            moduleNameNode.setLabel("module: " + moduleName);

            // function name node
            final TreeNode functionNameNode = new FunctionNode(moduleName.atomValue(),
                    functionName.atomValue(), arityValue);
            functionNameNode.setLabel("function: " + functionName);

            node.addChildren(moduleNameNode, functionNameNode, argsNode);
            lastFunctionDescription = label + moduleName + ":" + functionName + "/"
                    + arityValue;

        } else {
            lastFunctionDescription = "unknown";
        }
        node.setLabel(lastFunctionDescription);
        return node;
    }
View Full Code Here

Examples of org.erlide.tracing.core.mvc.model.treenodes.ITreeNode

        node.setLabel(lastFunctionDescription);
        return node;
    }

    private ITreeNode createMessageNode(final OtpErlangObject message) {
        final ITreeNode node = new TreeNode(message.toString(),
                Activator.getImage(Images.MESSAGE_NODE));
        return node;
    }
View Full Code Here

Examples of org.erlide.tracing.core.mvc.model.treenodes.ITreeNode

    private ITreeNode processGcTrace(final String label, final Images image,
            final OtpErlangTuple tuple) {
        final StringBuilder labelBuilder = new StringBuilder(label).append(": ");

        final ITreeNode processNode = createProcessNode("process: ",
                tuple.elementAt(INDEX_PROCESS));
        processNode.setImage(Activator.getImage(Images.PROCESS_NODE));
        labelBuilder.append(lastProcessDescription);

        final ITreeNode node = new TreeNode(createNodeLabel(labelBuilder.toString()),
                Activator.getImage(image));
        node.addChildren(processNode);

        final OtpErlangList list = (OtpErlangList) tuple.elementAt(INDEX_INFO);
        for (final OtpErlangObject otpErlangObject : list) {
            final OtpErlangTuple infoTuple = (OtpErlangTuple) otpErlangObject;
            final OtpErlangObject key = infoTuple.elementAt(0);
            final OtpErlangObject value = infoTuple.elementAt(1);
            final TreeNode treeNode = new TreeNode(key.toString() + ": "
                    + value.toString());
            treeNode.setImage(Activator.getImage(Images.INFO_NODE));
            node.addChildren(treeNode);
        }
        return node;
    }
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.