public class Main extends Object implements RouterApp, NotificationService, MenuService
Modifier and Type | Field and Description |
---|---|
static String |
PROP_ENABLE |
Constructor and Description |
---|
Main() |
Main(RouterContext ctx,
ClientAppManager mgr,
String[] args) |
Modifier and Type | Method and Description |
---|---|
MenuHandle |
addMenu(String message,
MenuCallback callback)
Menu will start out shown and enabled, in the root menu
|
MenuHandle |
addMenu(String message,
MenuCallback callback,
MenuHandle parent)
Menu will start out enabled, as a submenu
|
boolean |
cancel(int id)
Cancel a notification if possible.
|
void |
disableMenu(MenuHandle item) |
void |
enableMenu(MenuHandle item) |
String |
getDisplayName()
The display name of the ClientApp, used in user interfaces.
|
String |
getName()
The generic name of the ClientApp, used for registration,
e.g.
|
ClientAppState |
getState()
The current state of the ClientApp.
|
void |
hideMenu(MenuHandle item) |
static void |
main(String[] args) |
int |
notify(String source,
String category,
int priority,
String title,
String message,
String path)
Send a notification to the user.
|
void |
removeMenu(MenuHandle item) |
void |
showMenu(MenuHandle item) |
void |
shutdown(String[] args)
Do not take a long time.
|
void |
startup()
Do not take a long time.
|
boolean |
update(int id,
String title,
String message,
String path)
Update the text of a notification if possible.
|
void |
updateMenu(String message,
MenuHandle item) |
public static final String PROP_ENABLE
public Main(RouterContext ctx, ClientAppManager mgr, String[] args)
public Main()
public static void main(String[] args)
public int notify(String source, String category, int priority, String title, String message, String path)
notify
in interface NotificationService
source
- unsupportedcategory
- unsupportedpriority
- unsupportedtitle
- for the popup, translatedmessage
- translatedpath
- unsupportedpublic boolean cancel(int id)
cancel
in interface NotificationService
id
- as received from notify()public boolean update(int id, String title, String message, String path)
update
in interface NotificationService
id
- as received from notify()title
- for the popup, translatedmessage
- translatedpath
- in console starting with /, must be URL-escaped, or nullpublic MenuHandle addMenu(String message, MenuCallback callback)
addMenu
in interface MenuService
message
- for the menu, translatedcallback
- fired on clickpublic MenuHandle addMenu(String message, MenuCallback callback, MenuHandle parent)
addMenu
in interface MenuService
message
- for the menu, translatedcallback
- fired on clickparent
- the parent menu this will be a submenu of, or null for top levelpublic void removeMenu(MenuHandle item)
removeMenu
in interface MenuService
public void showMenu(MenuHandle item)
showMenu
in interface MenuService
public void hideMenu(MenuHandle item)
hideMenu
in interface MenuService
public void enableMenu(MenuHandle item)
enableMenu
in interface MenuService
public void disableMenu(MenuHandle item)
disableMenu
in interface MenuService
public void updateMenu(String message, MenuHandle item)
updateMenu
in interface MenuService
public void startup()
ClientApp
public void shutdown(String[] args)
ClientApp
public ClientAppState getState()
ClientApp
public String getName()
ClientApp
public String getDisplayName()
ClientApp
getDisplayName
in interface ClientApp