Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.swt.graphics
Class TextStyle

    java.lang.Object
      org.eclipse.swt.graphics.TextStyle

public class TextStyle
extends Object

`TextStyle` defines a set of styles that can be applied to a 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.

Application code does not need to explicitly release the resources managed by each instance when those instances are no longer required, and thus no `dispose()` method is provided.

Since:
  3.0
See Also:
  `TextLayout`, `Font`, `Color`

Field Summary
`Color` | `background` the background of the style
`Font` | `font` the font of the style
`Color` | `foreground` the foreground of the style

Constructor Summary
`TextStyle(Font font, Color foreground, Color background)` Create a new text style with the specified font, foreground and background.

Method Summary
`boolean` | `equals(Object object)`
`int` | `hashCode()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### font

    public Font font

  the font of the style

### foreground

    public Color foreground

  the foreground of the style

### background

    public Color background

  the background of the style

Constructor Detail

### TextStyle

    public TextStyle(Font font,
                     Color foreground,
                     Color background)

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

Parameters:
  `font` - the font of the style, `null` if none
  `foreground` - the foreground color of the style, `null` if none
  `background` - the background color of the style, `null` if none

Method Detail

### equals

    public boolean equals(Object object)

### hashCode

    public int hashCode()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.