|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.ui.notifier.AbstractNotifier
public abstract class AbstractNotifier
AbstractNotifier is a generic representation of a system notifier. It also provides factory methods to retrieve the current platform's notifier instance, if there is one.
A notifier serves the purpose of displaying notifications to the screen, to inform the user of an event when the application is not visible (in the background).
The notifier instance returnd by getNotifier() is platform-dependent. At this time, two notifier
implementations are available:
GrowlNotifier: for Mac OS X, requires Growl to be installed
SystemTrayNotifier: for Java 1.6 and up, using the java.awt.SystemTray API
| Field Summary |
|---|
| Fields inherited from interface com.mucommander.ui.notifier.NotificationTypes |
|---|
NOTIFICATION_TYPE_JOB_COMPLETED, NOTIFICATION_TYPE_JOB_ERROR |
| Constructor Summary | |
|---|---|
AbstractNotifier()
|
|
| Method Summary | |
|---|---|
void |
displayBackgroundNotification(int notificationType,
java.lang.String title,
java.lang.String description)
Displays a notification with the specified type, title and description and returns true if the
notification could be displayed. |
abstract boolean |
displayNotification(int notificationType,
java.lang.String title,
java.lang.String description)
Displays a notification with the specified type, title and description and returns true if the
notification could be displayed. |
static AbstractNotifier |
getNotifier()
Returns an AbstractNotifier instance that can be used on the current platform, null if none
is available. |
abstract java.lang.String |
getPrettyName()
Returns a pretty name for the underlying notification system that can be displayed to the end user. |
static boolean |
isAvailable()
Returns true |
abstract boolean |
isEnabled()
Returns true if this notifier is enabled and ready to display notifications. |
abstract boolean |
setEnabled(boolean enabled)
Enables/disables this notifier and returns true if the operation succeeded. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractNotifier()
| Method Detail |
|---|
public static boolean isAvailable()
true if an AbstractNotifier instance is available. In other words, if true is
returned, getNotifier() will return a non-null value.
- Returns:
- true if an AbstractNotifier instance is available
public static AbstractNotifier getNotifier()
null if none
is available.
Note that the returned AbstractNotifier must be enabled before it can be used, which is not
guaranteed to succeed.
public void displayBackgroundNotification(int notificationType,
java.lang.String title,
java.lang.String description)
true if the
notification could be displayed. The notification will not be displayed if the current muCommander window
(or one of its child windows) is presently in the foreground, so that the user doesn't get notified for things
that he/she can already see on the screen.
The notification will not be displayed if:
Note that this method is executed in a separate thread after all pending Swing events have been processed,
to ensure in the event of a window being made inactive that the notification will not be triggered. This method
immediately return s(i.e. does not wait for pending events) and thus is not be able to return if the notification
was displayed or not, unlike displayNotification(int, String, String).
notificationType - one of the available notification types, see NotificationTypes for possible valuestitle - the title of the notification to displaydescription - the description of the notification to displaypublic abstract boolean setEnabled(boolean enabled)
true if the operation succeeded. A typical case
for returning false, is when the underlying notification system (e.g. Growl under Mac OS X) could not be reached.
enabled - true to enable this notifier, false to disable it
public abstract boolean isEnabled()
true if this notifier is enabled and ready to display notifications.
public abstract boolean displayNotification(int notificationType,
java.lang.String title,
java.lang.String description)
true if the
notification could be displayed. Unlike displayBackgroundNotification(int, String, String), the
notification will be attempted for display even if muCommander is currently in the foreground.
Returns true if the notification could be displayed, false if:
notificationType - one of the available notification types, see NotificationTypes for possible valuestitle - the title of the notification to displaydescription - the description of the notification to display
public abstract java.lang.String getPrettyName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard