WUI : API


org.westofj.wui
Class Widget

java.lang.Object
  extended byorg.westofj.wui.Widget
Direct Known Subclasses:
WAbstractButton, WAbstractContainer, WAnchor, WCheckBox, WEmpty, WImage, WInclude, WInlineHtml, WLabelWidget, WList, WMenuBar, WMenuTree, WMultiList, WResetButton, WSeparator, WSpacer, WTabbedPane, WTable, WTextWidget

public abstract class Widget
extends Object

Represents a component that may be placed onto the display.

As the display is rendered, widgets are mapped to HTML elements via identifiers generated via the WRunner. During the rendering process if the widget instance desires event notification, the widget registers itself with the runner using the WRunner.registerWidget(org.westofj.wui.Widget) method. This method returns an identifier that the widget may place into the generated HTML to refer to itself.

Version:
$Revision: 1.10 $, $Date: 2004/03/22 00:34:01 $
Author:
bill

Constructor Summary
Widget()
          Constructs a widget.
 
Method Summary
 void addChangeListener(WChangeListener l)
          Adds a change listener to the selection list.
 WRunner getRunner()
          Returns the current runner context.
protected  void handleNoParams(WRunner runner)
           
protected  void handleParams(WRunner runner, String[] values)
           
 boolean hasChangeListeners()
          Returns true if the list has a change listener, false otherwise.
 WChangeListener removeChangeListener(WChangeListener l)
          Removes the specified change listener from the selection list.
abstract  void render(WRunner runner, WRenderContext context, PrintWriter out)
          Renders the widget to the display.
protected  void stateChanged()
          Generate a change event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Widget

public Widget()
Constructs a widget.

Method Detail

render

public abstract void render(WRunner runner,
                            WRenderContext context,
                            PrintWriter out)
                     throws WRenderException
Renders the widget to the display.

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

getRunner

public final WRunner getRunner()
Returns the current runner context.

Returns:
WRunner the current runner context.

handleParams

protected void handleParams(WRunner runner,
                            String[] values)

handleNoParams

protected void handleNoParams(WRunner runner)

addChangeListener

public void addChangeListener(WChangeListener l)
Adds a change listener to the selection list.

Parameters:
l - a change listener to be invoked when a selection is made.

removeChangeListener

public WChangeListener removeChangeListener(WChangeListener l)
Removes the specified change listener from the selection list.

Parameters:
l - the change listener to remove.

hasChangeListeners

public boolean hasChangeListeners()
Returns true if the list has a change listener, false otherwise.

Returns:
true if the list has a change listener, false otherwise.

stateChanged

protected final void stateChanged()
Generate a change event.


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