use of com.intellij.ui.SimpleTextAttributes in project intellij-plugins by JetBrains.
the class FlashUmlElementManager method decorate.
private SimpleColoredText decorate(String name) {
int style = SimpleTextAttributes.STYLE_BOLD;
final SimpleColoredText text = new SimpleColoredText();
text.append(name, new SimpleTextAttributes(style, getFGColor()));
return text;
}
use of com.intellij.ui.SimpleTextAttributes in project intellij-plugins by JetBrains.
the class FlashUmlElementManager method getClassPresentableName.
private SimpleColoredText getClassPresentableName(JSClass clazz) {
int style = SimpleTextAttributes.STYLE_BOLD;
if (clazz.isDeprecated())
style |= SimpleTextAttributes.STYLE_STRIKEOUT;
if (!clazz.isPhysical())
style |= SimpleTextAttributes.STYLE_ITALIC;
final SimpleColoredText text = new SimpleColoredText();
String name = StringUtil.notNullize(clazz.getName());
text.append(FlashUmlVfsResolver.fixVectorTypeName(name), new SimpleTextAttributes(style, getFGColor()));
return text;
}
use of com.intellij.ui.SimpleTextAttributes in project intellij-plugins by JetBrains.
the class FlashUmlElementManager method getMethodPresentableName.
private SimpleColoredText getMethodPresentableName(JSFunction method) {
int style = SimpleTextAttributes.STYLE_PLAIN;
if (method.isDeprecated())
style |= SimpleTextAttributes.STYLE_STRIKEOUT;
if (!method.isPhysical())
style |= SimpleTextAttributes.STYLE_ITALIC;
final SimpleColoredText text = new SimpleColoredText();
text.append(getMethodText(method), new SimpleTextAttributes(style, getFGColor()));
return text;
}
use of com.intellij.ui.SimpleTextAttributes in project intellij-community by JetBrains.
the class GotoFileCellRenderer method customizeNonPsiElementLeftRenderer.
@Override
protected boolean customizeNonPsiElementLeftRenderer(ColoredListCellRenderer renderer, JList list, Object value, int index, boolean selected, boolean hasFocus) {
if (!(value instanceof NavigationItem))
return false;
NavigationItem item = (NavigationItem) value;
TextAttributes attributes = getNavigationItemAttributes(item);
SimpleTextAttributes nameAttributes = attributes != null ? SimpleTextAttributes.fromTextAttributes(attributes) : null;
Color color = list.getForeground();
if (nameAttributes == null)
nameAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color);
renderer.append(item + " ", nameAttributes);
ItemPresentation itemPresentation = item.getPresentation();
assert itemPresentation != null;
renderer.setIcon(itemPresentation.getIcon(true));
String locationString = itemPresentation.getLocationString();
if (!StringUtil.isEmpty(locationString)) {
renderer.append(locationString, new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.GRAY));
}
return true;
}
use of com.intellij.ui.SimpleTextAttributes in project intellij-community by JetBrains.
the class XBreakpointItem method setupGenericRenderer.
@Override
public void setupGenericRenderer(SimpleColoredComponent renderer, boolean plainView) {
if (plainView) {
renderer.setIcon(getIcon());
}
final SimpleTextAttributes attributes = myBreakpoint.isEnabled() ? SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES : SimpleTextAttributes.GRAYED_ATTRIBUTES;
renderer.append(StringUtil.notNullize(getDisplayText()), attributes);
String description = getUserDescription();
if (!StringUtil.isEmpty(description)) {
renderer.append(" (" + description + ")", SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES);
}
}
Aggregations