ilog.webui.dhtml.components

Class IlxWButton

  • All Implemented Interfaces:
    ilog.webui.dhtml.IlxWConstants, ilog.webui.dhtml.IlxWCSSModelProvider, ilog.webui.dhtml.IlxWDependencyProvider, ilog.webui.dhtml.IlxWJSObject, java.io.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
    • Constructor Detail

      • IlxWButton

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

        public IlxWButton(java.lang.String text)
        Constructs a button with the given caption.
        Parameters:
        text - The text to display in the button.
    • Method Detail

      • setText

        public void setText(java.lang.String text)
        Sets the text to display in the button.
        Parameters:
        text - any string
      • getText

        public java.lang.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)
      • doPrint

        protected void doPrint(IlxWPort port)
                        throws java.io.IOException
        Overrides:
        doPrint in class IlxWComponent
        Throws:
        java.io.IOException
      • addActionListener

        public void addActionListener(java.awt.event.ActionListener listener)
        Adds the specified action listener.
        Parameters:
        listener - the action listener
      • removeActionListener

        public void removeActionListener(java.awt.event.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.

© Copyright IBM Corp. 1987, 2015