com.google.gwt.gadgets.client
Class Gadget<T extends UserPreferences>

java.lang.Object
  extended by com.google.gwt.gadgets.client.Gadget<T>
Type Parameters:
T - the type of UserPreferences the Gadget expects.
All Implemented Interfaces:
com.google.gwt.core.client.EntryPoint
Direct Known Subclasses:
GadgetAds

public abstract class Gadget<T extends UserPreferences>
extends java.lang.Object
implements com.google.gwt.core.client.EntryPoint

A base class for writing a Google Gadget.

Writing a Gadget:

  1. Declare a subtype of Gadget (e.g. public class MyGadget extends Gadget) that is default instantiable.
  2. If the Gadget requires access to features of the container, it should implement any of the NeedsFoo interfaces.
  3. At runtime, all feature setters will be called strictly before init(UserPreferences). The order in which the setters are called is undefined.

Access to user preferences is provided through a user-defined subtype of the UserPreferences interface. Each preference should be defined as a zero-argument method, returning the desired type of UserPreferences.Preference. The Gadget type should be parameterized with the specific UserPreferences subtype, which will be provided to the init(UserPreferences) method.


Nested Class Summary
static interface Gadget.AllowHtmlQuirksMode
          Annotation to turn on browser's quirks mode.
static interface Gadget.Content
          Specifies which View content sections should be associated with this Gadget.
static interface Gadget.ContentType
          Specifies the type of content and the list of views.
static interface Gadget.GadgetLocale
          This annotation allows Locale tags to be added to the module specification.
static interface Gadget.InjectContent
          Enables developers to define hand-written content that is injected into the gadget manifest file.
static interface Gadget.InjectModulePrefs
          Enables developers to define hand-written content for the ModulePrefs section of the gadget manifset file.
static interface Gadget.ModulePrefs
          Defines the preferences associated with the gadget.
static interface Gadget.UseLongManifestName
          Annotation to turn on long filename generation.
 
Constructor Summary
protected Gadget()
           
 
Method Summary
protected abstract  void init(T preferences)
          This method will be called after all of the feature initialization hooks have been called.
 void onModuleLoad()
          This is used by the Gadget framework for low-level bootstrap functions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gadget

protected Gadget()
Method Detail

onModuleLoad

public final void onModuleLoad()
This is used by the Gadget framework for low-level bootstrap functions.

Specified by:
onModuleLoad in interface com.google.gwt.core.client.EntryPoint

init

protected abstract void init(T preferences)
This method will be called after all of the feature initialization hooks have been called.