[Commits] r1709 - in sandbox/redlining/ux/FeatureEditing: examples ux ux/widgets ux/widgets/form ux/widgets/plugins
commits at geoext.org
commits at geoext.org
Mon Jan 11 11:32:33 CET 2010
Author: fredj
Date: 2010-01-11 11:32:33 +0100 (Mon, 11 Jan 2010)
New Revision: 1709
Added:
sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/
sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeature.js
sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeature.js
Modified:
sandbox/redlining/ux/FeatureEditing/examples/RedLiningPanelExample.js
sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js
sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js
sandbox/redlining/ux/FeatureEditing/ux/widgets/form/RedLiningPanel.js
Log:
remove the import and export tool from the controler. create plugins.
Modified: sandbox/redlining/ux/FeatureEditing/examples/RedLiningPanelExample.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/examples/RedLiningPanelExample.js 2010-01-11 09:01:14 UTC (rev 1708)
+++ sandbox/redlining/ux/FeatureEditing/examples/RedLiningPanelExample.js 2010-01-11 10:32:33 UTC (rev 1709)
@@ -14,7 +14,9 @@
redLiningPanel = new GeoExt.ux.form.RedLiningPanel({
title: "RedLining Panel",
region: "east",
- width: 300
+ width: 300,
+ plugins: [new GeoExt.ux.ImportFeature(),
+ new GeoExt.ux.ExportFeature()]
});
new Ext.Panel({
Modified: sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js 2010-01-11 09:01:14 UTC (rev 1708)
+++ sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js 2010-01-11 10:32:33 UTC (rev 1709)
@@ -55,7 +55,10 @@
"widgets/FeatureEditingControler.js",
"widgets/form/FeatureEditingPanel.js",
"widgets/form/RedLiningPanel.js",
- "widgets/form/FeaturePanel.js"
+ "widgets/form/FeaturePanel.js",
+
+ "widgets/plugins/ImportFeature.js",
+ "widgets/plugins/ExportFeature.js"
);
var agent = navigator.userAgent;
Modified: sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js 2010-01-11 09:01:14 UTC (rev 1708)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js 2010-01-11 10:32:33 UTC (rev 1709)
@@ -30,18 +30,6 @@
*/
deleteAllAction: null,
- /** api: config[importFeaturesAction]
- * ``Ext.Action``
- * The action created to import features
- */
- importFeaturesAction: null,
-
- /** api: config[exportAllFeaturesAction]
- * ``Ext.Action``
- * The action created to export all features
- */
- exportAllFeaturesAction: null,
-
/** api: config[actions]
* ``Array(GeoExt.Action or Ext.Action)``
* An array of actions created from various controls or tasks that are to
@@ -67,11 +55,6 @@
*/
activeLayer: null,
- /** api: config[activeLayer]
- * ``OpenLayers.Layer.Vector`` The layer in which data are imported.
- */
- importLayer: null,
-
/** private: method[constructor]
* Private constructor override.
*/
@@ -290,55 +273,6 @@
}
},
- /** private: method[initImportFeaturesAction]
- * :param event: ``OpenLayers.Layer.Vector`` Layer in which the data are imported
- * Create a Ext.Action object that is set as the importFeaturesAction property
- * and pushed to te actions array.
- */
- initImportFeaturesAction: function(layer) {
- if (layer) {
- this.importLayer = layer;
- }
- var action = new Ext.Action({
- text: OpenLayers.i18n('Import'),
- handler: this.importFeatures,
- scope: this
- });
- this.importFeaturesAction = action;
- this.actions.push(action);
- },
-
- /** private: method[importFeatures]
- * Called when the importFeaturesAction is triggered (button pressed).
- * Import features process from a KML file.
- */
- importFeatures: function() {
- GeoExt.ux.data.Import.KMLImport(this.map, this.importLayer);
- },
-
- /** private: method[initExportAllFeaturesAction]
- * Create a Ext.Action object that is set as the exportAllFeaturesAction property
- * and pushed to te actions array.
- */
- initExportAllFeaturesAction: function() {
- var action = new Ext.Action({
- text: OpenLayers.i18n('Export'),
- handler: this.exportAllFeatures,
- scope: this
- });
- this.exportAllFeaturesAction = action;
- this.actions.push(action);
- },
-
- /** private: method[exportAllFeatures]
- * Called when the exportAllFeaturesAction is triggered (button pressed).
- * Export all features as KML file.
- */
- exportAllFeatures: function() {
- // TODO no use of global export window.
- GeoExt.ux.data.Export.KMLExport(this.map, this.layers, null,'http://dev.geoext.org/sandbox/cmoullet/ux/LayerManager/ux/data/ExportWindow.html');
- },
-
/** private: method[getSelectControl]
* :return: ``OpenLayers.Control.Select``
* Convenience method to return the SelectFeature control from
Modified: sandbox/redlining/ux/FeatureEditing/ux/widgets/form/RedLiningPanel.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/form/RedLiningPanel.js 2010-01-11 09:01:14 UTC (rev 1708)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/form/RedLiningPanel.js 2010-01-11 10:32:33 UTC (rev 1709)
@@ -135,8 +135,6 @@
this.controler.initDrawControls();
this.controler.initFeatureControl();
this.controler.initDeleteAllAction();
- this.controler.initImportFeaturesAction(this.layer);
- this.controler.initExportAllFeaturesAction();
// Add buttons and toolbar
Ext.apply(this, {tbar: new Ext.Toolbar(this.controler.actions)});
Added: sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeature.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeature.js (rev 0)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ExportFeature.js 2010-01-11 10:32:33 UTC (rev 1709)
@@ -0,0 +1,20 @@
+GeoExt.ux.ExportFeature = Ext.extend(Ext.util.Observable, {
+
+ controler: null,
+
+ init: function(form) {
+ this.controler = form.controler;
+
+ var action = new Ext.Action({
+ text: "Export",
+ handler: this.exportFeatures,
+ scope: this
+ });
+ form.getTopToolbar().add(action);
+ },
+
+ exportFeatures: function() {
+ GeoExt.ux.data.Export.KMLExport(this.controler.map, this.controler.layers, null,
+ 'http://dev.geoext.org/sandbox/cmoullet/ux/LayerManager/ux/data/ExportWindow.html');
+ }
+});
Added: sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeature.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeature.js (rev 0)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/ImportFeature.js 2010-01-11 10:32:33 UTC (rev 1709)
@@ -0,0 +1,18 @@
+GeoExt.ux.ImportFeature = Ext.extend(Ext.util.Observable, {
+
+ layer: null,
+
+ init: function(form) {
+ this.layer = form.layer;
+ var action = new Ext.Action({
+ text: "Import",
+ handler: this.importFeatures,
+ scope: this
+ });
+ form.getTopToolbar().add(action);
+ },
+
+ importFeatures: function() {
+ GeoExt.ux.data.Import.KMLImport(this.layer.map, this.layer);
+ }
+});
More information about the Commits
mailing list