WUI : API


org.westofj.wui
Class WRadioMenuItem

java.lang.Object
  extended byorg.westofj.wui.Widget
      extended byorg.westofj.wui.WAbstractButton
          extended byorg.westofj.wui.WMenuElement
              extended byorg.westofj.wui.WMenuItem
                  extended byorg.westofj.wui.WRadioMenuItem

public class WRadioMenuItem
extends WMenuItem

A menu item that behaves as a radio button. Radio menu items are grouped within the same menu. Only one radio menu item within a menu may be selected at one time.

Version:
$Revision: 1.2 $, $Date: 2004/03/08 01:57:35 $
Author:
bill

Constructor Summary
WRadioMenuItem()
          Constructs a radio menu item.
WRadioMenuItem(String text)
          Constructs a radio menu item with the specified text.
WRadioMenuItem(WDisplayable text)
          Constructs a radio menu item with the specified text.
 
Method Summary
 boolean isSelected()
          Returns true if the radio menu item is selected, false otherwise.
 void press()
          Presses the button.
 void renderModifier(WRunner runner, PrintWriter out)
          Renders a modifier image to the display.
 void setSelected(boolean selected)
          Sets if the radio menu item is selected.
 
Methods inherited from class org.westofj.wui.WMenuItem
getElementCount, getSubElements
 
Methods inherited from class org.westofj.wui.WMenuElement
render
 
Methods inherited from class org.westofj.wui.WAbstractButton
addActionListener, getActionCommand, getText, getText, handleParams, hasActionListeners, isEnabled, removeActionListener, setActionCommand, setEnabled, setText, setText
 
Methods inherited from class org.westofj.wui.Widget
addChangeListener, getRunner, handleNoParams, hasChangeListeners, removeChangeListener, stateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WRadioMenuItem

public WRadioMenuItem()
Constructs a radio menu item.


WRadioMenuItem

public WRadioMenuItem(String text)
Constructs a radio menu item with the specified text.

Parameters:
text - the label of the radio menu item.

WRadioMenuItem

public WRadioMenuItem(WDisplayable text)
Constructs a radio menu item with the specified text.

Parameters:
text - the label of the radio menu item.
Method Detail

renderModifier

public void renderModifier(WRunner runner,
                           PrintWriter out)
Description copied from class: WMenuElement
Renders a modifier image to the display. A modifier image is an additional image that communicates state to the user. This render method is separate from the WMenuElement.render(org.westofj.wui.WRunner, org.westofj.wui.WRenderContext, java.io.PrintWriter) method to allow menu containers to place the modifier in different locations on the display.

Overrides:
renderModifier in class WMenuElement
Parameters:
runner - the current runner context.
out - the output for the display.

isSelected

public boolean isSelected()
Returns true if the radio menu item is selected, false otherwise.

Returns:
boolean true if the radio menu item is selected, false otherwise.

setSelected

public void setSelected(boolean selected)
Sets if the radio menu item is selected. True indicates that the radio menu item is selected. False indicates that the radio menu item is not selected. If the radio menu item is set to be selected, all other radio menu items contained within the same menu are set to not be selected.

Parameters:
selected - true if the radio menu item is selected, false otherwise.

press

public void press()
Description copied from class: WAbstractButton
Presses the button.

Overrides:
press in class WAbstractButton

Copyright (c) 2003 West of J - All rights reserved.