Skip to content

Instantly share code, notes, and snippets.

@lofidewanto
lofidewanto / pom.xml
Last active October 27, 2020 22:45
IndexedDB with Java Patterns - GWT Boot pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<!-- Using gwt-boot-starter-parent -->
<groupId>com.github.gwtboot</groupId>
<artifactId>gwt-boot-starter-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath />
...
...
Button button = new Button();
button.setType(..);
...
Element th1 = DOM.createTH();
th1.appendChild(button.getElement());
// NOT WORKING: add click event to Button
button.addClickHandler(event -> {
<!-- Apple class -->
<script language="javascript" type="text/javascript">
Apple = function () {
this.x = 40;
this.y = 2;
};
Apple.prototype.sum = function () {
return this.x + this.y;
};
/**
* A composite of a TextBox and a CheckBox that optionally enables it.
*/
public class OptionalTextBox extends Composite implements
ClickHandler {
private TextBox textBox = new TextBox();
private CheckBox checkBox = new CheckBox();
/**
@lofidewanto
lofidewanto / YourEntryPoint.java
Created March 20, 2018 08:50
GWT Boot - Better Implementation
package hello.client;
import com.google.gwt.core.client.*;
import com.google.gwt.user.client.ui.*;
@GwtModule(renameTo="basic")
public class YourEntryPoint implements EntryPoint {
@Override
public void onModuleLoad() {
Button button = new Button("Click me");