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.
| Modifier and Type | Field and Description |
|---|---|
| public int | fontStyle
the font style of the range. |
| public int | length
the length of the range |
| public int | start
the start offset of the range, zero-based from the document start |
| Access | Constructor and Description |
|---|---|
| public | |
| public | StyleRange(TextStyle
the text style to copy style)Create a new style range from an existing text style. |
| public | StyleRange(int
start offset of the style start, int length of the style length, Color foreground color of the style, null if none foreground, Color background color of the style, null if none background)Create a new style range. |
| public | StyleRange(int
start offset of the style start, int length of the style length, Color foreground color of the style, null if none foreground, Color background color of the style, null if none background, int font style of the style, may be SWT.NORMAL, SWT.ITALIC or SWT.BOLD fontStyle)Create a new style range. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: a shallow copy of this StyleRangeOverrides java. |
| public boolean | Returns: true if the object is the same as this object and false otherwisethe object to compare with this object object)Overrides org. |
| public int | Returns: the receiver's hashOverrides org. |
| public boolean | Returns: true if the receiver is unstyled, false otherwise.Returns whether or not the receiver is unstyled (i.e., does not have any style attributes specified). |
| pack-priv boolean | |
| public boolean | Returns: true if the objects are similar, false otherwisethe object to compare with this object style)Compares the specified object to this StyleRange and answer if the two are similar. |
| public String | Returns: a string representation of the StyleRangeOverrides org. |
| fontStyle | back to summary |
|---|---|
| public int fontStyle the font style of the range. It may be a combination of SWT.NORMAL, SWT.ITALIC or SWT.BOLD Note the font style is not used if the | |
| length | back to summary |
|---|---|
| public int length the length of the range | |
| start | back to summary |
|---|---|
| public int start the start offset of the range, zero-based from the document start | |
| StyleRange | back to summary |
|---|---|
| public StyleRange() Create a new style range with no styles
| |
| StyleRange | back to summary |
|---|---|
| public StyleRange(TextStyle style) Create a new style range from an existing text style.
| |
| StyleRange | back to summary |
|---|---|
| public StyleRange(int start, int length, Color foreground, Color background) Create a new style range. | |
| StyleRange | back to summary |
|---|---|
| public StyleRange(int start, int length, Color foreground, Color background, int fontStyle) Create a new style range. | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Returns a new StyleRange with the same values as this StyleRange. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides org. Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides org. Returns an integer hash code for the receiver. Any two
objects that return
| |
| isUnstyled | back to summary |
|---|---|
| public boolean isUnstyled() Returns whether or not the receiver is unstyled (i.e., does not have any style attributes specified).
| |
| isVariableHeight | back to summary |
|---|---|
| pack-priv boolean isVariableHeight() | |
| similarTo | back to summary |
|---|---|
| public boolean 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.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Returns a string containing a concise, human-readable description of the receiver. | |