|
MeVisLab Web Toolkit Reference
|
The application class manages the steps to create the web application. More...
Public Member Functions | |
| closeBrowserWindow (windowName) | |
| Closes a window that was created by MLAB.GUI.Application.createBrowserWindow(). | |
| createBrowserWindow (windowName, windowTitle, specs) | |
| Creates a new browser window with the given name, title, and specifications. | |
| createModule (moduleType, moduleName, moduleIsReadyCallback, connectionSettings) | |
| Creates a new module. | |
| destroyModule () | |
| enableLeaveCurrentPageConfirmationDialog (message, conditionalCallback) | |
| Registers a handler for the beforeunload event that may cause a confirmation dialog to popup. | |
| getArguments () | |
| Returns the application arguments, which may be specified as url arguments or as attributes of the arguments object that is passed to initialize(). | |
| getBrowserWindow (windowName) | |
| Returns a window that was created by MLAB.GUI.Application.createBrowserWindow(). | |
| initialize (args) | |
| Initializes the global application instance. | |
| module (moduleName) | |
| Returns the module by the given name. | |
| modules () | |
| Returns all parent modules that are created. | |
| setClientSettings (clientSettings) | |
| Sets the settings from the client which should be passed to the remote worker process. | |
| setConnectedHandler (handler) | |
| Sets the connected handler. | |
| setConnectionErrorHandler (handler) | |
| Sets the connection error handler. | |
| setConnectionTimeoutHandler (handler) | |
| Sets the connection timeout handler. | |
| setDisconnectedHandler (handler) | |
| Sets the disconnected handler. | |
| setRequestTimeoutHandler (handler) | |
| Sets the request timeout handler. | |
| showError () | |
| Displays an error as an alert. | |
| shutdown () | |
| Shuts the application down by disconnecting all module contexts and closing all browser windows. | |
Signals | |
See MLAB.Core.Object about use. # | |
| showLoadDialog () | |
| Is emitted when a load dialog should be shown. | |
| hideLoadDialog () | |
| Is emitted when a load dialog should be hidden again. | |
| moduleWindowCreated (windowControl) | |
| Is emitted when a module panel is created. | |
| creatingModuleContexts () | |
| Is emitted immediately before the module contexts are created. | |
| allPluginsLoaded () | |
| Is emitted when all plugins have been loaded. | |
| modulesAreReady () | |
| Is emitted immediately when the module objects are fully initialized. | |
| Public Member Functions inherited from MLAB.Core.Object | |
| __init__ () | |
| Creates a new MLAB.Core.Object. | |
| blockSignals (blocked) | |
| Sets if signals are blocked, which means that signals are suppressed in situations where they would have been emitted. | |
| connect (signal, receiver, slot) | |
| Connects a signal of this object to the slot of the receiver. | |
| connectCallback (signal, callback) | |
| Connects a signal of this object to the given callback function. | |
| connectSignal (signal, receiver, targetSignal) | |
| Connects a signal of this object to the signal of the receiver, so that if this signal is emitted, the target signal on the receiver is also emitted. | |
| disconnect (signal, receiver, signal) | |
| Disconnects a signal of this object from the slot of the receiver. | |
| disconnectCallback (signal, callback) | |
| Disconnects a signal of this object from the given callback function. | |
| disconnectReceiver (signal, receiver) | |
| Disconnects a signal of this object from all slots of the receiver. | |
| emit (signal) | |
| Emits a signal. | |
| isSignalRegistered () | |
| Returns true if the given signal is registered. | |
| registerSignal (signal) | |
| Registers a signal. | |
| signalsBlocked () | |
| Returns true if signals are blocked. | |
Protected Member Functions | |
| _allPluginsLoaded () | |
| This is called when all plugins have been loaded. | |
| _createModuleContextCreator () | |
| _handleCoreModulesLoaded () | |
| This is called after the core modules (core and gui) have been loaded. | |
| _notifyModulesAreReady (modules) | |
The application class manages the steps to create the web application.
It evaluates the (url) arguments, loads the core resources, instantiates and loads plugins, notifies connected objects about certain states, and creates specified modules.
is emitted when the application start creating module contexts.
|
protected |
This is called when all plugins have been loaded.
The application initialization is now finished, so it calls the callback that was provided in initialize().
|
protected |
|
protected |
|
protected |
| modules | An array of MLAB.Core.Module instances. |
| MLAB.GUI.Application.allPluginsLoaded | ( | ) |
| MLAB.GUI.Application.closeBrowserWindow | ( | windowName | ) |
Closes a window that was created by MLAB.GUI.Application.createBrowserWindow().
| windowName | The name of the window. |
| MLAB.GUI.Application.createBrowserWindow | ( | windowName, | |
| windowTitle, | |||
| specs ) |
Creates a new browser window with the given name, title, and specifications.
See the documentation of window.open() for more information about the specifications, typically it includes the width and height. Note that the function may return null if the browser has blocked the window.
| windowName | The name of the window. |
| windowTitle | The title for the new window. |
| specs | A dictionary containing the specifications. See the documentation of window.open() for more information. |
| MLAB.GUI.Application.createModule | ( | moduleType, | |
| moduleName, | |||
| moduleIsReadyCallback, | |||
| connectionSettings ) |
Creates a new module.
| moduleType | The module type. |
| moduleName | The instance name of the module. This is optional. By default the module type is the instance name. |
| moduleIsReadyCallback | This callback is optional. If given, it will be called when the module has finished its initialization. |
| connectionSettings | Optional dictionary to override global connection settings. |
| MLAB.GUI.Application.creatingModuleContexts | ( | ) |
| MLAB.GUI.Application.enableLeaveCurrentPageConfirmationDialog | ( | message, | |
| conditionalCallback ) |
Registers a handler for the beforeunload event that may cause a confirmation dialog to popup.
If the conditionalCallback function is given and if it returns false, then the confirmation dialog is not shown.
| message | The confirmation message that may be shown (e.g. Firefox >= 4 shows always the same message) |
| conditionalCallback | Optional function that prevents the confirmation dialog, if it returns false. |
| MLAB.GUI.Application.getArguments | ( | ) |
Returns the application arguments, which may be specified as url arguments or as attributes of the arguments object that is passed to initialize().
| MLAB.GUI.Application.getBrowserWindow | ( | windowName | ) |
Returns a window that was created by MLAB.GUI.Application.createBrowserWindow().
| windowName | The name of the window. |
| MLAB.GUI.Application.hideLoadDialog | ( | ) |
| MLAB.GUI.Application.initialize | ( | args | ) |
Initializes the global application instance.
The initialization callback is called after all plugins have been loaded. The arguments is an optional map containing any of the arguments that may also be specified as url arguments. See also getArguments().
| args | An optional object with attributes that are handled like page arguments. |
| MLAB.GUI.Application.module | ( | moduleName | ) |
Returns the module by the given name.
The name may include multiple names divided by dots to access sub modules.
| moduleName | The module name. |
| MLAB.GUI.Application.modules | ( | ) |
Returns all parent modules that are created.
| MLAB.GUI.Application.modulesAreReady | ( | ) |
| MLAB.GUI.Application.moduleWindowCreated | ( | windowControl | ) |
Is emitted when a module panel is created.
| windowControl | the created window, a MLAB.GUI.WidgetControl |
| MLAB.GUI.Application.setClientSettings | ( | clientSettings | ) |
Sets the settings from the client which should be passed to the remote worker process.
This can be used to specify which locale the worker should use for translations: MLAB.GUI.Application.setClientSettings({"locale": "de_DE"})
| clientSettings | A JSON dictonary that contains the client settings. |
| MLAB.GUI.Application.setConnectedHandler | ( | handler | ) |
Sets the connected handler.
It is called with the module context as argument when the web socket connection is established. Example:
| handler |
| MLAB.GUI.Application.setConnectionErrorHandler | ( | handler | ) |
Sets the connection error handler.
It is called with the module context and error event as arguments when an error in the web socket connection occurs. Example:
| handler |
| MLAB.GUI.Application.setConnectionTimeoutHandler | ( | handler | ) |
Sets the connection timeout handler.
It is called with the module context as argument when a timeout in the web socket connection occurs. Example:
| handler |
| MLAB.GUI.Application.setDisconnectedHandler | ( | handler | ) |
Sets the disconnected handler.
It is called with the module context, the disconnect reason, and possible details when the web socket connections is unexpectedly closed. Example:
| handler |
| MLAB.GUI.Application.setRequestTimeoutHandler | ( | handler | ) |
Sets the request timeout handler.
It is called with the module context and request details as arguments when a web socket request timeout occurs. Example:
| handler |
| MLAB.GUI.Application.showError | ( | ) |
| MLAB.GUI.Application.showLoadDialog | ( | ) |
| MLAB.GUI.Application.shutdown | ( | ) |