WUI : API


org.westofj.wui
Class WButton

java.lang.Object
  extended byorg.westofj.wui.Widget
      extended byorg.westofj.wui.WAbstractButton
          extended byorg.westofj.wui.WButton

public class WButton
extends WAbstractButton

Represents a button with a label. The current implementation renders the button as an html submit button. When the button is pressed, the wui framework maps the press event to a WActionEventinstance and invokes all WActionListenerinstances registered with the button.

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

Constructor Summary
WButton()
          Constructs a button without a label.
WButton(String text)
          Constructs a button with the specified label.
WButton(WDisplayable text)
          Constructs a button with the specified label.
 
Method Summary
 WFont getFont()
          Returns the font.
 int getHeight()
          Returns the height of the button.
 int getWidth()
          Returns the width of the button.
 void render(WRunner runner, WRenderContext context, PrintWriter out)
          Renders the widget to the display.
 void setFont(WFont font)
          Sets the font.
 void setHeight(int height)
          Sets the height of the button.
 void setWidth(int width)
          Sets the width of the button.
 
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

WButton

public WButton()
Constructs a button without a label.


WButton

public WButton(String text)
Constructs a button with the specified label.

Parameters:
text - the label of the button.

WButton

public WButton(WDisplayable text)
Constructs a button with the specified label.

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

getFont

public WFont getFont()
Returns the font.

Returns:
Returns the font.

getHeight

public int getHeight()
Returns the height of the button.

Returns:
Returns the height of the button.

getWidth

public int getWidth()
Returns the width of the button.

Returns:
Returns the width of the button.

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.

setFont

public void setFont(WFont font)
Sets the font.

Parameters:
font - The font to set.

setHeight

public void setHeight(int height)
Sets the height of the button.

Parameters:
height - The height of the button to set.

setWidth

public void setWidth(int width)
Sets the width of the button.

Parameters:
width - The width to set to set.

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