WUI : API


org.westofj.wui
Class WMenu

java.lang.Object
  extended byorg.westofj.wui.Widget
      extended byorg.westofj.wui.WAbstractButton
          extended byorg.westofj.wui.WMenuElement
              extended byorg.westofj.wui.WMenu

public class WMenu
extends WMenuElement

A menu groups menu elements into a hierarchical tree.

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

Constructor Summary
WMenu()
          Constructs an empty menu.
WMenu(String text)
          Constructs an empty menu with the specified label.
WMenu(WDisplayable text)
          Constructs an empty menu with the specified label.
 
Method Summary
 void add(WMenuElement element)
          Adds a menu element to the menu.
 WMenuElement getElement(int position)
          Returns the menu element at the specified position.
 int getElementCount()
          Returns the number of elements contained within this menu element.
 List getSubElements()
          Returns the sub-menu elements of this menu element.
 void insert(WMenuElement element, int position)
          Inserts the specified menu element into the menu at the specified position.
 
Methods inherited from class org.westofj.wui.WMenuElement
render, renderModifier
 
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

WMenu

public WMenu()
Constructs an empty menu.


WMenu

public WMenu(String text)
Constructs an empty menu with the specified label.

Parameters:
text - the label of the menu.

WMenu

public WMenu(WDisplayable text)
Constructs an empty menu with the specified label.

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

add

public void add(WMenuElement element)
Adds a menu element to the menu.

Parameters:
element - the menu element to add to the menu.

getElement

public WMenuElement getElement(int position)
Returns the menu element at the specified position.

Parameters:
position - the position of the menu element.
Returns:
WMenuElement the menu element at the specified position.

getElementCount

public int getElementCount()
Description copied from class: WMenuElement
Returns the number of elements contained within this menu element.

Specified by:
getElementCount in class WMenuElement
Returns:
int the number of elements contained within this menu element.

getSubElements

public List getSubElements()
Description copied from class: WMenuElement
Returns the sub-menu elements of this menu element.

Specified by:
getSubElements in class WMenuElement
Returns:
List the sub-menu elements of this menu element.

insert

public void insert(WMenuElement element,
                   int position)
Inserts the specified menu element into the menu at the specified position.

Parameters:
element - the menu element to add to the menu.
position - the position to place the menu element at within the menu.

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