/** * Call this method whenever you update the tree and needs it reloaded */ public synchronized void update() { synchronized (this.tree) { this.tree.removeTreeExpansionListener(this); this.tree.removeTreeSelectionListener(this); ((DefaultTreeModel) this.tree.getModel()).reload(); for (TreePath treePath : expandedTreePaths) { this.tree.expandPath(treePath); } this.tree.getSelectionModel().setSelectionPaths(selectedTreePaths); this.tree.addTreeExpansionListener(this); this.tree.addTreeSelectionListener(this); } }
protected void showSelection(TreePath[] treePaths) { tree.getSelectionModel().setSelectionPaths(treePaths); if (treePaths.length == 1) { showPathWithoutExpansion(treePaths[0]); } }
protected void showSelection (TreePath[] treePaths) { tree.getSelectionModel().setSelectionPaths(treePaths); if (treePaths.length == 1) showPathWithoutExpansion (treePaths[0]); }
@Override protected void done() { for (TreePath path : expandedNodes) { tree.expandPath(path); } tree.getSelectionModel().setSelectionPaths(selectedNodes); skipRefreshPaths.clear(); } };
@Override protected void showSelection(TreePath[] treePaths) { tree.getSelectionModel().setSelectionPaths(treePaths); if (treePaths.length == 1) { showPathWithoutExpansion(treePaths[0]); } }
@Override protected void showSelection(TreePath[] treePaths) { tree.getSelectionModel().setSelectionPaths(treePaths); if (treePaths.length == 1) { showPathWithoutExpansion(treePaths[0]); } }
protected void showSelection (TreePath[] treePaths) { tree.getSelectionModel().setSelectionPaths(treePaths); if (treePaths.length == 1) showPathWithoutExpansion (treePaths[0]); }
@Override public void run() { ignoreTreeSelectionEvents = true; tree.getSelectionModel().setSelectionPaths(new TreePath[]{ tp }); treeTable.repaint(); ignoreTreeSelectionEvents = false; } });
private void actionDelete(final BCalque[] _c) { final TreePath[] parent = getSelectionParent(); for (int i = 0; i < _c.length; i++) { _c[i].detruire(); } selection_.setSelectionPaths(parent); }
tree.getSelectionModel().setSelectionPaths(keptSelection.toArray(new TreePath[keptSelection.size()])); mapContext.setSelectedLayers(layers.toArray(new ILayer[layers.size()])); mapContext.setSelectedStyles(styles.toArray(new Style[styles.size()]));
@Override public void run() { ignoreTreeSelectionEvents = true; treeTable.getTree().getSelectionModel().setSelectionPaths(paths.toArray(new TreePath[paths.size()])); ignoreTreeSelectionEvents = false; int maxRow = 0; for (final TreePath tp : paths) { final int row = treeTable.getTree().getRowForPath(tp); maxRow = Math.max(maxRow, row); } final int row = maxRow; treeTable.getTree().scrollRowToVisible(row); treeTable.repaint(); } });
_tree.getSelectionModel().setSelectionPaths( paths.toArray( new TreePath[paths.size()] ) );
tree.getSelectionModel().setSelectionPaths(treePaths); tree.scrollPathToVisible(currentPath); } finally {
public void setSelectionPaths(TreePath[] paths) { paths = getFilteredPaths(paths); selectionModel.setSelectionPaths(paths);