public class ToastBar extends Object
See the StatusBarDemo
Note: the video above refers to the ToastBar based on its development name of StatusBar. This
was changed to avoid confusion with the iOS StatusBar.
| Modifier and Type | Class and Description |
|---|---|
class |
ToastBar.Status
Represents a single status message.
|
| Modifier and Type | Method and Description |
|---|---|
ToastBar.Status |
createStatus()
Creates a new Status.
|
static int |
getDefaultMessageTimeout()
The default timeout for info/error messages
|
String |
getDefaultMessageUIID()
Gets the default UIID to be used for the style of the
ToastBar text. |
String |
getDefaultUIID()
Gets the default UIID to be used for the style of the
ToastBar component. |
static ToastBar |
getInstance()
Gets reference to the singleton StatusBar instance
|
int |
getPosition()
Gets the position of the toast bar on the screen.
|
static void |
setDefaultMessageTimeout(int aDefaultMessageTimeout)
The default timeout for info/error messages
|
void |
setDefaultMessageUIID(String defaultMessageUIID)
Sets the default UIID to be used for the style of the
ToastBar text. |
void |
setDefaultUIID(String defaultUIID)
Sets the defaults UIID to be used for the style of the
ToastBar component. |
void |
setPosition(int position)
Sets the position of the toast bar on the screen.
|
void |
setVisible(boolean visible)
Shows or hides the
ToastBar. |
static void |
showConnectionProgress(String message,
ConnectionRequest cr,
SuccessCallback<NetworkEvent> onSuccess,
FailureCallback<NetworkEvent> onError) |
static void |
showErrorMessage(String msg)
Simplifies a common use case of showing an error message with an error icon that fades out after a few seconds
|
static ToastBar.Status |
showErrorMessage(String msg,
int timeout)
Simplifies a common use case of showing an error message with an error icon that fades out after a few seconds
|
static ToastBar.Status |
showInfoMessage(String msg)
Simplifies a common use case of showing an information message with an info icon that fades out after a few seconds
|
static ToastBar.Status |
showMessage(String msg,
char icon)
Simplifies a common use case of showing an error message with an error icon that fades out after a few seconds
|
static ToastBar.Status |
showMessage(String msg,
char icon,
ActionListener listener)
Simplifies a common use case of showing an error message with an error icon that fades out after a few seconds
|
static ToastBar.Status |
showMessage(String msg,
char icon,
int timeout)
Simplifies a common use case of showing a message with an icon that fades out after a few seconds
|
static ToastBar.Status |
showMessage(String msg,
char icon,
int timeout,
ActionListener listener)
Simplifies a common use case of showing a message with an icon that fades out after a few seconds
|
ToastBar |
useFormLayeredPane(boolean useFormLayeredPane)
By default the ToastBar uses the LayeredPane.
|
public static int getDefaultMessageTimeout()
public static void setDefaultMessageTimeout(int aDefaultMessageTimeout)
aDefaultMessageTimeout - the defaultMessageTimeout to setpublic static ToastBar getInstance()
public String getDefaultUIID()
ToastBar component.
By default this is "ToastBarComponent".public void setDefaultUIID(String defaultUIID)
ToastBar component. By default
this is "ToastBarComponent"defaultUIID - the defaultUIID to setpublic String getDefaultMessageUIID()
ToastBar text. By default
this is "ToastBarMessage"public ToastBar useFormLayeredPane(boolean useFormLayeredPane)
Key use-case is for displaying the ToastBar over a Sheet, which is on the FormLayeredPane. If you don't set this to true, then the ToastBar will be displayed behind the Sheet.
useFormLayeredPane - True to use the form layered pane to display the toastbar.public void setDefaultMessageUIID(String defaultMessageUIID)
ToastBar text. By default this is
"ToastBarMessage"defaultMessageUIID - the defaultMessageUIID to setpublic int getPosition()
Component.TOP or Component.BOTTOM.public void setPosition(int position)
position - the position to set Should be one of Component.TOP and Component.BOTTOMpublic ToastBar.Status createStatus()
public void setVisible(boolean visible)
ToastBar.visible - public static void showErrorMessage(String msg)
msg - the error messagepublic static ToastBar.Status showMessage(String msg, char icon, int timeout, ActionListener listener)
msg - the messageicon - the material icon to show from FontImagetimeout - the timeout value in millisecondslistener - the action to perform when the ToastBar is tappedpublic static ToastBar.Status showMessage(String msg, char icon, int timeout)
msg - the messageicon - the material icon to show from FontImagetimeout - the timeout value in millisecondspublic static ToastBar.Status showMessage(String msg, char icon, ActionListener listener)
msg - the messageicon - the material icon to show from FontImagelistener - the action to perform when the ToastBar is tappedpublic static ToastBar.Status showMessage(String msg, char icon)
icon - the material icon to show from FontImagemsg - the messagepublic static ToastBar.Status showInfoMessage(String msg)
msg - the messagepublic static ToastBar.Status showErrorMessage(String msg, int timeout)
msg - the error messagetimeout - the timeout value in millisecondspublic static void showConnectionProgress(String message, ConnectionRequest cr, SuccessCallback<NetworkEvent> onSuccess, FailureCallback<NetworkEvent> onError)