Search in sources :

Example 1 with SimpleNode

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;
}
Also used : TreePath(javax.swing.tree.TreePath) ArrayList(java.util.ArrayList) SimpleNode(com.intellij.ui.treeStructure.SimpleNode)

Example 2 with SimpleNode

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();
}
Also used : BaseDomElementNode(com.intellij.util.xml.tree.BaseDomElementNode) DomModelTreeView(com.intellij.util.xml.tree.DomModelTreeView) DomElementsGroupNode(com.intellij.util.xml.tree.DomElementsGroupNode) SimpleNode(com.intellij.ui.treeStructure.SimpleNode)

Example 3 with SimpleNode

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);
    }
}
Also used : BaseDomElementNode(com.intellij.util.xml.tree.BaseDomElementNode) DomElement(com.intellij.util.xml.DomElement) DomElementNavigationProvider(com.intellij.util.xml.DomElementNavigationProvider) SimpleNode(com.intellij.ui.treeStructure.SimpleNode)

Example 4 with SimpleNode

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();
}
Also used : TaskNode(com.intellij.openapi.externalSystem.view.TaskNode) NullNode(com.intellij.ui.treeStructure.NullNode) SimpleNode(com.intellij.ui.treeStructure.SimpleNode)

Example 5 with SimpleNode

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;
}
Also used : SimpleNode(com.intellij.ui.treeStructure.SimpleNode)

Aggregations

SimpleNode (com.intellij.ui.treeStructure.SimpleNode)20 BaseDomElementNode (com.intellij.util.xml.tree.BaseDomElementNode)5 NullNode (com.intellij.ui.treeStructure.NullNode)4 DomElement (com.intellij.util.xml.DomElement)3 TreePath (javax.swing.tree.TreePath)3 NotNull (org.jetbrains.annotations.NotNull)3 DomCollectionChildDescription (com.intellij.util.xml.reflect.DomCollectionChildDescription)2 DomElementsGroupNode (com.intellij.util.xml.tree.DomElementsGroupNode)2 DomFileElementNode (com.intellij.util.xml.tree.DomFileElementNode)2 DomModelTreeView (com.intellij.util.xml.tree.DomModelTreeView)2 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)2 AbstractDependencyNode (com.android.tools.idea.gradle.structure.configurables.android.dependencies.treeview.AbstractDependencyNode)1 AbstractTreeUi (com.intellij.ide.util.treeView.AbstractTreeUi)1 Result (com.intellij.openapi.application.Result)1 WriteCommandAction (com.intellij.openapi.command.WriteCommandAction)1 ProjectNode (com.intellij.openapi.externalSystem.view.ProjectNode)1 TaskNode (com.intellij.openapi.externalSystem.view.TaskNode)1 Configurable (com.intellij.openapi.options.Configurable)1 SearchableConfigurable (com.intellij.openapi.options.SearchableConfigurable)1 PackagingElementNode (com.intellij.openapi.roots.ui.configuration.artifacts.nodes.PackagingElementNode)1