[Commits] r2587 - sandbox/pgiraud/playground/print-multipage/geoext.ux/ux/MultiPagePrint/lib/GeoExt.ux

commits at geoext.org commits at geoext.org
Tue Feb 1 17:02:36 CET 2011


Author: fredj
Date: 2011-02-01 17:02:36 +0100 (Tue, 01 Feb 2011)
New Revision: 2587

Modified:
   sandbox/pgiraud/playground/print-multipage/geoext.ux/ux/MultiPagePrint/lib/GeoExt.ux/MultiPagePrint.js
Log:
don't directly build plugins, use ptype. no functional change

Modified: sandbox/pgiraud/playground/print-multipage/geoext.ux/ux/MultiPagePrint/lib/GeoExt.ux/MultiPagePrint.js
===================================================================
--- sandbox/pgiraud/playground/print-multipage/geoext.ux/ux/MultiPagePrint/lib/GeoExt.ux/MultiPagePrint.js	2011-02-01 13:02:19 UTC (rev 2586)
+++ sandbox/pgiraud/playground/print-multipage/geoext.ux/ux/MultiPagePrint/lib/GeoExt.ux/MultiPagePrint.js	2011-02-01 16:02:36 UTC (rev 2587)
@@ -1,12 +1,12 @@
 /**
  * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
- * 
+ *
  * Published under the BSD license.
  * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
  * of the license.
  */
 
-Ext.namespace("GeoExt.ux")
+Ext.ns("GeoExt.ux");
 
 /*
  * @include GeoExt/data/PrintPage.js
@@ -23,14 +23,14 @@
 
 /** api: constructor
  *  .. class:: MultiPagePrint
- * 
+ *
  *  An instance of this form creates a multiplu print page. Layout, DPI, scale
  *  and rotation are configurable in the form. A Print button is also added to
  *  the form. User can add pages and configure specific parameters such as
  *  title and comment for each page.
  */
 GeoExt.ux.MultiPagePrint = Ext.extend(Ext.form.FormPanel, {
-    
+
     /* begin i18n */
     /** api: config[layoutText] ``String`` i18n */
     layoutText: "Layout",
@@ -57,17 +57,17 @@
     /** api: config[defaultCommentText] ``String`` i18n */
     defaultCommentText: "A custom comment",
     /* end i18n */
-   
+
     /** api: config[printProvider]
      *  :class:`GeoExt.data.PrintProvider` The print provider this form
      *  is connected to.
      */
-    
+
     /** api: config[mapPanel]
      *  :class:`GeoExt.MapPanel` The map panel that this form should be
      *  connected to.
      */
-    
+
     /** api: config[layer]
      *  ``OpenLayers.Layer`` Layer to render page extents and handles
      *  to. Useful e.g. for setting a StyleMap. Optional, will be auto-created
@@ -82,30 +82,30 @@
      *  ``Object`` Optional options for the printProvider's print command.
      */
     printOptions: null,
-    
+
     /** api: config[fieldsWidth]
-     *  ``Object``Optional width to give to the form fields. We use an 
+     *  ``Object``Optional width to give to the form fields. We use an
      *  config option here because using defaults will not work with
      *  the form fields inside the tanpanel items. Defaults to 150.
      */
     fieldsWidth: 150,
-    
+
     /** api: config[hideUnique]
      *  ``Boolean`` If set to false, combo boxes for stores with just one value
      *  will be rendered. Default is true.
      */
-    
+
     /** api: config[hideRotation]
      *  ``Boolean`` If set to true, the Rotation field will not be rendered.
      *  Default is false.
      */
-    
+
     /** api: config[busyMask]
      *  ``Ext.LoadMask`` A LoadMask to use while the print document is
      *  prepared. Optional, will be auto-created with ``creatingPdfText` if
      *  not provided.
      */
-    
+
     /** private: property[busyMask]
      *  ``Ext.LoadMask``
      */
@@ -115,25 +115,25 @@
      *  ``Ext.TabPanel``
      */
     pagesPanel: null,
-   
+
     // FIXME required ?
     /** private: property[printExtent]
      *  :class:`GeoExt.plugins.PrintExtent`
      */
     printExtent: null,
-    
+
     // FIXME: required ? do we need multiple printPages ?
     /** api: property[printPages]
      *  ``Array`` Array of :class:`GeoExt.data.PrintPage`
      *  The print pages for this form.
      */
     printPages: null,
-   
+
     /** private: method[initComponent]
      */
     initComponent: function() {
         GeoExt.ux.MultiPagePrint.superclass.initComponent.call(this);
-        
+
         this.printExtent = new GeoExt.plugins.PrintExtent({
             printProvider: this.initialConfig.printProvider,
             layer: this.initialConfig.layer
@@ -162,7 +162,7 @@
                 scope: this,
                 single: true
             });
-        }        
+        }
 
         //for accordion
         this.on('expand', this.show, this);
@@ -179,7 +179,7 @@
         //for use in an Ext.Window with closeAction close
         this.on('destroy', this.hide, this);
     },
-    
+
     /** private: method[initForm]
      *  Creates and adds items to the form.
      */
@@ -197,9 +197,10 @@
             triggerAction: "all",
             selectOnFocus: true,
             width: this.fieldsWidth,
-            plugins: new GeoExt.plugins.PrintProviderField({
+            plugins: {
+                ptype: 'gx_printproviderfield',
                 printProvider: p
-            })
+            }
         });
         !(hideUnique && p.dpis.getCount() <= 1) && this.add({
             xtype: "combo",
@@ -212,9 +213,10 @@
             triggerAction: "all",
             selectOnFocus: true,
             width: this.fieldsWidth,
-            plugins: new GeoExt.plugins.PrintProviderField({
+            plugins: {
+                ptype: 'gx_printproviderfield',
                 printProvider: p
-            })
+            }
         });
 
         this.pagesPanel = new Ext.TabPanel({
@@ -301,9 +303,10 @@
             fieldLabel: this.titleFieldLabel,
             value: this.defaultTitleText,
             width: this.fieldsWidth,
-            plugins: new GeoExt.plugins.PrintPageField({
+            plugins: {
+                ptype: 'gx_printpagefield',
                 printPage: page
-            }),
+            },
             listeners: {
                 valid: function(field) {
                     pageTab.setTitle(field.getValue());
@@ -312,15 +315,16 @@
         });
         pageTab.add({
             xtype: "textarea",
-            fieldLabel: this.commentFieldLabel, 
+            fieldLabel: this.commentFieldLabel,
             name: "comment",
             value: this.defaultCommentText,
             width: this.fieldsWidth,
-            plugins: new GeoExt.plugins.PrintPageField({
+            plugins: {
+                ptype: 'gx_printpagefield',
                 printPage: page
-            })
+            }
         });
-        
+
         !(hideUnique && p.scales.getCount() <= 1) && pageTab.add({
             xtype: "combo",
             fieldLabel: this.scaleText,
@@ -332,9 +336,10 @@
             triggerAction: "all",
             selectOnFocus: true,
             width: this.fieldsWidth,
-            plugins: new GeoExt.plugins.PrintPageField({
+            plugins: {
+                ptype: 'gx_printpagefield',
                 printPage: page
-            })
+            }
         });
         pageTab.initialConfig.hideRotation !== true && pageTab.add({
             xtype: "textfield",
@@ -345,9 +350,10 @@
             validator: function(v) {
                 return !isNaN(v);
             },
-            plugins: new GeoExt.plugins.PrintPageField({
+            plugins: {
+                ptype: 'gx_printpagefield',
                 printPage: page
-            })
+            }
         });
 
         pageTab.on({
@@ -364,7 +370,7 @@
         this.doLayout();
         this.pagesPanel.setActiveTab(pageTab);
     },
-    
+
     /** private: method[onMoveend]
      *  Handler for the map's moveend event
      */
@@ -372,7 +378,7 @@
         // FIXME, now we have multiple pages
         //this.printPage.fit(this.mapPanel.map);
     },
-    
+
     /** private: method[beforeDestroy]
      */
     beforeDestroy: function() {



More information about the Commits mailing list