summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-12-27 22:33:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:30:17 -0500
commitbb6c6945e41aef051993ea9b4e1d3a3cce14a3c8 (patch)
tree70fcbfe7b45d9c77e685513e1a4fe2c42bbd2b9a
parent3f0d0d109c2d7f7f8138bd48412510a650eea3a6 (diff)
downloadsamba-bb6c6945e41aef051993ea9b4e1d3a3cce14a3c8.tar.gz
samba-bb6c6945e41aef051993ea9b4e1d3a3cce14a3c8.tar.bz2
samba-bb6c6945e41aef051993ea9b4e1d3a3cce14a3c8.zip
r20367: don't re-load API documentation each time the module is selected
(This used to be commit 233fc754c44692034c15c82fbafbc47cc40edeb6)
-rw-r--r--swat/apps/swat/source/class/swat/main/Main.js2
-rw-r--r--swat/apps/swat/source/class/swat/module/documentation/Documentation.js3
-rw-r--r--swat/apps/swat/source/class/swat/module/documentation/Fsm.js70
3 files changed, 74 insertions, 1 deletions
diff --git a/swat/apps/swat/source/class/swat/main/Main.js b/swat/apps/swat/source/class/swat/main/Main.js
index 16b2dd395c..2ae58a0c61 100644
--- a/swat/apps/swat/source/class/swat/main/Main.js
+++ b/swat/apps/swat/source/class/swat/main/Main.js
@@ -37,7 +37,7 @@ qx.Class.modules =
"gui" : null,
"class" : swat.module.statistics.Statistics
},
- "Documentation" :
+ "API Documentation" :
{
"canvas" : null,
"fsm" : null,
diff --git a/swat/apps/swat/source/class/swat/module/documentation/Documentation.js b/swat/apps/swat/source/class/swat/module/documentation/Documentation.js
index 6e09733735..eba62904a7 100644
--- a/swat/apps/swat/source/class/swat/module/documentation/Documentation.js
+++ b/swat/apps/swat/source/class/swat/module/documentation/Documentation.js
@@ -46,6 +46,9 @@ qx.Proto.initialAppear = function(module)
var viewer = new api.Viewer();
module.canvas.add(viewer);
viewer.load("script/data.js");
+
+ // Replace the existing (temporary) finite state machine with a null one
+ swat.module.documentation.Fsm.getInstance().buildFsm(module);
};
diff --git a/swat/apps/swat/source/class/swat/module/documentation/Fsm.js b/swat/apps/swat/source/class/swat/module/documentation/Fsm.js
new file mode 100644
index 0000000000..9df878b4f1
--- /dev/null
+++ b/swat/apps/swat/source/class/swat/module/documentation/Fsm.js
@@ -0,0 +1,70 @@
+/*
+ * Copyright:
+ * (C) 2006 by Derrell Lipman
+ * All rights reserved
+ *
+ * License:
+ * LGPL 2.1: http://creativecommons.org/licenses/LGPL/2.1/
+ */
+
+/**
+ * Swat statistics class finite state machine
+ */
+qx.OO.defineClass("swat.module.documentation.Fsm",
+ swat.module.AbstractModuleFsm,
+function()
+{
+ swat.module.AbstractModuleFsm.call(this);
+});
+
+
+qx.Proto.buildFsm = function(module)
+{
+ var fsm = module.fsm;
+
+ /*
+ * State: Idle
+ *
+ * This is a null state to replace the one that loads the API viewer. The
+ * API viewer does not use the finite state machine.
+ */
+ var state = new qx.util.fsm.State(
+ "State_Idle",
+ {
+ "events" :
+ {
+ // We need at least one event listed due to FSM requirements
+ "appear" :
+ {
+ "swat.module.canvas" :
+ "Transition_Idle_to_Idle_via_appear"
+ }
+ }
+ });
+
+ // Replace the initial Idle state with this one
+ fsm.replaceState(state, true);
+
+ /*
+ * Transition: Idle to Idle
+ *
+ * Cause: "appear" on canvas
+ *
+ * Action:
+ * None.
+ */
+ var trans = new qx.util.fsm.Transition(
+ "Transition_Idle_to_Idle_via_appear",
+ {
+ "nextState" :
+ "State_Idle"
+ });
+ state.addTransition(trans);
+
+};
+
+
+/**
+ * Singleton Instance Getter
+ */
+qx.Class.getInstance = qx.util.Return.returnInstance;