protected void setSelectionPath(TreePath path) { selectionModel.setSelectionPath(path); }
protected void setSelectionPath(TreePath path) { selectionModel.setSelectionPath(path); }
protected void setSelectionPath(TreePath path) { selectionModel.setSelectionPath(path); }
protected void setSelectionPath(TreePath path) { selectionModel.setSelectionPath(path); }
public static void selectCategoryTreePath(JTree tree, TreePath treePath) { tree.expandPath(treePath); tree.scrollPathToVisible(treePath); tree.getSelectionModel().setSelectionPath(treePath); }
private static void selectPath(final JTree tree, final TreePath treePath) { GuiUtilities.invokeLater(() -> { tree.getSelectionModel().setSelectionPath(treePath); tree.scrollPathToVisible(treePath); }); }
public void selectNodeAtOffset(int offset) { if (!scrollFromSource) { return; } DefaultMutableTreeNode root = (DefaultMutableTreeNode) myTree.getModel().getRoot(); Tree tree = (Tree) root.getUserObject(); if (tree instanceof ParseTree) { DefaultMutableTreeNode atOffset = getNodeAtOffset(root, offset); if (atOffset != null) { TreePath path = new TreePath(atOffset.getPath()); myTree.getSelectionModel().setSelectionPath(path); myTree.scrollPathToVisible(path); } } }
public void quickRefresh() { final TreePath p = selection_.getSelectionPath(); fireTreeModelStructureEvent(null); selection_.setSelectionPath(p); }
@Override public Point getPopupLocation(final MouseEvent event) { if (event != null) { // Select item on right click TreePath tp = treeAlert.getPathForLocation(event.getX(), event.getY()); if (tp != null) { // Only select a new item if the current item is not // already selected - this is to allow multiple items // to be selected if (!treeAlert.getSelectionModel().isPathSelected(tp)) { treeAlert.getSelectionModel().setSelectionPath(tp); } } } return super.getPopupLocation(event); } };
@Override public void setSelectionPath(TreePath path) { getUI().getTreeSelectionModel().setSelectionPath(path); }
/** * Selectionne un claque dans l'arbre. */ public void setSelectionCalque(final BCalque _cq) { if (_cq == null) { selection_.clearSelection(); } else { final Object n = calque_; final TreePath tp = new TreePath(n); if (n == _cq) { selection_.setSelectionPath(tp); } else { setSelectionCalque(_cq, tp); } } }
public void propertyChange (PropertyChangeEvent event) { if ((event.getSource () == detailsPane_) && (event.getPropertyName () == "root")) { VNode object = detailsPane_.getRoot (); treePane_.makeVisible (object); treePane_.getSelectionModel ().setSelectionPath (treePane_.getPath (object)); } } }
public void contentsChanged(ListDataEvent e) { if (e.getIndex0() == -1 && e.getIndex1() == -1 && e.getType() == ListDataEvent.CONTENTS_CHANGED) { if (_titleNodeMap != null && _pageList.getCurrentPage() != null) { TreeNode node = _titleNodeMap.get(_pageList.getCurrentPage().getFullTitle()); if (node != null) { ArrayList<TreeNode> list = new ArrayList<TreeNode>(); while (node != null) { list.add(0, node); node = node.getParent(); } TreePath treePath = new TreePath(list.toArray(new TreeNode[list.size()])); _tree.getSelectionModel().setSelectionPath(treePath); } } } } });
public void contentsChanged(ListDataEvent e) { if (e.getIndex0() == -1 && e.getIndex1() == -1 && e.getType() == ListDataEvent.CONTENTS_CHANGED) { if (_titleNodeMap != null && _pageList.getCurrentPage() != null) { TreeNode node = (TreeNode) _titleNodeMap.get(_pageList.getCurrentPage().getFullTitle()); if (node != null) { ArrayList<TreeNode> list = new ArrayList<TreeNode>(); while (node != null) { list.add(0, node); node = node.getParent(); } TreePath treePath = new TreePath(list.toArray(new TreeNode[list.size()])); _tree.getSelectionModel().setSelectionPath(treePath); } } } } });
/** * DOCUMENT ME! * * @param network_id DOCUMENT ME! */ public void focusNetworkNode(String network_id) { //logger.info("NetworkPanel: focus network node"); DefaultMutableTreeNode node = getNetworkNode(network_id); if (node != null) { // fires valueChanged if the network isn't already selected treeTable.getTree().getSelectionModel().setSelectionPath(new TreePath(node.getPath())); treeTable.getTree().scrollPathToVisible(new TreePath(node.getPath())); } }
private void setSelectionCalque(final BCalque _cq, final TreePath _tp) { final Object n = _tp.getLastPathComponent(); TreePath tpo = _tp; final int count = getChildCount(n); for (int i = 0; i < count; i++) { final Object o = getChild(n, i); tpo = _tp.pathByAddingChild(o); if (o == _cq) { // selection_.expandPath(tpo); // normalement le calque doit etre selectionne. selection_.setSelectionPath(tpo); return; } setSelectionCalque(_cq, tpo); } }
@CheckForNull private OccurenceNavigator.OccurenceInfo occurrence(@Nullable IssueNode node) { if (node == null) { return null; } TreePath path = new TreePath(node.getPath()); tree.getSelectionModel().setSelectionPath(path); tree.scrollPathToVisible(path); RangeMarker range = node.issue().getRange(); int startOffset = (range != null) ? range.getStartOffset() : 0; return new OccurenceNavigator.OccurenceInfo( new OpenFileDescriptor(project, node.issue().psiFile().getVirtualFile(), startOffset), -1, -1); }
private void restoreSelections() { EditorView editorView = ((CayenneModelerFrame) Application.getInstance().getFrameController().getView()) .getView(); editorView.getProjectTreeView().getSelectionModel().setSelectionPath(treePath); if (tabbedPane != null) { tabbedPane.setSelectedIndex(selectedTabIndex); if (tabbedPane instanceof SQLTemplateTabbedView) { ((SQLTemplateTabbedView) tabbedPane).getScriptsTab().setSelectedIndex(selectedItem); } } }
/** * Builds a tree path for a given path and make selection in it */ private static TreePath buildAndSelectTreePath(DataMap map, Object object, EditorView editor) { ProjectTreeView projectTreeView = editor.getProjectTreeView(); ProjectTreeModel treeModel = (ProjectTreeModel) projectTreeView.getModel(); DefaultMutableTreeNode[] mutableTreeNodes = new DefaultMutableTreeNode[] { treeModel.getRootNode(), treeModel.getNodeForObjectPath(new Object[]{map}), treeModel.getNodeForObjectPath(new Object[]{map, object}) }; TreePath treePath = new TreePath(mutableTreeNodes); if (!projectTreeView.isExpanded(treePath.getParentPath())) { projectTreeView.expandPath(treePath.getParentPath()); } projectTreeView.getSelectionModel().setSelectionPath(treePath); return treePath; }
public void navigateToEntity(Entity entity) { TreePath path = buildTreePath(entity); editor().getProjectTreeView().getSelectionModel().setSelectionPath(path); EntityDisplayEvent event = new EntityDisplayEvent( editor().getProjectTreeView(), entity, entity.getDataMap(), (DataChannelDescriptor) getProjectController().getProject().getRootNode()); if (entity instanceof DbEntity) { getProjectController().fireDbEntityDisplayEvent(event); } else if (entity instanceof ObjEntity){ getProjectController().fireObjEntityDisplayEvent(event); } } }