<commit_before>/**
 * Copyright (c) 2008-2011 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.
 */

/** api: (define)
 *  module = GeoExt.form
 *  class = FormPanel
 *  base_link = `Ext.form.FormPanel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.FormPanel>`_
 */

/**
 * @include GeoExt/form/Basic.js
 */

/** api: example
 *  Sample code showing how to use a GeoExt form panel.
 *
 *  .. code-block:: javascript
 *
 *      var formPanel = new GeoExt.form.FormPanel({
 *          renderTo: "formpanel",
 *          protocol: new OpenLayers.Protocol.WFS({
 *              url: "http://publicus.opengeo.org/geoserver/wfs",
 *              featureType: "tasmania_roads",
 *              featureNS: "http://www.openplans.org/topp"
 *          }),
 *          items: [{
 *              xtype: "textfield",
 *              name: "name__ilike",
 *              value: "mont"
 *          }, {
 *              xtype: "textfield",
 *              name: "elevation__ge",
 *              value: "2000"
 *          }],
 *          listeners: {
 *              actioncomplete: function(form, action) {
 *                  // this listener triggers when the search request
 *                  // is complete, the OpenLayers.Protocol.Response
 *                  // resulting from the request is available
 *                  // in "action.response"
 *              }
 *          }
 *      });
 *
 *      formPanel.addButton({
 *          text: "search",
 *          handler: function() {
 *              this.search();
 *          },
 *          scope: formPanel
 *      });
 */

/** api: constructor
 *  .. class:: FormPanel(config)
 *
 *      A specific ``Ext.form.FormPanel`` whose internal form is a
 *      :class:`GeoExt.form.BasicForm` instead of ``Ext.form.BasicForm``.
 *      One would use this form to do search requests through
 *      an ``OpenLayers.Protocol`` object (``OpenLayers.Protocol.WFS``
 *      for example).
 *
 *      Look at :class:`GeoExt.form.SearchAction` to understand how
 *      form fields must be named for appropriate filters to be
 *      passed to the protocol.
 */
Ext.define('GeoExt.form.Panel', {
    extend: 'Ext.form.Panel',
    requires: ['GeoExt.form.Basic'],
    alias: 'widget.gx_form',

    /** api: config[protocol]
     *  ``OpenLayers.Protocol`` The protocol instance this form panel
     *  is configured with, actions resulting from this form
     *  will be performed through the protocol.
     */
    protocol: null,

    /** private: method[createForm]
     *  Create the internal :class:`GeoExt.form.BasicForm` instance.
     */
    createForm: function() {
        return new GeoExt.form.Basic(this, Ext.applyIf({listeners: {}},
                                     this.initialConfig));
    },

    /** api: method[search]
     *  :param options: ``Object`` The options passed to the
     *      :class:`GeoExt.form.SearchAction` constructor.
     *
     *  Shortcut to the internal form's search method.<commit_msg>Form Panel - use jsdoc<commit_after>/*
 * Copyright (c) 2008-2012 The Open Source Geospatial Foundation
 * 
 * Published under the BSD license.
 * See https://github.com/geoext/geoext2/blob/master/license.txt for the full text
 * of the license.
 */

/*
 * @include GeoExt/form/Basic.js
 */

/**
 * A specific `Ext.form.Panel` whose internal form is a
 * {@link GeoExt.form.Basic} instead of `Ext.form.Basic`.
 * One would use this form to do search requests through
 * an `OpenLayers.Protocol` object (`OpenLayers.Protocol.WFS`
 * for example).
 *
 * Look at {@link GeoExt.form.action.Search} to understand how
 * form fields must be named for appropriate filters to be
 * passed to the protocol.
 *
 * Sample code showing how to use a GeoExt form panel.
 *
<pre><code>
var formPanel = new GeoExt.form.FormPanel({
    renderTo: "formpanel",
    protocol: new OpenLayers.Protocol.WFS({
        url: "http://publicus.opengeo.org/geoserver/wfs",
        featureType: "tasmania_roads",
        featureNS: "http://www.openplans.org/topp"
    }),
    items: [{
        xtype: "textfield",
        name: "name__ilike",
        value: "mont"
    }, {
        xtype: "textfield",
        name: "elevation__ge",
        value: "2000"
    }],
    listeners: {
        actioncomplete: function(form, action) {
            // this listener triggers when the search request
            // is complete, the OpenLayers.Protocol.Response
            // resulting from the request is available
            // in "action.response"
        }
    }
});

formPanel.addButton({
    text: "search",
    handler: function() {
        this.search();
    },
    scope: formPanel
});
</code></pre>
 */

Ext.define('GeoExt.form.Panel', {
    extend: 'Ext.form.Panel',
    requires: ['GeoExt.form.Basic'],
    alias: 'widget.gx_form',

    /**
     * @cfg {OpenLayers.Protocol} protocol
     * The protocol instance this form panel
     * is configured with, actions resulting from this form
     * will be performed through the protocol.
     */
    protocol: null,

    /**
     * Create the internal {GeoExt.form.Basic} instance.
     * @return {GeoExt.form.Basic} The basic form.
     * @private
     */
    createForm: function() {
        return new GeoExt.form.Basic(this, Ext.applyIf({listeners: {}},
                                     this.initialConfig));
    },

    /**
     * Shortcut to the internal form's search method.
     * @param {Object} options The options passed to the
     * GeoExt.form.action.Search constructor.
     *
{'fraction_non_alphanumeric': 0.1300552289328345, 'fraction_numerical': 0.004453946196329948, 'mean_word_length': 2.129319955406912, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '780028', 'n_tokens_mistral': 1703, 'n_tokens_neox': 1634, 'n_words': 439}