Class ActionItem
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.utils.toast.Action
-
- org.pepstock.charba.client.utils.toast.ActionItem
-
- All Implemented Interfaces:
IsDefaultFontContainer
,HasFont
,IsDefaultAction
,IsDefaultContentElement
public final class ActionItem extends Action
Defines user action to show on a toast in order to enable the user to act with the toast.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description ActionItem(String id, String content, ActionClickEventHandler handler)
Creates the action with the id of the action, the content to show on the toast and the handler to invoke when the user will click on the action.ActionItem(String content, ActionClickEventHandler handler)
Creates the action with the content to show on the toast and the handler to invoke when the user will click on the action.
The id of the action has been created automatically.ActionItem(Key id, String content, ActionClickEventHandler handler)
Creates the action with the id of the action, the content to show on the toast and the handler to invoke when the user will click on the action.ActionItem(Key id, ActionClickEventHandler handler)
Creates the action with the id of the toast and the handler to invoke when the user will click on the action.
The content is the value of the id.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
ActionClickEventHandler
getClickEventHandler()
Returns the action click event handler instance.String
getColorAsString()
Returns the font color as string.String
getContent()
Returns the content to show in the toast.FontContainer
getFontContainer()
Returns a font container instance to use in the default methods of this interface.Key
getId()
Returns the action unique id.int
hashCode()
-
Methods inherited from class org.pepstock.charba.client.utils.toast.Action
getBackgroundColor, getBackgroundColorAsString, getBorderColor, getBorderColorAsString, getBorderRadius, getBorderStyle, getBorderWidth, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setBorderRadius, setBorderStyle, setBorderWidth
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.options.HasFont
getColor, getFont, setColor, setColor
-
Methods inherited from interface org.pepstock.charba.client.utils.toast.IsDefaultContentElement
getColorAsString
-
-
-
-
Constructor Detail
-
ActionItem
public ActionItem(Key id, ActionClickEventHandler handler)
Creates the action with the id of the toast and the handler to invoke when the user will click on the action.
The content is the value of the id.- Parameters:
id
- id of the toasthandler
- the handler to use when a click was performed on the toast
-
ActionItem
public ActionItem(String content, ActionClickEventHandler handler)
Creates the action with the content to show on the toast and the handler to invoke when the user will click on the action.
The id of the action has been created automatically.- Parameters:
content
- content to show on the toasthandler
- the handler to use when a click was performed on the toast
-
ActionItem
public ActionItem(String id, String content, ActionClickEventHandler handler)
Creates the action with the id of the action, the content to show on the toast and the handler to invoke when the user will click on the action.- Parameters:
id
- id of the actioncontent
- content to show on the toasthandler
- the handler to use when a click was performed on the toast
-
ActionItem
public ActionItem(Key id, String content, ActionClickEventHandler handler)
Creates the action with the id of the action, the content to show on the toast and the handler to invoke when the user will click on the action.- Parameters:
id
- id of the actioncontent
- content to show on the toasthandler
- the handler to use when a click was performed on the toast
-
-
Method Detail
-
getId
public Key getId()
Returns the action unique id.- Returns:
- the action unique id
-
getContent
public String getContent()
Returns the content to show in the toast.- Returns:
- the content to show in the toast
-
getClickEventHandler
public ActionClickEventHandler getClickEventHandler()
Returns the action click event handler instance.- Returns:
- the action click event handler instance
-
getFontContainer
public final FontContainer getFontContainer()
Description copied from interface:HasFont
Returns a font container instance to use in the default methods of this interface.- Specified by:
getFontContainer
in interfaceHasFont
- Returns:
- a font container instance
-
getColorAsString
public String getColorAsString()
Description copied from interface:IsDefaultFontContainer
Returns the font color as string.- Specified by:
getColorAsString
in interfaceHasFont
- Specified by:
getColorAsString
in interfaceIsDefaultContentElement
- Specified by:
getColorAsString
in interfaceIsDefaultFontContainer
- Returns:
- font color as string
-
-