Hi,

I would like to add form factor support (desktop, tablet, mobile) to
an existing application (GWT 2.3, GWTP 0.6, GIN, GUICE, ...)

I had a quick look at the MobileWebApplication sample and then tried
the following:

- added FormFactor.gwt.xml to the project
- inherited the form factor module in the application's .gwt.xml
- added a replace-with to the application's .gwt.xml:

->
 ..

 <replace-with
class="com.gwtcx.sample.serendipity.client.gin.TabletViewFactory">
   <when-type-is
class="com.gwtcx.sample.serendipity.client.gin.ViewFactory"/>
   <when-property-is name="formfactor" value="tablet"/>
 </replace-with>

 ..
->

- defined a simple ViewFactory class (that returns the desktop view):

->

public class ViewFactory {

 public Class<? extends SignInPagePresenter.MyView>
getSignInPageView() {

   return SignInPageView.class;
 }
}

->

- defined a simple TabletViewFactory class (that returns the tablet
view):

->

public class TabletViewFactory {

 public Class<? extends SignInPagePresenter.MyView>
getSignInPageView() {

   return SignInPageTabletView.class;
 }
}

- updated the ClientModule to use the a ViewFactory:

->

public class ClientModule extends AbstractPresenterModule {

 private final ViewFactory viewFactory = new ViewFactory();

 @Override
 protected void configure() {

   ..

   bindPresenter(SerendipitySignInPagePresenter.class,
SerendipitySignInPagePresenter.MyView.class,
       viewFactory.getSignInPageView(),
SerendipitySignInPagePresenter.MyProxy.class);

   ..

 }
}

The formfactor property is being set correctly, however, ViewFactory
is not "replaced with" TabletViewFactory?

Any suggestions much appreciated.

Cheers
Rob

-> Also posted to gwt-platform discussion group

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to