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:
Hello, HelloMaps

public abstract class Gadget<T extends UserPreferences>
extends 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 Preference. The Gadget type should be parameterized with the specific UserPrefrences subtype, which will be provided to the init(UserPreferences) method.


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.