Module: Application

Methods

(static) getCurrent() → {fin.desktop.Application}

Returns an instance of the currently running application.

Tutorials:
Returns:
  • fin.desktop.Application Object.
Type
fin.desktop.Application

(static) wrap(uuid) → {fin.desktop.Application}

Returns an Application object that represents an existing application.

Parameters:
Name Type Description
uuid string

The UUID of the application to be wrapped.

Tutorials:
Returns:
  • fin.desktop.Application Object.
Type
fin.desktop.Application

addEventListener(type, listener, callbackopt, errorCallbackopt)

Registers an event listener on the specified event

Parameters:
Name Type Attributes Description
type string

The type of the event.

listener function

will be called whenever an event of the specified type occurs. It is passed an event object containing information related to the event.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

close(forceopt, callbackopt, errorCallbackopt)

Closes the application and any child windows created by the application.

Parameters:
Name Type Attributes Default Description
force boolean <optional>
false

Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

getChildWindows(callbackopt, errorCallbackopt)

Retrieves an array of wrapped fin.desktop.Windows for each of the application’s child windows.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

getGroups(callbackopt, errorCallbackopt)

Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

getManifest(callbackopt, errorCallbackopt)

Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

getParentUuid(callbackopt, errorCallbackopt)

Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

getWindow() → {fin.desktop.Window}

Returns an instance to the main Window of the application

Tutorials:
Returns:

window - fin.desktop.Window

Type
fin.desktop.Window

isRunning(callbackopt, errorCallbackopt)

Determines if the application is currently running.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

registerCustomData(data, callbackopt, errorCallbackopt)

Passes in custom data that will be relayed to the RVM

Parameters:
Name Type Attributes Description
data Object

data to be passed to the RVM

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

removeEventListener(type, listener, callbackopt, errorCallbackopt)

Removes a previously registered event listener from the specified event.

Parameters:
Name Type Attributes Description
type string

The type of the event.

listener function

will be called whenever an event of the specified type occurs. It is passed an event object containing information related to the event.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

removeTrayIcon(callbackopt, errorCallbackopt)

Removes the application’s icon from the tray.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

restart(callbackopt, errorCallbackopt)

Restarts the application.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

run(callbackopt, errorCallbackopt)

Runs the application. When the application is created, run must be called.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

scheduleRestart(callbackopt, errorCallbackopt)

Instructs the RVM to schedule one restart of the application

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

setTrayIcon(iconUrl, listener, callbackopt, errorCallbackopt)

Adds a customizable icon in the system tray and notifies the application when clicked.

Parameters:
Name Type Attributes Description
iconUrl string

Image URL to be used as the icon.

listener function

will be called whenever an event of the specified type occurs. It is passed an event object containing information related to the event.

callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

terminate(callbackopt, errorCallbackopt)

Closes the application by terminating its process.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials:

wait(callbackopt, errorCallbackopt)

Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application to continue and to generate another "not-responding" message after a certain period of time.

Parameters:
Name Type Attributes Description
callback function <optional>

called if the method succeeds.

errorCallback function <optional>

called if the method fails. The reason for failure is passed as an argument.

Tutorials: