Skip to content

Instantly share code, notes, and snippets.

public class MyGinModule extends AbstractGinModule {
public void configure() {
//...
//OPTION 1 part 1
bind(Scheduler.class).toProvider(MySchedulerProvider.class);
//...
}
//OPTION 2
@niloc132
niloc132 / Module.gwt.xml
Last active December 20, 2015 04:29
Full stack traces in compiled code
<!-- Turn on GWT logging -->
<set-property name="gwt.logging.logLevel" value="FINEST" />
<set-property name="gwt.logging.enabled" value="TRUE" />
<!-- ...except the popup handler, which is just about useless -->
<set-property name="gwt.logging.popupHandler" value="DISABLED" />
<!-- optional: turn on gxt internal logging -->
<set-property name="gxt.logging.enabled" value="true" />
<!-- emulated stack traces so you can see the full error -->
public interface OptionsObj {
public List<String> getKeys();
public void setKeys(List<String> keys);
@PropertyName("include_docs")
public boolean isIncludeDocs();
@PropertyName("include_docs")
publiv void setIncludeDocs(boolean includeDocs);
}
Window.alert("about to add handlers");
Window.addCloseHandler(new CloseHandler<Window>() {
@Override
public void onClose(CloseEvent<Window> event) {
Window.alert("close");
}
}) ;
Window.addWindowClosingHandler(new ClosingHandler() {
@Override
public void onWindowClosing(ClosingEvent event) {
@niloc132
niloc132 / HowDoIInnterHtml.java
Created February 4, 2014 18:17
In non-IE browsers, changing the innerHTML of an element detaches its children, but leaves them intact. In IE, it also clears the innerhtml property of all children, detaching all descendants.
public class HowDoIInnerHtml implements EntryPoint {
@Override
public void onModuleLoad() {
Element body = Document.get().getBody();
DivElement newDiv = Document.get().createDivElement();
newDiv.setClassName("foo");
newDiv.setInnerText("Text in the div");
SpanElement newSpan = Document.get().createSpanElement();
@niloc132
niloc132 / Log.java
Created February 17, 2014 20:20 — forked from carchrae/Log.java
public class Log {
/*
* type - is "INFO", "DEBUG", "ERROR" etc
* object - is an "id" of the person calling it. as a convention, I use 'this' unless it is a static method, then I pass in the class
* msg - the log message
*/
public static void log(String type, Object object, String msg) {
@niloc132
niloc132 / StreamTest.java
Created October 31, 2015 03:08
First GWT Stream emulation test is passing...
package com.google.gwt.emultest.java.util.stream;
import com.google.gwt.emultest.java.util.EmulTestBase;
import java.lang.Object;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class StreamTest extends EmulTestBase {
@niloc132
niloc132 / TEST-com.google.gwt.emultest.EmulJava8Suite.txt
Created May 19, 2016 04:05
6f20a10 introduced test compile error
Testsuite: com.google.gwt.emultest.EmulJava8Suite
Tests run: 232, Failures: 0, Errors: 232, Skipped: 0, Time elapsed: 25.04 sec
------------- Standard Output ---------------
Logging initialized @1567ms
jetty-9.2.z-SNAPSHOT
Started c.g.g.j.@1d2adfbe{/,file:/Users/colin/workspace/gwt/build/out/user/test/web-htmlunit/www/,AVAILABLE}{/Users/colin/workspace/gwt/build/out/user/test/web-htmlunit/www}
Started ServerConnector@29b6a78b{HTTP/1.1}{0.0.0.0:51860}
Started @1947ms
Compiling module com.google.gwt.emultest.EmulSuite.JUnit
[ERROR] Unexpected internal compiler error
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>incubator</artifactId>
<groupId>aleph.engineering</groupId>
<name>Aleph Engineering InCubator Parent</name>
<version>0.0.1-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
@niloc132
niloc132 / pom.xml
Created October 18, 2017 17:12
How to disable compiler assertions in gwt:test without preventing tests from running correctly.
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-7</version>
<extensions>true</extensions>
<configuration>
...
<!-- Disable assertions to avoid incorrect compiler errors, but enable test assertions anyway -->
<enableAssertions>false</enableAssertions>
<testArgs>