Class ToastOptions
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.utils.toast.ToastOptions
-
- All Implemented Interfaces:
IsDefaultToastOptions
public final class ToastOptions extends AbstractNode
Entity to configure the toast to show.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description ToastOptions()
Creates the object with an empty configuration instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Action
getAction()
Returns the actions element.List<ActionItem>
getActions()
Returns the actions to the toast.Align
getAlign()
Returns the alignment of the toast action.int
getBorderRadius()
Returns the border radius (in pixels).ClickEventHandler
getClickEventHandler()
Returns the CLICK event hander, if set, otherwisenull
.CloseHandler
getCloseHandler()
Returns the CLOSE hander, if set, otherwisenull
.Img
getIcon()
Returns the icon image set for toast.Label
getLabel()
Returns the label element.ModifierKey
getModifierKey()
Returns the modifier key to close the toast by clicking on it.OpenHandler
getOpenHandler()
Returns the OPEN hander, if set, otherwisenull
.int
getProgressBarHeight()
Returns the height (in pixels) of the toast progress bar.IsProgressBarType
getProgressBarType()
Returns the type of the toast progress bar.int
getTimeout()
Returns how long the toast notification should last.Title
getTitle()
Returns the title element.IsToastType
getType()
Returns the type of the toast.boolean
isAutoHide()
Returns whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked.boolean
isHideProgressBar()
Returnstrue
whether to hide the progress bar.boolean
isHideShadow()
Returnstrue
whether to hide the shadow of toast.void
setActions(List<ActionItem> actions)
Sets the actions to the toast.void
setActions(ActionItem... actions)
Sets the actions to the toast.void
setAlign(Align align)
Sets the alignment of the toast action.void
setAutoHide(boolean hide)
Sets whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked.void
setBorderRadius(int borderRadius)
Sets the border radius (in pixels) of toast container.void
setClickEventHandler(ClickEventHandler clickEventHandler)
Sets the CLICK event hander.void
setCloseHandler(CloseHandler closeHandler)
Sets the CLOSE hander.void
setHideProgressBar(boolean hide)
Setstrue
whether to hide the progress bar.void
setHideShadow(boolean hide)
Setstrue
whether to hide the shadow of toast.void
setIcon(Img icon)
Sets the icon image set for toast.void
setModifierKey(ModifierKey modifierKey)
Sets the modifier key to close the toast by clicking on it.void
setOpenHandler(OpenHandler openHandler)
Sets the OPEN hander.void
setProgressBarHeight(int height)
Sets the height (in pixels) of the toast progress bar.void
setProgressBarType(IsProgressBarType type)
Sets the type of the toast progress bar.void
setTimeout(int timeout)
Sets how long the toast notification should last.void
setType(IsToastType type)
Sets the type of the toast.-
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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.utils.toast.IsDefaultToastOptions
getText
-
-
-
-
Method Detail
-
getClickEventHandler
public ClickEventHandler getClickEventHandler()
Returns the CLICK event hander, if set, otherwisenull
.- Returns:
- the CLICK event hander, if set, otherwise
null
.
-
setClickEventHandler
public void setClickEventHandler(ClickEventHandler clickEventHandler)
Sets the CLICK event hander.- Parameters:
clickEventHandler
- the CLICK event hander.
-
getOpenHandler
public OpenHandler getOpenHandler()
Returns the OPEN hander, if set, otherwisenull
.- Returns:
- the OPEN hander, if set, otherwise
null
.
-
setOpenHandler
public void setOpenHandler(OpenHandler openHandler)
Sets the OPEN hander.- Parameters:
openHandler
- the OPEN hander.
-
getCloseHandler
public CloseHandler getCloseHandler()
Returns the CLOSE hander, if set, otherwisenull
.- Returns:
- the CLOSE hander, if set, otherwise
null
.
-
setCloseHandler
public void setCloseHandler(CloseHandler closeHandler)
Sets the CLOSE hander.- Parameters:
closeHandler
- the CLOSE hander.
-
setActions
public void setActions(ActionItem... actions)
Sets the actions to the toast.- Parameters:
actions
- the actions to the toast
-
setActions
public void setActions(List<ActionItem> actions)
Sets the actions to the toast.- Parameters:
actions
- the actions to the toast
-
getActions
public List<ActionItem> getActions()
Returns the actions to the toast.- Returns:
- the actions to the toast.
-
getTitle
public final Title getTitle()
Returns the title element.- Specified by:
getTitle
in interfaceIsDefaultToastOptions
- Returns:
- the title
-
getLabel
public final Label getLabel()
Returns the label element.- Specified by:
getLabel
in interfaceIsDefaultToastOptions
- Returns:
- the label
-
getAction
public final Action getAction()
Returns the actions element.- Specified by:
getAction
in interfaceIsDefaultToastOptions
- Returns:
- the actions
-
setType
public final void setType(IsToastType type)
Sets the type of the toast.- Parameters:
type
- the type of the toast
-
setProgressBarType
public final void setProgressBarType(IsProgressBarType type)
Sets the type of the toast progress bar.- Parameters:
type
- the type of the toast progress bar
-
setProgressBarHeight
public final void setProgressBarHeight(int height)
Sets the height (in pixels) of the toast progress bar.- Parameters:
height
- the height (in pixels) of the toast progress bar
-
setHideProgressBar
public final void setHideProgressBar(boolean hide)
Setstrue
whether to hide the progress bar.- Parameters:
hide
-true
whether to hide the progress bar
-
setHideShadow
public final void setHideShadow(boolean hide)
Setstrue
whether to hide the shadow of toast.- Parameters:
hide
-true
whether the shadow of toast
-
setAutoHide
public final void setAutoHide(boolean hide)
Sets whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked.- Parameters:
hide
- whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked
-
setTimeout
public final void setTimeout(int timeout)
Sets how long the toast notification should last.- Parameters:
timeout
- how long the toast notification should last
-
setIcon
public final void setIcon(Img icon)
Sets the icon image set for toast.- Parameters:
icon
- the icon image set for toast
-
setBorderRadius
public final void setBorderRadius(int borderRadius)
Sets the border radius (in pixels) of toast container.- Parameters:
borderRadius
- the border radius (in pixels) of toast container
-
setModifierKey
public final void setModifierKey(ModifierKey modifierKey)
Sets the modifier key to close the toast by clicking on it.- Parameters:
modifierKey
- the modifier key to close the toast by clicking on it
-
setAlign
public final void setAlign(Align align)
Sets the alignment of the toast action.- Parameters:
align
- the alignment of the toast action
-
getType
public final IsToastType getType()
Returns the type of the toast.- Specified by:
getType
in interfaceIsDefaultToastOptions
- Returns:
- the type of the toast
-
getProgressBarType
public final IsProgressBarType getProgressBarType()
Returns the type of the toast progress bar.- Specified by:
getProgressBarType
in interfaceIsDefaultToastOptions
- Returns:
- the type of the toast progress bar
-
getProgressBarHeight
public final int getProgressBarHeight()
Returns the height (in pixels) of the toast progress bar.- Specified by:
getProgressBarHeight
in interfaceIsDefaultToastOptions
- Returns:
- the height (in pixels) of the toast progress bar
-
isHideProgressBar
public final boolean isHideProgressBar()
Returnstrue
whether to hide the progress bar.- Specified by:
isHideProgressBar
in interfaceIsDefaultToastOptions
- Returns:
true
whether to hide the progress bar
-
isHideShadow
public final boolean isHideShadow()
Returnstrue
whether to hide the shadow of toast.- Specified by:
isHideShadow
in interfaceIsDefaultToastOptions
- Returns:
true
whether to hide the shadow of toast
-
isAutoHide
public final boolean isAutoHide()
Returns whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked.- Specified by:
isAutoHide
in interfaceIsDefaultToastOptions
- Returns:
- whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked
-
getTimeout
public final int getTimeout()
Returns how long the toast notification should last.- Specified by:
getTimeout
in interfaceIsDefaultToastOptions
- Returns:
- how long the toast notification should last
-
getIcon
public final Img getIcon()
Returns the icon image set for toast.- Specified by:
getIcon
in interfaceIsDefaultToastOptions
- Returns:
- the icon image set for toast
-
getBorderRadius
public int getBorderRadius()
Returns the border radius (in pixels).- Specified by:
getBorderRadius
in interfaceIsDefaultToastOptions
- Returns:
- the border radius (in pixels).
-
getModifierKey
public ModifierKey getModifierKey()
Returns the modifier key to close the toast by clicking on it.- Specified by:
getModifierKey
in interfaceIsDefaultToastOptions
- Returns:
- the modifier key to close the toast by clicking on it
-
getAlign
public final Align getAlign()
Returns the alignment of the toast action.- Specified by:
getAlign
in interfaceIsDefaultToastOptions
- Returns:
- the alignment of the toast action
-
-