Author: j...@google.com Date: Tue Mar 24 12:14:51 2009 New Revision: 5073 Added: wiki/UsingOOPHM.wiki
Log: Created wiki page through web user interface. Added: wiki/UsingOOPHM.wiki ============================================================================== --- (empty file) +++ wiki/UsingOOPHM.wiki Tue Mar 24 12:14:51 2009 @@ -0,0 +1,43 @@ +#summary How to use OOPHM in current trunk. +#labels Phase-Deploy + += Introduction = + +Previously, we have embedded the browser inside GWT hosted mode using SWT. This is unsatisfactory for a number of reasons: + * SWT has native pointers, so you have to build it for 32 or 64 bits. + * You can only use one browser per platform in hosted mode. + * You can't easily use tools like DOM Inspector, Firebug, etc. + * On Linux, we have to ship an embeddable version of Mozilla 1.7.12, which is a very old browser. Also, distributing a large binary like this is problematic to support on a wide range of distributions due to shared library dependencies. + +The solution is to invert the problem -- instead of embedding the browser in hosted mode, we will embed a hosted mode plugin in the browser. This has a much smaller footprint that is easier to support, and then we can get support for multiple browsers per platform and cross-machine hosted mode (ie, running hosted mode on Linux and connecting to it from IE on a Windows machine). + += Installing the Plugin = +You will need to install a plugin in each browser you intend to use with OOPHM. + + * *Firefox 3* + Install the [http://code.google.com/p/google-web-toolkit/source/browse/branches/oophm/plugins/xpcom/prebuilt/oophm-xpcom.xpi plugin] in your browser. + + * *Safari 3 on MacOSX* + Run the installer from this [http://google-web-toolkit.googlecode.com/svn/branches/oophm/plugins/webkit/prebuilt/oophm.dmg disk image]. + + * *IE6/7* + Download [http://google-web-toolkit.googlecode.com/svn/branches/oophm/plugins/ie/prebuilt/oophm.dll oophm.dll] to local disk. Run regsvr32 oophm.dll and restart IE. + += Using OOPHM = +OOPHM is currently in trunk, but is not enabled by default because the UI needs some work and some features are missing, plus it just hasn't had enough testing to be sure it is completely usable as a replacement. So, to use it now, you need to add gwt-dev-oophm.jar at the beginning of your classpath. There are a number of ways to do it: + +== Getting the right Classpath == + + * *webAppCreator* + If you are creating a war-style project, you can just use webAppCreator and it will generate an ant target "oophm" for you. You can just run "ant oophm" and it will run your application using OOPHM instead of legacy hosted mode. If you have an existing project, you can delete the build.xml file and then run webAppCreator with -ignore and it won't overwrite any existing files. + + * *Eclipse* + If you have an existing launch config for Eclipse, simply edit the classpath for that launch config and add gwt-dev-oophm.jar at the top of the classpath. + + * *Others* + Basically, wherever you set the classpath that includes gwt-dev-{platform}.jar, make sure that gwt-dev-oophm.jar is searched before the platform-specific jar. + +== Running == +Just execute the GWTShell or !HostedMode classes as usual. A swing UI will show up and it will try and launch firefox with the proper URL -- it does this by just running "firefox URL", so if you don't have the path set properly or if you need to run a different executable it will fail -- in that case, just copy the URL from the log window and paste it in the browser you want to use. + +Note that calls between Java and JS are synchronous, and that means the plugin has to block the browser while a Java method is executing. If you are debugging your Java code, the browser will appear hung until you return back to browser-side code. \ No newline at end of file --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---