org.formaria.swt
Class Label

java.lang.Object
  extended by org.eclipse.swt.widgets.Label
      extended by org.formaria.swt.Label
All Implemented Interfaces:
TextHolder
Direct Known Subclasses:
ToolTip

public class Label
extends org.eclipse.swt.widgets.Label
implements TextHolder

Draws text. The text may be wrapped over multiple lines. Double buffering is switched off by default.

Copyright (c) Formaria Ltd., 2008
License: see license.txt


Field Summary
protected  int bufferHeight
           
protected  int bufferWidth
           
protected  boolean doubleBuffered
           
protected  java.lang.String name
           
 
Constructor Summary
Label(java.lang.Object parent)
          Create an Label
 
Method Summary
protected  void checkSubclass()
          Suppress the subclasing exception
 int getAlignment()
          Get the alignment style constant
 java.lang.Object getPreferredSize()
          Gets the preferred size of this component.
 java.lang.String getToolTip()
          Get the tooltip text
 void setDoubleBuffered(boolean buffer)
          Toggle use of double buffering when painting this component
 void setImage(java.lang.String imageUrl)
          Set the image url
 void setText(java.lang.String text)
          Set the text
 void setToolTip(java.lang.String text)
          Set the tooltip text
 void setTransparent(boolean b)
          Sets the transparency of the text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.formaria.aria.TextHolder
getText
 

Field Detail

name

protected java.lang.String name

doubleBuffered

protected boolean doubleBuffered

bufferWidth

protected int bufferWidth

bufferHeight

protected int bufferHeight
Constructor Detail

Label

public Label(java.lang.Object parent)
Create an Label

Parameters:
parent - parent object
Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclasing exception


getAlignment

public int getAlignment()
Get the alignment style constant

Returns:
the alignment value

setTransparent

public void setTransparent(boolean b)
Sets the transparency of the text.

Parameters:
b - true to make text transparent

setToolTip

public void setToolTip(java.lang.String text)
Set the tooltip text

Parameters:
text - the new text

getToolTip

public java.lang.String getToolTip()
Get the tooltip text

Returns:
the existing text if any

setImage

public void setImage(java.lang.String imageUrl)
Set the image url

Parameters:
imageUrl - the relative image URL

getPreferredSize

public java.lang.Object getPreferredSize()
Gets the preferred size of this component.

Returns:
a dimension object indicating this component's preferred size
See Also:
#getMinimumSize, LayoutManager

setDoubleBuffered

public void setDoubleBuffered(boolean buffer)
Toggle use of double buffering when painting this component

Parameters:
buffer - true to double buffer

setText

public void setText(java.lang.String text)
Set the text

Specified by:
setText in interface TextHolder
Parameters:
text - the new text