Skip to content

Commit

Permalink
Tutorial #1
Browse files Browse the repository at this point in the history
  • Loading branch information
kevzlou7979 committed Aug 30, 2016
1 parent 9535aa8 commit 108a820
Show file tree
Hide file tree
Showing 19 changed files with 1,167 additions and 0 deletions.
164 changes: 164 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
<!--
#%L
GwtMaterial
%%
Copyright (C) 2015 - 2016 GwtMaterialDesign
%%
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#L%
-->
<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>

<groupId> com.gwtmaterial.tutorial</groupId>
<artifactId>gwt-material-tutorial</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<name>Basic Template for using GWT Material Design</name>
<url>https://github.com/GwtMaterialDesign</url>

<properties>
<app.id>gwt-material-tutorial</app.id>
<app.version>1</app.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gwt.version>2.7.0</gwt.version>
<gwtp.version>1.4</gwtp.version>
<gin.version>2.1.2</gin.version>
<gwt-material.version>1.5.0</gwt-material.version>
<gwt.style>OBF</gwt.style>

<!-- maven -->
<maven-war-plugin.version>2.6</maven-war-plugin.version>
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>

<target.jdk>1.7</target.jdk>

<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
</properties>

<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>sonatype-nexus-snapshot</id>
<name>Sonatype Nexus snapshot repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>

<build>
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>

<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${target.jdk}</source>
<target>${target.jdk}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>

<!-- GWT -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwt.version}</version>
<configuration>
<strict>true</strict>

<testTimeOut>180</testTimeOut>
<mode>htmlunit</mode>
<includes>**/*GwtTest.java</includes>

<logLevel>INFO</logLevel>

<runTarget>index.html</runTarget>
<module>com.gwtmaterial.tutorial.GwtMaterialBasic</module>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<!-- GWT -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>

<!-- GWTP -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-mvp-client</artifactId>
<version>${gwtp.version}</version>
<scope>provided</scope>
</dependency>

<!-- GwtMaterial -->
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material</artifactId>
<version>${gwt-material.version}</version>
</dependency>
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material-themes</artifactId>
<version>${gwt-material.version}</version>
</dependency>
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material-addins</artifactId>
<version>${gwt-material.version}</version>
</dependency>

<!-- DI -->
<dependency>
<groupId>com.google.gwt.inject</groupId>
<artifactId>gin</artifactId>
<version>${gin.version}</version>
<scope>provided</scope>
</dependency>

<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.gwtmaterial.tutorial.client.application;

/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/


import com.gwtmaterial.tutorial.client.application.home.HomeModule;
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;

public class ApplicationModule extends AbstractPresenterModule {
@Override
protected void configure() {
install(new HomeModule());

bindPresenter(ApplicationPresenter.class, ApplicationPresenter.MyView.class, ApplicationView.class,
ApplicationPresenter.MyProxy.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.gwtmaterial.tutorial.client.application;

/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/


import com.google.gwt.event.shared.GwtEvent;
import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;
import com.gwtplatform.mvp.client.Presenter;
import com.gwtplatform.mvp.client.View;
import com.gwtplatform.mvp.client.annotations.ContentSlot;
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
import com.gwtplatform.mvp.client.proxy.Proxy;
import com.gwtplatform.mvp.client.proxy.RevealContentHandler;

public class ApplicationPresenter
extends Presenter<ApplicationPresenter.MyView, ApplicationPresenter.MyProxy> {
interface MyView extends View {
}

@ProxyStandard
interface MyProxy extends Proxy<ApplicationPresenter> {
}

@ContentSlot
public static final GwtEvent.Type<RevealContentHandler<?>> SLOT_MAIN = new GwtEvent.Type<>();

@Inject
ApplicationPresenter(
EventBus eventBus,
MyView view,
MyProxy proxy) {
super(eventBus, view, proxy, RevealType.Root);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.gwtmaterial.tutorial.client.application;

/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/


import javax.inject.Inject;

import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.gwtplatform.mvp.client.ViewImpl;

public class ApplicationView extends ViewImpl implements ApplicationPresenter.MyView {
interface Binder extends UiBinder<Widget, ApplicationView> {
}

@Inject
ApplicationView(
Binder uiBinder) {
initWidget(uiBinder.createAndBindUi(this));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.gwtmaterial.tutorial.client.application.home;

/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/


import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;

public class HomeModule extends AbstractPresenterModule {
@Override
protected void configure() {
bindPresenter(HomePresenter.class, HomePresenter.MyView.class, HomeView.class,
HomePresenter.MyProxy.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package com.gwtmaterial.tutorial.client.application.home;

/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/


import com.gwtmaterial.tutorial.client.application.ApplicationPresenter;
import com.gwtmaterial.tutorial.client.place.NameTokens;
import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;
import com.gwtplatform.mvp.client.Presenter;
import com.gwtplatform.mvp.client.View;
import com.gwtplatform.mvp.client.annotations.NameToken;
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
import com.gwtplatform.mvp.client.proxy.ProxyPlace;

public class HomePresenter extends Presenter<HomePresenter.MyView, HomePresenter.MyProxy> {
interface MyView extends View {
}

@ProxyStandard
@NameToken(NameTokens.HOME)
interface MyProxy extends ProxyPlace<HomePresenter> {
}

@Inject
HomePresenter(
EventBus eventBus,
MyView view,
MyProxy proxy) {
super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);
}
}
Loading

0 comments on commit 108a820

Please sign in to comment.