use of com.intellij.usages.UsageGroup in project intellij-community by JetBrains.
the class UsageNodeTreeBuilder method appendUsage.
UsageNode appendUsage(@NotNull Usage usage, @NotNull Consumer<Node> edtInsertedUnderQueue, boolean filterDuplicateLines) {
if (!isVisible(usage))
return null;
final boolean dumb = DumbService.isDumb(myProject);
GroupNode groupNode = myRoot;
for (int i = 0; i < myGroupingRules.length; i++) {
UsageGroupingRule rule = myGroupingRules[i];
if (dumb && !DumbService.isDumbAware(rule))
continue;
UsageGroup group = rule instanceof UsageGroupingRuleEx ? ((UsageGroupingRuleEx) rule).groupUsage(usage, myTargets) : rule.groupUsage(usage);
if (group != null) {
groupNode = groupNode.addOrGetGroup(group, i, edtInsertedUnderQueue);
}
}
return groupNode.addUsage(usage, edtInsertedUnderQueue, filterDuplicateLines);
}
use of com.intellij.usages.UsageGroup in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoFileStructureGroupRuleTest method getGroupElement.
@NotNull
private PsiElement getGroupElement() {
UsageGroup group = GoFileStructureGroupRuleProvider.USAGE_GROUPING_RULE.groupUsage(findSingleUsage());
assertNotNull(group);
assertInstanceOf(group, PsiElementUsageGroupBase.class);
return ((PsiElementUsageGroupBase) group).getElement();
}
use of com.intellij.usages.UsageGroup in project intellij-community by JetBrains.
the class ShowUsagesTableCellRenderer method appendGroupText.
private void appendGroupText(JTable table, final GroupNode node, JPanel panel, Color fileBgColor, boolean isSelected) {
UsageGroup group = node == null ? null : node.getGroup();
if (group == null)
return;
GroupNode parentGroup = (GroupNode) node.getParent();
appendGroupText(table, parentGroup, panel, fileBgColor, isSelected);
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.setBorder(null);
SpeedSearchUtil.applySpeedSearchHighlighting(table, renderer, false, isSelected);
panel.add(renderer);
}
}
Aggregations