WUI : API


org.westofj.wui
Class WMenuElement

java.lang.Object
  extended byorg.westofj.wui.Widget
      extended byorg.westofj.wui.WAbstractButton
          extended byorg.westofj.wui.WMenuElement
Direct Known Subclasses:
WMenu, WMenuItem

public abstract class WMenuElement
extends WAbstractButton

An element of a menu.

Version:
$Revision: 1.3 $, $Date: 2004/03/14 21:27:46 $
Author:
bill

Constructor Summary
WMenuElement()
          Constructs a menu element.
WMenuElement(String text)
          Constructs a menu element with the specified label.
WMenuElement(WDisplayable text)
          Constructs a menu element with the specified label.
 
Method Summary
abstract  int getElementCount()
          Returns the number of elements contained within this menu element.
abstract  List getSubElements()
          Returns the sub-menu elements of this menu element.
 void render(WRunner runner, WRenderContext context, PrintWriter out)
          Renders the widget to the display.
 void renderModifier(WRunner runner, PrintWriter out)
          Renders a modifier image to the display.
 
Methods inherited from class org.westofj.wui.WAbstractButton
addActionListener, getActionCommand, getText, getText, handleParams, hasActionListeners, isEnabled, press, 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

WMenuElement

public WMenuElement()
Constructs a menu element.


WMenuElement

public WMenuElement(String text)
Constructs a menu element with the specified label.

Parameters:
text - the label of the menu element.

WMenuElement

public WMenuElement(WDisplayable text)
Constructs a menu element with the specified label.

Parameters:
text - the label of the menu element.
Method Detail

render

public void render(WRunner runner,
                   WRenderContext context,
                   PrintWriter out)
Description copied from class: Widget
Renders the widget to the display.

Specified by:
render in class Widget
Parameters:
runner - the current runner context.
out - the output for the display.

getElementCount

public abstract int getElementCount()
Returns the number of elements contained within this menu element.

Returns:
int the number of elements contained within this menu element.

getSubElements

public abstract List getSubElements()
Returns the sub-menu elements of this menu element.

Returns:
List the sub-menu elements of this menu element.

renderModifier

public void renderModifier(WRunner runner,
                           PrintWriter out)
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 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.

Parameters:
runner - the current runner context.
out - the output for the display.

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