use of javax.swing.tree.TreeSelectionModel in project android by JetBrains.
the class UiUtil method setUp.
@NotNull
public static JScrollPane setUp(@NotNull AbstractBaseTreeBuilder treeBuilder) {
JTree tree = treeBuilder.getUi().getTree();
tree.setExpandsSelectedPaths(true);
tree.setRootVisible(false);
TreeSelectionModel selectionModel = tree.getSelectionModel();
selectionModel.setSelectionMode(DISCONTIGUOUS_TREE_SELECTION);
TreeBuilderSpeedSearch.installTo(treeBuilder);
JScrollPane scrollPane = createScrollPane(tree);
scrollPane.setBorder(IdeBorderFactory.createEmptyBorder());
return scrollPane;
}
use of javax.swing.tree.TreeSelectionModel in project JMRI by JMRI.
the class RosterGroupsPanel method getTree.
/**
* Get the JTree containing the roster groups.
*
* @return The internal JTree
*/
public final JTree getTree() {
if (_tree == null) {
TreeSelectionModel sm = new DefaultTreeSelectionModel();
DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
sm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
renderer.setLeafIcon(null);
renderer.setClosedIcon(null);
renderer.setOpenIcon(null);
_tree = new JTree(getModel());
_tree.setUI(new TreeUI());
_tree.putClientProperty("JTree.lineStyle", "None");
_tree.setRootVisible(false);
_tree.expandRow(0);
_tree.setSelectionModel(sm);
_tree.setCellRenderer(renderer);
_tree.addTreeWillExpandListener(new TreeWillExpandListener());
_TSL = new TreeSelectionListener();
_tree.addTreeSelectionListener(_TSL);
_tree.setDragEnabled(true);
_tree.setDropMode(DropMode.ON);
_tree.setTransferHandler(new TransferHandler());
_tree.addMouseListener(new MouseAdapter());
setSelectionToGroup(selectedRosterGroup);
Roster.getDefault().addPropertyChangeListener(new PropertyChangeListener());
}
return _tree;
}
use of javax.swing.tree.TreeSelectionModel in project Gargoyle by callakrsos.
the class DesignerFx method createASTPanel.
private javafx.scene.Node createASTPanel() {
astTreeWidget.setCellRenderer(createNoImageTreeCellRenderer());
TreeSelectionModel model = astTreeWidget.getSelectionModel();
model.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
model.addTreeSelectionListener(new SymbolTableListener());
model.addTreeSelectionListener(new CodeHighlightListener());
SwingNode swingNode = new SwingNode();
createSwingContent(swingNode, new JScrollPane(astTreeWidget));
return swingNode;
}
use of javax.swing.tree.TreeSelectionModel in project vcell by virtualcell.
the class TestingFrameworkPanel method getTestSuiteInfoOfSelectedTestCriteria.
public TestSuiteInfoNew getTestSuiteInfoOfSelectedTestCriteria() {
TreeSelectionModel treeSelectionModel = getselectionModel();
TreePath treePath = treeSelectionModel.getSelectionPath();
return getTestSuiteInfoOfTreePath(treePath);
}
use of javax.swing.tree.TreeSelectionModel in project vcell by virtualcell.
the class TestingFrameworkPanel method getTreeSelection.
/**
* Comment
*/
public Object getTreeSelection() {
TreeSelectionModel treeSelectionModel = getselectionModel();
TreePath treePath = treeSelectionModel.getSelectionPath();
if (treePath == null) {
return null;
}
BioModelNode bioModelNode = (BioModelNode) treePath.getLastPathComponent();
Object object = bioModelNode.getUserObject();
return object;
}
Aggregations