public class Notification
extends java.lang.Object
show(String)
will not encode the strings passed into them,
thus the formatting of messages at 'client-side' is allowed.
User input should be escaped carefully.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TYPE_ERROR
Notification type: error
|
static java.lang.String |
TYPE_INFO
Notification type: information
|
static java.lang.String |
TYPE_WARNING
Notification type: warning
|
Constructor and Description |
---|
Notification() |
Modifier and Type | Method and Description |
---|---|
static void |
show(java.lang.String msg)
Shows a message at the center of the browser window.
|
static void |
show(java.lang.String msg,
boolean closable)
Shows a message at the center of the browser window.
|
static void |
show(java.lang.String msg,
Component ref)
Shows a message at the right side of the given component.
|
static void |
show(java.lang.String msg,
Component ref,
boolean closable)
Shows a message at the right side of the given component.
|
static void |
show(java.lang.String msg,
java.lang.String type,
Component ref,
int x,
int y,
int duration)
Displays a message.
|
static void |
show(java.lang.String msg,
java.lang.String type,
Component ref,
int x,
int y,
int duration,
boolean closable)
Displays a message.
|
static void |
show(java.lang.String msg,
java.lang.String type,
Component ref,
java.lang.String position,
int duration)
Displays a message.
|
static void |
show(java.lang.String msg,
java.lang.String type,
Component ref,
java.lang.String position,
int duration,
boolean closable)
Displays a message.
|
public static final java.lang.String TYPE_INFO
public static final java.lang.String TYPE_WARNING
public static final java.lang.String TYPE_ERROR
public static void show(java.lang.String msg, java.lang.String type, Component ref, java.lang.String position, int duration, boolean closable)
msg
- the message to showtype
- available types are "info", "warning", "error"ref
- the referenced component, null to be based on browser windowposition
- predefined positions.
Available options are:
duration
- the duration of notification in millisecond. If zero or
negative the notification does not dismiss until user left-clicks outside
of the notification box.closable
- whether to close notification manually or not. If true there will be a
close button on notification message and won't close until user click the button
or duration time up, default false.public static void show(java.lang.String msg, java.lang.String type, Component ref, int x, int y, int duration, boolean closable)
msg
- the message to showtype
- available types are "info", "warning", "error"ref
- the referenced component, null to be based on browser windowx
- the horizontal position of the notification, aligned at top-left (in pixel)y
- the vertical position of the notification, aligned at top-left (in pixel)duration
- the duration of notification in millisecond. If zero or
negative the notification does not dismiss until user left-clicks outside
of the notification box.closable
- whether to close notification manually or not. If true there will be a
close button on notification message and won't close until user click the button
or duration time up, default false.public static void show(java.lang.String msg, java.lang.String type, Component ref, int x, int y, int duration)
msg
- the message to showtype
- available types are "info", "warning", "error"ref
- the referenced component, null to be based on browser windowx
- the horizontal position of the notification, aligned at top-left (in pixel)y
- the vertical position of the notification, aligned at top-left (in pixel)duration
- the duration of notification in millisecond. If zero or
negative the notification does not dismiss until user left-clicks outside
of the notification box.public static void show(java.lang.String msg, java.lang.String type, Component ref, java.lang.String position, int duration)
msg
- the message to showtype
- available types are "info", "warning", "error"ref
- the referenced component, null to be based on browser windowposition
- predefined positions.
Available options are:
duration
- the duration of notification in millisecond. If zero or
negative the notification does not dismiss until user left-clicks outside
of the notification box.public static void show(java.lang.String msg, Component ref, boolean closable)
msg
- the message to showref
- the referenced component, null to be based on browser windowclosable
- whether to close notification manually or not. If true there will be a
close button on notification message and won't close until user click the button
or duration time up, default false.public static void show(java.lang.String msg, Component ref)
msg
- the message to showref
- the referenced component, null to be based on browser windowpublic static void show(java.lang.String msg)
msg
- the message to showpublic static void show(java.lang.String msg, boolean closable)
msg
- the message to showclosable
- whether to close notification manually or not. If true there will be a
close button on notification message and won't close until user click the button
or duration time up, default false.Copyright © 2005-2022 Potix Corporation. All Rights Reserved.