mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RIDER-5008 Solution Explorer: reduce the number of markers for errors
This commit is contained in:
+22
-20
@@ -91,26 +91,7 @@ public abstract class AbstractProjectViewPSIPane extends AbstractProjectViewPane
|
||||
DefaultMutableTreeNode node = (DefaultMutableTreeNode)object;
|
||||
object = node.getUserObject();
|
||||
}
|
||||
if (object instanceof PsiDirectoryNode && !myTree.isCollapsed(index)) {
|
||||
object = null;
|
||||
}
|
||||
super.update(painter, index, object);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ErrorStripe getErrorStripe(Object object) {
|
||||
if (object instanceof PresentableNodeDescriptor) {
|
||||
PresentableNodeDescriptor node = (PresentableNodeDescriptor)object;
|
||||
PresentationData presentation = node.getPresentation();
|
||||
TextAttributesKey key = presentation.getTextAttributesKey();
|
||||
if (key != null) {
|
||||
TextAttributes attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(key);
|
||||
if (attributes != null && EffectType.WAVE_UNDERSCORE == attributes.getEffectType()) {
|
||||
return ErrorStripe.create(attributes.getEffectColor(), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
super.update(painter, index, getStripe(object, myTree.isExpanded(index)));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -283,6 +264,27 @@ public abstract class AbstractProjectViewPSIPane extends AbstractProjectViewPane
|
||||
|
||||
protected abstract AbstractTreeUpdater createTreeUpdater(AbstractTreeBuilder treeBuilder);
|
||||
|
||||
/**
|
||||
* @param object an object that represents a node in the project tree
|
||||
* @param expanded {@code true} if the corresponding node is expanded,
|
||||
* {@code false} if it is collapsed
|
||||
* @return a non-null value if the corresponding node should be , or {@code null}
|
||||
*/
|
||||
protected ErrorStripe getStripe(Object object, boolean expanded) {
|
||||
if (expanded && object instanceof PsiDirectoryNode) return null;
|
||||
if (object instanceof PresentableNodeDescriptor) {
|
||||
PresentableNodeDescriptor node = (PresentableNodeDescriptor)object;
|
||||
PresentationData presentation = node.getPresentation();
|
||||
TextAttributesKey key = presentation.getTextAttributesKey();
|
||||
if (key != null) {
|
||||
TextAttributes attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(key);
|
||||
if (attributes != null && EffectType.WAVE_UNDERSCORE == attributes.getEffectType()) {
|
||||
return ErrorStripe.create(attributes.getEffectColor(), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected static final class MySpeedSearch extends TreeSpeedSearch {
|
||||
MySpeedSearch(JTree tree) {
|
||||
|
||||
@@ -141,7 +141,7 @@ public abstract class Updater<Painter extends ErrorStripePainter> implements Dis
|
||||
}
|
||||
|
||||
protected ErrorStripe getErrorStripe(Object object) {
|
||||
return null;
|
||||
return object instanceof ErrorStripe ? (ErrorStripe)object : null;
|
||||
}
|
||||
|
||||
public final void update() {
|
||||
|
||||
Reference in New Issue
Block a user