Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, using the <code>int</code> "|" operator) two or more of those <code>SWT</code> style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses. </p>
Returns the alignment. The alignment style (LEFT, CENTER or RIGHT) is returned.
Return the CLabel's image or <code>null</code>.
Return the Label's text.
Set the alignment of the CLabel. Use the values LEFT, CENTER and RIGHT to align image and text within the available space.
Specify a gradient of colours to be drawn in the background of the CLabel. <p>For example, to draw a gradient that varies from dark blue to blue and then to white and stays white for the right half of the label, use the following call to setBackground:</p> <pre> clabel.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE), display.getSystemColor(SWT.COLOR_BLUE), display.getSystemColor(SWT.COLOR_WHITE), display.getSystemColor(SWT.COLOR_WHITE)}, new int[] {25, 50, 100}); </pre>
Specify a gradient of colours to be drawn in the background of the CLabel. <p>For example, to draw a gradient that varies from dark blue to white in the vertical, direction use the following call to setBackground:</p> <pre> clabel.setBackground(new Color[]{display.getSystemColor(SWT.COLOR_DARK_BLUE), display.getSystemColor(SWT.COLOR_WHITE)}, new int[] {100}, true); </pre>
Set the image to be drawn in the background of the label.
Set the label's Image. The value <code>null</code> clears it.
Set the label's text. The value <code>null</code> clears it.
Shorten the given text <code>t</code> so that its length doesn't exceed the given width. The default implementation replaces characters in the center of the original string with an ellipsis ("..."). Override if you need a different strategy.
Fills the interior of the rectangle specified by the arguments, with the receiver's background.
Returns the caret. <p> The caret for the control is automatically hidden and shown when the control is painted or resized, when focus is gained or lost and when an the control is scrolled. To avoid drawing on top of the caret, the programmer must hide and show the caret when drawing in the window any other time. </p>
Returns the IME.
Scrolls a rectangular area of the receiver by first copying the source area to the destination and then causing the area of the source which is not covered by the destination to be repainted. Children that intersect the rectangle are optionally moved during the operation. In addition, outstanding paint events are flushed before the source area is copied to ensure that the contents of the canvas are drawn correctly.
Sets the receiver's caret. <p> The caret for the control is automatically hidden and shown when the control is painted or resized, when focus is gained or lost and when an the control is scrolled. To avoid drawing on top of the caret, the programmer must hide and show the caret when drawing in the window any other time. </p> @param caret the new caret for the receiver, may be null
Sets the receiver's IME.
A Label which supports aligned text and/or an image and different border styles. <p> If there is not enough space a CLabel uses the following strategy to fit the information into the available space: <pre> ignores the indent in left align mode ignores the image and the gap shortens the text by replacing the center portion of the label with an ellipsis shortens the text by removing the center portion of the label </pre> <p> <dl> <dt><b>Styles:</b> <dd>LEFT, RIGHT, CENTER, SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd> <dt><b>Events:</b> <dd></dd> </dl>
</p><p> IMPORTANT: This class is <em>not</em> intended to be subclassed. </p>
@see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: CustomControlExample</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>