Class Button
java.lang.Object
com.aquima.interactions.composer.model.Element
com.aquima.interactions.composer.model.Button
- All Implemented Interfaces:
IButton
,IElement
,Serializable
Runtime page element representing a button.
- Since:
- 5.0
- Author:
- O. Kerpershoek
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Button
(String name, IMultilingualText caption) Simple constructor accepting a button name and caption.Button
(String name, IMultilingualText caption, String eventName, String[] actions, boolean isRefresh) Constructor that can be used to initialize a runtime page button. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method may be used to add an event name to the button.This method should clone the element and return the cloned element.boolean
String[]
This method returns an array of strings containing the events that will be set when the button is clicked.This method returns a multilingual text object that should be used as caption.This method returns the name of the event the button triggers.int
getType()
This method returns an integer indicating the type of the button.int
hashCode()
boolean
This method returns a boolean indicating if the button triggers a refresh event.void
This method may be used to set the actions to the button.void
setActions
(String[] actions) This method may be used to set the actions to the button.void
setCaption
(IMultilingualText caption) This method may be used to change the caption (display text) of a button.void
setEventName
(String buttonEvent) This method set the event name that will be triggered when the button is pressed.void
setRefresh
(boolean isRefresh) This method may be used to change the button type to a refresh button.toString()
Methods inherited from class com.aquima.interactions.composer.model.Element
accept, addPresentationStyle, evaluateTsl, getName, getParent, getPresentationStyles, getProperty, getPropertyKeys, getRuntimeKey, getVisibilityCondition, hasFocus, hasPresentationStyle, isReadonly, isReadonlyInheritFromParent, isVisible, setFocus, setParent, setPresentationStyle, setPresentationStyles, setPresentationStyles, setProperty, setReadonly, setReadonlyInheritFromParent, setRuntimeKey, setVisibilityCondition, setVisible
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.aquima.interactions.composer.IElement
accept, getName, getParent, getPresentationStyles, getProperty, getPropertyKeys, getRuntimeKey, hasFocus, hasPresentationStyle, isReadonly, isReadonlyInheritFromParent, isVisible, setProperty
-
Constructor Details
-
Button
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
-
-
Method Details
-
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. -
isRefresh
public boolean isRefresh()Description copied from interface:IButton
This method 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. -
setAction
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
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
Description copied from interface:IButton
This method returns a multilingual text object that should be used as caption.- Specified by:
getCaption
in interfaceIButton
- Returns:
- a multilingual text object that should be used as caption.
-
setCaption
This method may be used to change the caption (display text) of a button.- Parameters:
caption
- The new caption of the button.
-
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 interfaceIButton
- Returns:
- the name of the event the button triggers.
-
setEventName
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 {@link ContainerDefinition#getExitEvent(String)) and {@link ContainerDefinition#getMappedExitEvents())- Parameters:
buttonEvent
- The event name.
-
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 interfaceIButton
- Returns:
- an array of strings containing the events that will be set when the button is clicked.
-
setActions
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
-
equals
-
hashCode
public int hashCode()
-