treeModel = new DefaultTreeModel(treeRootNode); tree = new JTree(treeModel); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); tree.addMouseListener(new MouseAdapter() { @Override
componentTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); componentTree.addTreeSelectionListener(new TreeSelectionListener() { @Override
toolbar.add(closeButton); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); tree.addTreeSelectionListener( new TreeSelectionListener() {
private JComponent createASTPanel() { astTreeWidget.setCellRenderer(createNoImageTreeCellRenderer()); TreeSelectionModel model = astTreeWidget.getSelectionModel(); model.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); model.addTreeSelectionListener(new SymbolTableListener()); model.addTreeSelectionListener(new CodeHighlightListener()); return new JScrollPane(astTreeWidget); }
public CheckBoxTree(DefaultMutableTreeNode root) { super(root); addMouseListener(new CheckBoxTreeMouseListener(this)); setCellRenderer(new CheckBoxTreeCellRenderer()); setToggleClickCount(0); getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); }
public void init(ControlPoint controlPoint, Service service) { rootContainer = createRootContainer(service); rootNode = new DefaultMutableTreeNode(rootContainer) { @Override public boolean isLeaf() { return false; } }; DefaultTreeModel treeModel = new DefaultTreeModel(rootNode); setModel(treeModel); getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); addTreeWillExpandListener(createContainerTreeExpandListener(controlPoint, service, treeModel)); setCellRenderer(createContainerTreeCellRenderer()); controlPoint.execute(createContentBrowseActionCallback(service, treeModel, getRootNode())); }
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); tree.setCellRenderer(new CellRenderer()); TreeListener tl = new TreeListener();
tree.setDropMode(DropMode.ON_OR_INSERT); tree.setTransferHandler(new TreeTransferHandler()); tree.getSelectionModel().setSelectionMode( TreeSelectionModel.CONTIGUOUS_TREE_SELECTION); expandTree(tree);
tree.getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); tree.addTreeSelectionListener( new TreeSelectionListener() {
/** Constructor */ public XChartDemo() { super(new GridLayout(1, 0)); // Create the nodes. DefaultMutableTreeNode top = new DefaultMutableTreeNode("XChart Example Charts"); createNodes(top); // Create a tree that allows one selection at a time. tree = new JTree(top); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); // Listen for when the selection changes. tree.addTreeSelectionListener(this); // Create the scroll pane and add the tree to it. JScrollPane treeView = new JScrollPane(tree); // Create Chart Panel chartPanel = new XChartPanel(new AreaChart01().getChart()); // Add the scroll panes to a split pane. splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); splitPane.setTopComponent(treeView); splitPane.setBottomComponent(chartPanel); Dimension minimumSize = new Dimension(130, 160); treeView.setMinimumSize(minimumSize); splitPane.setPreferredSize(new Dimension(700, 700)); // Add the split pane to this panel. add(splitPane); }
processList.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); processList .getSelectionModel()
protected void init() { // Create the nodes. DefaultMutableTreeNode top = new DefaultMutableTreeNode("XChart Example Charts"); createNodes(top); tree = new JTree(top); // Create a tree that allows one selection at a time. tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); // Listen for when the selection changes. tree.addTreeSelectionListener(this); // Create the scroll pane and add the tree to it. JScrollPane treeView = new JScrollPane(tree); // Create Chart Panel tabbedPane = new JTabbedPane(); for (int i = 0; i < tree.getRowCount(); i++) { tree.expandRow(i); } // select first leaf DefaultMutableTreeNode firstLeaf = top.getFirstLeaf(); tree.setSelectionPath(new TreePath(firstLeaf.getPath())); // Add the scroll panes to a split pane. splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); splitPane.setTopComponent(treeView); splitPane.setBottomComponent(tabbedPane); Dimension minimumSize = new Dimension(130, 160); treeView.setMinimumSize(minimumSize); splitPane.setPreferredSize(new Dimension(700, 700)); // Add the split pane to this panel. add(splitPane); }
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); tree.setName("mongoTree"); tree.setRootVisible(false);
m_tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); m_tree.setShowsRootHandles(true); m_tree.setEditable(false);
this.tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.getSelectionModel().setSelectionMode( DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);
/** Constructor. */ public ContextTreeView() { tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); }
/** Constructor. */ public ContextTreeView() { tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); }
private void fireMultiSelectionChanged(PropertyChangeEvent e) { if (getFileChooser().isMultiSelectionEnabled()) { tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); } else { tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); getFileChooser().setSelectedFiles(null); } }
private void initFromModel(Project project) { // build model ProjectTreeModel model = new ProjectTreeModel(project); setRootVisible(true); setModel(model); getSelectionModel().setSelectionMode( TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); }