1 // $Id$
  2 
  3 /**
  4  * Baseclass for all widgets. 
  5  * 
  6  * Provides abstract hooks for child classes.
  7  *
  8  * @param properties A map of fields to set. May be new or public fields.
  9  * @class AbstractWidget
 10  */
 11 AjaxSolr.AbstractWidget = AjaxSolr.Class.extend(
 12   /** @lends AjaxSolr.AbstractWidget.prototype */
 13   {
 14   /** 
 15    * A unique identifier of this widget.
 16    *
 17    * @field 
 18    * @public
 19    * @type String
 20    */
 21   id: null,
 22 
 23   /** 
 24    * The CSS selector for this widget's target HTML element, e.g. a specific
 25    * <tt>div</tt> or <tt>ul</tt>. A Widget is usually implemented to perform
 26    * all its UI changes relative to its target HTML element.
 27    * 
 28    * @field 
 29    * @public
 30    * @type String
 31    */
 32   target: null,
 33 
 34   /**
 35    * A reference to the widget's manager. For internal use only.
 36    *
 37    * @field
 38    * @private
 39    * @type AjaxSolr.AbstractManager
 40    */
 41   manager: null,
 42 
 43   /**
 44    * An abstract hook for child implementations.
 45    *
 46    * <p>This method should do any necessary one-time initializations.</p>
 47    */
 48   init: function () {},
 49 
 50   /** 
 51    * An abstract hook for child implementations.
 52    *
 53    * <p>This method is executed before the Solr request is sent.</p>
 54    */
 55   beforeRequest: function () {},
 56 
 57   /**
 58    * An abstract hook for child implementations.
 59    *
 60    * <p>This method is executed after the Solr response is received.</p>
 61    */
 62   afterRequest: function () {}
 63 });
 64