StyleRange

<code>StyleRange</code> defines a set of styles for a specified 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>

@see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

Constructors

this
this()

Create a new style range with no styles

this
this(StyleRange other)

SWT extension for clone implementation

this
this(TextStyle style)

Create a new style range from an existing text style.

this
this(int start, int length, Color foreground, Color background)

Create a new style range.

this
this(int start, int length, Color foreground, Color background, int fontStyle)

Create a new style range.

Members

Functions

clone
Object clone()

Returns a new StyleRange with the same values as this StyleRange.

isUnstyled
bool isUnstyled()

Returns whether or not the receiver is unstyled (i.e., does not have any style attributes specified).

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.

similarTo
bool similarTo(StyleRange style)

Compares the specified object to this StyleRange and answer if the two are similar. The object must be an instance of StyleRange and have the same field values for except for start and length.

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

fontStyle
int fontStyle;

the font style of the range. It may be a combination of SWT.NORMAL, SWT.ITALIC or SWT.BOLD

length
int length;

the length of the range

start
int start;

the start offset of the range, zero-based from the document start

Inherited Members

From TextStyle

font
Font font;

the font of the style

foreground
Color foreground;

the foreground of the style

background
Color background;

the background 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>

strikeout
bool strikeout;

the strikeout flag of the style

strikeoutColor
Color strikeoutColor;

the strikeout 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>

borderColor
Color borderColor;

the border color of the style

metrics
GlyphMetrics metrics;

the GlyphMetrics of the style

rise
int rise;

the baseline rise of the style.

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.

Meta