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)
Closes the application with a listener that gets called if the method succeeds
|
void |
close(Boolean force,
AckListener listener)
Closes the application with a listener that gets called if the method succeeds
|
protected DesktopConnection |
getConnection()
Returns the applications connection object
|
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 |
remove()
Removes the application from memory.
|
void |
remove(AckListener listener)
Removes the application from memory.
|
void |
removeEventListener(String type,
EventListener listener,
AckListener callback)
Removes a previously registered event listener from the specified event
|
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 |
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,
AckListenerpublic static Application wrap(String uuid, DesktopConnection connection)
uuid - The UUID of the Application to wrapconnection - Connection object to the AppDesktopDesktopConnectionpublic void run()
public void run(AckListener listener)
listener - The listener that gets called if the method succeedsAckListenerpublic void restart()
public void restart(AckListener listener)
listener - The listener that gets called if the method succeedsAckListenerpublic void close()
public void close(AckListener listener)
listener - The listener that gets called if the method succeedsAckListenerpublic void close(Boolean force, AckListener listener)
force - When true the close can not be prevented through the window event 'close-requested'listener - The listener that gets called if the method succeedsAckListenerpublic void terminate()
public void terminate(AckListener listener)
listener - The listener that gets called if the method succeedsAckListenerpublic void waitFor()
public void waitFor(AckListener listener)
listener - The listener that gets called if the method succeedsAckListenerpublic void remove()
public void remove(AckListener listener)
listener - The listener that gets called if the method succeedsAckListenerpublic void getManifest(AckListener listener)
listener - The listener that gets called if the method succeedsAckListenerpublic Window getWindow()
public ApplicationOptions getOptions()
protected String getUuid()
protected DesktopConnection getConnection()
DesktopConnectionpublic void addEventListener(String type, EventListener listener, AckListener callback)
type - Event typelistener - A listener that is called whenever an event of the specified type occurscallback - A function that is called if the method succeedsEventListener,
ActionEventpublic void removeEventListener(String type, EventListener listener, AckListener callback)
type - Event typelistener - A listener to removecallback - AckListener for the requestEventListener,
ActionEventCopyright © 2014. All rights reserved.