Skip to content

Commit 48103e0

Browse files
authored
Merge pull request #732 from GwtMaterialDesign/release_2.1
Release 2.1
2 parents 5973481 + b23158b commit 48103e0

File tree

149 files changed

+15491
-750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+15491
-750
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ cache:
77
- $HOME/.m2
88
before_install:
99
# install the gwt-material-jquery because it will depends on built in jquery
10-
- git clone -b release_2.0.1 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
10+
- git clone -b master https://github.com/GwtMaterialDesign/gwt-material-jquery.git
1111
- cd gwt-material-jquery
1212
- mvn install -DskipTests=true -DdryRun=true
1313
- cd ..
1414
install: true
1515
before_script:
1616
- chmod +x .utility/*
1717
script:
18-
- mvn clean install -DdryRun=true
18+
- mvn clean install -DdryRun=true -DskipTests=true
1919
after_success:
2020
- .utility/deploy.sh

.utility/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
set -ev
3-
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.0.1" ]; then
3+
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
44
echo "<settings><servers><server><id>ossrh</id><username>\${env.OSSRH_USER}</username><password>\${env.OSSRH_PASS}</password></server></servers></settings>" > ~/settings.xml
55
mvn deploy --settings ~/settings.xml
66
fi

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,34 @@
66

77
<br/>
88

9+
## Migration 2.0 -> 2.1
10+
- [Mojo to TBroyer](https://github.com/GwtMaterialDesign/gwt-material/wiki/Migrating-from-Mojo-GWT-Maven-Plugin-to-TBroyer)
11+
- [PWA Support](https://github.com/GwtMaterialDesign/gwt-material/wiki/PWA-:-Service-Worker-Automation)
12+
913
## Demo
10-
* [2.0.1 Release Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/)
11-
* [2.1 Snapshot Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/snapshot/)
14+
* [2.1 Release Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/)
15+
* [2.2 Snapshot Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/snapshot/)
1216

1317
## Documentation
1418
Support documentation can be found [here](https://github.com/GwtMaterialDesign/gwt-material/wiki) <br/>
1519
We created <a href="http://gwtmaterialdesign.github.io/gwt-material-demo/apidocs" > Java Docs </a> for developers
1620

1721

1822
## Maven
19-
### Current Version 2.0.1
23+
### Current Version 2.1
2024
```xml
2125
<dependency>
2226
<groupId>com.github.gwtmaterialdesign</groupId>
2327
<artifactId>gwt-material</artifactId>
24-
<version>2.0.1</version>
28+
<version>2.1</version>
2529
</dependency>
2630
```
27-
### Snapshot Version 2.1-SNAPSHOT
31+
### Snapshot Version 2.2-SNAPSHOT
2832
```xml
2933
<dependency>
3034
<groupId>com.github.gwtmaterialdesign</groupId>
3135
<artifactId>gwt-material</artifactId>
32-
<version>2.1-SNAPSHOT</version>
36+
<version>2.2-SNAPSHOT</version>
3337
</dependency>
3438
```
3539

@@ -57,6 +61,7 @@ Please follow the [contribution document](https://github.com/GwtMaterialDesign/g
5761
<li><a href="https://github.com/GwtMaterialDesign/gwt-material-themes" >Themes</a></li>
5862
<li><a href="https://github.com/GwtMaterialDesign/gwt-material-jquery" >JQuery</a></li>
5963
<li><a href="https://github.com/GwtMaterialDesign/gwt-material-table" >Table</a></li>
64+
<li><a href="https://github.com/GwtMaterialDesign/gwt-material-amcharts" >AmCharts</a></li>
6065
<li><a href="https://github.com/GwtMaterialDesign/gwt-material-demo" >Demo</a></li>
6166
<li><a href="https://github.com/GwtMaterialDesign/gwt-material-demo-errai" >Errai Demo</a></li>
6267
<li><a href="https://github.com/GwtMaterialDesign/gwt-material-template" >Starter</a></li>

gwt-material/pom.xml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
<parent>
55
<artifactId>gwt-material-parent</artifactId>
66
<groupId>com.github.gwtmaterialdesign</groupId>
7-
<version>2.0.1</version>
7+
<version>2.1</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

1111
<artifactId>gwt-material</artifactId>
12+
<packaging>gwt-lib</packaging>
1213

1314
<name>Gwt Material</name>
1415
<description>A Material Design look and feel for GWT Applications</description>
@@ -17,19 +18,17 @@
1718
<dependency>
1819
<groupId>com.github.gwtmaterialdesign</groupId>
1920
<artifactId>gwt-material-jquery</artifactId>
20-
<version>2.0.1</version>
21+
<version>2.1</version>
2122
</dependency>
2223
<dependency>
2324
<groupId>com.google.gwt</groupId>
2425
<artifactId>gwt-user</artifactId>
2526
<version>${gwt.version}</version>
26-
<scope>provided</scope>
2727
</dependency>
2828
<dependency>
2929
<groupId>com.google.gwt</groupId>
3030
<artifactId>gwt-dev</artifactId>
3131
<version>${gwt.version}</version>
32-
<scope>provided</scope>
3332
</dependency>
3433
<dependency>
3534
<groupId>junit</groupId>
@@ -56,7 +55,7 @@
5655
<plugins>
5756
<plugin>
5857
<artifactId>maven-surefire-plugin</artifactId>
59-
<version>2.6</version>
58+
<version>${surefire.version}</version>
6059
<configuration>
6160
<additionalClasspathElements>
6261
<additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>
@@ -66,15 +65,42 @@
6665
<forkMode>always</forkMode>
6766
<argLine>-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog</argLine>
6867
</configuration>
68+
<executions>
69+
<execution>
70+
<goals>
71+
<goal>test</goal>
72+
</goals>
73+
</execution>
74+
</executions>
6975
</plugin>
7076
<plugin>
71-
<groupId>org.codehaus.mojo</groupId>
77+
<groupId>net.ltgt.gwt.maven</groupId>
7278
<artifactId>gwt-maven-plugin</artifactId>
73-
<version>${gwt.version}</version>
79+
<version>${tbroyer.version}</version>
80+
<extensions>true</extensions>
81+
<configuration>
82+
<moduleName>gwt.material.design.GwtMaterialWithJQuery</moduleName>
83+
<style>OBFUSCATED</style>
84+
<logLevel>INFO</logLevel>
85+
<sourceLevel>1.8</sourceLevel>
86+
<jvmArgs>
87+
<jvmArg>-Xmx1g</jvmArg>
88+
<jvmArg>-Xms1g</jvmArg>
89+
<jvmArg>-XX:CompileThreshold=7000</jvmArg>
90+
</jvmArgs>
91+
<optimize>9</optimize>
92+
<compilerArgs>
93+
<compilerArg>-compileReport</compilerArg>
94+
<compilerArg>-XcompilerMetrics</compilerArg>
95+
</compilerArgs>
96+
<classpathScope>compile+runtime</classpathScope>
97+
<failOnError>true</failOnError>
98+
<skipModule>true</skipModule>
99+
</configuration>
74100
<executions>
75101
<execution>
76102
<goals>
77-
<goal>test</goal>
103+
<goal>compile</goal>
78104
</goals>
79105
</execution>
80106
</executions>

gwt-material/src/main/java/gwt/material/design/client/MaterialDesignBase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected void load() {
5151
if(!isMaterializeLoaded()) {
5252
injectJs(MaterialResources.INSTANCE.materializeJs());
5353
injectJs(MaterialResources.INSTANCE.animationJs());
54+
injectJs(MaterialResources.INSTANCE.appInstallerJs());
5455
}
5556
onModuleLoaded();
5657
}

gwt-material/src/main/java/gwt/material/design/client/MaterialDesignDebugBase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public void load() {
3030
if(!isMaterializeLoaded()) {
3131
injectDebugJs(MaterialDebugResources.INSTANCE.materializeJsDebug());
3232
injectDebugJs(MaterialDebugResources.INSTANCE.animationJsDebug());
33+
injectDebugJs(MaterialDebugResources.INSTANCE.appInstallerJsDebug());
3334
}
3435
onModuleLoaded();
3536
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2018 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package gwt.material.design.client.api;
21+
22+
import com.google.gwt.core.client.Callback;
23+
import gwt.material.design.client.api.google.maps.GoogleApi;
24+
25+
/**
26+
* A Base feature that can be extended to build your own custom API Component.
27+
* See {@link ApiRegistry#register(ApiFeature, Callback)}
28+
* @author kevzlou7979
29+
*/
30+
public interface ApiFeature {
31+
32+
/**
33+
* Will construct the given url. See {@link GoogleApi#constructApiUrl()} for the usage.
34+
*/
35+
String constructApiUrl();
36+
37+
/**
38+
* A Feature Api Key {i.e Google API Key}
39+
*/
40+
String getApiKey();
41+
42+
/**
43+
* A Feature Api Url provided to load any external js framework {i.e Google Maps Js resources}
44+
*/
45+
String getApiUrl();
46+
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2018 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package gwt.material.design.client.api;
21+
22+
import com.google.gwt.core.client.Callback;
23+
import com.google.gwt.core.client.JavaScriptObject;
24+
import com.google.gwt.core.client.ScriptInjector;
25+
import com.google.gwt.dom.client.Element;
26+
27+
import java.util.LinkedHashMap;
28+
import java.util.Map;
29+
import java.util.Set;
30+
31+
/**
32+
* A class to register a {@link ApiFeature} that contains apiKey and apiUrl to load your custom API the provided a callback
33+
* upon injecting the resource api url as a script element into the DOM. You can also unload the api resources by calling
34+
* {@link ApiRegistry#unregister(ApiFeature)}.
35+
*
36+
* @author kevzlou7979
37+
*/
38+
public class ApiRegistry {
39+
40+
protected static Map<ApiFeature, JavaScriptObject> features = new LinkedHashMap<>();
41+
42+
/**
43+
* Will register the {@link ApiFeature} to the list of features providing also the Javascript Script element object
44+
* for later removal / update.
45+
*/
46+
public static void register(ApiFeature apiFeature, Callback<Void, Exception> callback) {
47+
if (apiFeature != null && apiFeature.getApiKey() != null && !apiFeature.getApiKey().isEmpty()) {
48+
JavaScriptObject scriptObject = ScriptInjector.fromUrl(apiFeature.constructApiUrl())
49+
.setWindow(ScriptInjector.TOP_WINDOW)
50+
.setCallback(new Callback<Void, Exception>() {
51+
@Override
52+
public void onFailure(Exception e) {
53+
callback.onFailure(e);
54+
}
55+
56+
@Override
57+
public void onSuccess(Void aVoid) {
58+
callback.onSuccess(aVoid);
59+
}
60+
}).inject();
61+
features.put(apiFeature, scriptObject);
62+
}
63+
}
64+
65+
/**
66+
* Will unregister the provided {@link ApiFeature} in to map of features.
67+
*/
68+
public static void unregister(ApiFeature apiFeature) {
69+
JavaScriptObject scriptObject = features.get(apiFeature);
70+
if (scriptObject != null) {
71+
if (scriptObject.cast() instanceof Element) {
72+
Element scriptElement = scriptObject.cast();
73+
scriptElement.removeFromParent();
74+
}
75+
}
76+
features.remove(apiFeature);
77+
}
78+
79+
/**
80+
* Will unregister all {@link ApiFeature}
81+
*/
82+
public static void unregisterAllFeature() {
83+
for (ApiFeature apiFeature : features.keySet()) {
84+
unregister(apiFeature);
85+
}
86+
}
87+
88+
/**
89+
* Get all {@link ApiFeature} lists
90+
*/
91+
public static Set<ApiFeature> getAllFeatures() {
92+
return features.keySet();
93+
}
94+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2018 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package gwt.material.design.client.api.google.maps;
21+
22+
import gwt.material.design.client.api.ApiFeature;
23+
24+
/**
25+
* An abstract implementation for loading any {@link GoogleApi}.
26+
*
27+
* @author kevzlou7979
28+
*/
29+
public abstract class GoogleApi implements ApiFeature {
30+
31+
protected final String apiKey;
32+
33+
public GoogleApi(String apiKey) {
34+
this.apiKey = apiKey;
35+
}
36+
37+
@Override
38+
public String constructApiUrl() {
39+
return getApiUrl() + "?key=" + getApiKey();
40+
}
41+
42+
@Override
43+
public String getApiKey() {
44+
return apiKey;
45+
}
46+
}

0 commit comments

Comments
 (0)