public class Application extends Object
Constructor and Description |
---|
Application(ApplicationOptions options,
DesktopConnection connection,
AckListener listener)
Application Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(String type,
EventListener listener,
AckListener callback)
Registers an event listener on the specified event.
|
void |
close()
Closes the application and any child windows created by the application
|
void |
close(AckListener listener)
Deprecated.
use close() instead.
|
void |
close(Boolean force,
AckListener listener)
Closes the application with a listener that gets called if the method succeeds
|
void |
createChildWindow(WindowOptions windowOptions,
AckListener callback)
Create a child window of this application
|
protected DesktopConnection |
getConnection()
Returns the applications connection object
|
void |
getGroups(AsyncCallback<List<List<Window>>> groupHandler,
AckListener callback)
Retrieves an array of active window groups for all of the application's windows.
|
void |
getManifest(AckListener listener)
Retrieves the JSON manifest that was used to create the application.
|
ApplicationOptions |
getOptions()
Get the ApplicationOptions object for the application
|
protected String |
getUuid()
Get UUID of this Application
|
Window |
getWindow()
Returns an instance to the main Window of the application.
|
void |
removeEventListener(String type,
EventListener listener,
AckListener callback)
Removes a previously registered event listener from the specified event
|
void |
removeTrayIcon(AckListener callback)
Removes the application’s icon from the tray.
|
void |
restart()
Restarts the application
|
void |
restart(AckListener listener)
Restarts the application with a listener that gets called if the method succeeds
|
void |
run()
Runs the application
|
void |
run(AckListener listener)
Runs the application with a listener that gets called if the method succeeds
|
void |
setTrayIcon(String iconUrl,
EventListener listener,
AckListener callback)
Adds a customizable icon in the system tray and notifies the application when clicked
|
void |
terminate()
Closes the application by terminating its process.
|
void |
terminate(AckListener listener)
Closes the application by terminating its process.
|
void |
waitFor()
Waits for a hanging application.
|
void |
waitFor(AckListener listener)
Waits for a hanging application.
|
static Application |
wrap(String uuid,
DesktopConnection connection)
Attaches an Application object to an application that already exists
|
public Application(ApplicationOptions options, DesktopConnection connection, AckListener listener)
options
- Settings of the applicationconnection
- Connection object to the AppDesktop.listener
- function that is called if the method succeeds.ApplicationOptions
,
DesktopConnection
,
AckListener
public static Application wrap(String uuid, DesktopConnection connection)
uuid
- The UUID of the Application to wrapconnection
- Connection object to the AppDesktopDesktopConnection
public void run() throws DesktopException
DesktopException
- if application fails to runDesktopException
public void run(AckListener listener)
listener
- The listener that gets called if the method succeedsAckListener
public void restart() throws DesktopException
DesktopException
- if application fails to restartDesktopException
public void restart(AckListener listener)
listener
- The listener that gets called if the method succeedsAckListener
public void close() throws DesktopException
DesktopException
- if application fails to closeDesktopException
public void close(AckListener listener)
listener
- The listener that gets called if the method succeedsAckListener
public void close(Boolean force, AckListener listener) throws DesktopException
force
- When true the close can not be prevented through the window event 'close-requested'. If force is false, AckListener is being ignoredlistener
- The listener that gets called if the method succeedsDesktopException
- if application fails to closeAckListener
public void terminate() throws DesktopException
DesktopException
- if application fails to terminateDesktopException
public void terminate(AckListener listener)
listener
- The listener that gets called if the method succeedsAckListener
public void waitFor() throws DesktopException
DesktopException
- if application fails to wait for a hanging applicationDesktopException
public void waitFor(AckListener listener)
listener
- The listener that gets called if the method succeedsAckListener
public void getManifest(AckListener listener)
listener
- The listener that gets called if the method succeedsAckListener
public Window getWindow()
public ApplicationOptions getOptions()
protected String getUuid()
protected DesktopConnection getConnection()
DesktopConnection
public void addEventListener(String type, EventListener listener, AckListener callback) throws DesktopException
type
- Event typelistener
- A listener that is called whenever an event of the specified type occurscallback
- A function that is called if the method succeedsDesktopException
- if this methos fails to add event listenerEventListener
,
ActionEvent
public void removeEventListener(String type, EventListener listener, AckListener callback) throws DesktopException
type
- Event typelistener
- A listener to removecallback
- AckListener for the requestDesktopException
- if this methd fails to remove an event listenerEventListener
,
ActionEvent
public void setTrayIcon(String iconUrl, EventListener listener, AckListener callback) throws DesktopException
iconUrl
- Image URL to be used as the iconlistener
- will be called whenever an event of the specified type occurs. It is passed an event object containing information related to the eventcallback
- AckListener for the requestDesktopException
- if this methed fails to set tray iconEventListener
,
ActionEvent
public void removeTrayIcon(AckListener callback) throws DesktopException
callback
- AckListener for the requestDesktopException
- if this method fails to remove tray icnpublic void createChildWindow(WindowOptions windowOptions, AckListener callback) throws DesktopException
windowOptions
- WindowOptions object for the requested child window.callback
- AckListener for the requestDesktopException
- if this method fails to create a child windowpublic void getGroups(AsyncCallback<List<List<Window>>> groupHandler, AckListener callback)
groupHandler
- A class that receives a list of wrapped windows in the same group.callback
- AckListener for the requestAsyncCallback
,
AckListener
Copyright © 2017. All rights reserved.