|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openfin.desktop.Application
public class Application
An object representing the Application. Allows the developer to execute, show and close an application, as well as show and hide an icon on Desktop. Also provides access to the Window object for the main application window to control window state such as the ability to minimize, maximize, restore, etc.
| Constructor Summary | |
|---|---|
Application(ApplicationOptions options,
DesktopConnection connection,
AckListener listener)
Application Constructor |
|
| Method Summary | |
|---|---|
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 |
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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| Method Detail |
|---|
public static Application wrap(String uuid,
DesktopConnection connection)
uuid - The UUID of the Application to wrapconnection - Connection object to the AppDesktop
DesktopConnection
public void run()
throws DesktopIOException,
DesktopException
DesktopIOException
DesktopExceptionDesktopIOException,
DesktopExceptionpublic void run(AckListener listener)
listener - The listener that gets called if the method succeedsAckListener
public void restart()
throws DesktopIOException,
DesktopException
DesktopIOException
DesktopExceptionDesktopIOException,
DesktopExceptionpublic void restart(AckListener listener)
listener - The listener that gets called if the method succeedsAckListener
public void close()
throws DesktopIOException,
DesktopException
DesktopIOException
DesktopExceptionDesktopIOException,
DesktopExceptionpublic 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 succeeds
DesktopExceptionAckListener
public void terminate()
throws DesktopIOException,
DesktopException
DesktopIOException
DesktopExceptionDesktopIOException,
DesktopExceptionpublic void terminate(AckListener listener)
listener - The listener that gets called if the method succeedsAckListener
public void waitFor()
throws DesktopIOException,
DesktopException
DesktopIOException
DesktopExceptionDesktopIOException,
DesktopExceptionpublic void waitFor(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()
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 succeeds
DesktopExceptionEventListener,
ActionEvent
public void removeEventListener(String type,
EventListener listener,
AckListener callback)
throws DesktopException
type - Event typelistener - A listener to removecallback - AckListener for the request
DesktopExceptionEventListener,
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 request
DesktopExceptionEventListener,
ActionEvent
public void removeTrayIcon(AckListener callback)
throws DesktopException
callback - AckListener for the request
DesktopException
public void createChildWindow(WindowOptions windowOptions,
AckListener callback)
throws DesktopException
windowOptions - WindowOptions object for the requested child window.callback - AckListener for the request
DesktopException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||