com.google.gwt.gadgets.client
Class PreferencesProvider

java.lang.Object
  extended by com.google.gwt.gadgets.client.PreferencesProvider

public class PreferencesProvider
extends java.lang.Object

Utility class to retrieve an instance of PreferencesFeature. This class is designed to allow a unit test to add a mock implementation of PreferencesFeature.


Constructor Summary
PreferencesProvider()
           
 
Method Summary
static PreferencesFeature get()
          Retrieve a copy of the global PreferencesFeature.
static PreferencesFeature get(java.lang.String moduleId)
          Retrieve a copy of the global PreferencesFeature.
static void reset()
          To remove any previously set PreferencesFeature implementation.
static void set(PreferencesFeature preferencesFeature)
          Use this method to override the implementation of preferencesFeature (useful for unit testing).
static void set(java.lang.String moduleId, PreferencesFeature preferencesFeature)
          Use this method to override the implementation of preferencesFeature for a specific module (useful for unit testing)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferencesProvider

public PreferencesProvider()
Method Detail

set

public static void set(PreferencesFeature preferencesFeature)
Use this method to override the implementation of preferencesFeature (useful for unit testing).

Parameters:
preferencesFeature - A class that implements a way to set and retrieve Preferences.

set

public static void set(java.lang.String moduleId,
                       PreferencesFeature preferencesFeature)
Use this method to override the implementation of preferencesFeature for a specific module (useful for unit testing)

Parameters:
moduleId - identifier for a gadgets module.
preferencesFeature - A class that implements a way to set and retrieve Preferences.

reset

public static void reset()
To remove any previously set PreferencesFeature implementation.


get

public static PreferencesFeature get()
Retrieve a copy of the global PreferencesFeature.


get

public static PreferencesFeature get(java.lang.String moduleId)
Retrieve a copy of the global PreferencesFeature.