1 /**
  2 * @fileOverview  
  3 * Copyright (c) 2013 Regione Autonoma della Sardegna
  4 * Published under the GPL license.<br>
  5 * See <a href="https://sardegnageoportale.it/webgis/license.txt">https://sardegnageoportale.it/webgis/license.txt</a>
  6 * for the full text of the license.
  7 * @version 0.1
  8 */
  9 
 10 /**
 11  * @require plugins/Tool.js
 12  * @require GeoExt/widgets/Action.js
 13  */
 14 
 15 /**
 16  * @namespace framework.plugins
 17  */
 18 Ext.ns("framework.plugins");
 19 
 20 /** 
 21  * Class to manage loads of local layer in several formats.
 22  * @name_ ImportLocalLayerAction
 23  * @class Class to manage loads of local layer in several formats.
 24  * @constructor
 25  * @extends <a target="_blank" href="http://gxp.opengeo.org/master/doc/lib/plugins/Tool.html">gxp.plugins.Tool</a>
 26  */
 27 framework.plugins.ImportLocalLayerAction = Ext.extend(gxp.plugins.Tool, 
 28 /** 
 29 * @lends framework.plugins.ImportLocalLayerAction.prototype 
 30 */
 31 {
 32      /**
 33     * framework_importlocallayeraction plugin type.
 34     * @public
 35     * @type String
 36     */
 37     ptype: 'framework_importlocallayeraction',
 38     
 39     /**
 40     * Text for zoom in action tooltip (i18n).
 41     * @public
 42     * @type string
 43     */
 44     tooltipText: "Importazione file geografici",
 45     
 46     /** 
 47     * The names of the css classes that define the icons of the buttons created 
 48     * @public
 49     * @type String
 50     */
 51     iconCls: "gxp-icon-import",
 52     
 53     /** Adds actions to be performed on click.
 54     * @public
 55     */  
 56     addActions: function() {
 57         var map = this.target.mapPanel.map;
 58         var action = new GeoExt.Action({
 59             iconCls: this.iconCls,
 60             tooltip: this.tooltipText,
 61             map: map,
 62             handler: function() {                
 63                 GeoExt.ux.data.Import.KMLImport(map, null);         
 64             }
 65         });
 66         return framework.plugins.ImportLocalLayerAction.superclass.addActions.apply(this, [action]);
 67     }
 68 });
 69 
 70 Ext.preg(framework.plugins.ImportLocalLayerAction.prototype.ptype, framework.plugins.ImportLocalLayerAction);
 71