org.eclipse.swt.custom
Class StyleRange

java.lang.Object
  |
  +--org.eclipse.swt.custom.StyleRange
All Implemented Interfaces:
Cloneable, org.eclipse.swt.internal.CloneableCompatibility

public class StyleRange
extends Object
implements org.eclipse.swt.internal.CloneableCompatibility

Safe:


Field Summary
 Color background
          Enabled:
 int fontStyle
          Enabled:
 Color foreground
          Enabled:
 int length
          Enabled:
 int start
          Enabled:
 
Constructor Summary
StyleRange()
          Enabled:
StyleRange(int start, int length, Color foreground, Color background)
          Enabled: Create a new style range.
StyleRange(int start, int length, Color foreground, Color background, int fontStyle)
          Enabled: Create a new style range.
 
Method Summary
 Object clone()
          Suppressed: Answers a new StyleRange with the same values as this StyleRange.
 boolean equals(Object object)
          Suppressed: Compare the specified object to this StyleRange and answer if the two are equal.
 int hashCode()
          Suppressed: Returns an integer hash code for the receiver.
 boolean isUnstyled()
          Enabled: Returns whether or not the receiver is unstyled (i.e., does not have any style attributes specified).
 boolean similarTo(StyleRange style)
          Enabled: Compares the specified object to this StyleRange and answer if the two are similar.
 String toString()
          Suppressed: Answers a string description of the receiver.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

start

public int start
Enabled:


length

public int length
Enabled:


foreground

public Color foreground
Enabled:


background

public Color background
Enabled:


fontStyle

public int fontStyle
Enabled:

Constructor Detail

StyleRange

public StyleRange()
Enabled:


StyleRange

public StyleRange(int start,
                  int length,
                  Color foreground,
                  Color background)
Enabled: Create a new style range.

Parameters:
start - start offset of the style
length - length of the style
foreground - foreground color of the style, null if none
background - background color of the style, null if none

StyleRange

public StyleRange(int start,
                  int length,
                  Color foreground,
                  Color background,
                  int fontStyle)
Enabled: Create a new style range.

Parameters:
start - start offset of the style
length - length of the style
foreground - foreground color of the style, null if none
background - background color of the style, null if none
fontStyle - font style of the style, may be SWT.NORMAL or SWT.BOLD
Method Detail

equals

public boolean equals(Object object)
Suppressed: Compare the specified object to this StyleRange and answer if the two are equal. The object must be an instance of StyleRange and have the same field values.

Overrides:
equals in class Object
Parameters:
object - the object to compare with this object
Returns:
true if the objects are equal, false otherwise
See Also:
Object.hashCode(), java.util.Hashtable

hashCode

public int hashCode()
Suppressed: Returns an integer hash code for the receiver. Objects which are equal answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
the receiver's hash
See Also:
java.lang.Object#equals(java.lang.Object), java.util.Hashtable

isUnstyled

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

Returns:
true if the receiver is unstyled, false otherwise.

similarTo

public boolean similarTo(StyleRange style)
Enabled: 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.

Returns:
true if the objects are similar, false otherwise

clone

public Object clone()
Suppressed: Answers a new StyleRange with the same values as this StyleRange.

Overrides:
clone in class Object
Returns:
a shallow copy of this StyleRange
See Also:
java.lang.Cloneable

toString

public String toString()
Suppressed: Answers a string description of the receiver.

Overrides:
toString in class Object
Returns:
a printable representation for the receiver.


comments?