Skip to content

Instantly share code, notes, and snippets.

public class Test implements EntryPoint {
public void onModuleLoad() {
Widget label = new Label();
Window.alert("HasText? " + (label instanceof HasText));
}
}
@niloc132
niloc132 / gist:4702659
Last active December 12, 2015 02:58
Run GWT compiler from maven without any gwt-m-p restrictions. This can be useful for two main reasons: * Running the compiler during test (i.e. switch phase to process-test-classes, and set classpathScope to test) to allow the test phase to have compiled JS to work on * Running without skipping built-in entrypoints to completely verify that the …
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>compile-js</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
@niloc132
niloc132 / gist:4702630
Created February 3, 2013 17:10
running gwt precompile from within your pom
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>verify-modules</id>
<phase>test</phase>
<goals><goal>exec</goal></goals>
<configuration>
@niloc132
niloc132 / example failure log.log
Created October 26, 2012 22:33
ImageResourceGenerator fd leaks in GWT 2.4 - same behavior observed in 2.5. These end up being cleaned up later in the build, but during that part of the build it may bump into the OS limits on open files
[INFO] Adding image 'com.sencha.gxt.examples.test.client.Test.MonsterBundle.rez4'
[INFO] Preparing method rez40
[INFO] Adding image 'com.sencha.gxt.examples.test.client.Test.MonsterBundle.rez40'
[INFO] Preparing method rez400
[INFO] Adding image 'com.sencha.gxt.examples.test.client.Test.MonsterBundle.rez400'
[INFO] Preparing method rez401
[INFO] Adding image 'com.sencha.gxt.examples.test.client.Test.MonsterBundle.rez401'
[INFO] Preparing method rez402
[INFO] Adding image 'com.sencha.gxt.examples.test.client.Test.MonsterBundle.rez402'
[INFO] Preparing method rez403
@niloc132
niloc132 / Sample.gwt.xml
Created October 17, 2012 16:22
Make more premutations for both small builds and bigger builds with full stack traces. Just add debug=true to the querystring of app's url, reproduce the issue, and read the trace!
<set-property name="compiler.emulatedStack" value="true, false" />
<property-provider name="compiler.emulatedStack">
<![CDATA[return (location.search.indexOf("debug=true") != -1) ? "true" : "false";]]>
</property-provider>
<set-configuration-property name="compiler.emulatedStack.recordFileNames" value="true" />
<set-configuration-property name="compiler.emulatedStack.recordLineNumbers" value="true" />
@niloc132
niloc132 / 1 Test.java
Created October 5, 2012 14:52
GWT 2.4.0 optimizations on JSNI source
/**
* Run with -Dgwt.jjs.traceMethods=Test.* to see optimization progress, then view
* compiled JS to see what other rewriting happens
* @author colin
*
*/
public class Test implements EntryPoint {
public native void onModuleLoad() /*-{
//Strings appearing multiple times will be interned
var a = {test:true};
@niloc132
niloc132 / README.md
Created October 1, 2012 15:53
GXT maven config sample with support subscription

This is a sample of how to set up your GXT 3 project to build from nightlies and support-only builds using your support credentials. We build every night if changes have been merged into trunk, and make that available for viewing at http://staging.sencha.com:8080/examples-dev/ as well as from our maven repository.

@niloc132
niloc132 / Test.java
Created May 23, 2012 16:46
Possible GWT compiler/j.l.String bug
package com.example.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.regexp.shared.RegExp;
import com.google.gwt.user.client.Window;
public class Test implements EntryPoint {
private static final String REGEX = "([0-9]|[0-5][0-9])";
@Override
@niloc132
niloc132 / PackageNameHasCellImpl.java
Created April 30, 2012 18:00
Package Name Has Cell
public class HasCellImpl<M,V> implements HasCell<M,V>
{
public HasCellImpl(ValueProvider<? super M, V> vp, Cell<V> cell)
{
this.cell = cell;
this.vp = vp;
}
@Override
interface MyAltTextImageTemplate extends SafeHtmlTemplates {
@Template("<img alt=\"{0}\" src=\"{1}\" />")
SafeHtml image(String altText, SafeUri image);
}