Package org.eclipse.jface.text
Class TextAttribute
java.lang.Object
org.eclipse.jface.text.TextAttribute
Description of textual attributes such as color and style. Text attributes
are considered value objects.
Clients usually instantiate object of the class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intText attribute for strikethrough style.static final intText attribute for underline style. -
Constructor Summary
ConstructorsConstructorDescriptionTextAttribute(Color foreground) Creates a text attribute for the given foreground color, no background color and with the SWT normal style.TextAttribute(Color foreground, Color background, int style) Creates a text attribute with the given colors and style.TextAttribute(Color foreground, Color background, int style, Font font) Creates a text attribute with the given colors and style. -
Method Summary
-
Field Details
-
STRIKETHROUGH
public static final int STRIKETHROUGHText attribute for strikethrough style. (value1 << 29).- Since:
- 3.1
- See Also:
-
UNDERLINE
public static final int UNDERLINEText attribute for underline style. (value1 << 30)- Since:
- 3.1
- See Also:
-
-
Constructor Details
-
TextAttribute
Creates a text attribute with the given colors and style.- Parameters:
foreground- the foreground color,nullif nonebackground- the background color,nullif nonestyle- the style
-
TextAttribute
Creates a text attribute with the given colors and style.- Parameters:
foreground- the foreground color,nullif nonebackground- the background color,nullif nonestyle- the stylefont- the font,nullif none- Since:
- 3.3
-
TextAttribute
Creates a text attribute for the given foreground color, no background color and with the SWT normal style.- Parameters:
foreground- the foreground color,nullif none
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
getForeground
Returns the attribute's foreground color.- Returns:
- the attribute's foreground color or
nullif not set
-
getBackground
Returns the attribute's background color.- Returns:
- the attribute's background color or
nullif not set
-
getStyle
public int getStyle()Returns the attribute's style.- Returns:
- the attribute's style
-
getFont
Returns the attribute's font.- Returns:
- the attribute's font or
nullif not set - Since:
- 3.3
-