Search in sources :

Example 51 with SimpleTextAttributes

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;
}
Also used : SimpleTextAttributes(com.intellij.ui.SimpleTextAttributes) SimpleColoredText(com.intellij.ui.SimpleColoredText)

Example 52 with SimpleTextAttributes

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;
}
Also used : SimpleTextAttributes(com.intellij.ui.SimpleTextAttributes) SimpleColoredText(com.intellij.ui.SimpleColoredText)

Example 53 with SimpleTextAttributes

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;
}
Also used : SimpleTextAttributes(com.intellij.ui.SimpleTextAttributes) SimpleColoredText(com.intellij.ui.SimpleColoredText)

Example 54 with SimpleTextAttributes

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;
}
Also used : NavigationItem(com.intellij.navigation.NavigationItem) SimpleTextAttributes(com.intellij.ui.SimpleTextAttributes) JBColor(com.intellij.ui.JBColor) ItemPresentation(com.intellij.navigation.ItemPresentation) TextAttributes(com.intellij.openapi.editor.markup.TextAttributes) SimpleTextAttributes(com.intellij.ui.SimpleTextAttributes)

Example 55 with SimpleTextAttributes

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);
    }
}
Also used : SimpleTextAttributes(com.intellij.ui.SimpleTextAttributes)

Aggregations

SimpleTextAttributes (com.intellij.ui.SimpleTextAttributes)87 TextAttributes (com.intellij.openapi.editor.markup.TextAttributes)15 JBColor (com.intellij.ui.JBColor)11 NotNull (org.jetbrains.annotations.NotNull)9 VirtualFile (com.intellij.openapi.vfs.VirtualFile)7 SimpleColoredComponent (com.intellij.ui.SimpleColoredComponent)7 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)7 TextAttributesKey (com.intellij.openapi.editor.colors.TextAttributesKey)6 TextRange (com.intellij.openapi.util.TextRange)6 NodeDescriptor (com.intellij.ide.util.treeView.NodeDescriptor)5 ItemPresentation (com.intellij.navigation.ItemPresentation)4 FileStatus (com.intellij.openapi.vcs.FileStatus)4 PresentationData (com.intellij.ide.projectView.PresentationData)3 PsiElement (com.intellij.psi.PsiElement)3 SimpleColoredText (com.intellij.ui.SimpleColoredText)3 List (java.util.List)3 PsIssue (com.android.tools.idea.gradle.structure.model.PsIssue)2 PTableItem (com.android.tools.idea.uibuilder.property.ptable.PTableItem)2 HighlightDisplayLevel (com.intellij.codeHighlighting.HighlightDisplayLevel)2 RefEntity (com.intellij.codeInspection.reference.RefEntity)2