Examples of TreeModel


Examples of com.extjs.gxt.ui.client.data.TreeModel

  }

  protected void appendModel(ModelData p, List<ModelData> models, int index) {
    if (models.size() == 0) return;
    if (models.get(0) instanceof TreeModel) {
      TreeModel test = (TreeModel) models.get(0);
      // drop is in form from tree store
      if (test.getPropertyNames().contains("model")) {

        List<ModelData> children = new ArrayList<ModelData>();
        for (ModelData tm : models) {
          ModelData child = tm.get("model");
          children.add(child);
View Full Code Here

Examples of com.google.devtools.depan.view.TreeModel

  }

  public static <F> GraphData<F> createGraphData(
      NodeTreeProvider<F> provider,
      GraphModel graph, DirectedRelationFinder relFinder) {
    TreeModel hierarchy =
        new HierarchicalTreeModel(graph.computeSpanningHierarchy(relFinder));
    return new GraphData<F>(provider, hierarchy);
  }
View Full Code Here

Examples of com.sun.jersey.samples.jmaki.beans.TreeModel

     */
    @Test
    public void doTestGetPrinterJMakiTree() {
        WebResource webResource = resource();
        //GET on printer list - mime-type application/json
        TreeModel treeModel = webResource.path("printers").path("jMakiTree").accept(MediaType.APPLICATION_JSON).get(TreeModel.class);
        Assert.assertEquals("Method: doTestGetPrinterJMakiTree \nMessage: Root of the returned " +
                "jMakiTree doesn't match the expected value", "printers", treeModel.root.label);
    }
View Full Code Here

Examples of javax.swing.tree.TreeModel

    return count;
  }

  public void expandAll(TreePath path) {
    expandPath(path);
    TreeModel model = getModel();
    if (path != null && model != null) {
      Object comp = path.getLastPathComponent();
      int cnt = model.getChildCount(comp);
      for (int i = 0; i < cnt; i++) {
        Object node = model.getChild(comp, i);
        expandAll(path.pathByAddingChild(node));
      }
    }
  }
View Full Code Here

Examples of javax.swing.tree.TreeModel

      }
    }
  }

  public void collapseAll(TreePath path) {
    TreeModel model = getModel();
    if (path != null && model != null) {
      Object comp = path.getLastPathComponent();
      int cnt = model.getChildCount(comp);
      for (int i = 0; i < cnt; i++) {
        Object node = model.getChild(comp, i);
        collapseAll(path.pathByAddingChild(node));
      }
      if (!path.getLastPathComponent().equals(model.getRoot())) {
        collapsePath(path);
      }
    }
  }
View Full Code Here

Examples of javax.swing.tree.TreeModel

        public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
        }

        private void notifyChange(final RepoTreeNode pNode) {
            synchronized (RepoTree.this) {
                final TreeModel model = getModel();
                if (!(model instanceof RepoTreeModel))
                    return;

                //
                //make sure the node that fired this change still belongs
                //to our model (if the model was swapped in the middle of
                //a fetch operation, this can happen)
                //
                TreeNode parent = pNode;
                while (parent != null && parent.getParent() != null) parent = parent.getParent();
                if (parent == null || !parent.equals(model.getRoot()))
                    return;

                //
                //notify that the structure of the given node has been changed
                //
View Full Code Here

Examples of javax.swing.tree.TreeModel

    public RepositoryTreeExpander(final JTree pTree) {
        tree = pTree;
    }

    public boolean canCollapse() {
        final TreeModel model = tree.getModel();

        final Object root = model.getRoot();
        if (tree.isCollapsed(new TreePath(root)))
            return false;

        final Object[] treePath = new Object[2];
        treePath[0] = root;

        final int childCount = model.getChildCount(root);
        for (int i = 0; i < childCount; i++) {
            treePath[1] = model.getChild(root, i);
            if (tree.isExpanded(new TreePath(treePath)))
                return true;
        }

        return false;
View Full Code Here

Examples of javax.swing.tree.TreeModel

    public boolean canExpand() {
        return false;
    }

    public void collapseAll() {
        final TreeModel model = tree.getModel();

        final Object root = model.getRoot();
        final Object[] treePath = new Object[2];
        treePath[0] = root;

        final int childCount = model.getChildCount(root);
        for (int i = 0; i < childCount; i++) {
            treePath[1] = model.getChild(root, i);
            tree.collapsePath(new TreePath(treePath));
        }
    }
View Full Code Here

Examples of javax.swing.tree.TreeModel


  public TreeModel getTreeModel() {
    ValueBinding valueBinding = getValueBinding("value");
    if(valueBinding != null){
      TreeModel treeModel = (TreeModel) valueBinding.getValue(getFacesContext());
      return treeModel;
    }
    return null;
  }
View Full Code Here

Examples of javax.swing.tree.TreeModel

    // 4. Check alphabetical order of categories and furniture in tree
    assertTreeIsSorted(tree);
  }
 
  public void assertTreeIsSorted(JTree tree) {
    TreeModel model = tree.getModel();
    Object    root  = model.getRoot();
    Collator  comparator = Collator.getInstance();
    // For each category
    for (int i = 0, n = model.getChildCount(root); i < n; i++) {
      Object rootChild = model.getChild(root, i);
      if (i < n - 1) {
        Object nextChild = model.getChild(root, i + 1);
        // Check alphatical order of categories nodes in tree
        assertTrue("Categories not sorted", comparator.compare(
            getNodeText(tree, rootChild),
            getNodeText(tree, nextChild)) <= 0);
      }
      // For each piece of furniture of a category
      for (int j = 0, m = model.getChildCount(rootChild) - 1;
           j < m; j++) {
        Object child = model.getChild(rootChild, j);
        if (j < m - 1) {
          Object nextChild = model.getChild(rootChild, j + 1);
          // Check alphatical order of furniture nodes in tree
          assertTrue("Furniture not sorted", comparator.compare(
              getNodeText(tree, child),
              getNodeText(tree, nextChild)) <= 0);
        }
        assertTrue("Piece not a leaf", model.isLeaf(child));
      }
    }
  }
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.