net.xoetrope.swt
Class XRadioButton

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Button
              extended by net.xoetrope.swt.XRadioButton
All Implemented Interfaces:
XAttributedComponent, XRadioButtonGroup, XRadioHolder, XStateHolder, XTextHolder, XValueHolder, org.eclipse.swt.graphics.Drawable

public class XRadioButton
extends org.eclipse.swt.widgets.Button
implements XStateHolder, XTextHolder, XValueHolder, XRadioHolder, XAttributedComponent, XRadioButtonGroup

A wrapper for the RadioButton class

Copyright (c) Xoetrope Ltd., 1998-2004
License: see license.txt $Revision: 2.10 $


Field Summary
protected  java.lang.Object value
           
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
XRadioButton(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.Object getValue()
          Get the checkbox's value if it has one or else get the text
 int setAttribute(java.lang.String attribName, java.lang.Object attribValue)
          Set one or more attributes of the component.
 void setComponentState(java.lang.Object o)
          Set the component state
 void setRadioButtonGroup(java.lang.Object grp)
          Set the button group
 void setSelectedObject(java.lang.Object object)
          Select an item
 void setValue(java.lang.Object newValue)
          Set the value associated with this button
 
Methods inherited from class org.eclipse.swt.widgets.Button
addSelectionListener, computeSize, getAlignment, getImage, getSelection, getText, removeSelectionListener, setAlignment, setImage, setSelection, setText
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setFocus, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.xoetrope.xui.XTextHolder
getText, setText
 
Methods inherited from interface net.xoetrope.xui.XValueHolder
getText, setText
 

Field Detail

value

protected java.lang.Object value
Constructor Detail

XRadioButton

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

Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclassing exception

Overrides:
checkSubclass in class org.eclipse.swt.widgets.Widget

getComponentState

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

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

setComponentState

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

Specified by:
setComponentState in interface XStateHolder
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 XValueHolder
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 XValueHolder
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 XRadioButtonGroup
Returns:
the new group

setRadioButtonGroup

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

Specified by:
setRadioButtonGroup in interface XRadioButtonGroup
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 XRadioButtonGroup
Returns:
the ButtonGroup

getSelectedObject

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

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

setSelectedObject

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

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

setAttribute

public int setAttribute(java.lang.String attribName,
                        java.lang.Object attribValue)
Set one or more attributes of the component.

Specified by:
setAttribute in interface XAttributedComponent
Parameters:
attribName - the name of the attribute
attribValue - the value of the attribute
Returns:
0 for success, non zero for failure or to require some further action