WUI : API


org.westofj.wui
Class WAbstractButton

java.lang.Object
  extended byorg.westofj.wui.Widget
      extended byorg.westofj.wui.WAbstractButton
Direct Known Subclasses:
WButton, WImageButton, WLink, WMenuElement

public abstract class WAbstractButton
extends Widget

Implements base functionality for button like objects including buttons, links and menu items.

Version:
$Revision: 1.4 $, $Date: 2004/03/08 01:57:36 $
Author:
bill

Constructor Summary
protected WAbstractButton()
          Contructs a button.
protected WAbstractButton(String text)
          Constructs a button labelled with the specified text.
protected WAbstractButton(WDisplayable text)
          Constructs a button labelled with the specified text.
 
Method Summary
 void addActionListener(WActionListener l)
          Adds a WActionListener to the button.
 String getActionCommand()
          Returns the action command of the button.
 WDisplayable getText()
          Returns the button label.
 String getText(WRunner runner)
          Returns the label of the button as a String.
protected  void handleParams(WRunner runner, String[] values)
           
 boolean hasActionListeners()
          Returns true if the list has action listeners, false otherwise.
 boolean isEnabled()
          Returns true if the button is enabled, false otherwise.
 void press()
          Presses the button.
 WActionListener removeActionListener(WActionListener l)
          Removes an WActionListener from the button.
 void setActionCommand(String actionCommand)
          Sets the action command of the button.
 void setEnabled(boolean enabled)
          Enables or disables the button.
 void setText(String text)
          Sets the label of the button.
 void setText(WDisplayable text)
          Sets the label of the button.
 
Methods inherited from class org.westofj.wui.Widget
addChangeListener, getRunner, handleNoParams, hasChangeListeners, removeChangeListener, render, stateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WAbstractButton

protected WAbstractButton()
Contructs a button.


WAbstractButton

protected WAbstractButton(String text)
Constructs a button labelled with the specified text.

Parameters:
text - the label of the button.

WAbstractButton

protected WAbstractButton(WDisplayable text)
Constructs a button labelled with the specified text.

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

addActionListener

public void addActionListener(WActionListener l)
Adds a WActionListener to the button. The specific listener is invoked when an action occurs on the button.

Parameters:
l - the listener to be added the the button.

handleParams

protected void handleParams(WRunner runner,
                            String[] values)
Overrides:
handleParams in class Widget

press

public void press()
Presses the button.


getActionCommand

public String getActionCommand()
Returns the action command of the button.

Returns:
String the action command of the button.

getText

public WDisplayable getText()
Returns the button label.

Returns:
WDisplayable the label of the button.

getText

public final String getText(WRunner runner)
Returns the label of the button as a String.

Parameters:
runner - the runner context.
Returns:
String the label of the button.

isEnabled

public boolean isEnabled()
Returns true if the button is enabled, false otherwise.

Returns:
boolean true if the button is enabled, false otherwise.

removeActionListener

public WActionListener removeActionListener(WActionListener l)
Removes an WActionListener from the button.

Parameters:
l - the WActionListener to remove.

setActionCommand

public void setActionCommand(String actionCommand)
Sets the action command of the button.

Parameters:
actionCommand - the new action command.

setEnabled

public void setEnabled(boolean enabled)
Enables or disables the button.

Parameters:
enabled - true if the button is enabled, false otherwise.

setText

public void setText(String text)
Sets the label of the button.

Parameters:
text - the label of the button.

setText

public void setText(WDisplayable text)
Sets the label of the button.

Parameters:
text - the label of the button.

hasActionListeners

public boolean hasActionListeners()
Returns true if the list has action listeners, false otherwise.

Returns:
true if the list has action listeners, false otherwise.

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