Package fr.soleil.comete.definition.widget.util

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


     * @return An {@link ITreeNode}. <code>null</code> if the entity is <code>null</code>
     */
    public static ITreeNode buildNode(IEntity entity, boolean recursive) {
        ITreeNode node = null;
        if (entity != null) {
            node = new BasicTreeNode();
            node.setData(entity);
            node.setName(entity.getName());
            if (entity instanceof IDirectory) {
                node.setImage(ImageTool.getCometeImage((ImageIcon) Icons
                        .getIcon("salsa.scanconfig.folder")));
View Full Code Here


            e1.printStackTrace();
        } catch (URISyntaxException e2) {
            e2.printStackTrace();
        }

        ITreeNode rootNode = new BasicTreeNode();
        constructTree(rootNode, dataset.getRootGroup());
        tree.setRootNode(rootNode);
        tree.addMouseListener(archivingListener);

        panel.add(tree, BorderLayout.CENTER);
View Full Code Here

    private static void constructTree(ITreeNode parentNode, IGroup group) {
        if (parentNode != null) {
            try {
                parentNode.setName(group.getName());
                for (IGroup tempGroup : group.getGroupList()) {
                    ITreeNode node = new BasicTreeNode();
                    parentNode.addNodes(node);
                    constructTree(node, tempGroup);
                }
                for (IDataItem dataItem : group.getDataItemList()) {
                    ITreeNode node = new BasicTreeNode();
                    node.setName(dataItem.getName());
                    node.setData(dataItem.getData());
                    parentNode.addNodes(node);
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
View Full Code Here

    private void fillTree() {
        List<String> deviceList = null;
        try {
            deviceList = match();
        } catch (Exception e) {
            currentRootNode = new BasicTreeNode();
            currentRootNode.setName("ERROR");
            currentRootNode.setImage(errorImage);
        }
        if ((deviceList != null) && (tree != null)) {
            ITreeNode rootNode = new BasicTreeNode();
            rootNode.setName(rootName);

            for (String path : deviceList) {
                String[] pathSplit = path.split("/");
                ITreeNode currentNode = rootNode;
                String nodePath = null;
                String el = null;
                for (String element : pathSplit) {
                    el = element;
                    ITreeNode node = null;
                    for (ITreeNode child : currentNode.getChildren()) {
                        if (child.getName().equals(el)) {
                            node = child;
                        }
                    }
                    if (node == null) {
                        node = new BasicTreeNode();
                    }
                    node.setName(el);
                    ITreeNode[] childToAdd = new ITreeNode[1];
                    childToAdd[0] = node;
                    currentNode.addNodes(childToAdd);
View Full Code Here

    }

    private void fillTree() {
        List<String> deviceList = match();
        if ((deviceList != null) && (tree != null)) {
            ITreeNode rootNode = new BasicTreeNode();
            rootNode.setName(rootName);
            rootNode.setImage(rootImage);

            for (String path : deviceList) {

                String[] pathSplit = path.split("/");
                ITreeNode currentNode = rootNode;
                String nodePath = null;
                for (String el : pathSplit) {
                    ITreeNode node = null;
                    for (ITreeNode child : currentNode.getChildren()) {
                        if (child.getName().equals(el)) {
                            node = child;
                        }
                    }
                    if (node == null) {
                        node = new BasicTreeNode();
                    }
                    node.setName(el);
                    node.setImage(nodeImage);

                    ITreeNode[] childToAdd = new ITreeNode[1];
View Full Code Here

        componentPanel.setLayoutData(componentGridData);

        Tree theComponent = new Tree(componentPanel, SWT.NONE);
        theComponent.setLayoutData(new RowData(150, 450));

        root = new BasicTreeNode();
        root.setName("ROOT");

        childString = new String[4];
        for (int i = 0; i < childString.length; i++) {
            childString[i] = "Child " + i;
            child = new BasicTreeNode();
            child.setName(childString[i]);
            root.addNodes(child);
        }

        theComponent.setRootNode(root);
View Full Code Here

        setRootNodeIndexButton.setText("Set root node");
        setRootNodeIndexButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {

                root = new BasicTreeNode();
                root.setName("Set root name");
                childString = new String[4];
                for (int i = 0; i < childString.length; i++) {
                    childString[i] = "Child " + i;
                    child = new BasicTreeNode();
                    child.setName(childString[i]);
                    root.addNodes(child);
                }

                theComponent.setRootNode(root);
View Full Code Here


        Tree theComponent = new Tree(componentPanel, SWT.NONE);
        theComponent.setLayoutData(new RowData(150, 450));

        root = new BasicTreeNode();
        root.setName("ROOT");

        childString = new String[4];
        for (int i = 0; i < childString.length; i++) {
            childString[i] = "Child " + i;
            child = new BasicTreeNode();
            child.setName(childString[i]);
            root.addNodes(child);
        }

        theComponent.setRootNode(root);
View Full Code Here

        tree = new Tree(parent, SWT.NONE);
        GridData treeData = new GridData(200, 300);
        treeData.verticalAlignment = GridData.BEGINNING;
        tree.setLayoutData(treeData);

        ITreeNode root = new BasicTreeNode();
        root.setName("ROOT");
        String[] childString = new String[4];
        for (int i = 0; i < childString.length; i++) {
            childString[i] = "Child " + i;
            ITreeNode child = new BasicTreeNode();
            child.setName(childString[i]);
            root.addNodes(child);
        }
        tree.setRootNode(root);

        //Player
View Full Code Here

TOP

Related Classes of fr.soleil.comete.definition.widget.util.BasicTreeNode

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.