Search in sources :

Example 1 with GroupingElement

use of com.intellij.ide.errorTreeView.GroupingElement in project intellij-community by JetBrains.

the class ProblemsViewImpl method addMessage.

@Override
public void addMessage(final int type, @NotNull final String[] text, @Nullable final String groupName, @Nullable final Navigatable navigatable, @Nullable final String exportTextPrefix, @Nullable final String rendererTextPrefix, @Nullable final UUID sessionId) {
    myViewUpdater.execute(() -> {
        final ErrorViewStructure structure = myPanel.getErrorViewStructure();
        final GroupingElement group = structure.lookupGroupingElement(groupName);
        if (group != null && sessionId != null && !sessionId.equals(group.getData())) {
            structure.removeElement(group);
        }
        if (navigatable != null) {
            myPanel.addMessage(type, text, groupName, navigatable, exportTextPrefix, rendererTextPrefix, sessionId);
        } else {
            myPanel.addMessage(type, text, null, -1, -1, sessionId);
        }
        updateIcon();
    });
}
Also used : GroupingElement(com.intellij.ide.errorTreeView.GroupingElement) ErrorViewStructure(com.intellij.ide.errorTreeView.ErrorViewStructure)

Example 2 with GroupingElement

use of com.intellij.ide.errorTreeView.GroupingElement in project intellij-community by JetBrains.

the class ExcludeFromCompileAction method getSelectedFile.

@Nullable
private VirtualFile getSelectedFile() {
    final ErrorTreeNodeDescriptor descriptor = myErrorTreeView.getSelectedNodeDescriptor();
    ErrorTreeElement element = descriptor != null ? descriptor.getElement() : null;
    if (element != null && !(element instanceof GroupingElement)) {
        NodeDescriptor parent = descriptor.getParentDescriptor();
        if (parent instanceof ErrorTreeNodeDescriptor) {
            element = ((ErrorTreeNodeDescriptor) parent).getElement();
        }
    }
    return element instanceof GroupingElement ? ((GroupingElement) element).getFile() : null;
}
Also used : ErrorTreeElement(com.intellij.ide.errorTreeView.ErrorTreeElement) GroupingElement(com.intellij.ide.errorTreeView.GroupingElement) ErrorTreeNodeDescriptor(com.intellij.ide.errorTreeView.ErrorTreeNodeDescriptor) NodeDescriptor(com.intellij.ide.util.treeView.NodeDescriptor) ErrorTreeNodeDescriptor(com.intellij.ide.errorTreeView.ErrorTreeNodeDescriptor) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

GroupingElement (com.intellij.ide.errorTreeView.GroupingElement)2 ErrorTreeElement (com.intellij.ide.errorTreeView.ErrorTreeElement)1 ErrorTreeNodeDescriptor (com.intellij.ide.errorTreeView.ErrorTreeNodeDescriptor)1 ErrorViewStructure (com.intellij.ide.errorTreeView.ErrorViewStructure)1 NodeDescriptor (com.intellij.ide.util.treeView.NodeDescriptor)1 Nullable (org.jetbrains.annotations.Nullable)1