public final class ToastOptionsBuilder extends AbstractBaseBuilder
Toaster
options by a builder.Modifier and Type | Method and Description |
---|---|
ToastOptions |
build()
Returns a configured toast options.
|
static ToastOptionsBuilder |
create()
Returns new builder instance.
|
static ToastOptionsBuilder |
create(IsToastType type)
Returns new builder instance, setting the toast type.
|
ToastOptionsBuilder |
setActionBackgroundColor(IsColor backgroundColor)
Sets the background color of action.
|
ToastOptionsBuilder |
setActionBackgroundColor(String backgroundColor)
Sets the background color of action.
|
ToastOptionsBuilder |
setActionBorderColor(IsColor borderColor)
Sets the border color of action.
|
ToastOptionsBuilder |
setActionBorderColor(String borderColor)
Sets the border color of action.
|
ToastOptionsBuilder |
setActionBorderRadius(int borderRadius)
Sets the border radius (in pixels) of toast action.
|
ToastOptionsBuilder |
setActionBorderStyle(BorderStyle style)
Sets the border style set for the action element.
|
ToastOptionsBuilder |
setActionBorderWidth(int borderWidth)
Sets the border width of action.
|
ToastOptionsBuilder |
setActionColor(IsColor color)
Sets the font color of action.
|
ToastOptionsBuilder |
setActionColor(String color)
Sets the font color of action.
|
ToastOptionsBuilder |
setActionFontFamily(String family)
Sets the font family, follows CSS font-family options of action.
|
ToastOptionsBuilder |
setActionFontLineHeight(double lineHeight)
Sets the line height of action.
|
ToastOptionsBuilder |
setActionFontLineHeight(String lineHeight)
Sets the line height of action.
|
ToastOptionsBuilder |
setActionFontSize(int size)
Sets the font size of action.
|
ToastOptionsBuilder |
setActionFontStyle(FontStyle style)
Sets the font style, follows CSS font-style options (i.e.
|
ToastOptionsBuilder |
setActionFontWeight(Weight weight)
Sets the font weight, follows CSS font-style-weight options of action.
|
ToastOptionsBuilder |
setActions(ActionItem... actions)
Sets the actions to the toast.
|
ToastOptionsBuilder |
setActions(List<ActionItem> actions)
Sets the actions to the toast.
|
ToastOptionsBuilder |
setAlign(Align align)
Sets the alignment of the toast action.
|
ToastOptionsBuilder |
setAutoHide(boolean hide)
Sets whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked.
|
ToastOptionsBuilder |
setBorderRadius(int borderRadius)
Sets the border radius (in pixels) of toast container.
|
ToastOptionsBuilder |
setClickEventHandler(ClickEventHandler clickEventHandler)
Sets the CLICK event hander.
|
ToastOptionsBuilder |
setCloseHandler(CloseHandler closeHandler)
Sets the CLOSE hander.
|
ToastOptionsBuilder |
setHideProgressBar(boolean hide)
Sets
true whether to hide the progress bar. |
ToastOptionsBuilder |
setHideShadow(boolean hide)
Sets
true whether to hide the shadow of toast. |
ToastOptionsBuilder |
setIcon(Img icon)
Sets the icon image set for toast.
|
ToastOptionsBuilder |
setLabelColor(IsColor color)
Sets the font color of label.
|
ToastOptionsBuilder |
setLabelColor(String color)
Sets the font color of label.
|
ToastOptionsBuilder |
setLabelFontFamily(String family)
Sets the font family, follows CSS font-family options of label.
|
ToastOptionsBuilder |
setLabelFontLineHeight(double lineHeight)
Sets the line height of label.
|
ToastOptionsBuilder |
setLabelFontLineHeight(String lineHeight)
Sets the line height of label.
|
ToastOptionsBuilder |
setLabelFontSize(int size)
Sets the font size of label.
|
ToastOptionsBuilder |
setLabelFontStyle(FontStyle style)
Sets the font style, follows CSS font-style options (i.e.
|
ToastOptionsBuilder |
setLabelFontWeight(Weight weight)
Sets the font weight, follows CSS font-style-weight options of label.
|
ToastOptionsBuilder |
setModifierKey(ModifierKey modifierKey)
Sets the modifier key to close the toast by clicking on it.
|
ToastOptionsBuilder |
setOpenHandler(OpenHandler openHandler)
Sets the OPEN hander.
|
ToastOptionsBuilder |
setProgressBarHeight(int height)
Sets the height (in pixels) of the toast progress bar.
|
ToastOptionsBuilder |
setProgressBarType(IsProgressBarType type)
Sets the type of the toast progress bar.
|
ToastOptionsBuilder |
setTimeout(int timeout)
Sets how long the toast notification should last.
|
ToastOptionsBuilder |
setTitleColor(IsColor color)
Sets the font color of title.
|
ToastOptionsBuilder |
setTitleColor(String color)
Sets the font color of title.
|
ToastOptionsBuilder |
setTitleFontFamily(String family)
Sets the font family, follows CSS font-family options of title.
|
ToastOptionsBuilder |
setTitleFontLineHeight(double lineHeight)
Sets the line height of title.
|
ToastOptionsBuilder |
setTitleFontLineHeight(String lineHeight)
Sets the line height of title.
|
ToastOptionsBuilder |
setTitleFontSize(int size)
Sets the font size of title.
|
ToastOptionsBuilder |
setTitleFontStyle(FontStyle style)
Sets the font style, follows CSS font-style options (i.e.
|
ToastOptionsBuilder |
setTitleFontWeight(Weight weight)
Sets the font weight, follows CSS font-style-weight options of title.
|
ToastOptionsBuilder |
setType(IsToastType type)
Sets the type of the toast.
|
isBuilt, setBuilt
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkAndGetIfValid, checkIfValid, isValid
public static ToastOptionsBuilder create()
public static ToastOptionsBuilder create(IsToastType type)
type
- the type of the toastpublic ToastOptions build()
public ToastOptionsBuilder setTitleColor(IsColor color)
color
- font color of titlepublic ToastOptionsBuilder setTitleColor(String color)
color
- font color of titlepublic ToastOptionsBuilder setTitleFontSize(int size)
size
- the font size of title.public ToastOptionsBuilder setTitleFontStyle(FontStyle style)
style
- Font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit) of title.public ToastOptionsBuilder setTitleFontFamily(String family)
family
- Font family, follows CSS font-family options of title.public ToastOptionsBuilder setTitleFontWeight(Weight weight)
weight
- font weight, follows CSS font-style-weight options of title.public ToastOptionsBuilder setTitleFontLineHeight(double lineHeight)
lineHeight
- the line height of title.public ToastOptionsBuilder setTitleFontLineHeight(String lineHeight)
lineHeight
- the line height of title.public ToastOptionsBuilder setLabelColor(IsColor color)
color
- font color of labelpublic ToastOptionsBuilder setLabelColor(String color)
color
- font color of labelpublic ToastOptionsBuilder setLabelFontSize(int size)
size
- the font size of label.public ToastOptionsBuilder setLabelFontStyle(FontStyle style)
style
- Font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit) of label.public ToastOptionsBuilder setLabelFontFamily(String family)
family
- Font family, follows CSS font-family options of label.public ToastOptionsBuilder setLabelFontWeight(Weight weight)
weight
- font weight, follows CSS font-style-weight options of label.public ToastOptionsBuilder setLabelFontLineHeight(double lineHeight)
lineHeight
- the line height of label.public ToastOptionsBuilder setLabelFontLineHeight(String lineHeight)
lineHeight
- the line height of label.public ToastOptionsBuilder setActionColor(IsColor color)
color
- font color of actionpublic ToastOptionsBuilder setActionColor(String color)
color
- font color of actionpublic ToastOptionsBuilder setActionFontSize(int size)
size
- the font size of action.public ToastOptionsBuilder setActionFontStyle(FontStyle style)
style
- Font style, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit) of action.public ToastOptionsBuilder setActionFontFamily(String family)
family
- Font family, follows CSS font-family options of action.public ToastOptionsBuilder setActionFontWeight(Weight weight)
weight
- font weight, follows CSS font-style-weight options of action.public ToastOptionsBuilder setActionFontLineHeight(double lineHeight)
lineHeight
- the line height of action.public ToastOptionsBuilder setActionFontLineHeight(String lineHeight)
lineHeight
- the line height of action.public ToastOptionsBuilder setActionBackgroundColor(IsColor backgroundColor)
backgroundColor
- the background color of action.public ToastOptionsBuilder setActionBackgroundColor(String backgroundColor)
backgroundColor
- the background color of action.public ToastOptionsBuilder setActionBorderWidth(int borderWidth)
borderWidth
- the border width of action.public ToastOptionsBuilder setActionBorderColor(IsColor borderColor)
borderColor
- the border color of action.public ToastOptionsBuilder setActionBorderColor(String borderColor)
borderColor
- the border color of action.public ToastOptionsBuilder setActionBorderRadius(int borderRadius)
borderRadius
- the border radius (in pixels) of toast actionpublic ToastOptionsBuilder setActionBorderStyle(BorderStyle style)
style
- the border styles set for the action element.public ToastOptionsBuilder setType(IsToastType type)
type
- the type of the toastpublic ToastOptionsBuilder setProgressBarType(IsProgressBarType type)
type
- the type of the toast progress barpublic ToastOptionsBuilder setHideProgressBar(boolean hide)
true
whether to hide the progress bar.hide
- true
whether to hide the progress barpublic ToastOptionsBuilder setAutoHide(boolean hide)
hide
- whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clickedpublic ToastOptionsBuilder setTimeout(int timeout)
timeout
- how long the toast notification should lastpublic ToastOptionsBuilder setIcon(Img icon)
icon
- the icon image set for toastpublic ToastOptionsBuilder setBorderRadius(int borderRadius)
borderRadius
- the border radius (in pixels) of toast containerpublic ToastOptionsBuilder setActions(ActionItem... actions)
actions
- the actions to the toastpublic ToastOptionsBuilder setActions(List<ActionItem> actions)
actions
- the actions to the toastpublic ToastOptionsBuilder setProgressBarHeight(int height)
height
- the height (in pixels) of the toast progress barpublic ToastOptionsBuilder setHideShadow(boolean hide)
true
whether to hide the shadow of toast.hide
- true
whether the shadow of toastpublic ToastOptionsBuilder setModifierKey(ModifierKey modifierKey)
modifierKey
- the modifier key to close the toast by clicking on itpublic ToastOptionsBuilder setAlign(Align align)
align
- the alignment of the toast actionpublic ToastOptionsBuilder setClickEventHandler(ClickEventHandler clickEventHandler)
clickEventHandler
- the CLICK event hander.public ToastOptionsBuilder setOpenHandler(OpenHandler openHandler)
openHandler
- the OPEN hander.public ToastOptionsBuilder setCloseHandler(CloseHandler closeHandler)
closeHandler
- the CLOSE hander.