public abstract class NotifyService
extends java.lang.Object
NotifyService
makes it possible to centralize control and display
notifications in a single process for the current host (either a physical or
virtual machine), in such a way several processes can make use of DS Desktop
Notify without colliding with each other, even those where the Java platform
is not necesarily present.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DARK_THEME
String for the stock dark theme.
|
static java.lang.String |
LIGHT_THEME
String for the stock light theme.
|
static int |
LISTENING_PORT
The port that will be used for instance control.
|
Constructor and Description |
---|
NotifyService() |
Modifier and Type | Method and Description |
---|---|
static NotifyService |
get()
Returns the currently active notification service for this device.
|
abstract void |
postNotification(java.lang.String title,
java.lang.String message,
java.lang.Integer type,
java.lang.Integer align,
java.lang.Long timeout,
java.lang.String themeName)
Posts a new notification to the service, setting the parameters needed
for it.
|
protected static void |
reset()
Called by the inner system, clears any existing instance data so the
service lookup can be done once again.
|
abstract void |
start()
Starts the service, in case it hasn't been started yet.
|
abstract void |
stop()
Stops the service, in case it's running.
|
public static final int LISTENING_PORT
public static final java.lang.String DARK_THEME
public static final java.lang.String LIGHT_THEME
public static NotifyService get()
protected static void reset()
public abstract void start()
public abstract void postNotification(java.lang.String title, java.lang.String message, java.lang.Integer type, java.lang.Integer align, java.lang.Long timeout, java.lang.String themeName)
title
- The title to display.message
- The message to display.type
- The notification type (0~7).align
- The text/layout alignment (0,1).timeout
- The maximum time in milliseconds the notification will
stay on screen.themeName
- Either "light" or "dark", refering to the two stock
themes available.DARK_THEME
,
LIGHT_THEME
public abstract void stop()