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 ActiongetAction()Returns the actions element.List<ActionItem>getActions()Returns the actions to the toast.AligngetAlign()Returns the alignment of the toast action.intgetBorderRadius()Returns the border radius (in pixels).ClickEventHandlergetClickEventHandler()Returns the CLICK event hander, if set, otherwisenull.CloseHandlergetCloseHandler()Returns the CLOSE hander, if set, otherwisenull.ImggetIcon()Returns the icon image set for toast.LabelgetLabel()Returns the label element.ModifierKeygetModifierKey()Returns the modifier key to close the toast by clicking on it.OpenHandlergetOpenHandler()Returns the OPEN hander, if set, otherwisenull.intgetProgressBarHeight()Returns the height (in pixels) of the toast progress bar.IsProgressBarTypegetProgressBarType()Returns the type of the toast progress bar.intgetTimeout()Returns how long the toast notification should last.TitlegetTitle()Returns the title element.IsToastTypegetType()Returns the type of the toast.booleanisAutoHide()Returns whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked.booleanisHideProgressBar()Returnstruewhether to hide the progress bar.booleanisHideShadow()Returnstruewhether to hide the shadow of toast.voidsetActions(List<ActionItem> actions)Sets the actions to the toast.voidsetActions(ActionItem... actions)Sets the actions to the toast.voidsetAlign(Align align)Sets the alignment of the toast action.voidsetAutoHide(boolean hide)Sets whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked.voidsetBorderRadius(int borderRadius)Sets the border radius (in pixels) of toast container.voidsetClickEventHandler(ClickEventHandler clickEventHandler)Sets the CLICK event hander.voidsetCloseHandler(CloseHandler closeHandler)Sets the CLOSE hander.voidsetHideProgressBar(boolean hide)Setstruewhether to hide the progress bar.voidsetHideShadow(boolean hide)Setstruewhether to hide the shadow of toast.voidsetIcon(Img icon)Sets the icon image set for toast.voidsetModifierKey(ModifierKey modifierKey)Sets the modifier key to close the toast by clicking on it.voidsetOpenHandler(OpenHandler openHandler)Sets the OPEN hander.voidsetProgressBarHeight(int height)Sets the height (in pixels) of the toast progress bar.voidsetProgressBarType(IsProgressBarType type)Sets the type of the toast progress bar.voidsetTimeout(int timeout)Sets how long the toast notification should last.voidsetType(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
checkAndGetColor, 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:
getTitlein interfaceIsDefaultToastOptions- Returns:
- the title
-
getLabel
public final Label getLabel()
Returns the label element.- Specified by:
getLabelin interfaceIsDefaultToastOptions- Returns:
- the label
-
getAction
public final Action getAction()
Returns the actions element.- Specified by:
getActionin 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)
Setstruewhether to hide the progress bar.- Parameters:
hide-truewhether to hide the progress bar
-
setHideShadow
public final void setHideShadow(boolean hide)
Setstruewhether to hide the shadow of toast.- Parameters:
hide-truewhether 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:
getTypein interfaceIsDefaultToastOptions- Returns:
- the type of the toast
-
getProgressBarType
public final IsProgressBarType getProgressBarType()
Returns the type of the toast progress bar.- Specified by:
getProgressBarTypein 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:
getProgressBarHeightin interfaceIsDefaultToastOptions- Returns:
- the height (in pixels) of the toast progress bar
-
isHideProgressBar
public final boolean isHideProgressBar()
Returnstruewhether to hide the progress bar.- Specified by:
isHideProgressBarin interfaceIsDefaultToastOptions- Returns:
truewhether to hide the progress bar
-
isHideShadow
public final boolean isHideShadow()
Returnstruewhether to hide the shadow of toast.- Specified by:
isHideShadowin interfaceIsDefaultToastOptions- Returns:
truewhether 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:
isAutoHidein 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:
getTimeoutin interfaceIsDefaultToastOptions- Returns:
- how long the toast notification should last
-
getIcon
public final Img getIcon()
Returns the icon image set for toast.- Specified by:
getIconin interfaceIsDefaultToastOptions- Returns:
- the icon image set for toast
-
getBorderRadius
public int getBorderRadius()
Returns the border radius (in pixels).- Specified by:
getBorderRadiusin 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:
getModifierKeyin 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:
getAlignin interfaceIsDefaultToastOptions- Returns:
- the alignment of the toast action
-
-