Package com.intellij.ide.util.treeView

Examples of com.intellij.ide.util.treeView.NodeDescriptor


      else
      {
        DefaultMutableTreeNode moduleNode = moduleNodesCache.get(module);
        if (moduleNode == null)
        {
          NodeDescriptor nodeDescriptor = new CustomModuleNodeDescriptor(project, module);
          moduleNode = new DefaultMutableTreeNode(nodeDescriptor);
          rootNode.insert(moduleNode, findIndex(rootNode, nodeDescriptor));

          moduleNodesCache.put(module, moduleNode);
        }

        parentNode = moduleNode;
      }

      NodeDescriptor nodeDescriptor = new CustomFileNodeDescriptor(project,
        (NodeDescriptor) parentNode.getUserObject(), vFile);

      node = new DefaultMutableTreeNode(nodeDescriptor);
      parentNode.insert(node, findIndex(parentNode, nodeDescriptor));
View Full Code Here


    private int findIndex(DefaultMutableTreeNode parentNode, NodeDescriptor nodeDescriptor)
    {
      for (int i=0; i<parentNode.getChildCount(); i++)
      {
        DefaultMutableTreeNode childNode = (DefaultMutableTreeNode) parentNode.getChildAt(i);
        NodeDescriptor childDescriptor = (NodeDescriptor) childNode.getUserObject();

        if (childDescriptor.toString().compareTo(nodeDescriptor.toString()) > 0)
        {
          return i;
        }
      }
View Full Code Here

  public final int getToggleClickCount() {
    final DefaultMutableTreeNode selectedNode = getSelectedNode();
    if (selectedNode != null) {
      final Object object = selectedNode.getUserObject();
      if (object instanceof NodeDescriptor) {
        NodeDescriptor descriptor = (NodeDescriptor)object;
        if (!descriptor.expandOnDoubleClick()) {
          return -1;
        }
      }
    }
    return super.getToggleClickCount();
View Full Code Here

    DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
    final Object userObject = node.getUserObject();
    if (!(userObject instanceof NodeDescriptor)) {
      return null;
    }
    NodeDescriptor nodeDescriptor = (NodeDescriptor) userObject;
    Object object = nodeDescriptor.getElement();

    return (object instanceof Issue) ? (Issue) object : null;
  }
View Full Code Here

    {
      TreeNode group = root.getChildAt(i);
      for (int j=0; j<group.getChildCount(); j++)
      {
        DefaultMutableTreeNode node = (DefaultMutableTreeNode) group.getChildAt(j);
        NodeDescriptor nodeDescriptor = (NodeDescriptor) node.getUserObject();
        if (issue.equals(nodeDescriptor.getElement()))
        {
          return new TreePath(node.getPath());
        }
      }
    }
View Full Code Here

    {
      return null;
    }

    DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
    NodeDescriptor nodeDescriptor = (NodeDescriptor) node.getUserObject();

    Object object = nodeDescriptor.getElement();

    return (object instanceof Issue) ? (Issue) object : null;
  }
View Full Code Here

    {
      TreeNode group = root.getChildAt(i);
      for (int j=0; j<group.getChildCount(); j++)
      {
        DefaultMutableTreeNode node = (DefaultMutableTreeNode) group.getChildAt(j);
        NodeDescriptor nodeDescriptor = (NodeDescriptor) node.getUserObject();
        if (issue.equals(nodeDescriptor.getElement()))
        {
          return new TreePath(node.getPath());
        }
      }
    }
View Full Code Here

  protected abstract ColumnInfo[] createColumnInfos();

  @Nullable
  private Object getSelectedElement() {
    NodeDescriptor descriptor = getSelectedDescriptor();
    return descriptor == null ? null : descriptor.getElement();
  }
View Full Code Here

      return element instanceof PsiFile ? element : null;
    }
    else if (DataConstants.PROJECT.equals(dataId)) {
      return myProject;
    }
    NodeDescriptor descriptor = getSelectedDescriptor();
    if (descriptor instanceof JamNodeDescriptor) {
      return ((JamNodeDescriptor)descriptor).getDataForElement(dataId);
    }
    return null;
  }
View Full Code Here

    Color color = null;
    if (value instanceof DefaultMutableTreeNode) {
      DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
      Object userObject = node.getUserObject();
      if (userObject instanceof NodeDescriptor) {
        NodeDescriptor descriptor = (NodeDescriptor) userObject;
        if (expanded) {
          setIcon(descriptor.getOpenIcon());
        } else {
          setIcon(descriptor.getClosedIcon());
        }
        color = descriptor.getColor();
      }

      if (userObject instanceof SimpleNode) {
        renderNodeText(((SimpleNode) userObject), this);
        return;
View Full Code Here

TOP

Related Classes of com.intellij.ide.util.treeView.NodeDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.