This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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(); | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
... | |
Button button = new Button(); | |
button.setType(..); | |
... | |
Element th1 = DOM.createTH(); | |
th1.appendChild(button.getElement()); | |
// NOT WORKING: add click event to Button | |
button.addClickHandler(event -> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<build> | |
<plugins> | |
<!-- GWT Maven Plugin --> | |
<plugin> | |
<groupId>net.ltgt.gwt.maven</groupId> | |
<artifactId>gwt-maven-plugin</artifactId> | |
<configuration> | |
<moduleName> | |
com.github.lofi.Calculator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.lofi.client | |
import java.util.logging.Logger; | |
import com.google.gwt.core.client.EntryPoint; | |
public class AppEntryPoint implements EntryPoint { | |
private static Logger logger = Logger.getLogger(AppEntryPoint.class.getName()); | |
@Override | |
public void onModuleLoad() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spring Boot | Dagger2 | Explanation | |
---|---|---|---|
@Configuration | @Module | A class that provides or builds the objects' dependencies | |
@Bean | @Provides | Create the objects | |
@SpringBootApplication | @Component | Interface used to generate the injector for the entry point and serves as a bridge between dependency providers (@Module) and dependency users (@Inject) | |
@Component @Service | @Singleton | Marking the classes to be managed as Singleton by DI framework | |
@Scope | @Singleton or nothing | Scoping the objects | |
@Autowired | @Inject | Inject the object to the marked property or constructor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.lofi.client; | |
import java.util.logging.Logger; | |
import javax.inject.Inject; | |
import javax.inject.Singleton; | |
@Singleton | |
public class ProductService { | |
private static Logger logger = Logger.getLogger(ProductService.class.getName()); | |
private ProductIdbRepository productRepository; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.lofi.client; | |
import java.util.Optional; | |
import java.util.Set; | |
interface Repository<T> { | |
Optional<T> get(String id); | |
Set<T> get(); | |
void persist(T entity); | |
void remove(T entity); |
OlderNewer