Class ToastItem


  • public final class ToastItem
    extends NativeObjectContainer
    Represents an toast instance, once it has been created and consumed.
    Author:
    Andrea "Stock" Stocchero
    • 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 the Div 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
      • getLabel

        public List<String> getLabel()
        Returns the label of toast.
        Returns:
        the label of 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.