|
Project Information
Links
|
GWT Freeze Dry is a very simple framework for passsing compile time or start time objects to your GWT application. It has two operating modes: a Compile time factory and a Run time Dictionary mode. In each mode the first task is to create an interface that extends Freezer and has no-args methods returning Objects that implement IsSerializable. If you want to build the objects at compile time, you need to write a YourFreezerInterfaceNameFactory class. This will be executed at compile time and the value it returns encoded into your GWT source file. If you want to build the objects at run time, you can pass them in via a Dictionary JavaScript var. For example: <script language='javascript'>;
var com_totsp_freezedry_example_client_DictionaryFreezer = {
getObject: unescape( '<%=URLEncoder.encode( SimpleSerializer.serializeObject( o ), 'UTF-8' )%>' )
};
</script>;Where the var name is the fully qualified name of your Freezer interface and the key names are the object names you need to return. The SimpleSerializer class is included to make this easier to do from the server. Finally, inherit the FreezeDry module: <inherits name='com.totsp.gwt.freezedry.FreezeDry' /> And use the GWT class to create your instance: ExampleFreezer freezer = (ExampleFreezer) GWT.create( ExampleFreezer.class ); Note: This is only for use with GWT 1.4+ More here. |