public class System extends Object
| Constructor and Description |
|---|
System(DesktopConnection connection)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(String type,
EventListener listener,
AckListener callback)
Registers an event listener on the specified event
Supported system event types are:
deskband-icon-clicked
desktop-icon-clicked
monitor-info-changed
|
void |
clearCache(boolean cache,
boolean cookies,
boolean localStorage,
boolean appcache,
boolean userData)
Clears cached data containing window state/positions,
application resource files (images, HTML, JavaScript files)
cookies, and items stored in the Local Storage.
|
void |
clearCache(boolean cache,
boolean cookies,
boolean localStorage,
boolean appcache,
boolean userData,
AckListener listener)
Clears cached data containing window state/positions,
application resource files (images, HTML, JavaScript files)
cookies, and items stored in the Local Storage.
|
void |
deleteCacheOnRestart()
Clears all cached data when App Desktop is restarted
|
void |
deleteCacheOnRestart(AckListener listener)
Clears all cached data when App Desktop is restarted
|
void |
exit()
Exits App Desktop
|
void |
exit(AckListener listener)
Exits App Desktop
|
void |
getAllApplications(AckListener callback)
Retrieves an array of data (uuid, running/active state) for all application windows
The object passed to callback takes the form:
[
{
uuid: (string) uuid of the application,
isRunning: (bool) true when the application is running/active
},
...
|
void |
getAllWindows(AckListener listener)
The object passed to callback takes the form:
[
{
uuid: (string) uuid of the application,
mainWindow: {
name: (string) name of the main window,
top: (integer) top-most coordinate of the main window,
right: (integer) right-most coordinate of the main window,
bottom: (integer) bottom-most coordinate of the main window,
left: (integer) left-most coordinate of the main window
},
childWindows: [{
name: (string) name of the child window,
top: (integer) top-most coordinate of the child window,
right: (integer) right-most coordinate of the child window,
bottom: (integer) bottom-most coordinate of the child window,
left: (integer) left-most coordinate of the child window
},
...
|
void |
getCommandLineArguments(AckListener listener)
Retrieves the command line argument string that started App Desktop
|
void |
getConfig(String section,
AckListener callback)
Retrieves the App Desktop's configuration
|
void |
getDeviceId(AckListener listener)
Gets Device ID
|
void |
getLog(String logName,
AckListener listener)
Retrieves the contents of the log with the specified filename
|
void |
getLogList(AckListener listener)
Retrieves an array of data objects for all available logs
Each object in the returned array takes the form:
{
name: (string) the filename of the log,
size: (integer) the size of the log in bytes,
date: (integer) the unix time at which the log was created
}
|
void |
getMonitorInfo(AckListener listener)
Retrieves an object that contains data about the about the
monitor setup of the computer that App Desktop is running on.
|
void |
getMousePosition(AckListener listener)
Returns the mouse in virtual screen coordinates (left, top)
The returned object takes the form:
{
top: (integer) the top position of the mouse in virtual screen
coordinates,
left: (integer) the left position of the mouse in virtual screen
coordinates
}
|
void |
getProcessList(AckListener listener)
Retrieves an array of all App Desktop processes that are currently running
Each element in the array is an object containing the uuid
and the name of the application to which the process belongs.
|
void |
getProxySettings(AckListener listener)
Retrieves the proxy settings object
The proxy object the callback receives takes the following form:
{
type: (string) "system" or "named",
proxyAddress: (string) the address of the proxy server,
proxyPort: (integer) the port of proxy server
}
|
void |
getVersion(AckListener listener)
Gets AppDesktop version number
|
void |
hideStartWindow()
Hides the start menu window
|
void |
hideStartWindow(AckListener listener)
Hides the start menu window
|
void |
installDeskbandIcon(String enabledIcon,
String disabledIcon,
String hoverIcon)
Installs a start icon in the Windows Deskband
|
void |
installDeskbandIcon(String enabledIcon,
String disabledIcon,
String hoverIcon,
AckListener listener)
Installs a start icon in the Windows Deskband
|
void |
installStartIcon(String enabledIcon,
String disabledIcon,
String hoverIcon)
Installs a start icon in the notification tray
|
void |
installStartIcon(String enabledIcon,
String disabledIcon,
String hoverIcon,
AckListener listener)
Installs a start icon in the notification tray
|
void |
launchExternalProcess(String path,
String commandLine,
AsyncCallback<LaunchExternalProcessResult> callback,
AckListener listener)
Runs an executable or batch file.
|
void |
log(String level,
String message)
Writes a message to the log
|
void |
log(String level,
String message,
AckListener listener)
Writes a message to the log
|
void |
openUrlWithBrowser()
Opens the passed URL
|
void |
openUrlWithBrowser(AckListener listener)
Opens the passed URL
|
void |
releaseExternalProcess(String processUuid,
AckListener callback)
Removes the process entry for the passed UUID obtained
from a previous call to DesktopSystem.launchExternalProcess().
|
void |
removeDeskbandIcon()
Removes a start icon from the Windows Deskband
|
void |
removeDeskbandIcon(AckListener listener)
Removes a start icon from the Windows Deskband
|
void |
removeEventListener(String type,
EventListener listener,
AckListener callback)
Removes a previously registered event listener from the specified event
Supported system event types are:
deskband-icon-clicked
desktop-icon-clicked
monitor-info-changed
|
void |
removeStartIcon()
Removes a start icon from the notification tray
|
void |
removeStartIcon(AckListener listener)
Removes a start icon from the notification tray
|
void |
showDeveloperTools(String applicationUUID,
String windowName,
AckListener callback)
Shows Developer tool
|
void |
showStartWindow()
Shows the start menu window
|
void |
showStartWindow(AckListener listener)
Shows the start menu window
|
void |
terminateExternalProcess(String processUuid,
int timeout,
boolean killTree,
AsyncCallback<TerminateExternalProcessResult> callback,
AckListener listener)
Attempts to cleanly close an external process and terminates it
if the close has not occured after the elapsed timeout in milliseconds.
|
void |
updateProxySettings(String type,
String proxyAddress,
int proxyPort,
AckListener listener)
Updates the proxy settings
The passed type can be either "system" or "named".
|
public System(DesktopConnection connection)
connection - Connection object to the AppDesktopDesktopConnectionpublic void getDeviceId(AckListener listener)
listener - AckListener for device IDAckListenerpublic void getVersion(AckListener listener)
listener - AckListener for version numberAckListenerpublic void getCommandLineArguments(AckListener listener)
listener - AckListener for command line argumentAckListenerpublic void getProcessList(AckListener listener)
listener - AckListener for process listAckListenerpublic void getLog(String logName, AckListener listener)
logName - The filename of the loglistener - AckListener for log contentsAckListenerpublic void getLogList(AckListener listener)
listener - AckListener for log listAckListenerpublic void log(String level, String message)
level - The log level for the entry. Can be either "info", "warning" or "error"message - The log message textpublic void log(String level, String message, AckListener listener)
level - The log level for the entry. Can be either "info", "warning" or "error"message - The log message textlistener - AckListener for the resultAckListenerpublic void getProxySettings(AckListener listener)
listener - AckListener for the requestAckListenerpublic void updateProxySettings(String type, String proxyAddress, int proxyPort, AckListener listener)
type - Type of the proxyproxyAddress - Address of the proxyproxyPort - Port of the proxylistener - AckListener for the requestAckListenerpublic void installStartIcon(String enabledIcon, String disabledIcon, String hoverIcon)
enabledIcon - URL of icon when app is enableddisabledIcon - URL of icon when app is disabledhoverIcon - URL of icon for hover overpublic void installDeskbandIcon(String enabledIcon, String disabledIcon, String hoverIcon)
enabledIcon - URL of icon when app is enableddisabledIcon - URL of icon when app is disabledhoverIcon - URL of icon for hover overpublic void clearCache(boolean cache,
boolean cookies,
boolean localStorage,
boolean appcache,
boolean userData)
cache - If true, clears chrome cachescookies - If true, deletes all cookieslocalStorage - If true, clear application cachesappcache - If true, clears local storageuserData - If true, clears user datapublic void clearCache(boolean cache,
boolean cookies,
boolean localStorage,
boolean appcache,
boolean userData,
AckListener listener)
cache - If true, clears chrome cachescookies - If true, deletes all cookieslocalStorage - If true, clear application cachesappcache - If true, clears local storageuserData - If true, clears user datalistener - AckListener for the requestAckListenerpublic void deleteCacheOnRestart()
public void deleteCacheOnRestart(AckListener listener)
listener - AckListener for the requestAckListenerpublic void installStartIcon(String enabledIcon, String disabledIcon, String hoverIcon, AckListener listener)
enabledIcon - URL of icon when app is enableddisabledIcon - URL of icon when app is disabledhoverIcon - URL of icon for hover overlistener - AckListener for the requestAckListenerpublic void installDeskbandIcon(String enabledIcon, String disabledIcon, String hoverIcon, AckListener listener)
enabledIcon - URL of icon when app is enableddisabledIcon - URL of icon when app is disabledhoverIcon - URL of icon for hover overlistener - AckListener for the requestAckListenerpublic void openUrlWithBrowser(AckListener listener)
listener - AckListener for the requestAckListenerpublic void removeStartIcon()
public void removeStartIcon(AckListener listener)
listener - AckListener for the requestAckListenerpublic void removeDeskbandIcon()
public void removeDeskbandIcon(AckListener listener)
listener - AckListener for the requestAckListenerpublic void showStartWindow()
public void showStartWindow(AckListener listener)
listener - AckListener for the requestAckListenerpublic void hideStartWindow()
public void hideStartWindow(AckListener listener)
listener - AckListener for the requestAckListenerpublic void getMonitorInfo(AckListener listener)
listener - AckListener for the requestAckListenerpublic void getAllWindows(AckListener listener)
listener - AckListener for the requestAckListenerpublic void getAllApplications(AckListener callback)
callback - public void exit()
public void exit(AckListener listener)
listener - AckListener for the requestAckListenerpublic void getMousePosition(AckListener listener)
listener - AckListener for the requestAckListenerpublic void openUrlWithBrowser()
public void getConfig(String section, AckListener callback)
section - Which section to return from the configurationcallback - AckListener for the requestAckListenerpublic void showDeveloperTools(String applicationUUID, String windowName, AckListener callback)
applicationUUID - The application IDwindowName - The name of dev tool windowcallback - AckListener for the requestAckListenerpublic void addEventListener(String type, EventListener listener, AckListener callback)
listener - EventListener for the eventcallback - AckListener for the requestEventListener,
AckListenerpublic void removeEventListener(String type, EventListener listener, AckListener callback)
listener - EventListener for the eventcallback - AckListener for the requestEventListener,
AckListenerpublic void launchExternalProcess(String path, String commandLine, AsyncCallback<LaunchExternalProcessResult> callback, AckListener listener)
path - The path of the file to launch via the command linecommandLine - The command line arguments to passcallback - A function that is called if the method succeedslistener - A function that is called if the method failsAsyncCallback,
LaunchExternalProcessResult,
AckListenerpublic void terminateExternalProcess(String processUuid, int timeout, boolean killTree, AsyncCallback<TerminateExternalProcessResult> callback, AckListener listener)
processUuid - The UUID for a process launched by DesktopSystem.launchExternalProcess()timeout - The time in milliseconds to wait for a close to occur before terminatingkillTree - callback - A function that is called if the method succeed with result code being passedlistener - A function that is called if the method failsterminateExternalProcess,
TerminateExternalProcessResult,
AckListenerpublic void releaseExternalProcess(String processUuid, AckListener callback)
processUuid - The UUID for a process launched by DesktopSystem.launchExternalProcess()callback - AckListener for the requestAckListenerCopyright © 2014. All rights reserved.