|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.swt.graphics.TextStyle
org.eclipse.swt.custom.StyleRange
public class StyleRange
StyleRange defines a set of styles for a specified
range of text.
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.
| Field Summary | |
|---|---|
int |
fontStyle
the font style of the range. |
int |
length
the length of the range |
int |
start
the start offset of the range, zero-based from the document start |
| Fields inherited from class org.eclipse.swt.graphics.TextStyle |
|---|
background, borderColor, borderStyle, data, font, foreground, metrics, rise, strikeout, strikeoutColor, underline, underlineColor, underlineStyle |
| Constructor Summary | |
|---|---|
StyleRange()
Create a new style range with no styles |
|
StyleRange(int start,
int length,
Color foreground,
Color background)
Create a new style range. |
|
StyleRange(int start,
int length,
Color foreground,
Color background,
int fontStyle)
Create a new style range. |
|
StyleRange(TextStyle style)
Create a new style range from an existing text style. |
|
| Method Summary | |
|---|---|
Object |
clone()
Returns a new StyleRange with the same values as this StyleRange. |
boolean |
equals(Object object)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. |
int |
hashCode()
Returns an integer hash code for the receiver. |
boolean |
isUnstyled()
Returns whether or not the receiver is unstyled (i.e., does not have any style attributes specified). |
boolean |
similarTo(StyleRange style)
Compares the specified object to this StyleRange and answer if the two are similar. |
String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int start
public int length
public int fontStyle
font attribute
is set
| Constructor Detail |
|---|
public StyleRange()
public StyleRange(TextStyle style)
style - the text style to copy
public StyleRange(int start,
int length,
Color foreground,
Color background)
start - start offset of the stylelength - length of the styleforeground - foreground color of the style, null if nonebackground - background color of the style, null if none
public StyleRange(int start,
int length,
Color foreground,
Color background,
int fontStyle)
start - start offset of the stylelength - length of the styleforeground - foreground color of the style, null if nonebackground - background color of the style, null if nonefontStyle - font style of the style, may be SWT.NORMAL, SWT.ITALIC or SWT.BOLD| Method Detail |
|---|
public boolean equals(Object object)
equals in class TextStyleobject - the object to compare with this object
true if the object is the same as this object and false otherwisehashCode()public int hashCode()
true when passed to
equals must return the same value for this
method.
hashCode in class TextStyleequals(Object)public boolean isUnstyled()
public boolean similarTo(StyleRange style)
style - the object to compare with this object
public Object clone()
clone in class Objectpublic String toString()
toString in class TextStyle
|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.