org.formaria.swt
Class Button

java.lang.Object
  extended by org.eclipse.swt.widgets.Button
      extended by org.formaria.swt.Button
All Implemented Interfaces:
TextHolder, ValueHolder
Direct Known Subclasses:
Checkbox, RadioButton

public class Button
extends org.eclipse.swt.widgets.Button
implements ValueHolder

A wrapper for the SWT Button class. In addition to wrapping the button this object can hold a value.

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


Field Summary
protected  java.lang.Object value
          The button value
 
Constructor Summary
Button(java.lang.Object parent)
          Create a new button
 
Method Summary
protected  void checkSubclass()
          Suppress the subclassing exception
 java.lang.String getToolTip()
          Get the tooltip text
 java.lang.Object getValue()
          Get the radiobutton's value if it has one or else get the text
 void setImage(java.lang.String imageUrl)
          Set the image url
 void setToolTip(java.lang.String text)
          Set the tooltip text
 void setValue(java.lang.Object newValue)
          Set the value associated with this button
 
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, setText
 

Field Detail

value

protected java.lang.Object value
The button value

Constructor Detail

Button

public Button(java.lang.Object parent)
Create a new button

Parameters:
parent - parent object
Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclassing exception


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

getValue

public java.lang.Object getValue()
Get the radiobutton's value if it has one or else get the text

Specified by:
getValue in interface ValueHolder
Returns:
the value for this button

setValue

public void setValue(java.lang.Object newValue)
Set the value associated with this button

Specified by:
setValue in interface ValueHolder
Parameters:
newValue - the new button value