protected TreePath getSelectionPath() { return selectionModel.getSelectionPath(); }
protected TreePath getSelectionPath() { return selectionModel.getSelectionPath(); }
protected TreePath getSelectionPath() { return selectionModel.getSelectionPath(); }
protected TreePath getSelectionPath() { return selectionModel.getSelectionPath(); }
public final BCalque getSelectedCalque() { final TreePath p = selection_.getSelectionPath(); return p == null ? null : (BCalque) p.getLastPathComponent(); }
/** * Retourne le calque selectionn dans l'arbre. * @param _m Le modele de selection. * @return Le calque selectionn. Normalement de type BCalque ?? */ protected Object getTarget(final TreeSelectionModel _m) { final TreePath path = _m.getSelectionPath(); return path == null ? null : path.getLastPathComponent(); }
public void treeNodesChanged(TreeModelEvent e) { selectTreePath(treeCategories.getSelectionModel().getSelectionPath(), true); }
@SuppressWarnings({"unchecked"}) @Override public N getSelectedNode() { TreePath path = getSelectionModel().getSelectionPath(); N node = null; if (path != null) { node = (N) path.getLastPathComponent(); } return node; }
/** * A convenience method that gets the first selected * <code>OWLClass</code> * @return The selected <code>OWLClass</code>, or * <code>null</code> if no class is selected */ protected E getSelectedOWLEntity() { TreePath treePath = selectionModel.getSelectionPath(); if (treePath == null) { return null; } return (E) ((OWLObjectTreeNode<E>) treePath.getLastPathComponent()).getUserObject(); }
/** * A convenience method that gets the first selected * <code>OWLClass</code> * @return The selected <code>OWLClass</code>, or * <code>null</code> if no class is selected */ protected E getSelectedOWLEntity() { TreePath treePath = selectionModel.getSelectionPath(); if (treePath == null) { return null; } return (E) ((OWLObjectTreeNode<E>) treePath.getLastPathComponent()).getUserObject(); }
/** * A convenience method that gets the first selected * <code>OWLClass</code> * @return The selected <code>OWLClass</code>, or * <code>null</code> if no class is selected */ protected E getSelectedOWLEntity() { TreePath treePath = selectionModel.getSelectionPath(); if (treePath == null) { return null; } return (E) ((OWLObjectTreeNode<E>) treePath.getLastPathComponent()).getUserObject(); }
/** * A convenience method that gets the first selected * <code>OWLClass</code> * @return The selected <code>OWLClass</code>, or * <code>null</code> if no class is selected */ protected E getSelectedOWLEntity() { TreePath treePath = selectionModel.getSelectionPath(); if (treePath == null) { return null; } return (E) ((OWLObjectTreeNode<E>) treePath.getLastPathComponent()).getUserObject(); }
@Nullable public ConfigCheckedTreeNode getSelectedNode() { TreePath treePath = getSelectionModel().getSelectionPath(); if (treePath == null) { return null; } Object[] path = treePath.getPath(); return (ConfigCheckedTreeNode) path[path.length - 1]; }
public void quickRefresh() { final TreePath p = selection_.getSelectionPath(); fireTreeModelStructureEvent(null); selection_.setSelectionPath(p); }
/** * Returns the currently selected directory, if any. * * @return Null, if no directory is currently selected. */ public File getSelectedDirectory() { return getFileFor(getSelectionModel().getSelectionPath()); }
public void valueChanged(final TreeSelectionEvent _e) { final TreeSelectionModel model = (TreeSelectionModel) _e.getSource(); setPalettePanelTarget(model.isSelectionEmpty() ? null : model.getSelectionPath().getLastPathComponent()); }
/** * Create a resource identifier. */ public IFuture<IResourceIdentifier> createResourceIdentifier() { // Get the first child of selection path as url final TreePath selpath = mpanel.getTree().getSelectionModel().getSelectionPath(); ITreeNode root = (ITreeNode)selpath.getPathComponent(1); // while(root.getParent()!=null && root.getParent().getParent()!=null) // root = root.getParent(); final String filename = ((IFileNode)root).getFilePath(); return ModelTreePanel.createResourceIdentifier(jcc.getPlatformAccess(), filename); }
/** * Create a resource identifier. */ public IFuture<IResourceIdentifier> createResourceIdentifier() { // Get the first child of selection path as url final TreePath selpath = mpanel.getTree().getSelectionModel().getSelectionPath(); ITreeNode root = (ITreeNode)selpath.getPathComponent(1); // while(root.getParent()!=null && root.getParent().getParent()!=null) // root = root.getParent(); final String filename = ((IFileNode)root).getFilePath(); return ModelTreePanel.createResourceIdentifier(jcc.getPlatformAccess(), filename); }
private void resetTree() { _tree.getSelectionModel().removeTreeSelectionListener(_treeSelectionListener); Enumeration expandedDescendants = null; TreePath path = null; if (_model.getRoot() != null) { expandedDescendants = _tree.getExpandedDescendants(new TreePath(_model.getRoot())); path = _tree.getSelectionModel().getSelectionPath(); } _model = new PsiViewerTreeModel(_projectComponent); _model.setRoot(getRootElement()); _tree.setModel(_model); if (expandedDescendants != null) while (expandedDescendants.hasMoreElements()) { TreePath treePath = (TreePath) expandedDescendants.nextElement(); _tree.expandPath(treePath); } _tree.setSelectionPath(path); _tree.scrollPathToVisible(path); _tree.getSelectionModel().addTreeSelectionListener(_treeSelectionListener); }
/** * Met a jour le modele et la selection. * * @param _m le nouveau modele */ public final void setModel(final BArbreCalqueModel _m) { if (getModel()!=null) ((BArbreCalqueModel)getModel()).getObservable().deleteObserver(this); if (_m!=null) _m.getObservable().addObserver(this); // pour eviter d'initialiser l'ancien model de selection super.setSelectionModel(null); super.setModel(_m); if (_m != null) { final TreePath p = _m.getTreeSelectionModel().getSelectionPath(); super.setSelectionModel(_m.getTreeSelectionModel()); if (p != null) { final TreePath par = p.getParentPath(); if (par != null) { expandPath(par); } } } }