java.lang.Object
com.aquima.interactions.composer.model.Element
com.aquima.interactions.composer.model.Button
All Implemented Interfaces:
IButton, IElement, Serializable

public class Button extends Element implements IButton
Runtime page element representing a button.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • Button

      public Button(String name, IMultilingualText caption)
      Simple constructor accepting a button name and caption.
      Parameters:
      name - The name of the button (mandatory).
      caption - The caption of the button (optional).
    • Button

      public Button(String name, IMultilingualText caption, String eventName, String[] actions, boolean isRefresh)
      Constructor that can be used to initialize a runtime page button.
      Parameters:
      name - The name of the button (mandatory).
      caption - The caption of the button (optional).
      eventName - The name of the event that is triggered by this button (optional).
      actions - The action(s) associated with the button (optional).
      isRefresh - The type of the button.
    • Button

      protected Button(Button other)
  • Method Details

    • duplicate

      public Element duplicate()
      Description copied from interface: IElement
      This method should clone the element and return the cloned element. The duplicate method should usually make a deep copy of the element, with the exception of members that are not mutable (and thus can safely be shared between multiple copies). The properties of an element are considered to be non-mutable, and will thus by default be copied.
      Specified by:
      duplicate in interface IElement
      Returns:
      The cloned (duplicate) element.
    • isRefresh

      public boolean isRefresh()
      Description copied from interface: IButton
      This method returns a boolean indicating if the button triggers a refresh event.
      Specified by:
      isRefresh in interface IButton
      Returns:
      a boolean indicating if the button triggers a refresh event.
    • setRefresh

      public void setRefresh(boolean isRefresh)
      This method may be used to change the button type to a refresh button. When the parameter value is false the button will be set to the submit type.
      Parameters:
      isRefresh - boolean indicating if the button should trigger a refresh or submit event.
    • getType

      public int getType()
      Description copied from interface: IButton
      This method returns an integer indicating the type of the button.
      Specified by:
      getType in interface IButton
      Returns:
      an integer indicating the type of the button.
    • setAction

      public void setAction(String action)
      This method may be used to set the actions to the button. When multiple actions should be added to the button, either use the addAction method, use the setActions method or supply the action in a comma separated string. Button actions will be copied to the System.event during the handling of an event, if the button was the source of the event (i.e. the one that triggered the event).
      Parameters:
      action - The name of the event that should be associated with this button.
    • addAction

      public void addAction(String action)
      This method may be used to add an event name to the button. Button events will be copied to the System.event during the handling of an event, if the button was the source of the event (i.e. the one that triggered the event).
      Parameters:
      action - The name of the event that should be associated with this button.
    • getCaption

      public IMultilingualText getCaption()
      Description copied from interface: IButton
      This method returns a multilingual text object that should be used as caption.
      Specified by:
      getCaption in interface IButton
      Returns:
      a multilingual text object that should be used as caption.
    • setCaption

      public void setCaption(IMultilingualText caption)
      This method may be used to change the caption (display text) of a button.
      Parameters:
      caption - The new caption of the button.
    • getEventName

      public String getEventName()
      Description copied from interface: IButton
      This method returns the name of the event the button triggers. For buttons that do not have a specific event, this method will return null.
      Specified by:
      getEventName in interface IButton
      Returns:
      the name of the event the button triggers.
    • setEventName

      public void setEventName(String buttonEvent)
      This method set the event name that will be triggered when the button is pressed. Important: If this button is on a dynamic container and there is a mapping between the container events and the flow events, the container definition can be used to get the exit event as shown in the example below. In this example the container "add" event could be mapped to a flow event like "AddUser".
       Button button = new Button("addButton", new MultilingualText("Add User"));
       button.setEventName(containerDefinition.getExitEvent("add"));
       
      Also see ContainerDefinition.getExitEvent(String) and ContainerDefinition.getMappedExitEvents()
      Parameters:
      buttonEvent - The event name.
    • getActions

      public String[] getActions()
      Description copied from interface: IButton
      This method returns an array of strings containing the events that will be set when the button is clicked.
      Specified by:
      getActions in interface IButton
      Returns:
      an array of strings containing the events that will be set when the button is clicked.
    • setActions

      public void setActions(String[] actions)
      This method may be used to set the actions to the button. Button actions will be copied to the System.event during the handling of an event, if the button was the source of the event (i.e. the one that triggered the event).
      Parameters:
      actions - The actions that should be associated with this button.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Element
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Element