com.intellij.usages.impl.GroupNode Java Examples

The following examples show how to use com.intellij.usages.impl.GroupNode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ShowUsagesTableCellRenderer.java    From dagger-intellij-plugin with Apache License 2.0 6 votes vote down vote up
private void appendGroupText(final GroupNode node, JPanel panel, Color fileBgColor) {
  UsageGroup group = node == null ? null : node.getGroup();
  if (group == null) return;
  GroupNode parentGroup = (GroupNode) node.getParent();
  appendGroupText(parentGroup, panel, fileBgColor);
  if (node.canNavigateToSource()) {
    SimpleColoredComponent renderer = new SimpleColoredComponent();

    renderer.setIcon(group.getIcon(false));
    SimpleTextAttributes attributes =
        deriveAttributesWithColor(SimpleTextAttributes.REGULAR_ATTRIBUTES, fileBgColor);
    renderer.append(group.getText(myUsageView), attributes);
    renderer.append(" ", attributes);
    renderer.setIpad(new Insets(0, 0, 0, 0));
    renderer.setBorder(null);
    panel.add(renderer);
  }
}
 
Example #2
Source File: ShowUsagesTableCellRenderer.java    From consulo with Apache License 2.0 6 votes vote down vote up
private void appendGroupText(final GroupNode node, JPanel panel, Color fileBgColor) {
  UsageGroup group = node == null ? null : node.getGroup();
  if (group == null) return;
  GroupNode parentGroup = (GroupNode)node.getParent();
  appendGroupText(parentGroup, panel, fileBgColor);
  if (node.canNavigateToSource()) {
    SimpleColoredComponent renderer = new SimpleColoredComponent();

    renderer.setIcon(group.getIcon());
    SimpleTextAttributes attributes = deriveAttributesWithColor(SimpleTextAttributes.REGULAR_ATTRIBUTES, fileBgColor);
    renderer.append(group.getText(myUsageView), attributes);
    renderer.append(" ", attributes);
    renderer.setIpad(new Insets(0,0,0,0));
    renderer.setBorder(null);
    panel.add(renderer);
  }
}
 
Example #3
Source File: ShowUsagesTableCellRenderer.java    From otto-intellij-plugin with Apache License 2.0 6 votes vote down vote up
private void appendGroupText(final GroupNode node, JPanel panel, Color fileBgColor) {
  UsageGroup group = node == null ? null : node.getGroup();
  if (group == null) return;
  GroupNode parentGroup = (GroupNode)node.getParent();
  appendGroupText(parentGroup, panel, fileBgColor);
  if (node.canNavigateToSource()) {
    SimpleColoredComponent renderer = new SimpleColoredComponent();

    renderer.setIcon(group.getIcon(false));
    SimpleTextAttributes attributes = deriveAttributesWithColor(SimpleTextAttributes.REGULAR_ATTRIBUTES, fileBgColor);
    renderer.append(group.getText(myUsageView), attributes);
    renderer.append(" ", attributes);
    renderer.setIpad(new Insets(0,0,0,0));
    renderer.setBorder(null);
    panel.add(renderer);
  }
}
 
Example #4
Source File: ShowUsagesAction.java    From dagger-intellij-plugin with Apache License 2.0 5 votes vote down vote up
private void addUsageNodes(@NotNull GroupNode root, @NotNull final UsageViewImpl usageView,
    @NotNull List<UsageNode> outNodes) {
  for (UsageNode node : root.getUsageNodes()) {
    Usage usage = node.getUsage();
    if (usageView.isVisible(usage)) {
      node.setParent(root);
      outNodes.add(node);
    }
  }
  for (GroupNode groupNode : root.getSubGroups()) {
    groupNode.setParent(root);
    addUsageNodes(groupNode, usageView, outNodes);
  }
}
 
Example #5
Source File: ShowUsagesAction.java    From dagger-intellij-plugin with Apache License 2.0 5 votes vote down vote up
@Override
protected String getElementText(@NotNull Object element) {
  if (!(element instanceof UsageNode)) return element.toString();
  UsageNode node = (UsageNode) element;
  if (node instanceof StringNode) return "";
  Usage usage = node.getUsage();
  if (usage == MORE_USAGES_SEPARATOR) return "";
  GroupNode group = (GroupNode) node.getParent();
  return usage.getPresentation().getPlainText() + group;
}
 
Example #6
Source File: ShowUsagesAction.java    From otto-intellij-plugin with Apache License 2.0 5 votes vote down vote up
private void addUsageNodes(@NotNull GroupNode root, @NotNull final UsageViewImpl usageView, @NotNull List<UsageNode> outNodes) {
  for (UsageNode node : root.getUsageNodes()) {
    Usage usage = node.getUsage();
    if (usageView.isVisible(usage)) {
      node.setParent(root);
      outNodes.add(node);
    }
  }
  for (GroupNode groupNode : root.getSubGroups()) {
    groupNode.setParent(root);
    addUsageNodes(groupNode, usageView, outNodes);
  }
}
 
Example #7
Source File: ShowUsagesAction.java    From otto-intellij-plugin with Apache License 2.0 5 votes vote down vote up
@Override
protected String getElementText(@NotNull Object element) {
  if (!(element instanceof UsageNode)) return element.toString();
  UsageNode node = (UsageNode)element;
  if (node instanceof StringNode) return "";
  Usage usage = node.getUsage();
  if (usage == MORE_USAGES_SEPARATOR) return "";
  GroupNode group = (GroupNode)node.getParent();
  return usage.getPresentation().getPlainText() + group;
}