|
java-gnome version 4.0.19 | ||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.freedesktop.bindings.Pointer
org.freedesktop.bindings.Proxy
org.gnome.glib.Object
org.gnome.notify.Notification
public class Notification
Notification represents an actual item to be displayed by notification
system. You can simply create and display a Notification after the system
is initialized with Notify.init()
.
Nested Class Summary | |
---|---|
static interface |
Notification.Action
Callback invoked when an added action is invoked. |
static interface |
Notification.Closed
Signal emmitted when a notification is closed. |
Field Summary | |
---|---|
static int |
NOTIFY_EXPIRES_DEFAULT
Constant for default timeout duration. |
static int |
NOTIFY_EXPIRES_NEVER
Constant for infinite timeout duration. |
Constructor Summary | |
---|---|
Notification(String summary,
String body,
String icon)
Create a new notification. |
Method Summary | |
---|---|
void |
addAction(String actionID,
String label,
Notification.Action action)
Add an action to a notification. |
void |
clearActions()
Remove all added actions. |
void |
clearHints()
Clear hints from the notification. |
void |
close()
Hide the notification on screen. |
void |
connect(Notification.Closed handler)
Hook up a handler to receive Notification.Closed events on
this Notification. |
void |
setCategory(String category)
Set the category of the notification which may later be used to display or filter out the notification. |
void |
setHint(String key,
byte value)
Sets a hint with a byte value. |
void |
setHint(String key,
byte[] value)
Sets a hint with a byte array data. |
void |
setHint(String key,
double value)
Sets a hint with a double value. |
void |
setHint(String key,
int value)
Sets a hint with an integer value. |
void |
setHint(String key,
String value)
Sets a hint with a string value. |
void |
setIcon(Pixbuf icon)
Sets the icon of the notification from a Pixbuf . |
void |
setTimeout(int timeout)
Set the timeout that the notification disappears in milliseconds. |
void |
setUrgency(Urgency urgency)
Sets the urgency to one of LOW ,
NORMAL , or CRITICAL . |
void |
show()
Display the notification on screen. |
void |
update(String summary,
String body,
String icon)
Updates the notification with given parameters see Notification() for
parameters. |
Methods inherited from class org.freedesktop.bindings.Pointer |
---|
toString |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NOTIFY_EXPIRES_DEFAULT
public static final int NOTIFY_EXPIRES_NEVER
Constructor Detail |
---|
public Notification(String summary, String body, String icon)
The summary appears on the titlebar of notification and body appears as its text. Icon may be a string defining a theme icon or the filename identifying the icon that appears next to text.
Note that all but summary can be null
.
Method Detail |
---|
public void addAction(String actionID, String label, Notification.Action action)
Note that for some bizarre reason the new Notify-OSD of Ubuntu Linux
does not support actions at all. To determine if notification system
supports actions look for "actions"
in
capabilities.
Notify.getServerCapabilities()
public void clearActions()
public void clearHints()
public void close()
public void connect(Notification.Closed handler)
Notification.Closed
events on
this Notification.
public void setCategory(String category)
public void setHint(String key, byte value)
Hints are interpreted by the notification system in various ways to modify the notification behavior and/or appearance. See the "Hints" section in Desktop Notifications Specification for standard hints and their interpretations.
public void setHint(String key, byte[] value)
setHint()
for further details.
public void setHint(String key, double value)
setHint()
for further details.
public void setHint(String key, int value)
setHint()
for further details.
Example: "x"
(sets the horizontal position of the
notification)
public void setHint(String key, String value)
setHint()
for further details.
Example: "sound-file"
(adds sound to the notification)
public void setIcon(Pixbuf icon)
Pixbuf
.
public void setTimeout(int timeout)
NOTIFY_EXPIRES_DEFAULT
for
the default timeout duration. Use
NOTIFY_EXPIRES_NEVER
for
infinite timeout duration.
public void setUrgency(Urgency urgency)
LOW
,
NORMAL
, or CRITICAL
.
public void show()
public void update(String summary, String body, String icon)
Notification()
for
parameters.
|
![]() java-gnome |
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |