mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Runnable icon for all classes Groovy can run
This commit is contained in:
@@ -86,7 +86,7 @@ public class ElementPresentationUtil implements PlatformIcons {
|
||||
private static final int FLAGS_STATIC = 0x200;
|
||||
private static final int FLAGS_FINAL = 0x400;
|
||||
private static final int FLAGS_JUNIT_TEST = 0x2000;
|
||||
private static final int FLAGS_RUNNABLE = 0x4000;
|
||||
public static final int FLAGS_RUNNABLE = 0x4000;
|
||||
|
||||
private static final Key<CachedValue<Integer>> CLASS_KIND_KEY = new Key<CachedValue<Integer>>("CLASS_KIND_KEY");
|
||||
|
||||
|
||||
+7
-1
@@ -74,6 +74,7 @@ import org.jetbrains.plugins.groovy.lang.psi.stubs.GrTypeDefinitionStub;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.util.GrClassImplUtil;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.util.PsiUtil;
|
||||
import org.jetbrains.plugins.groovy.lang.resolve.AstTransformContributor;
|
||||
import org.jetbrains.plugins.groovy.runner.GroovyRunnerUtil;
|
||||
import org.jetbrains.plugins.groovy.util.LightCacheKey;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -660,13 +661,18 @@ public abstract class GrTypeDefinitionImpl extends GrStubElementBase<GrTypeDefin
|
||||
public Icon getIcon(int flags) {
|
||||
Icon icon = getIconInner();
|
||||
final boolean isLocked = (flags & ICON_FLAG_READ_STATUS) != 0 && !isWritable();
|
||||
RowIcon rowIcon = ElementPresentationUtil.createLayeredIcon(icon, this, isLocked);
|
||||
RowIcon rowIcon = createLayeredIcon(this, icon, ElementPresentationUtil.getFlags(this, isLocked) | getFlagsInner());
|
||||
if ((flags & ICON_FLAG_VISIBILITY) != 0) {
|
||||
VisibilityIcons.setVisibilityIcon(getModifierList(), rowIcon);
|
||||
}
|
||||
return rowIcon;
|
||||
}
|
||||
|
||||
//hack to get runnable icon for all classes that can be run by Groovy
|
||||
private int getFlagsInner() {
|
||||
return GroovyRunnerUtil.isRunnable(this) ? ElementPresentationUtil.FLAGS_RUNNABLE : 0;
|
||||
}
|
||||
|
||||
private Icon getIconInner() {
|
||||
if (isAnnotationType()) return GroovyIcons.ANNOTATION_TYPE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user