Package com.gwtext.client.widgets.tree

Examples of com.gwtext.client.widgets.tree.TreeNode


        currentSelection.add((EntityData) node.getUserObject());
        notifySelectionListeners(new SelectionEvent(ImportsTreePortlet.this));
      }
    });
   
    TreeNode root = new TreeNode();
    root.setText(getProject().getDisplayName());
    root.setId(getProjectId().getId());
    root.setUserObject(new EntityData(getProjectId().getId(), getProject().getDisplayName()));

    importsTree.setRootNode(root);
    importsTree.setRootVisible(true);

    add(importsTree);
View Full Code Here


    node.setId(nodeName);
    node.setUserObject(new EntityData(data.getName(), data.getName()));
   
    ArrayList<ImportsData> imports = data.getImports();
    for (ImportsData importData : imports) {
      TreeNode childNode = new TreeNode();
      addImports(importData, childNode);
      node.appendChild(childNode);
    }
  }
View Full Code Here

    public void handleFailure(Throwable caught) {
      GWT.log("RPC error getting imported ontologies ", caught);
    }

    public void handleSuccess(ImportsData result) {
      TreeNode root = importsTree.getRootNode();
      addImports(result, root);
      root.select();
      root.expand();
    }
View Full Code Here

            }
        });


        // Temporary - to be replaced when ontology is loaded.
        TreeNode root = new TreeNode((String) null);
        root.setId("RootPropertyNode");
        root.setHref("");
        root.setUserObject(new PropertyEntityData("RootPropertyNode", "RootPropertyNode", null));
        setTreeNodeIcon(root);

        treePanel.setRootNode(root);
        treePanel.setRootVisible(false);
View Full Code Here

        currentSelection.add((EntityData) node.getUserObject());
        notifySelectionListeners(new SelectionEvent(this));
    }

    private void handleRelationshipAdded(final HierarchyChangedEvent<? extends OWLEntity, ?> event) {
        TreeNode parentTn = findTreeNode(event.getParent());
        if (parentTn == null) {
            return;
        }
        final OWLEntity child = event.getChild();
        handleChildAdded(parentTn, child, false);
View Full Code Here

    private void handleRelationshipRemoved(final HierarchyChangedEvent<? extends OWLEntity, ?> event) {
        if(event.getChild().isBuiltIn()) {
            // Don't remove built in things from the tree
            return;
        }
        TreeNode tn = findTreeNode(event.getChild());
        if(tn == null) {
            return;
        }
        TreeNode parTn = findTreeNode(event.getParent());
        if(parTn != null) {
            parTn.removeChild(tn);
        }
    }
View Full Code Here

    }

    private void handleRootAdded(HierarchyRootAddedEvent<?> event) {
        Object root = event.getRoot();
        if (root instanceof OWLAnnotationProperty) {
            TreeNode treeNode = getAnnotationPropertiesRootNode();
            if (treeNode != null) {
                handleChildAdded(treeNode, (OWLAnnotationProperty) root, false);
            }
        }
    }
View Full Code Here

                // Don't remove built in things!
                return;
            }
        }
        if(root instanceof OWLAnnotationProperty) {
            TreeNode annoRoot = getAnnotationPropertiesRootNode();
            if(annoRoot != null) {
                TreeNode childTn = findTreeNode((OWLAnnotationProperty) root);
                annoRoot.removeChild(childTn);
                childTn.remove();
            }
        }
    }
View Full Code Here

        }
    }


    private void handleChildAdded(TreeNode parentTn, final OWLEntity child, boolean shouldSelect) {
        final TreeNode childTn = findTreeNode(child.getIRI().toString());
        final TreeNode freshChild;
        if (childTn == null) {
            final PropertyEntityData entityData = createEntityDataPlaceholder(child);
            freshChild = createTreeNode(entityData);
            updateTextAsync(child, freshChild);
            parentTn.appendChild(freshChild);

        }
        else {
            freshChild = childTn;
        }
        if (freshChild != null && shouldSelect) {
            parentTn.expand();
            freshChild.select();
            selectNode(freshChild);
        }
    }
View Full Code Here

    }


    private void handleBrowserTextChanged(BrowserTextChangedEvent event) {
        OWLEntity entity = event.getEntity();
        TreeNode treeNode = findTreeNode(entity);
        if(treeNode != null) {
            final Object userObject = treeNode.getUserObject();
            if (userObject instanceof EntityData) {
                EntityData entityData = (EntityData) userObject;
                entityData.setBrowserText(event.getNewBrowserText());
                treeNode.setText(getNodeText(entityData));
            }

        }
    }
View Full Code Here

TOP

Related Classes of com.gwtext.client.widgets.tree.TreeNode

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.