org.formaria.swt
Class RadioButton

java.lang.Object
  extended by org.eclipse.swt.widgets.Button
      extended by org.formaria.swt.Button
          extended by org.formaria.swt.RadioButton
All Implemented Interfaces:
RadioButtonGroup, RadioHolder, StateHolder, TextHolder, ValueHolder

public class RadioButton
extends Button
implements StateHolder, ValueHolder, RadioHolder, RadioButtonGroup

A wrapper for the RadioButton class

Copyright (c) Formaria Ltd.,
License: see license.txt $Revision: 2.10 $


Field Summary
protected  java.lang.Object value
           
 
Constructor Summary
RadioButton(java.lang.Object parent)
          Create a new radio button
 
Method Summary
protected  void checkSubclass()
          Suppress the subclassing exception
 java.lang.Object createGroup()
          Create a new checkbox group and adds this radio button top the new group
 java.lang.Object getComponentState()
          Get the component state
 java.lang.Object getRadioButtonGroup()
          Gets the group controlling this radio button
 java.lang.Object getSelectedObject()
          Gets the selected radio button
 java.lang.String getToolTip()
          Get the tooltip text
 java.lang.Object getValue()
          Get the checkbox's value if it has one or else get the text
 void setComponentState(java.lang.Object o)
          Set the component state
 void setImage(java.lang.String imageUrl)
          Set the image url
 void setRadioButtonGroup(java.lang.Object grp)
          Set the button group
 void setSelectedObject(java.lang.Object object)
          Select an item
 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
Constructor Detail

RadioButton

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

Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclassing exception

Overrides:
checkSubclass in class Button

getComponentState

public java.lang.Object getComponentState()
Get the component state

Specified by:
getComponentState in interface StateHolder
Returns:
the Boolean value for the state

setComponentState

public void setComponentState(java.lang.Object o)
Set the component state

Specified by:
setComponentState in interface StateHolder
Parameters:
o - the selection state. Possible values: 1 or true and 0 or false

getValue

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

Specified by:
getValue in interface ValueHolder
Overrides:
getValue in class Button
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
Overrides:
setValue in class Button
Parameters:
newValue - the new button value

createGroup

public java.lang.Object createGroup()
Create a new checkbox group and adds this radio button top the new group

Specified by:
createGroup in interface RadioButtonGroup
Returns:
the new group

setRadioButtonGroup

public void setRadioButtonGroup(java.lang.Object grp)
Set the button group

Specified by:
setRadioButtonGroup in interface RadioButtonGroup
Parameters:
grp - the group control this radio button

getRadioButtonGroup

public java.lang.Object getRadioButtonGroup()
Gets the group controlling this radio button

Specified by:
getRadioButtonGroup in interface RadioButtonGroup
Returns:
the ButtonGroup

getSelectedObject

public java.lang.Object getSelectedObject()
Gets the selected radio button

Specified by:
getSelectedObject in interface RadioHolder
Returns:
the selected radio button

setSelectedObject

public void setSelectedObject(java.lang.Object object)
Select an item

Specified by:
setSelectedObject in interface RadioHolder
Parameters:
object - the index of the item to select

setImage

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

Overrides:
setImage in class Button
Parameters:
imageUrl - the relative image URL

setToolTip

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

Overrides:
setToolTip in class Button
Parameters:
text - the new text

getToolTip

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

Overrides:
getToolTip in class Button
Returns:
the existing text if any