Is your Ajax application running really slowly for users on IE7 (poor folks)? Have you narrowed down the cause to updating the history with location.hash? Is dynaTrace showing you that it’s actually the native DOM call hanging for more than 5 seconds?
If so, disable the Internet Explorer 7 Developer Toolbar and associated Browser Helper Object (BHO).
The following assumes you’re starting from scratch and need to install the basic software to get going.
- Install Eclipse.
- Download the appropriate version from http://www.eclipse.org/downloads/ . I usually get the Java EE version.
- Unzipping this will take a moment. I highly recommend using 7-Zip and making sure you don’t unzip over/on a network drive.
- Copy the extracted files to an appropriate place. I drop mine in the Program Files folder.
- Create a desktop icon / shortcut for eclipse.exe.
- Download and install Java Development Kit JDK.
- Download the appropriate version from http://www.oracle.com/technetwork/java/javase/downloads/index.html
- This takes even longer.
- Start Eclipse and set up the Google Eclipse plug-in. The first time you start Eclipse, it’ll prompt you for a location for the workspace.
- Click the Help-menu, and then click Install New Software….
- Enter the appropriate plug-in installation path from http://code.google.com/eclipse/docs/download.html, and then click Add….
- Enter Google Plug-in or similar into the Name field, and then click OK.
- Check Plugin and SDKs.
- Follow the instructions to finish the wizard.
- Restart Eclipse when prompted.
Here’s a quick for anyone who is using Google Web Toolkit rebind and code generators. If you want to see the output of the created .java source file(s), add the “-gen gen” parameter to the compiler options. This will cause the GWT compiler to emit the files your generator created into a folder named “gen” next to the “src” directory.
OK, fiddled around a little today with GWT trying to get i18n working with UiBinder. Ran into some issues that I was able to sort out so here’s the obligatory post. I’ll leave reading the basic information from the GWT docs up to you and only highlight the steps that seem to be missing. GWT 2.0.3.
- Create a UiBinder *.ui.xml file with <msg/> elements.
- Compile the project using the –soyc or –extra compiler argument. –soyc does some extra legwork, so you may want to configure –extra instead. This generates .properties files in the extra folder.
- Copy the generated properties file(s) from the extras folder into the folder where the *.ui.xml lives.
- Rename the properties file(s) removing the namespace from the beginning. Note that the class name is duplicated. For example, if the your UiBinder file is named MyView.ui.xml, then the properties file should be named MyViewMyViewUiBinderImplGenMessages.properties.
- Create translated properties files by appending _XX (language, independent of country) or _XX_YY (language_country) to end of the filename, before the extension. For example, MyViewMyViewUiBinderImplGenMessages_fi_FI.properties.
Editing Properties Files In Eclipse
Please be aware that the properties files need to be encoded as UTF-8 and by default Eclipse will encode using ISO-8859-1. You’ll probably want to change the default encoding for .properties files as follows before editing them. Otherwise, Eclipse will simply save them with the incorrect encoding.
- In Eclipse, click the Window-menu, and then click Preferences.
- Expand and select General/Content Types in the options tree on the left.
- In the Content types list, select Java Properties File.
- In the Default encoding field, type UTF-8.
- Click OK.
Set Default and Fallback Language
[Untested, beware] By default GWT uses a locale named “default”. You’ll most likely want to change this to whatever your real default language is. You do this in (each of) the module XML files, for example MyModule.gwt.xml. Here’s what I did to switch to “en” as the default and remove the “default” from the compile permutations.
<extend-property name=”locale” values=”en”/>
<set-property name=”locale” value=”en"/>
<set-property-fallback name=”locale” value=”en”/>
And then I added another language:
<extend-property name=”locale” values=”fi”/>
Optimizing Compile Permutations
While I’m almost still on the subject of compile permutations, you can continue to edit the MyModule.gwt.xml file to optimize how many permutations GWT creates for languages and browser combinations. To remove languages for development, just comment out the extra languages you added in the previous step. To modify which browsers should be compiled to, add and edit the following like:
<set-property name=”user.agent” value=”safari,ie8"/>
Separate multiple browsers with a comma. Here are some supported values: