当前位置: 首页>>代码示例>>Java>>正文


Java SimpleNode类代码示例

本文整理汇总了Java中com.intellij.ui.treeStructure.SimpleNode的典型用法代码示例。如果您正苦于以下问题:Java SimpleNode类的具体用法?Java SimpleNode怎么用?Java SimpleNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SimpleNode类属于com.intellij.ui.treeStructure包,在下文中一共展示了SimpleNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectNode

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
public void selectNode(@NotNull String parentPath, @NotNull PackagingElement<?> element) {
  final PackagingElementNode<?> parent = myTree.findCompositeNodeByPath(parentPath);
  if (parent == null) return;

  for (SimpleNode node : parent.getChildren()) {
    if (node instanceof PackagingElementNode) {
      final List<? extends PackagingElement<?>> elements = ((PackagingElementNode<?>)node).getPackagingElements();
      for (PackagingElement<?> packagingElement : elements) {
        if (packagingElement.isEqualTo(element)) {
          myBuilder.select(node);
          return;
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:LayoutTreeComponent.java

示例2: LayoutTreeSelection

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
public LayoutTreeSelection(@NotNull LayoutTree tree) {
  final TreePath[] paths = tree.getSelectionPaths();
  if (paths == null) {
    return;
  }

  for (TreePath path : paths) {
    final SimpleNode node = tree.getNodeFor(path);
    if (node instanceof PackagingElementNode) {
      final PackagingElementNode<?> elementNode = (PackagingElementNode<?>)node;
      mySelectedNodes.add(elementNode);
      myNode2Path.put(elementNode, path);
      for (PackagingElement<?> element : elementNode.getPackagingElements()) {
        mySelectedElements.add(element);
        myElement2Node.put(element, elementNode);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:LayoutTreeSelection.java

示例3: buildChildren

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
@Override
protected SimpleNode[] buildChildren() {
  if (myConfigurable != null) {
    myConfigurableToNodeMap.put(myConfigurable, this);
  }
  if (myComposite == null) {
    return NO_CHILDREN;
  }
  Configurable[] configurables = myComposite.getConfigurables();
  if (configurables == null || configurables.length == 0) {
    return NO_CHILDREN;
  }
  SimpleNode[] result = new SimpleNode[configurables.length];
  for (int i = 0; i < configurables.length; i++) {
    result[i] = new MyNode(this, configurables[i], myLevel + 1);
    if (myConfigurable != null) {
      myFilter.myContext.registerKid(myConfigurable, configurables[i]);
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SettingsTreeView.java

示例4: shouldBeShowing

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
@Override
public boolean shouldBeShowing(SimpleNode node) {
  if (myFiltered != null) {
    Configurable configurable = getConfigurable(node);
    if (configurable != null) {
      if (!myFiltered.contains(configurable)) {
        if (myHits != null) {
          Set<Configurable> configurables = myHits.getNameFullHits();
          while (node != null) {
            if (configurable != null) {
              if (configurables.contains(configurable)) {
                return true;
              }
            }
            node = node.getParent();
            configurable = getConfigurable(node);
          }
        }
        return false;
      }
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:SettingsFilter.java

示例5: getDomCollectionChildDescriptions

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
@Override
@NotNull
protected DomCollectionChildDescription[] getDomCollectionChildDescriptions(final AnActionEvent e) {
  final DomModelTreeView view = getTreeView(e);

  SimpleNode node = view.getTree().getSelectedNode();
  if (node instanceof BaseDomElementNode) {
    List<DomCollectionChildDescription> consolidated = ((BaseDomElementNode)node).getConsolidatedChildrenDescriptions();
    if (consolidated.size() > 0) {
      return consolidated.toArray(new DomCollectionChildDescription[consolidated.size()]);
    }
  }

  final DomElementsGroupNode groupNode = getDomElementsGroupNode(view);

  return groupNode == null
         ? DomCollectionChildDescription.EMPTY_ARRAY
         : new DomCollectionChildDescription[]{groupNode.getChildDescription()};
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AddElementInCollectionAction.java

示例6: actionPerformed

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e, DomModelTreeView treeView) {
  final SimpleNode selectedNode = treeView.getTree().getSelectedNode();

  if (selectedNode instanceof BaseDomElementNode) {

    if (selectedNode instanceof DomFileElementNode) {
      e.getPresentation().setVisible(false);
      return;
    }
    
    final DomElement domElement = ((BaseDomElementNode)selectedNode).getDomElement();

    final int ret = Messages.showOkCancelDialog(getPresentationText(selectedNode, "Remove") + "?", "Remove",
                                                Messages.getQuestionIcon());
    if (ret == Messages.OK) {
    new WriteCommandAction(domElement.getManager().getProject(), DomUtil.getFile(domElement)) {
      @Override
      protected void run(@NotNull final Result result) throws Throwable {
        domElement.undefine();
      }
    }.execute();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DeleteDomElement.java

示例7: getData

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
@Override
@Nullable
public Object getData(String dataId) {
  if (DATA_KEY.is(dataId)) {
    return this;
  }
  final SimpleNode simpleNode = getTree().getSelectedNode();
  if (simpleNode instanceof AbstractDomElementNode) {
    final DomElement domElement = ((AbstractDomElementNode)simpleNode).getDomElement();
    if (domElement != null && domElement.isValid()) {
      if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
        final XmlElement tag = domElement.getXmlElement();
        if (tag instanceof Navigatable) {
          return tag;
        }
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:DomModelTreeView.java

示例8: getChildren

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
@Override
public SimpleNode[] getChildren() {
    if (!isDirectory) {
        return NO_CHILDREN;
    }

    List<TfvcItem> children;
    try {
        children = treeContext.getChildItems(path);
    } catch (TfsException e) {
        return new SimpleNode[]{new TfsErrorTreeNode(this, e.getMessage())};
    }

    final List<TfsTreeNode> result = new ArrayList<TfsTreeNode>(virtualChildren);
    for (final TfvcItem childItem : children) {
        result.add(new TfsTreeNode(this, childItem.getPath(), childItem.isFolder(), false));
    }
    return result.toArray(new SimpleNode[result.size()]);
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:20,代码来源:TfsTreeNode.java

示例9: getChildren

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
@NotNull
private List<SimpleNode> getChildren(@NotNull QueryFolder folder) {
  List<SimpleNode> result = ContainerUtil.newArrayList();

  for (QueryItem item : folder.getItems()) {
    SimpleNode child;

    if (item instanceof QueryDefinition) {
      child = new SavedQueryDefinitionNode(myQueriesTreeContext, (QueryDefinition)item);
    }
    else if (item instanceof QueryFolder) {
      child = new SavedQueryFolderNode(myQueriesTreeContext, (QueryFolder)item);
    }
    else {
      throw new IllegalArgumentException("Unknown query item " + item);
    }

    result.add(child);
  }

  return result;
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:23,代码来源:SavedQueryFolderNode.java

示例10: getDomCollectionChildDescriptions

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
@NotNull
protected DomCollectionChildDescription[] getDomCollectionChildDescriptions(final AnActionEvent e) {
  final DomModelTreeView view = getTreeView(e);

  SimpleNode node = view.getTree().getSelectedNode();
  if (node instanceof BaseDomElementNode) {
    List<DomCollectionChildDescription> consolidated = ((BaseDomElementNode)node).getConsolidatedChildrenDescriptions();
    if (consolidated.size() > 0) {
      return consolidated.toArray(new DomCollectionChildDescription[consolidated.size()]);
    }
  }

  final DomElementsGroupNode groupNode = getDomElementsGroupNode(view);

  return groupNode == null
         ? DomCollectionChildDescription.EMPTY_ARRAY
         : new DomCollectionChildDescription[]{groupNode.getChildDescription()};
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:AddElementInCollectionAction.java

示例11: actionPerformed

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e, DomModelTreeView treeView) {
  final SimpleNode selectedNode = treeView.getTree().getSelectedNode();

  if (selectedNode instanceof BaseDomElementNode) {

    if (selectedNode instanceof DomFileElementNode) {
      e.getPresentation().setVisible(false);
      return;
    }
    
    final DomElement domElement = ((BaseDomElementNode)selectedNode).getDomElement();

    final int ret = Messages.showOkCancelDialog(getPresentationText(selectedNode) + "?", ApplicationBundle.message("action.remove"),
                                                Messages.getQuestionIcon());
    if (ret == 0) {
    new WriteCommandAction(domElement.getManager().getProject(), DomUtil.getFile(domElement)) {
      protected void run(final Result result) throws Throwable {
        domElement.undefine();
      }
    }.execute();
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:DeleteDomElement.java

示例12: getData

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
@Nullable
public Object getData(String dataId) {
  if (DomModelTreeView.DATA_KEY.is(dataId)) {
    return this;
  }
  final SimpleNode simpleNode = getTree().getSelectedNode();
  if (simpleNode instanceof AbstractDomElementNode) {
    final DomElement domElement = ((AbstractDomElementNode)simpleNode).getDomElement();
    if (domElement != null && domElement.isValid()) {
      if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
        final XmlElement tag = domElement.getXmlElement();
        if (tag instanceof Navigatable) {
          return new Navigatable[] { (Navigatable)tag };
        }
      }
    }
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:DomModelTreeView.java

示例13: retrieveChildren

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
@Override
public void retrieveChildren() {
    retrievingChildren = true;

    DescribeResult describeResult;
    try {
        describeResult = client.describeObject(versionUrl, sObjectDescription.getName());
    } catch (Exception e) {
        logger.error(ERROR_MESSAGE + getName(), e);
        describeResult = null;
    }

    if (describeResult == null) {
        this.children = new SimpleNode[] { new ExplorerErrorNode(this, ERROR_MESSAGE + getName()) };
    } else {
        this.children = getChildrenFromJSONObject(describeResult);
    }
    retrievingChildren = false;
}
 
开发者ID:polyglot-mark,项目名称:salesforce-plugin,代码行数:20,代码来源:MetadataExplorerSObjectNode.java

示例14: setupMetadataPanel

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
private void setupMetadataPanel(Project project, SimpleToolWindowPanel metadataPanel) {
    RestClientService restClientService = ServiceManager.getService(project, RestClientService.class);
    SimpleNode metadataRootNode = new MetadataExplorerRootNode(project, restClientService, "Metadata");

    SimpleTree metadataTree = new SimpleTree();
    SimpleTreeBuilder metadataTreeBuilder = new SimpleTreeBuilder(metadataTree, (DefaultTreeModel)metadataTree.getModel(), new ExplorerTreeStructure(metadataRootNode), null);
    Disposer.register(project, metadataTreeBuilder);
    metadataTree.addTreeExpansionListener(new ExplorerTreeExpansionListener(metadataTreeBuilder));
    metadataTree.setCellRenderer(new ExplorerCellRenderer());

    ActionToolbar toolbar = createToolbar(metadataRootNode, metadataTreeBuilder);
    toolbar.setTargetComponent(metadataPanel);
    metadataPanel.setToolbar(toolbar.getComponent());
    metadataPanel.setContent(ScrollPaneFactory.createScrollPane(metadataTree));

    metadataTree.setShowsRootHandles(true);

}
 
开发者ID:polyglot-mark,项目名称:salesforce-plugin,代码行数:19,代码来源:MetadataExplorerToolWindowFactory.java

示例15: setupToolingMetadataPanel

import com.intellij.ui.treeStructure.SimpleNode; //导入依赖的package包/类
private void setupToolingMetadataPanel(Project project, SimpleToolWindowPanel toolingMetadataPanel) {
    ToolingRestClientService toolingRestClientService = ServiceManager.getService(project, ToolingRestClientService.class);
    SimpleNode toolingMetadataRootNode = new MetadataExplorerRootNode(project, toolingRestClientService, " Tooling Metadata");

    SimpleTree toolingMetadataTree = new SimpleTree();
    SimpleTreeBuilder toolingMetadataTreeBuilder = new SimpleTreeBuilder(toolingMetadataTree, (DefaultTreeModel)toolingMetadataTree.getModel(), new ExplorerTreeStructure(toolingMetadataRootNode), null);
    Disposer.register(project, toolingMetadataTreeBuilder);
    toolingMetadataTree.addTreeExpansionListener(new ExplorerTreeExpansionListener(toolingMetadataTreeBuilder));
    toolingMetadataTree.setCellRenderer(new ExplorerCellRenderer());

    ActionToolbar toolbar = createToolbar(toolingMetadataRootNode, toolingMetadataTreeBuilder);
    toolbar.setTargetComponent(toolingMetadataPanel);
    toolingMetadataPanel.setToolbar(toolbar.getComponent());
    toolingMetadataPanel.setContent(ScrollPaneFactory.createScrollPane(toolingMetadataTree));

    toolingMetadataTree.setShowsRootHandles(true);

}
 
开发者ID:polyglot-mark,项目名称:salesforce-plugin,代码行数:19,代码来源:MetadataExplorerToolWindowFactory.java


注:本文中的com.intellij.ui.treeStructure.SimpleNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。