Class ToastBar.Status
- Enclosing class:
ToastBar
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears this status message.getIcon()Gets the icon (may be null) that is displayed with this status.Returns the listener added to perform a particular action.Returns the text that will be displayed for this status.Gets the UIID to use for styling the text of this status message.intReturns the progress of this status.getUiid()Gets the UIID that should be used for styling the status component while this status is displayed.booleanReturns
voidsetExpires(int millis) Directs the status to be cleared (if it isn't already cleared() after a given number of milliseconds.voidSets the icon that is to be displayed with this status.voidsetListener(ActionListener listener) Sets the action listener needed to perform an action when the bar is tappedToastBar.voidsetMessage(String message) Sets the message that should be displayed in theToastBar.voidsetMessageUIID(String messageUIID) Sets the UIID to use for styling the text of this status message.voidsetProgress(int progress) Sets the progress (-1..100) that should be displayed in the progress bar for this status.voidsetShowProgressIndicator(boolean showProgressIndicator) Sets whether this status message should include an infinite progress indicator (e.g. spinning beach ball).voidSets the UIID that should be used for styling the status component while this status is displayed.voidshow()Shows this status message.voidshowDelayed(int millis) Schedules this status message to be shown after a specified number of milliseconds, if it hasn't been cleared or shown first.
-
Method Details
-
setExpires
public void setExpires(int millis) Directs the status to be cleared (if it isn't already cleared() after a given number of milliseconds.
Parameters
millis: @param millis The maximum number of milliseconds that the status message should be displayed for. Helpful for error messages that only need to be displayed for a few seconds.
-
show
public void show()Shows this status message. Call this method after making any changes to the status that you want to have displayed. This will always cause any currently-displayed status to be replaced by this status.
If you don't want to show the status immediately, but rather to wait some delay, you can use the
#showDelayed(int)method instead.See also
- #showDelayed(int)
-
showDelayed
public void showDelayed(int millis) Schedules this status message to be shown after a specified number of milliseconds, if it hasn't been cleared or shown first.
This is handy if you want to show a status for an operation that usually completes very quickly, but could potentially hang. In such a case you might decide not to display a status message at all unless the operation takes more than 500ms to complete.
If you want to show the status immediately, use the
#show()method instead.Parameters
millis: Number of milliseconds to wait before showing the status.
-
clear
public void clear()Clears this status message. This any pending "showDelayed" requests for this status. -
getMessage
Returns the text that will be displayed for this status.
Returns
the message
-
setMessage
Sets the message that should be displayed in the
ToastBar.Parameters
message
-
getListener
Returns the listener added to perform a particular action.
Returns
the listener
-
setListener
Sets the action listener needed to perform an action when the bar is tapped
ToastBar.Parameters
listener
-
getProgress
public int getProgress()Returns the progress of this status. A value of -1 indicates that the progress bar should not be shown. Values between 0 and 100 inclusive will be rendered on a progress bar (slider) in the status component.
Returns
the progress
-
setProgress
public void setProgress(int progress) Sets the progress (-1..100) that should be displayed in the progress bar for this status. When set to -1 it will act as an infinite progress
Parameters
progress
-
getIcon
Gets the icon (may be null) that is displayed with this status.
Returns
the icon
-
setIcon
Sets the icon that is to be displayed with this status. Set this to null to not show an icon.
Parameters
icon: the icon to set
-
isShowProgressIndicator
public boolean isShowProgressIndicator()Returns
the showProgressIndicator
-
setShowProgressIndicator
public void setShowProgressIndicator(boolean showProgressIndicator) Sets whether this status message should include an infinite progress indicator (e.g. spinning beach ball).
Parameters
showProgressIndicator: the showProgressIndicator to set
-
getMessageUIID
Gets the UIID to use for styling the text of this status message.
Returns
the messageUIID
-
setMessageUIID
Sets the UIID to use for styling the text of this status message.
Parameters
messageUIID: the messageUIID to set
-
getUiid
Gets the UIID that should be used for styling the status component while this status is displayed.
Returns
the uiid
-
setUiid
Sets the UIID that should be used for styling the status component while this status is displayed.
Parameters
uiid: the uiid to set
-