Decision Center API

ilog.webui.dhtml.components
Class IlxWButton

java.lang.Object
  extended by ilog.webui.dhtml.IlxWContainer
      extended by ilog.webui.dhtml.IlxWComponent
          extended by ilog.webui.dhtml.components.IlxWButton
All Implemented Interfaces:
ilog.webui.dhtml.IlxWConstants, ilog.webui.dhtml.IlxWCSSModelProvider, ilog.webui.dhtml.IlxWDependencyProvider, ilog.webui.dhtml.IlxWJSObject, Serializable

public class IlxWButton
extends IlxWComponent

This class implements a simple button component. A button component is rendered on the web browser as an <input type="submit"> element.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.webui.dhtml.IlxWComponent
IlxWComponent.DynamicStyleMap
 
Field Summary
 
Fields inherited from class ilog.webui.dhtml.IlxWContainer
listenerList
 
Constructor Summary
IlxWButton()
          Constructs an empty button, with no text.
IlxWButton(String text)
          Constructs a button with the given caption.
 
Method Summary
 void addActionListener(ActionListener listener)
          Adds the specified action listener.
protected  IlxWAction createDefaultAction()
          Create the default action.
protected  void doPrint(IlxWPort port)
           
protected  void fireActionPerformed()
          Notifies all action listeners than an action has been triggered, using the text of the button as the name of the event command.
 IlxWAction getAction()
          Gets the action which will be called when the user clicks on the button.
 String getText()
          Gets the text displayed in the button
 boolean isEnabled()
          Specifies whether the component is enabled or not.
protected  void printComponent(IlxWPort port)
          Prints the HTML code that will display the graphical representation of this component.
 void removeActionListener(ActionListener listener)
          Removes the specified action listener.
 void setAction(IlxWAction action)
          Sets the action which will be called when the user clicks on this button.
 void setEnabled(boolean enabled)
          Sets the component as enabled or disabled.
 void setText(String text)
          Sets the text to display in the button.
 
Methods inherited from class ilog.webui.dhtml.IlxWComponent
addPropertyChangeListener, addPropertyChangeListener, detach, firePropertyChange, firePropertyChange, getName, getRealHtmlTagName, getStyle, invalidate, isInvalidated, notifyDependencies, print, removePropertyChangeListener, removePropertyChangeListener, setName, validate
 
Methods inherited from class ilog.webui.dhtml.IlxWContainer
add, add, getAttribute, getAttributeNames, getComponent, getComponentCount, getComponentNamed, getComponents, getManager, getParent, getUserAgentRules, indexOf, isAncestorOf, remove, remove, removeAll, removeAttribute, setAttribute, setAuthorRules, setFinalizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlxWButton

public IlxWButton()
Constructs an empty button, with no text.


IlxWButton

public IlxWButton(String text)
Constructs a button with the given caption.

Parameters:
text - The text to display in the button.
Method Detail

setText

public void setText(String text)
Sets the text to display in the button.

Parameters:
text - any string

getText

public String getText()
Gets the text displayed in the button

Returns:
The text displayed in the button.

setEnabled

public void setEnabled(boolean enabled)
Sets the component as enabled or disabled.

Parameters:
enabled - enabled flag value

isEnabled

public boolean isEnabled()
Specifies whether the component is enabled or not.

Returns:
true if the button is enabled.

setAction

public void setAction(IlxWAction action)
Sets the action which will be called when the user clicks on this button. If you define your own action, be aware that the default action will not be called anymore and the registered action listeners will not be notified anymore, unless you do it explicitly.

Parameters:
action - The action to perform when the user clicks on the button.
See Also:
getAction()

getAction

public IlxWAction getAction()
Gets the action which will be called when the user clicks on the button.

By default, this action is a Java action (IlxWJavaAction) of which the perform method calls fireActionPerformed on the button.

Returns:
The action to perform when the user clicks on the button.
See Also:
setAction(ilog.webui.dhtml.components.IlxWAction)

createDefaultAction

protected IlxWAction createDefaultAction()
Create the default action. The default action is a Java action of which the perform method simply calls fireActionPerformed.

See Also:
setAction(ilog.webui.dhtml.components.IlxWAction)

doPrint

protected void doPrint(IlxWPort port)
                throws IOException
Overrides:
doPrint in class IlxWComponent
Throws:
IOException

printComponent

protected void printComponent(IlxWPort port)
                       throws IOException
Description copied from class: IlxWComponent
Prints the HTML code that will display the graphical representation of this component. This method is called by the IlxWComponent.print(ilog.webui.dhtml.IlxWPort) method.

Specified by:
printComponent in class IlxWComponent
Throws:
IOException
Parameters:
port - The port on which the component will be printed.
See Also:
IlxWComponent.print(ilog.webui.dhtml.IlxWPort)

addActionListener

public void addActionListener(ActionListener listener)
Adds the specified action listener.

Parameters:
listener - the action listener

removeActionListener

public void removeActionListener(ActionListener listener)
Removes the specified action listener.

Parameters:
listener - the action listener

fireActionPerformed

protected void fireActionPerformed()
Notifies all action listeners than an action has been triggered, using the text of the button as the name of the event command.


Decision Center API

© Copyright IBM Corp. 1987, 2013