Packagefin.desktop
Classpublic class Application
InheritanceApplication Inheritance DesktopEventManager Inheritance Object

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.



Public Properties
 PropertyDefined By
  name : String
[read-only]
Application
  url : String
[read-only]
Application
  uuid : String
[read-only]
Application
  window : Window
[read-only] an instance of the main Window of the application.
Application
Protected Properties
 PropertyDefined By
 Inherited_connection : DesktopConnection
DesktopEventManager
 Inherited_defaultPayload : Object
DesktopEventManager
 Inherited_eventDispatcher : EventDispatcher
DesktopEventManager
 Inherited_eventTopic : String
DesktopEventManager
Public Methods
 MethodDefined By
  
Application(options:ApplicationOptions, callback:Function = null, errorCallback:Function = null)
Application Constructor
Application
  
addEventListener(type:String, listener:Function, callback:Function = null, errorCallback:Function = null):void
[override] Registers an event listener on the specified event.
Application
  
close(force:Boolean = false, callback:Function = null, errorCallback:Function = null):void
Closes the application and any child windows created by the application
Application
 Inherited
dispatchEvent(event:Event):void
DesktopEventManager
  
getChildWindows(callback:Function, errorCallback:Function = null):void
Retrieves an array of wrapped fin.desktop.Windows for each of the application’s child windows.
Application
  
getGroups(callback:Function, errorCallback:Function = null):void
Retrieves an array of active window groups for all of the application's windows.
Application
  
getInstances():Dictionary
[static]
Application
  
getManifest(callback:Function, errorCallback:Function = null):void
Retrieves the JSON manifest that was used to create the application.
Application
  
isRunning(callback:Function, errorCallback:Function = null):void
A test for if application is runngin or not.
Application
  
onGetGroupsCallback(callback:Function, data:Array):void
Application
  
removeEventListener(type:String, listener:Function, callback:Function = null, errorCallback:Function = null):void
[override] Removes a previously registered event listener from the specified event
Application
  
removeTrayIcon(callback:Function = null, errorCallback:Function = null):void
Removes the icon from the tray if there is one.
Application
  
restart(callback:Function = null, errorCallback:Function = null):void
Restarts the application
Application
  
run(callback:Function = null, errorCallback:Function = null):void
Runs the application
Application
  
setTrayIcon(enabledIcon:String, disabledIcon:String, hoverIcon:String, callback:Function = null, errorCallback:Function = null):void
Sets a tray icon for the application
Application
  
terminate(callback:Function = null, errorCallback:Function = null):void
Closes the application by terminating its process.
Application
  
wait(callback:Function = null, errorCallback:Function = null):void
Waits for a hanging application.
Application
  
wrap(uuid:String):Application
[static] Attaches an Application object to an application that already exists
Application
Protected Methods
 MethodDefined By
 Inherited
createPayload(object:Object = null):Object
DesktopEventManager
 Inherited
sendMessage(action:String, payload:Object, callback:Function = null, errorCallback:Function = null):void
DesktopEventManager
Property Detail
nameproperty
name:String  [read-only]


Implementation
    public function get name():String
urlproperty 
url:String  [read-only]


Implementation
    public function get url():String
uuidproperty 
uuid:String  [read-only]


Implementation
    public function get uuid():String
windowproperty 
window:Window  [read-only]

an instance of the main Window of the application.


Implementation
    public function get window():Window

See also

Constructor Detail
Application()Constructor
public function Application(options:ApplicationOptions, callback:Function = null, errorCallback:Function = null)

Application Constructor

Parameters
options:ApplicationOptions — Settings of the application
 
callback:Function (default = null) — A function that is called if the method succeeds.
 
errorCallback:Function (default = null) — A function that is called when method fails.

Events
CLOSED:ApplicationEvent — [dispatched when application has closed]
 
CRASHED:ApplicationEvent — [dispatched when application has crashed]
 
ERROR:ApplicationEvent — [dispatched when there is an error]
 
NOT_RESPONDING:ApplicationEvent — [dispatched when when application is not responding]
 
RESPONDING:ApplicationEvent — [dispatched when application is responding again]
 
RUN_REQUESTED:ApplicationEvent — [dispatched when there is a for running the application]
 
STARTED:ApplicationEvent — [dispatched when application has started]
 
TRAY_ICON_CLICKED:ApplicationEvent — [dispatched when the tray icon has been clicked]

See also

Method Detail
addEventListener()method
override public function addEventListener(type:String, listener:Function, callback:Function = null, errorCallback:Function = null):void

Registers an event listener on the specified event.

Parameters

type:String — Event type
 
listener:Function — A listener that is called whenever an event of the specified type occurs
 
callback:Function (default = null) — A function that is called if the method succeeds
 
errorCallback:Function (default = null) — A function that is called if the method fails


Events
CLOSED
 
CRASHED
 
ERROR
 
NOT_RESPONDING
 
RESPONDING
 
RUN_REQUESTED
 
STARTED
 
TRAY_ICON_CLICKED
close()method 
public function close(force:Boolean = false, callback:Function = null, errorCallback:Function = null):void

Closes the application and any child windows created by the application

Parameters

force:Boolean (default = false) — A function that is called if the method succeeds.
 
callback:Function (default = null) — A function that is called when method fails.
 
errorCallback:Function (default = null)

getChildWindows()method 
public function getChildWindows(callback:Function, errorCallback:Function = null):void

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

Parameters

callback:Function — A function that will be called if successful, and a Vector of fin.desktop.Window will be passed.
 
errorCallback:Function (default = null) — A function that is called on failure.

getGroups()method 
public function getGroups(callback:Function, errorCallback:Function = null):void

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

Parameters

callback:Function — A function that will be called if successful, and nested Vector(Vector of fin.desktop.Window Vectors) will be passed.
 
errorCallback:Function (default = null) — A function that is called on failure.

getInstances()method 
public static function getInstances():Dictionary

Returns
Dictionary
getManifest()method 
public function getManifest(callback:Function, errorCallback:Function = null):void

Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. callback is called and passed an Object containing the JSONObject manifest that was used to create the application.

Parameters

callback:Function — A function that will be called if successful.
 
errorCallback:Function (default = null) — A function that is called on failure.

isRunning()method 
public function isRunning(callback:Function, errorCallback:Function = null):void

A test for if application is runngin or not.

Parameters

callback:Function — A function that gets a boolean value passed to indicating if application is running or not.
 
errorCallback:Function (default = null) — A function that is called when method fails.

onGetGroupsCallback()method 
public function onGetGroupsCallback(callback:Function, data:Array):void

Parameters

callback:Function
 
data:Array

removeEventListener()method 
override public function removeEventListener(type:String, listener:Function, callback:Function = null, errorCallback:Function = null):void

Removes a previously registered event listener from the specified event

Parameters

type:String — Event type
 
listener:Function — A listener to remove
 
callback:Function (default = null) — A function that is called if the method succeeds
 
errorCallback:Function (default = null) — A function that is called if the method fails

removeTrayIcon()method 
public function removeTrayIcon(callback:Function = null, errorCallback:Function = null):void

Removes the icon from the tray if there is one.

Parameters

callback:Function (default = null) — A function that will be called if successful.
 
errorCallback:Function (default = null) — A function that is called on failure.

restart()method 
public function restart(callback:Function = null, errorCallback:Function = null):void

Restarts the application

Parameters

callback:Function (default = null) — A function that is called if the method succeeds.
 
errorCallback:Function (default = null) — A function that is called when method fails.

run()method 
public function run(callback:Function = null, errorCallback:Function = null):void

Runs the application

Parameters

callback:Function (default = null) — A function that is called if the method succeeds.
 
errorCallback:Function (default = null) — A function that is called when method fails.

setTrayIcon()method 
public function setTrayIcon(enabledIcon:String, disabledIcon:String, hoverIcon:String, callback:Function = null, errorCallback:Function = null):void

Sets a tray icon for the application

Parameters

enabledIcon:String — URL to the image that gets used as enabled tray icon
 
disabledIcon:String — URL to the image that gets used as disabled tray icon
 
hoverIcon:String — URL to the image that gets used as hover(mouse over) tray icon
 
callback:Function (default = null) — A function that will be called if successful.
 
errorCallback:Function (default = null) — A function that is called on failure.

terminate()method 
public function terminate(callback:Function = null, errorCallback:Function = null):void

Closes the application by terminating its process.

Parameters

callback:Function (default = null) — A function that is called if the method succeeds.
 
errorCallback:Function (default = null) — A function that is called when method fails.

wait()method 
public function wait(callback:Function = null, errorCallback:Function = null):void

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

callback:Function (default = null)
 
errorCallback:Function (default = null)

wrap()method 
public static function wrap(uuid:String):Application

Attaches an Application object to an application that already exists

Parameters

uuid:String — The UUID of the Application to wrap

Returns
Application — Application