org.eclipse.xtext.ui.label
Class StylerFactory
java.lang.Object
org.eclipse.xtext.ui.label.StylerFactory
public class StylerFactory
- extends java.lang.Object
Helper class for styled strings.
- Author:
- Jan Koehnlein - Initial contribution and API
Method Summary |
org.eclipse.jface.viewers.StyledString |
createFromXtextStyle(java.lang.String text,
TextStyle xtextStyle)
Convenience method to create a new StyledString from a given label text and
XtextTextStyle |
org.eclipse.jface.viewers.StyledString.Styler |
createStyler(org.eclipse.jface.resource.FontDescriptor fontDescriptor,
java.lang.String foregroundColorName,
java.lang.String backgroundColorName)
Creates a styler that takes the given descriptor of a font, foreground and background colors from the JFace color
registry. |
org.eclipse.jface.viewers.StyledString.Styler |
createStyler(java.lang.String foregroundColorName,
java.lang.String backgroundColorName)
|
org.eclipse.jface.viewers.StyledString.Styler |
createXtextStyleAdapterStyler(TextStyle xtextStyle)
Creates an adapter styler for XtextStyles . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StylerFactory
public StylerFactory()
createStyler
public org.eclipse.jface.viewers.StyledString.Styler createStyler(java.lang.String foregroundColorName,
java.lang.String backgroundColorName)
- See Also:
DefaultLabelProvider#createStyler(FontDescriptor, String, String)
createStyler
public org.eclipse.jface.viewers.StyledString.Styler createStyler(org.eclipse.jface.resource.FontDescriptor fontDescriptor,
java.lang.String foregroundColorName,
java.lang.String backgroundColorName)
- Creates a styler that takes the given descriptor of a font, foreground and background colors from the JFace color
registry.
- Parameters:
fontDescriptor
- the descriptor of a font to applyforegroundColorName
- the color name for the foreground colorbackgroundColorName
- the color name for the background color
- Returns:
- the created style
createXtextStyleAdapterStyler
public org.eclipse.jface.viewers.StyledString.Styler createXtextStyleAdapterStyler(TextStyle xtextStyle)
- Creates an adapter styler for
XtextStyles
.
- Parameters:
xtextStyle
- the xtextStyle to apply
- Returns:
- the created style
createFromXtextStyle
public org.eclipse.jface.viewers.StyledString createFromXtextStyle(java.lang.String text,
TextStyle xtextStyle)
- Convenience method to create a new
StyledString
from a given label text and
XtextTextStyle
- Parameters:
text
- the label to displayxtextStyle
- the style to apply to the given text
- Returns:
- the created style