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 booleanequals(Object obj)ActionClickEventHandlergetClickEventHandler()Returns the action click event handler instance.StringgetColorAsString()Returns the font color as string.StringgetContent()Returns the content to show in the toast.FontContainergetFontContainer()Returns a font container instance to use in the default methods of this interface.KeygetId()Returns the action unique id.inthashCode()-
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, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, 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, 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:HasFontReturns a font container instance to use in the default methods of this interface.- Specified by:
getFontContainerin interfaceHasFont- Returns:
- a font container instance
-
getColorAsString
public String getColorAsString()
Description copied from interface:IsDefaultFontContainerReturns the font color as string.- Specified by:
getColorAsStringin interfaceHasFont- Specified by:
getColorAsStringin interfaceIsDefaultContentElement- Specified by:
getColorAsStringin interfaceIsDefaultFontContainer- Returns:
- font color as string
-
-