Application source
Specializes Target
The application is a singleton, it initially loads and oversees the running
program.
It is also responsible for window management.
The behavior of the application can be modified by implementing a delegate
{Application#delegate}.
It is also possible to subclass the application by specifying an
applicationPrototype"
in the package.json
.
Properties
-
acceptsActiveTarget :boolean source
-
Whether or not this target can accept user focus and become the activeTarget This matches up with the
document.activeElement
property purpose-wise; Events from components that should be dispatched as logically occurring at the point of user focus should be dispatched at the activeTargetBy default a target does not accept this responsibility.
Inherited From: Default Value: - false
-
attachedWindows :Array.<MontageWindow> source
-
An array of the child windows attached to the application.
Default Value: - {Array} []
-
delegate :Object source
-
The application's delegate object, it can implement a
willFinishLoading
method that will be called right after the index.html is loaded. The application delegate is also the next event target after the application.Default Value: - null
-
eventManager :EventManager source
-
Provides a reference to the Montage event manager used in the application.
-
focusWindow :MontageWindow source
-
Return the top most window of any of the Montage Windows.
Default Value: - document.defaultView
-
isActiveTarget :boolean <readonly> source
-
Whether or not this is the activeTarget
This is a getter and is not bindable. Bind to
defaultEventManager.activeTarget == this
.Inherited From: -
mainApplication :Application source
-
Provides a reference to the main application.
Default Value: - this
-
parentApplication :Application source
-
Provides a reference to the parent application.
Default Value: - null
-
window :MontageWindow source
-
Provides a reference to the MontageWindow associated with the application.
-
windows :Array.<MontageWindow> source
-
Provides a reference to all the windows opened by the main application or any of its descendents, including the main window itself. The list is kept sorted, the sort order is determined by the
Application.windowsSortOrder
property -
windowsSortOrder :string source
-
Determines the sort order for the Application.windows array. Possible values are: z-order, reverse-z-order, open-order, reverse-open-order
Default Value: - "reverse-z-order"
Methods
-
addEventListener(type, listener, useCapture) source
-
Adds an event listener to the object.
Parameters:
Name Type Description type
string The event type to listen for.
listener
object | function The listener object or function.
useCapture
boolean Specifies whether to listen for the event during the bubble or capture phases.
Inherited From: -
attachWindow(window) source
-
Attach a window to a parent application. When a window open, it is automatically attached to the Application used to create the window.
Parameters:
Name Type Description window
MontageWindow to detach.
-
detachWindow(window) source
-
Detach the window from its parent application. If no montageWindow is specified, the current application's windows will be detached.
Parameters:
Name Type Description window
MontageWindow to detach.
-
didBecomeActiveTarget() source
-
Called after to this target became the activeTarget
Inherited From: -
dispatchEvent(event) source
-
Dispatches the specified event with this target as the event's proximal target
Parameters:
Name Type Description event
Event The event object to dispatch
Inherited From: -
dispatchEventNamed(type, canBubble, cancelable, detail) source
-
Creates and dispatches an event with the specified properties with this target as the event's proximal target
Parameters:
Name Type Description type
string The type of the event to dispatch
canBubble
boolean Whether or not the event can bubble
cancelable
boolean Whether or not the event can be cancelled
detail
Object The optional detail object of the event
Inherited From: -
eventManagerForWindow(aWindow) source
-
Returns the event manager for the specified window object.
Parameters:
Name Type Description aWindow
Window The browser window whose event manager object should be returned.
Returns:
aWindow.defaultEventMananger
-
openWindow(component,, name,, parameters,) source
-
Opens a component in a new browser window, and registers the window with the Montage event manager.
The component URL must be in the same domain as the calling script. Can be relative to the main application
Parameters:
Name Type Description component,
string the path to the reel component to open in the new window.
name,
string the component main class name.
parameters,
Object the new window parameters (accept same parameters than window.open).
Example
var app = document.application; app.openWindow("docs/help.reel", "Help", "{width:300, height:500}");
-
removeEventListener(type, listener, useCapture) source
-
Removes an event listener from the object.
Parameters:
Name Type Description type
string The event type.
listener
object | function The listener object or function.
useCapture
boolean The phase of the event listener.
Inherited From: -
surrendersActiveTarget(newTarget) → {boolean} source
-
Ask this target to surrender its activeTarget status.
Parameters:
Name Type Description newTarget
Target the Target that is about to become the
activeTarget
Inherited From: Returns: boolean
Whether or not to surrender activeTarget status
-
willBecomeActiveTarget(oldTarget) source
-
Called prior to this target becoming the activeTarget
Parameters:
Name Type Description oldTarget
Target the current activeTarget
Inherited From:
Generated from v0.14.14