Class ToastItem
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.utils.toast.ToastItem
-
public final class ToastItem extends NativeObjectContainer
Represents an toast instance, once it has been created and consumed.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
getContext()
Returns the unmodifiable toast context.Date
getDateTime(ActionItem action)
Returns the date time when the action invocation was applied to the toast.Date
getDateTime(Status status)
Returns the date time when the status was applied to the toast.Date
getDateTime(ToastItemAction action)
Returns the date time when the action invocation was applied to the toast.Div
getElement()
Returns theDiv
element which represents the toast in the DOM.int
getId()
Returns the unique id of toast item.List<String>
getLabel()
Returns the label of toast.ToastItemOptions
getOptions()
Returns the toast options.Status
getStatus()
Returns the status of the toast.String
getTitle()
Returns the title of the toast.void
hide()
Closes the item if is opened.Status
show()
Shows the toast item.String
toString()
-
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
-
-
-
-
Method Detail
-
getId
public int getId()
Returns the unique id of toast item.- Returns:
- the unique id of toast item
-
getContext
public Map<String,Object> getContext()
Returns the unmodifiable toast context.- Returns:
- the unmodifiable toast context.
-
getDateTime
public Date getDateTime(Status status)
Returns the date time when the status was applied to the toast.- Parameters:
status
- the status to get the date time- Returns:
- the date time when the status was applied to the toast
-
getDateTime
public Date getDateTime(ActionItem action)
Returns the date time when the action invocation was applied to the toast.- Parameters:
action
- the action to get the date time- Returns:
- the date time when the action invocation was applied to the toast
-
getDateTime
public Date getDateTime(ToastItemAction action)
Returns the date time when the action invocation was applied to the toast.- Parameters:
action
- the action to get the date time- Returns:
- the date time when the action invocation was applied to the toast
-
getStatus
public Status getStatus()
Returns the status of the toast.- Returns:
- the status of the toast
-
getElement
public Div getElement()
Returns theDiv
element which represents the toast in the DOM.- Returns:
- the
Div
element which represents the toast in the DOM
-
getTitle
public String getTitle()
Returns the title of the toast.- Returns:
- the title of the toast
-
getOptions
public ToastItemOptions getOptions()
Returns the toast options.- Returns:
- the toast options
-
show
public Status show()
Shows the toast item.- Returns:
- the status if the toast has been shown
-
hide
public void hide()
Closes the item if is opened.
-
-