/** * Returns the icon representing the object. * * @param unused Used to mean if open/close icons for tree renderer. No longer in use. The parameter is only there for API compatibility reason. */ @Nullable @Override public Icon getIcon(boolean unused) { RowIcon rowIcon = new RowIcon(3); // same as {@code def} rowIcon.setIcon(Icons.Time.RUN, 0); rowIcon.setIcon(Icons.Visibility.PUBLIC, 1); rowIcon.setIcon(Icons.CALL_DEFINITION_CLAUSE, 2); return rowIcon; }
/** * Returns the icon representing the object. * * @param unused Used to mean if open/close icons for tree renderer. No longer in use. The parameter is only there for API compatibility reason. */ @Nullable @Override public Icon getIcon(boolean unused) { RowIcon rowIcon = new RowIcon(2); rowIcon.setIcon(Icons.Time.COMPILE, 0); rowIcon.setIcon(PlatformIcons.ANONYMOUS_CLASS_ICON, 1); return rowIcon; }
/** * Returns the icon representing the object. * * @param unused Used to mean if open/close icons for tree renderer. No longer in use. The parameter is only there for API compatibility reason. */ @Nullable @Override public Icon getIcon(boolean unused) { RowIcon rowIcon = new RowIcon(2); rowIcon.setIcon(Icons.MODULE, 0); rowIcon.setIcon(PlatformIcons.ANONYMOUS_CLASS_ICON, 1); return rowIcon; }
/** * Returns the icon representing the object. * * @param unused Used to mean if open/close icons for tree renderer. No longer in use. The parameter is only there for API compatibility reason. */ @Nullable @Override public Icon getIcon(boolean unused) { int layers = 3; if (callback) { layers++; } RowIcon rowIcon = new RowIcon(layers); int layer = 0; if (callback) { rowIcon.setIcon(Icons.CALLBACK, layer++); } Icon timeIcon = Icons.Time.from(time); rowIcon.setIcon(timeIcon, layer++); rowIcon.setIcon(Icons.Visibility.PUBLIC, layer++); rowIcon.setIcon(Icons.SPECIFICATION, layer); return rowIcon; }
/** * Returns the icon representing the object. * * @param unused Used to mean if open/close icons for tree renderer. No longer in use. The parameter is only there for API compatibility reason. */ @NotNull @Override public Icon getIcon(boolean unused) { Icon[] icons = new Icon[]{ Icons.Time.COMPILE, Icons.Visibility.from(visibility), Icons.TYPE }; RowIcon rowIcon = new RowIcon(icons.length); for (int layer = 0; layer < icons.length; layer++) { rowIcon.setIcon(icons[layer], layer); } return rowIcon; }
@Nullable @Override public Icon getIcon(int flags) { Icon icon = null; if (this instanceof GoMethodDeclaration) icon = GoIcons.METHOD; else if (this instanceof GoFunctionDeclaration) icon = GoIcons.FUNCTION; else if (this instanceof GoTypeSpec) icon = GoIcons.TYPE; else if (this instanceof GoVarDefinition) icon = GoIcons.VARIABLE; else if (this instanceof GoConstDefinition) icon = GoIcons.CONSTANT; else if (this instanceof GoFieldDefinition) icon = GoIcons.FIELD; else if (this instanceof GoMethodSpec) icon = GoIcons.METHOD; else if (this instanceof GoAnonymousFieldDefinition) icon = GoIcons.FIELD; else if (this instanceof GoParamDefinition) icon = GoIcons.PARAMETER; else if (this instanceof GoLabelDefinition) icon = GoIcons.LABEL; if (icon != null) { if ((flags & Iconable.ICON_FLAG_VISIBILITY) != 0) { RowIcon rowIcon = ElementBase.createLayeredIcon(this, icon, flags); rowIcon.setIcon(isPublic() ? PlatformIcons.PUBLIC_ICON : PlatformIcons.PRIVATE_ICON, 1); return rowIcon; } return icon; } return super.getIcon(flags); }
@Nullable @Override public Icon getIcon(int flags) { // Todo - Add more icons Icon icon = null; if (this instanceof BallerinaFunctionDefinition) { icon = BallerinaIcons.FUNCTION; } else if (this instanceof BallerinaGlobalVariableDefinition) { icon = BallerinaIcons.GLOBAL_VARIABLE; } else if (this instanceof BallerinaTypeDefinition) { icon = BallerinaIcons.TYPE; } if (icon != null) { if ((flags & Iconable.ICON_FLAG_VISIBILITY) != 0) { RowIcon rowIcon = ElementBase.createLayeredIcon(this, icon, flags); rowIcon.setIcon(isPublic() ? PlatformIcons.PUBLIC_ICON : PlatformIcons.PRIVATE_ICON, 1); return rowIcon; } return icon; } return super.getIcon(flags); }
/** * Returns the icon representing the object. * * @param unused Used to mean if open/close icons for tree renderer. No longer in use. The parameter is only there for API compatibility reason. */ @Nullable @Override public Icon getIcon(boolean unused) { Icon[] icons = new Icon[]{ Icons.Time.from(callDefinition.time()), Icons.Visibility.from(visibility), Icons.CALL_DEFINITION_CLAUSE }; RowIcon rowIcon = new RowIcon(icons.length); for (int layer = 0; layer < icons.length; layer++) { rowIcon.setIcon(icons[layer], layer); } return rowIcon; }
@Override public Icon getIcon(int flags) { if (this instanceof BnfRule) { final Icon base = hasModifier((BnfRule)this, "external") ? BnfIcons.EXTERNAL_RULE : BnfIcons.RULE; final Icon visibility = hasModifier((BnfRule)this, "private") ? PlatformIcons.PRIVATE_ICON : PlatformIcons.PUBLIC_ICON; final RowIcon row = new RowIcon(2); row.setIcon(base, 0); row.setIcon(visibility, 1); return row; } else if (this instanceof BnfAttr) { return BnfIcons.ATTRIBUTE; } return super.getIcon(flags); }
public static void setVisibilityIcon(@MagicConstant(intValues = {PsiUtil.ACCESS_LEVEL_PUBLIC, PsiUtil.ACCESS_LEVEL_PROTECTED, PsiUtil.ACCESS_LEVEL_PACKAGE_LOCAL, PsiUtil.ACCESS_LEVEL_PRIVATE}) int accessLevel, RowIcon baseIcon) { Icon icon; switch (accessLevel) { case PsiUtil.ACCESS_LEVEL_PUBLIC: icon = PlatformIcons.PUBLIC_ICON; break; case PsiUtil.ACCESS_LEVEL_PROTECTED: icon = PlatformIcons.PROTECTED_ICON; break; case PsiUtil.ACCESS_LEVEL_PACKAGE_LOCAL: icon = PlatformIcons.PACKAGE_LOCAL_ICON; break; case PsiUtil.ACCESS_LEVEL_PRIVATE: icon = PlatformIcons.PRIVATE_ICON; break; default: if (PlatformIcons.PUBLIC_ICON != null) { icon = new EmptyIcon(PlatformIcons.PUBLIC_ICON.getIconWidth(), PlatformIcons.PUBLIC_ICON.getIconHeight()); } else { return; } } baseIcon.setIcon(icon, 1); } }
public static void setVisibilityIcon(PsiModifierList modifierList, RowIcon baseIcon) { if (modifierList != null) { if (modifierList.hasModifierProperty(PsiModifier.PUBLIC)) { setVisibilityIcon(PsiUtil.ACCESS_LEVEL_PUBLIC, baseIcon); } else if (modifierList.hasModifierProperty(PsiModifier.PRIVATE)) { setVisibilityIcon(PsiUtil.ACCESS_LEVEL_PRIVATE, baseIcon); } else if (modifierList.hasModifierProperty(PsiModifier.PROTECTED)) { setVisibilityIcon(PsiUtil.ACCESS_LEVEL_PROTECTED, baseIcon); } else if (modifierList.hasModifierProperty(PsiModifier.PACKAGE_LOCAL)) { setVisibilityIcon(PsiUtil.ACCESS_LEVEL_PACKAGE_LOCAL, baseIcon); } else { Icon emptyIcon = new EmptyIcon(PlatformIcons.PUBLIC_ICON.getIconWidth(), PlatformIcons.PUBLIC_ICON.getIconHeight()); baseIcon.setIcon(emptyIcon, 1); } } else if (PlatformIcons.PUBLIC_ICON != null) { Icon emptyIcon = new EmptyIcon(PlatformIcons.PUBLIC_ICON.getIconWidth(), PlatformIcons.PUBLIC_ICON.getIconHeight()); baseIcon.setIcon(emptyIcon, 1); } }