TextStyle

<code>TextStyle</code> defines a set of styles that can be applied to a range of text. <p> The hashCode() method in this class uses the values of the public fields to compute the hash value. When storing instances of the class in hashed collections, do not modify these fields after the object has been inserted. </p> <p> Application code does <em>not</em> need to explicitly release the resources managed by each instance when those instances are no longer required, and thus no <code>dispose()</code> method is provided. </p>

@see TextLayout @see Font @see Color @see <a href="http://www.eclipse.org/swt/snippets/#textlayout">TextLayout, TextStyle snippets</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

@since 3.0

Constructors

this
this()

Create an empty text style.

this
this(Font font, Color foreground, Color background)

Create a new text style with the specified font, foreground and background.

this
this(TextStyle style)

Create a new text style from an existing text style.

Members

Functions

opEquals
equals_t opEquals(Object object)

Compares the argument to the receiver, and returns true if they represent the <em>same</em> object using a class specific comparison.

toHash
hash_t toHash()

Returns an integer hash code for the receiver. Any two objects that return <code>true</code> when passed to <code>equals</code> must return the same value for this method.

toString
String toString()

Returns a string containing a concise, human-readable description of the receiver.

Variables

background
Color background;

the background of the style

borderColor
Color borderColor;

the border color of the style

borderStyle
int borderStyle;

the border style. The default border style is <code>SWT.NONE</code>. <p> This value should be one of <code>SWT.BORDER_SOLID</code>, <code>SWT.BORDER_DASH</code>,<code>SWT.BORDER_DOT</code> or <code>SWT.NONE</code>. </p>

font
Font font;

the font of the style

foreground
Color foreground;

the foreground of the style

metrics
GlyphMetrics metrics;

the GlyphMetrics of the style

rise
int rise;

the baseline rise of the style.

strikeout
bool strikeout;

the strikeout flag of the style

strikeoutColor
Color strikeoutColor;

the strikeout color of the style

underline
bool underline;

the underline flag of the style. The default underline style is <code>SWT.UNDERLINE_SINGLE</code>.

underlineColor
Color underlineColor;

the underline color of the style

underlineStyle
int underlineStyle;

the underline style. This style is ignored when <code>underline</code> is false. <p> This value should be one of <code>SWT.UNDERLINE_SINGLE</code>, <code>SWT.UNDERLINE_DOUBLE</code>, <code>SWT.UNDERLINE_ERROR</code>, or <code>SWT.UNDERLINE_SQUIGGLE</code>. </p>

Meta