- Has to be on Linux or Windows. Because Firefox 24 no longer available on Mac OS
- Install GWT Eclipse Plugin
- Make sure Eclipse is configured use JDK 8 (Java->Installed JRE)
- Install Firefox 24.8.1 ESR
- Install GWT Firefox Plugin (Download first, then File->Open and install it.)
Search This Blog
Showing posts with label gwt. Show all posts
Showing posts with label gwt. Show all posts
GWT Classic DevMode
GWT override css from theme
- Create css file in com/myapp/client/resource/myapp.css:
body, table td, select { font-family: Helvetica, Arial Unicode MS, Arial, sans-serif; font-size: small; } .my-css-class { }
- Create client bundle file: com.myapp.client.Resources.java:
package com.myapp.client; import com.google.gwt.core.client.GWT; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.CssResource; public interface Resources extends ClientBundle { public static final Resources INSTANCE = GWT.create(Resources.class); public interface Style extends CssResource { @ClassName("my-css-class") myCssClass(); } @ClientBundle.Source("resource/myapp.css") // relative path to the css file. @CssResource.NotStrict // No compile error if no css class in the css file. Style css(); }
- In the entry point class: com.myapp.client.MyAPP.java
package com.myapp.client; public class MyApp implements EntryPoint { public void onModuleLoadSafe() { // Inject the css Resources.INSTANCE.css().ensureInjected(); // ... ... ... } }
Configure gwt-maven-plugin to start classic DevMode instead of SuperDevMode in GWT 2.7.0
In the pom.xml, pluginManagement -> plugins:
For more details about the configuration options for gwt:run goal, run the following command:
<pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <goals> <goal>run</goal> </goals> <configuration> <extraJvmArgs>-Xmx1024m</extraJvmArgs> <superDevMode>false</superDevMode> <noServer>true</noServer> </configuration> </plugin> </plugins> </pluginManagement>Note:noServer is set true which will not start the embedded jetty web server.
For more details about the configuration options for gwt:run goal, run the following command:
mvn help:describe -Dplugin=org.codehaus.mojo:gwt-maven-plugin -Dgoal=run -Ddetail
GWT: extract protocol and host from url
AnchorElement anchor = Document.get().createAnchorElement(); anchor.setHref("http://youdomain.org/path/"); String protocol = anchor.getPropertyString("protocol"); String host = anchor.getPropertyString("host"); String path = anchor.getPropertyString("pathname"); anchor.removeFromParent();
GWT 2.5.0: gwtc failed: java.lang.RuntimeException: Unexpected IOException on in-memory stream
Got following error when compiling a GWT project using GWT 2.5.0:
[INFO] [ERROR] Unexpected internal compiler error [INFO] java.lang.RuntimeException: Unexpected IOException on in-memory stream [INFO] at com.google.gwt.dev.javac.CompilationUnit.getTypes(CompilationUnit.java:360)Work around is remove gwt-unitCache folder.
GWT: open a url in a new browser window
com.google.gwt.user.client.Window has static method open(String url, String name, String features) can open a url in a new window:
To open a relative URL, GWT has a static method: getHostPageBaseURL() can be used, see the example below:
To open a relative URL, GWT has a static method: getHostPageBaseURL() can be used, see the example below:
GWT Developer's Plugin for Firefox 19
Update
The latest official google gwt devmode plugin for firefox 19 (release candidate). You can download it and open it with Firefox to install.See also
- GWT Developer's Plugin for Firefox 19
- GWT Developer's Plugin for Firefox 17
- GWT Developer's Plugin for Firefox 16
- GWT Developer's Plugin for Firefox 15
- GWT Developer's Plugin for Firefox 14
- GWT Developer's Plugin for Firefox 13
- GWT Developer's Plugin for Firefox 12
- GWT Developer's Plugin for Firefox 11
- GWT Developer's Plugin for Firefox 10
Google web toolkit plugin for Eclipse: Errors running builder 'Google WebApp Project Validator'
Getting this error:
It is a bug from Google plugin for Eclipse. The work around is:
Errors running builder 'Google WebApp Project Validator' on project 'myproject'.
when trying to build a project using ant from Eclipse. (I have a GWT project in my Eclipse workspace but the project I was trying to build has nothing to do with GWT.)
It is a bug from Google plugin for Eclipse. The work around is:
- In Eclipse, open "Preferences...", Select "Google", then "Web Toolkit"
- Select a valid GWT sdk then click "OK" button. It will rebuild your workspace and fix the error.
How to build Google Web Toolkit DevMode plugin for Firefox 17.0 on Mac OS X
- Install XCode if you do not have it. (XCode 3.2.6 is recommended for building this plugin, because the source code is configured to used Mac OS 10.5 sdk, which is included in XCode 3.2.6, but it is dropped by later version XCodes. However, the later version e.g. xcode 4.3, can also be used with a few modifications on the configuration.)
- To download XCode go to: https://developer.apple.com/downloads. (You need to sign up and login.)
- Here is a guide on how to install xcode on Mac OS X 10.7 Lion
- Check out the source code:
svn checkout http://google-web-toolkit.googlecode.com/svn/trunk/plugins gwt/plugins svn checkout http://google-web-toolkit.googlecode.com/svn/plugin-sdks/gecko-sdks/gecko-17.0.0 plugin-sdks/gecko-sdks/gecko-17.0.0
- If you have xcode 3.2.6 installed, you can try to build it:
cd gwt/plugins/xpcom && make BROWSER=ff170
- If you have later xcode version, e.g. xcode 4.3, installed, the command above will fail with errors finding cstdio.h. To make it work, you need to
- modify plugins/config.mk,
vi ../config.mk
changeBASECFLAGS= $(DEBUGCFLAGS) -O2 -fPIC $(INC) -D__mac -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk -std=c++11
toBASECFLAGS= $(DEBUGCFLAGS) -O2 -fPIC $(INC) -D__mac -mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -std=c++11
- modify gwt/plugins/xpcom/Makefile,
vi Makefile
changeDLLFLAGS += -bundle $(ALLARCHCFLAGS) -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
toDLLFLAGS += -bundle $(ALLARCHCFLAGS) -mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
- modify plugins/config.mk,
- run
make BROWSER=ff170
(in gwt/plugins/xpcom directory.) to build. - the result plugin file will be gwt/plugins/xpcom/prebuilt/wt-dev-plugin.xpi
GWT Developer's Plugin for Firefox 17
Update
The latest official google gwt devmode plugin for firefox has been updated to support Firefox 17. Upgrading to Firefox 17 should automatically update the gwt plugin as well.See also
- GWT Developer's Plugin for Firefox 19
- GWT Developer's Plugin for Firefox 17
- GWT Developer's Plugin for Firefox 16
- GWT Developer's Plugin for Firefox 15
- GWT Developer's Plugin for Firefox 14
- GWT Developer's Plugin for Firefox 13
- GWT Developer's Plugin for Firefox 12
- GWT Developer's Plugin for Firefox 11
- GWT Developer's Plugin for Firefox 10
GWT Developer's Plugin for Firefox 16
- Click the link below:
http://google-web-toolkit.googlecode.com/svn-history/trunk/plugins/xpcom/prebuilt/gwt-dev-plugin.xpi - Open it with Firefox
See also
- GWT Developer's Plugin for Firefox 19
- GWT Developer's Plugin for Firefox 17
- GWT Developer's Plugin for Firefox 16
- GWT Developer's Plugin for Firefox 15
- GWT Developer's Plugin for Firefox 14
- GWT Developer's Plugin for Firefox 13
- GWT Developer's Plugin for Firefox 12
- GWT Developer's Plugin for Firefox 11
- GWT Developer's Plugin for Firefox 10
GWT Developer's Plugin for Firefox 15
The automatic update should work, or click the link below:
https://dl-ssl.google.com/gwt/plugins/firefox/gwt-dev-plugin.xpi
https://dl-ssl.google.com/gwt/plugins/firefox/gwt-dev-plugin.xpi
See also
- GWT Developer's Plugin for Firefox 19
- GWT Developer's Plugin for Firefox 17
- GWT Developer's Plugin for Firefox 16
- GWT Developer's Plugin for Firefox 15
- GWT Developer's Plugin for Firefox 14
- GWT Developer's Plugin for Firefox 13
- GWT Developer's Plugin for Firefox 12
- GWT Developer's Plugin for Firefox 11
- GWT Developer's Plugin for Firefox 10
GWT Developer's Plugin for Firefox 14
- Google web toolkit developer plugin for Firefox 14 running on Windows: http://acleung.com/ff14-win.xpi
- Google web toolkit developer plugin for Firefox 14 running on 64 bit Linux: http://acleung.com/ff14-linux64.xpi
- Google web toolkit developer plugin for Firefox 14 running on 32 bit Linux: http://acleung.com/ff14-linux32.xpi
- Google web toolkit developer plugin for Firefox 14 running on Mac OS: http://acleung.com/ff14-mac.xpi
See also
- GWT Developer's Plugin for Firefox 19
- GWT Developer's Plugin for Firefox 17
- GWT Developer's Plugin for Firefox 16
- GWT Developer's Plugin for Firefox 15
- GWT Developer's Plugin for Firefox 14
- GWT Developer's Plugin for Firefox 13
- GWT Developer's Plugin for Firefox 12
- GWT Developer's Plugin for Firefox 11
- GWT Developer's Plugin for Firefox 10
Thanks Alan Leung for compiling the plugins for us
GWT Example: set cookies
package test; import com.google.gwt.user.client.Cookies; public class CookieTest { public static final int COOKIE_EXPIRE_DAYS = 30; public static final long MILLISECS_PER_DAY = 1000L * 60L * 60L * 24L; public static void setMyCookie(String name, String value, int days) { if (value == null) { Cookies.removeCookie(name); return; } String v = Cookies.getCookie(name); if (value.equals(v)) { // Now Date d = new Date(); // Now + days d.setTime(d.getTime() + MILLISECS_PER_DAY * days); Cookies.setCookie(name, value, d); } } public static void setMyCookie(String name, String value) { setCookie(name, value, COOKIE_EXPIRE_DAYS); } }
GWT Developer's Plugin for Firefox 13
- For Firefox 13 running Windows(32/64 bit): http://acleung.com/ff13-win.xpi
- For Firefox 13 running on Mac OS: http://acleung.com/ff13-mac.xpi
- For Firefox 13 running on 64 bit Linux: http://acleung.com/ff13-linux64.xpi
- For Firefox 13 running on 32 bit Linux: http://acleung.com/ff13-linux32.xpi
See also
- GWT Developer's Plugin for Firefox 19
- GWT Developer's Plugin for Firefox 17
- GWT Developer's Plugin for Firefox 16
- GWT Developer's Plugin for Firefox 15
- GWT Developer's Plugin for Firefox 14
- GWT Developer's Plugin for Firefox 13
- GWT Developer's Plugin for Firefox 12
- GWT Developer's Plugin for Firefox 11
- GWT Developer's Plugin for Firefox 10
Thanks Alan Leung for compiling the plugins for us
Javascript: regular expression to validate URL
function isValidURL(url) {
var pattern = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
return pattern.test(url);
}
GWT JSNI method:
public native boolean isValidUrl(String url) /*-{
var pattern = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
return pattern.test(url);
}-*/;
GWT Developer's Plugin for Firefox 12
- For Firefox 12 running on all platforms(Mac OS, Windows, Linux 32/64): http://acleung.com/ff12-win.xpi
- For Firefox 12 running on Mac OS: http://acleung.com/ff12-mac.xpi
- For Firefox 12 running on 64 bit Linux: http://acleung.com/ff12-linux64.xpi
- For Firefox 12 running on 32 bit Linux: http://acleung.com/ff12-linux32.xpi
See also
- GWT Developer's Plugin for Firefox 19
- GWT Developer's Plugin for Firefox 17
- GWT Developer's Plugin for Firefox 16
- GWT Developer's Plugin for Firefox 15
- GWT Developer's Plugin for Firefox 14
- GWT Developer's Plugin for Firefox 13
- GWT Developer's Plugin for Firefox 12
- GWT Developer's Plugin for Firefox 11
- GWT Developer's Plugin for Firefox 10
Thanks Alan Leung for compiling the plugins for us
GWT Developer's Plugin for Firefox 11
Update: GWT Developer's Plugin for Firefox 12 is available. see
GWT Developer's Plugin for Firefox 12
Thanks Alan Leung for compiling the plugins for us
- For Firefox 11 on all platforms including (Windows 32/64, Mac OS 32/64, Linux 32/64): http://acleung.com/gwt-dev-
plugin-ff11.xpi - For Firefox 11 on Linux(32bit or 64bit): http://acleung.com/gwt-dev-plugin.xpi
- For Firefox 11 on Mac OS(32bit or 64bit): http://acleung.com/gwt-dev-plugin-mac.xpi
See also
- GWT Developer's Plugin for Firefox 19
- GWT Developer's Plugin for Firefox 17
- GWT Developer's Plugin for Firefox 16
- GWT Developer's Plugin for Firefox 15
- GWT Developer's Plugin for Firefox 14
- GWT Developer's Plugin for Firefox 13
- GWT Developer's Plugin for Firefox 12
- GWT Developer's Plugin for Firefox 11
- GWT Developer's Plugin for Firefox 10
Thanks Alan Leung for compiling the plugins for us
GWT Developer's plugin for Firefox 10
https://dl.google.com/dl/gwt/plugins/firefox/1.0.10862/gwt-dev-plugin.xpi
See also
- GWT Developer's Plugin for Firefox 19
- GWT Developer's Plugin for Firefox 17
- GWT Developer's Plugin for Firefox 16
- GWT Developer's Plugin for Firefox 15
- GWT Developer's Plugin for Firefox 14
- GWT Developer's Plugin for Firefox 13
- GWT Developer's Plugin for Firefox 12
- GWT Developer's Plugin for Firefox 11
- GWT Developer's Plugin for Firefox 10
Subscribe to:
Posts (Atom)