diff options
author | Derrell Lipman <derrell@samba.org> | 2007-01-05 21:42:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:37:04 -0500 |
commit | 33009ef6ad77597f326f72e4c678c7032ea968a2 (patch) | |
tree | a3a85a19548ebea9719b53d31eb33285351c8457 /webapps/swat/source/class/swat/main/Module.js | |
parent | 40b71722e184e82de6c030d56af6943854599e19 (diff) | |
download | samba-33009ef6ad77597f326f72e4c678c7032ea968a2.tar.gz samba-33009ef6ad77597f326f72e4c678c7032ea968a2.tar.bz2 samba-33009ef6ad77597f326f72e4c678c7032ea968a2.zip |
r20574: reorganization of common modules
(This used to be commit 5075e008941177d5be1d9471387c9d27aba65f81)
Diffstat (limited to 'webapps/swat/source/class/swat/main/Module.js')
-rw-r--r-- | webapps/swat/source/class/swat/main/Module.js | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/webapps/swat/source/class/swat/main/Module.js b/webapps/swat/source/class/swat/main/Module.js new file mode 100644 index 0000000000..ef71eae625 --- /dev/null +++ b/webapps/swat/source/class/swat/main/Module.js @@ -0,0 +1,74 @@ +/* + * Copyright: + * (C) 2006 by Derrell Lipman + * All rights reserved + * + * License: + * LGPL 2.1: http://creativecommons.org/licenses/LGPL/2.1/ + */ + +/** + * This class defines a module descriptor (the registration of a module) and + * maintains the list of modules that have been registered. + * + * A Module object contains the following public properties which may be + * accessed directly by name: + * + * fsm - + * The finite state machine for this module. + * + * canvas - + * The canvas on which to create the gui for this module + * + * name - + * The name of this module + * + * class - + * The class for this module + * + * @param moduleName {string} + * The name of the module being registered. This is the name that will + * appear in the Modules menu. + * + * @param class {class} + * The class which contains the module implementation. That class must + * extend swat.main.AbstractModule and implement a singleton interface + * that provides a public method called initialAppear() which takes this + * Module object as a parameter, and creates the finite state machine for + * the module (if applicable) and builds the graphical user interface for + * the module. + */ +qx.OO.defineClass("swat.main.Module", qx.core.Object, +function(moduleName, class) +{ + qx.core.Object.call(this); + + // Initialize commonly-used properties of a module + this.canvas = null; + this.fsm = null; + this.gui = null; + + // Save the module name + this.name = moduleName; + + // Save this class name + this.class = class; + + // Add this new module to the module list. + swat.main.Module._list[moduleName] = this; +}); + + +/** + * Return the list of modules + */ +qx.Class.getList = function() +{ + return swat.main.Module._list; +}; + + +/** + * The list of modules which have been registered. + */ +qx.Class._list = { }; |