use of com.intellij.ui.treeStructure.SimpleNode in project intellij-leiningen-plugin by derkork.
the class LeiningenProjectStructure method getSelectedNodes.
private static List<SimpleNode> getSelectedNodes(SimpleTree tree) {
List<SimpleNode> nodes = new ArrayList<SimpleNode>();
TreePath[] treePaths = tree.getSelectionPaths();
if (treePaths != null) {
for (TreePath treePath : treePaths) {
nodes.add(tree.getNodeFor(treePath));
}
}
return nodes;
}
use of com.intellij.ui.treeStructure.SimpleNode in project intellij-community by JetBrains.
the class AddElementInCollectionAction method getParentDomElement.
@Override
protected DomElement getParentDomElement(final AnActionEvent e) {
final DomModelTreeView view = getTreeView(e);
SimpleNode node = view.getTree().getSelectedNode();
if (node instanceof BaseDomElementNode) {
if (((BaseDomElementNode) node).getConsolidatedChildrenDescriptions().size() > 0) {
return ((BaseDomElementNode) node).getDomElement();
}
}
final DomElementsGroupNode groupNode = getDomElementsGroupNode(view);
return groupNode == null ? null : groupNode.getDomElement();
}
use of com.intellij.ui.treeStructure.SimpleNode in project intellij-community by JetBrains.
the class GotoDomElementDeclarationAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e, DomModelTreeView treeView) {
final SimpleNode simpleNode = treeView.getTree().getSelectedNode();
if (simpleNode instanceof BaseDomElementNode) {
final DomElement domElement = ((BaseDomElementNode) simpleNode).getDomElement();
final DomElementNavigationProvider provider = DomElementsNavigationManager.getManager(domElement.getManager().getProject()).getDomElementsNavigateProvider(DomElementsNavigationManager.DEFAULT_PROVIDER_NAME);
provider.navigate(domElement, true);
}
}
use of com.intellij.ui.treeStructure.SimpleNode in project intellij-community by JetBrains.
the class SelectExternalTaskDialog method doOKAction.
@Override
protected void doOKAction() {
SimpleNode node = getSelectedNode();
if (node instanceof NullNode)
node = null;
myResult = node instanceof TaskNode ? Pair.create(((TaskNode) node).getModuleOwnerName(), ((TaskNode) node).getData()) : null;
super.doOKAction();
}
use of com.intellij.ui.treeStructure.SimpleNode in project intellij-community by JetBrains.
the class LayoutNodesDraggingObject method pathContains.
private static boolean pathContains(TreePath path, PackagingElementNode<?> node, LayoutTree tree) {
while (path != null) {
final SimpleNode pathNode = tree.getNodeFor(path);
if (pathNode == node) {
return true;
}
path = path.getParentPath();
}
return false;
}
Aggregations