[Commits] r750 - in sandbox/elemoine/playground/geoext/lib: . GeoExt GeoExt/widgets
commits at geoext.org
commits at geoext.org
Fri May 15 10:46:24 CEST 2009
Author: elemoine
Date: 2009-05-15 10:46:24 +0200 (Fri, 15 May 2009)
New Revision: 750
Added:
sandbox/elemoine/playground/geoext/lib/GeoExt/widgets/Action.js
Removed:
sandbox/elemoine/playground/geoext/lib/GeoExt/Action.js
Modified:
sandbox/elemoine/playground/geoext/lib/GeoExt.js
Log:
move the Action.js file under widgets/
Deleted: sandbox/elemoine/playground/geoext/lib/GeoExt/Action.js
===================================================================
--- sandbox/elemoine/playground/geoext/lib/GeoExt/Action.js 2009-05-15 08:45:58 UTC (rev 749)
+++ sandbox/elemoine/playground/geoext/lib/GeoExt/Action.js 2009-05-15 08:46:24 UTC (rev 750)
@@ -1,151 +0,0 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
- * Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
- * of the license.
- *
- * pending approval */
-
-/** api: (define)
- * module = GeoExt
- * class = Action
- * base_link = `Ext.Action <http://extjs.com/deploy/dev/docs/?class=Ext.Action>`_
- */
-Ext.namespace("GeoExt");
-
-/** api: constructor
- * .. class:: Action
- *
- * A record that represents an ``OpenLayers.Feature.Vector``. This record
- * will always have at least the following fields:
- *
- * * feature ``OpenLayers.Feature.Vector``
- * * state ``String``
- * * fid ``String``
- *
- */
-
-GeoExt.Action = Ext.extend(Ext.Action, {
-
- uHandler: null,
-
- uScope: null,
-
- uToggleHandler: null,
-
- uCheckHandler: null,
-
- control: null,
-
- master: false,
-
- constructor: function(config) {
- // config highjack
- this.uHandler = config.handler;
- this.uScope = config.scope;
- this.uToggleHandler = config.toggleHandler;
- this.uCheckHandler = config.checkHandler;
-
- config.scope = this;
- config.handler = this.pHandler;
- config.toggleHandler = this.pToggleHandler;
- config.checkHandler = this.pCheckHandler;
-
- // set control in the instance, the Ext.Action
- // constructor won't do it for us
- var ctrl = this.control = config.control;
-
- // register "activate" and "deactivate" listeners
- // on the control
- if(ctrl) {
- ctrl.events.on({
- activate: this.onCtrlActivate,
- deactivate: this.onCtrlDeactivate,
- scope: this
- });
- }
-
- arguments.callee.superclass.constructor.call(this, config);
- },
-
- pHandler: function(cmp) {
- // cmp is the component that triggers this action
- var ctrl = this.control;
- if(ctrl &&
- ctrl.type == OpenLayers.Control.TYPE_BUTTON) {
- ctrl.trigger();
- }
- if(this.uHandler) {
- this.uHandler.apply(this.uScope, arguments);
- }
- },
-
- pToggleHandler: function(cmp, state) {
- this.changeControlState(state);
- if(this.uToggleHandler) {
- this.uToggleHandler.apply(this.uScope, arguments);
- }
- },
-
- pCheckHandler: function(cmp, state) {
- this.changeControlState(state);
- if(this.uCheckHandler) {
- this.uCheckHandler.apply(this.uScope, arguments);
- }
- },
-
- changeControlState: function(state) {
- //this.master = true;
- if(state) {
- this.control.activate();
- } else {
- this.control.deactivate();
- }
- //this.master = false;
- },
-
- onCtrlActivate: function() {
- //if(!this.master) {
- var ctrl = this.control;
- if(ctrl.type == OpenLayers.Control.TYPE_BUTTON) {
- this.enable();
- } else {
- // deal with buttons
- this.safeCallEach("toggle", [true]);
- // deal with check items
- this.safeCallEach("setChecked", [true]);
- }
- //}
- },
-
- onCtrlDeactivate: function() {
- //if(!this.master) {
- var ctrl = this.control;
- if(ctrl.type == OpenLayers.Control.TYPE_BUTTON) {
- this.disable();
- } else {
- // deal with buttons
- this.safeCallEach("toggle", [false]);
- // deal with check items
- this.safeCallEach("setChecked", [false]);
- }
- //}
- },
-
- safeCallEach: function(fnName, args) {
- var cs = this.items;
- for(var i = 0, len = cs.length; i < len; i++){
- if(cs[i][fnName]) {
- cs[i][fnName].apply(cs[i], args);
- }
- }
- }
-});
-
-GeoExt.Action.wrapControl = function(control, cfg) {
- cfg = cfg || {};
- if(cfg instanceof Ext.Action) {
- cfg = cfg.initialConfig;
- }
- cfg.control = control;
- return new GeoExt.Action(cfg);
-};
Copied: sandbox/elemoine/playground/geoext/lib/GeoExt/widgets/Action.js (from rev 743, sandbox/elemoine/playground/geoext/lib/GeoExt/Action.js)
===================================================================
--- sandbox/elemoine/playground/geoext/lib/GeoExt/widgets/Action.js (rev 0)
+++ sandbox/elemoine/playground/geoext/lib/GeoExt/widgets/Action.js 2009-05-15 08:46:24 UTC (rev 750)
@@ -0,0 +1,151 @@
+/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+ * Published under the BSD license.
+ * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * of the license.
+ *
+ * pending approval */
+
+/** api: (define)
+ * module = GeoExt
+ * class = Action
+ * base_link = `Ext.Action <http://extjs.com/deploy/dev/docs/?class=Ext.Action>`_
+ */
+Ext.namespace("GeoExt");
+
+/** api: constructor
+ * .. class:: Action
+ *
+ * A record that represents an ``OpenLayers.Feature.Vector``. This record
+ * will always have at least the following fields:
+ *
+ * * feature ``OpenLayers.Feature.Vector``
+ * * state ``String``
+ * * fid ``String``
+ *
+ */
+
+GeoExt.Action = Ext.extend(Ext.Action, {
+
+ uHandler: null,
+
+ uScope: null,
+
+ uToggleHandler: null,
+
+ uCheckHandler: null,
+
+ control: null,
+
+ master: false,
+
+ constructor: function(config) {
+ // config highjack
+ this.uHandler = config.handler;
+ this.uScope = config.scope;
+ this.uToggleHandler = config.toggleHandler;
+ this.uCheckHandler = config.checkHandler;
+
+ config.scope = this;
+ config.handler = this.pHandler;
+ config.toggleHandler = this.pToggleHandler;
+ config.checkHandler = this.pCheckHandler;
+
+ // set control in the instance, the Ext.Action
+ // constructor won't do it for us
+ var ctrl = this.control = config.control;
+
+ // register "activate" and "deactivate" listeners
+ // on the control
+ if(ctrl) {
+ ctrl.events.on({
+ activate: this.onCtrlActivate,
+ deactivate: this.onCtrlDeactivate,
+ scope: this
+ });
+ }
+
+ arguments.callee.superclass.constructor.call(this, config);
+ },
+
+ pHandler: function(cmp) {
+ // cmp is the component that triggers this action
+ var ctrl = this.control;
+ if(ctrl &&
+ ctrl.type == OpenLayers.Control.TYPE_BUTTON) {
+ ctrl.trigger();
+ }
+ if(this.uHandler) {
+ this.uHandler.apply(this.uScope, arguments);
+ }
+ },
+
+ pToggleHandler: function(cmp, state) {
+ this.changeControlState(state);
+ if(this.uToggleHandler) {
+ this.uToggleHandler.apply(this.uScope, arguments);
+ }
+ },
+
+ pCheckHandler: function(cmp, state) {
+ this.changeControlState(state);
+ if(this.uCheckHandler) {
+ this.uCheckHandler.apply(this.uScope, arguments);
+ }
+ },
+
+ changeControlState: function(state) {
+ //this.master = true;
+ if(state) {
+ this.control.activate();
+ } else {
+ this.control.deactivate();
+ }
+ //this.master = false;
+ },
+
+ onCtrlActivate: function() {
+ //if(!this.master) {
+ var ctrl = this.control;
+ if(ctrl.type == OpenLayers.Control.TYPE_BUTTON) {
+ this.enable();
+ } else {
+ // deal with buttons
+ this.safeCallEach("toggle", [true]);
+ // deal with check items
+ this.safeCallEach("setChecked", [true]);
+ }
+ //}
+ },
+
+ onCtrlDeactivate: function() {
+ //if(!this.master) {
+ var ctrl = this.control;
+ if(ctrl.type == OpenLayers.Control.TYPE_BUTTON) {
+ this.disable();
+ } else {
+ // deal with buttons
+ this.safeCallEach("toggle", [false]);
+ // deal with check items
+ this.safeCallEach("setChecked", [false]);
+ }
+ //}
+ },
+
+ safeCallEach: function(fnName, args) {
+ var cs = this.items;
+ for(var i = 0, len = cs.length; i < len; i++){
+ if(cs[i][fnName]) {
+ cs[i][fnName].apply(cs[i], args);
+ }
+ }
+ }
+});
+
+GeoExt.Action.wrapControl = function(control, cfg) {
+ cfg = cfg || {};
+ if(cfg instanceof Ext.Action) {
+ cfg = cfg.initialConfig;
+ }
+ cfg.control = control;
+ return new GeoExt.Action(cfg);
+};
Property changes on: sandbox/elemoine/playground/geoext/lib/GeoExt/widgets/Action.js
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: sandbox/elemoine/playground/geoext/lib/GeoExt.js
===================================================================
--- sandbox/elemoine/playground/geoext/lib/GeoExt.js 2009-05-15 08:45:58 UTC (rev 749)
+++ sandbox/elemoine/playground/geoext/lib/GeoExt.js 2009-05-15 08:46:24 UTC (rev 750)
@@ -58,7 +58,6 @@
*/
if(!singleFile) {
var jsfiles = new Array(
- "GeoExt/Action.js",
"GeoExt/data/FeatureRecord.js",
"GeoExt/data/FeatureReader.js",
"GeoExt/data/FeatureStore.js",
@@ -68,6 +67,7 @@
"GeoExt/data/ScaleStore.js",
"GeoExt/data/WMSCapabilitiesReader.js",
"GeoExt/data/WMSCapabilitiesStore.js",
+ "GeoExt/widgets/Action.js",
"GeoExt/data/ProtocolProxy.js",
"GeoExt/widgets/MapPanel.js",
"GeoExt/widgets/Popup.js",
More information about the Commits
mailing list