Package javax.swing.tree

Examples of javax.swing.tree.TreeSelectionModel


        tree.setRootVisible(false);
        tree.setShowsRootHandles(true);
        tree.setCellRenderer(new PomManagerTreeCellRenderer(project));
        tree.addTreeSelectionListener(new TreeSelectionHandler());
        tree.addMouseListener(new DblClickHandler());
        final TreeSelectionModel treeSelModel = tree.getSelectionModel();
        treeSelModel.setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
        add(ScrollPaneFactory.createScrollPane(tree), BorderLayout.CENTER);

        //
        //create the toolbar
        //
View Full Code Here


    }
    return pathArray;
  }

  private @Nullable String selectionMode(JTree tree) {
    TreeSelectionModel model = tree.getSelectionModel();
    return SELECTION_MODES.get(model.getSelectionMode());
  }
View Full Code Here

                        .contains("showing=false");
  }

  @RunsInEDT
  private void setContiguousSelectionMode() {
    TreeSelectionModel selectionModel = new DefaultTreeSelectionModel();
    selectionModel.setSelectionMode(CONTIGUOUS_TREE_SELECTION);
    setSelectionModel(tree, selectionModel);
  }
View Full Code Here

   */
  private JComponent createEntryTree(final boolean includeGlobals)
  {
    treeModel = new ConfigTreeModel(packageManager, includeGlobals);

    final TreeSelectionModel selectionModel = new DefaultTreeSelectionModel();
    selectionModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

    tree = new JTree(treeModel);
    tree.setSelectionModel(selectionModel);
    tree.setCellRenderer(new ConfigTreeRenderer());
    tree.setRootVisible(false);
View Full Code Here

  }
 
  public void checkConstructor1(TestHarness harness)
  {
    harness.checkPoint("(Object, TreePath, boolean, TreePath, TreePath)");
    TreeSelectionModel m = new DefaultTreeSelectionModel();
    TreePath p1 = new TreePath("A");
    TreePath p2 = new TreePath("B");
    TreePath p3 = new TreePath("C");
    TreeSelectionEvent tse = new TreeSelectionEvent(m, p1, true, p2, p3);
    harness.check(tse.getSource(), m);
View Full Code Here

  }

  public void checkConstructor2(TestHarness harness)
  {
    harness.checkPoint("(Object, TreePath[], boolean[], TreePath, TreePath)");
    TreeSelectionModel m = new DefaultTreeSelectionModel();
    TreePath p1A = new TreePath("A");
    TreePath p1B = new TreePath("AA");
    TreePath[] p1 = new TreePath[] {p1A, p1B};
    TreePath p2 = new TreePath("B");
    TreePath p3 = new TreePath("C");
View Full Code Here

public class cloneWithSource implements Testlet
{
  public void test(TestHarness harness)
  {
    TreeSelectionModel m1 = new DefaultTreeSelectionModel();
    TreeSelectionModel m2 = new DefaultTreeSelectionModel();
    TreePath p1 = new TreePath("A");
    TreePath p2 = new TreePath("B");
    TreePath p3 = new TreePath("C");
    TreeSelectionEvent tse1 = new TreeSelectionEvent(m1, p1, true, p2, p3);
    TreeSelectionEvent tse2 = (TreeSelectionEvent) tse1.cloneWithSource(m2);
View Full Code Here

  }
 
  public void checkMethod1(TestHarness harness)
  {
    harness.checkPoint("()");
    TreeSelectionModel m = new DefaultTreeSelectionModel();
    TreePath p1 = new TreePath("A");
    TreeSelectionEvent tse = new TreeSelectionEvent(m, p1, false, null, null);
    harness.check(tse.isAddedPath(), false);
  }
View Full Code Here

  }

  public void checkMethod2(TestHarness harness)
  {
    harness.checkPoint("(int)");
    TreeSelectionModel m = new DefaultTreeSelectionModel();
    TreePath p1A = new TreePath("A");
    TreePath p1B = new TreePath("AA");
    TreePath[] p1 = new TreePath[] {p1A, p1B};
    boolean[] b = new boolean[] {true, false};
    TreeSelectionEvent tse = new TreeSelectionEvent(m, p1, b, null, null);
View Full Code Here

  }

  public void checkMethod3(TestHarness harness)
  {
    harness.checkPoint("(TreePath)");
    TreeSelectionModel m = new DefaultTreeSelectionModel();
    TreePath p1A = new TreePath("A");
    TreePath p1B = new TreePath("AA");
    TreePath[] p1 = new TreePath[] {p1A, p1B};
    boolean[] b = new boolean[] {true, false};
    TreeSelectionEvent tse = new TreeSelectionEvent(m, p1, b, null, null);
View Full Code Here

TOP

Related Classes of javax.swing.tree.TreeSelectionModel

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.