org.eclipse.swt.widgets
Class Label

java.lang.Object
  |
  +--org.eclipse.swt.widgets.Widget
        |
        +--org.eclipse.swt.widgets.Control
              |
              +--org.eclipse.swt.widgets.Label
All Implemented Interfaces:
Drawable, Runnable

public class Label
extends Control

Instances of this class represent a non-selectable user interface object that displays a string or an image. When SEPARATOR is specified, it displays a single vertical or horizontal line. Styles: SEPARATOR, HORIZONTAL, VERTICAL SHADOW_IN, SHADOW_OUT, SHADOW_NONE CENTER, LEFT, RIGHT WRAP Note: Only one of SHADOW_IN, SHADOW_OUT and SHADOW_NONE may be specified. SHADOW_NONE is a HINT. Only one of HORIZONTAL and VERTICAL may be specified. Only one of CENTER, LEFT and RIGHT may be specified.


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Widget
h, INCMD_DISPOSE, INCMD_EXTKEY, INCMD_KEY, INCMD_LDOWN, INCMD_LUP, INCMD_MENU, INCMD_POS, UPDATEITEM_ENABLED, UPDATEITEM_NAME, w, x, y
 
Constructor Summary
Label(Composite composite, int style)
          Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
 
Method Summary
 void setText(String string)
          This method sets the widget label.
 
Methods inherited from class org.eclipse.swt.widgets.Control
computeSize, computeSize, getLayoutData, isFocusControl, pack, pack, setBackground, setBounds, setFocus, setLayoutData, setSize, setSize, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addListener, dispose, focusState, getBorderWidth, getDisplayArea, getSelection, getStyle, getText, isDisposed, removeListener, setBounds, setCursor, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, toString
 
Methods inherited from interface org.eclipse.swt.graphics.Drawable
drawLine, drawRect, drawText, setColor
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

Label

public Label(Composite composite,
             int style)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. The style value is either one of the style constants defined in the class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing them. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.

Parameters:
composite - - a composite control being the parent of the new instance (cannot be null)
style - - the style of the control to be constructed
Method Detail

setText

public void setText(String string)
This method sets the widget label. The label may include the mnemonic character and line delimiters. Mnemonics are indicated by an '&' that causes the next character to be the mnemonic. When the user presses a key sequence that matches the mnemonic, focus is assigned to the control that follows the label. On most platforms, the mnemonic appears underlined but may be emphasised in a platform specific manner. The mnemonic indicator character '&' can be escaped by doubling it in the string, causing a single '&' to be displayed.

Parameters:
string - - the widget label