Skip to content

Commit 934eae1

Browse files
authored
Merge pull request #971 from GwtMaterialDesign/release_2.4.0
Release 2.4.0
2 parents 580869f + 91fdde9 commit 934eae1

File tree

107 files changed

+19577
-14762
lines changed

Some content is hidden

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

107 files changed

+19577
-14762
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ cache:
88
- $HOME/.m2
99
before_install:
1010
# install the gwt-material-jquery because it will depends on built in jquery
11-
- git clone -b release_2.3 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
11+
- git clone -b release_2.4.0 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
1212
- cd gwt-material-jquery
1313
- mvn install -DskipTests=true -DdryRun=true
1414
- cd ..
1515
install: true
1616
before_script:
1717
- chmod +x .utility/*
1818
script:
19-
# TODO: Remove skip test
20-
- mvn clean install -DdryRun=true -DskipTests=true
19+
- mvn clean install -DdryRun=true
2120
after_success:
2221
- .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.3" ]; then
3+
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.4.0" ]; 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 -DskipTests --settings ~/settings.xml
66
fi

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ We created <a href="http://gwtmaterialdesign.github.io/gwt-material-demo/apidocs
2020

2121

2222
## Maven
23-
### Current Version 2.3.0
23+
### Current Version 2.4.0-rc1
2424
```xml
2525
<dependency>
2626
<groupId>com.github.gwtmaterialdesign</groupId>
2727
<artifactId>gwt-material</artifactId>
28-
<version>2.3.0</version>
28+
<version>2.4.0-rc1</version>
2929
</dependency>
3030
```
31-
### Snapshot Version 2.3.1-SNAPSHOT
31+
### Snapshot Version 2.4.0-SNAPSHOT
3232
```xml
3333
<dependency>
3434
<groupId>com.github.gwtmaterialdesign</groupId>
3535
<artifactId>gwt-material</artifactId>
36-
<version>2.3.1-SNAPSHOT</version>
36+
<version>2.4.0-SNAPSHOT</version>
3737
</dependency>
3838
```
3939

gwt-material/pom.xml

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>gwt-material-parent</artifactId>
66
<groupId>com.github.gwtmaterialdesign</groupId>
7-
<version>2.3.0</version>
7+
<version>2.4.0-rc1</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

@@ -33,9 +33,14 @@
3333
<dependency>
3434
<groupId>junit</groupId>
3535
<artifactId>junit</artifactId>
36-
<version>4.11</version>
36+
<version>${junit.version}</version>
3737
<scope>test</scope>
3838
</dependency>
39+
<dependency>
40+
<groupId>net.sourceforge.htmlunit</groupId>
41+
<artifactId>htmlunit</artifactId>
42+
<version>${htmlunit.version}</version>
43+
</dependency>
3944
</dependencies>
4045

4146
<repositories>
@@ -51,28 +56,42 @@
5156
</repository>
5257
</repositories>
5358

59+
<!-- TODO Update the testing -->
5460
<build>
5561
<plugins>
5662
<plugin>
5763
<artifactId>maven-surefire-plugin</artifactId>
5864
<version>${surefire.version}</version>
5965
<configuration>
60-
<additionalClasspathElements>
61-
<additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>
62-
<additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement>
63-
</additionalClasspathElements>
64-
<useManifestOnlyJar>false</useManifestOnlyJar>
65-
<forkMode>always</forkMode>
66-
<argLine>-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog</argLine>
66+
<excludes>
67+
<exclude>**/**.java</exclude>
68+
</excludes>
6769
</configuration>
6870
<executions>
6971
<execution>
72+
<phase>test</phase>
7073
<goals>
7174
<goal>test</goal>
7275
</goals>
7376
</execution>
7477
</executions>
7578
</plugin>
79+
80+
<plugin>
81+
<!--
82+
The integration-test phase runs after regular test phase (but before verify/install).
83+
We use this to our advantage to peak at the compiled output from the GWTTestSuite
84+
-->
85+
<groupId>org.apache.maven.plugins</groupId>
86+
<artifactId>maven-failsafe-plugin</artifactId>
87+
<version>${maven.failsafe.plugin}</version>
88+
<configuration>
89+
<includes>
90+
<include>**/*.class</include>
91+
</includes>
92+
</configuration>
93+
</plugin>
94+
7695
<plugin>
7796
<groupId>net.ltgt.gwt.maven</groupId>
7897
<artifactId>gwt-maven-plugin</artifactId>
@@ -93,16 +112,41 @@
93112
<compilerArg>-compileReport</compilerArg>
94113
<compilerArg>-XcompilerMetrics</compilerArg>
95114
</compilerArgs>
115+
<skipModule>true</skipModule>
96116
<classpathScope>compile+runtime</classpathScope>
97117
<failOnError>true</failOnError>
98-
<skipModule>true</skipModule>
99118
</configuration>
100119
<executions>
101120
<execution>
121+
<id>compile</id>
102122
<goals>
103123
<goal>compile</goal>
104124
</goals>
105125
</execution>
126+
<execution>
127+
<id>default-test</id>
128+
<goals>
129+
<goal>test</goal>
130+
</goals>
131+
<configuration>
132+
<!--
133+
Because we expressly disable asserts in tests to avoid a compiler bug, we also must run surefire manually
134+
on the JRE tests
135+
-->
136+
<excludes>
137+
<exclude>**/ui/**.java</exclude>
138+
</excludes>
139+
<includes>
140+
<include>**/MaterialWidgetTestSuite.java</include>
141+
</includes>
142+
<!-- disable JVM asserts, but enable JS asserts for tests -->
143+
<enableAssertions>false</enableAssertions>
144+
<testArgs>
145+
<testArg>-checkAssertions</testArg>
146+
</testArgs>
147+
<style>OBFUSCATED</style>
148+
</configuration>
149+
</execution>
106150
</executions>
107151
</plugin>
108152
<plugin>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2020 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;
21+
22+
import gwt.material.design.client.resources.JQueryMigrateDebugResources;
23+
import gwt.material.design.client.resources.JQueryMigrateResources;
24+
import jsinterop.annotations.*;
25+
26+
27+
@JsType(isNative = true, name = "jQuery", namespace = JsPackage.GLOBAL)
28+
public class JQueryMigrate {
29+
30+
/**
31+
* This property is an array of string warning messages that have been generated by the code on the page, in the
32+
* order they were generated. Messages appear in the array only once, even if the condition has occurred multiple
33+
* times, unless jQuery.migrateReset() is called.
34+
*/
35+
@JsProperty
36+
public static boolean migrateWarnings;
37+
38+
/**
39+
* Set this property to true to prevent console warnings from being generated in the development version.
40+
* The jQuery.migrateWarnings array is still maintained when this property is set, which allows programmatic
41+
* inspection without console output.
42+
*/
43+
@JsProperty
44+
public static boolean migrateMute;
45+
46+
/**
47+
* Set this property to false if you want warnings but do not want stack traces to appear on the console.
48+
*/
49+
@JsProperty
50+
public static boolean migrateTrace;
51+
52+
/**
53+
* This string property indicates the version of Migrate in use.
54+
*/
55+
@JsProperty
56+
public static boolean migrateVersion;
57+
58+
/**
59+
* By default, Migrate only gives a specific warning once. If you set this property to false it will give a warning
60+
* for every occurrence each time it happens. Note that this can generate a lot of output, for example when a warning
61+
* occurs in a loop.
62+
*/
63+
@JsProperty
64+
public static boolean migrateDeduplicateWarnings;
65+
66+
/**
67+
* This method clears the jQuery.migrateWarnings array and "forgets" the list of messages that have been seen already.
68+
*/
69+
@JsMethod
70+
public static native void migrateReset();
71+
72+
@JsOverlay
73+
public static void load() {
74+
load(false);
75+
}
76+
77+
@JsOverlay
78+
public static void load(boolean debug) {
79+
if (debug) {
80+
MaterialDesign.injectJs(JQueryMigrateDebugResources.INSTANCE.jQueryMigrate());
81+
} else {
82+
MaterialDesign.injectJs(JQueryMigrateResources.INSTANCE.jQueryMigrate());
83+
}
84+
}
85+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ public static boolean isProvidingJQuery() {
135135
*
136136
* @return true is jQuery is loaded, false otherwise
137137
*/
138+
//TODO: Convert to JSInterop
138139
public static native boolean isjQueryLoaded() /*-{
139140
return (typeof $wnd['jQuery'] !== 'undefined');
140141
}-*/;
141142

143+
//TODO: Convert to JSInterop
142144
public static native boolean isMaterializeLoaded() /*-{
143145
return (typeof $wnd['Materialize'] !== 'undefined')
144146
}-*/;

gwt-material/src/main/java/gwt/material/design/client/async/HasAsyncDisplayLoader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
import gwt.material.design.client.async.loader.AsyncDisplayLoader;
2323

24-
public interface HasAsyncDisplayLoader {
24+
public interface HasAsyncDisplayLoader<V> {
2525

26-
void setAsyncDisplayLoader(AsyncDisplayLoader displayLoader);
26+
void setAsyncDisplayLoader(AsyncDisplayLoader<V> displayLoader);
2727

28-
AsyncDisplayLoader getAsyncDisplayLoader();
28+
AsyncDisplayLoader<V> getAsyncDisplayLoader();
2929
}

gwt-material/src/main/java/gwt/material/design/client/async/IsAsyncWidget.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import com.google.gwt.user.client.ui.Widget;
2323

24-
public interface IsAsyncWidget<W extends Widget, V> extends HasAsyncCallback<W, V>, HasAsyncDisplayLoader {
24+
public interface IsAsyncWidget<W extends Widget, V> extends HasAsyncCallback<W, V>, HasAsyncDisplayLoader<V> {
2525

2626
void setAsynchronous(boolean asynchronous);
2727

gwt-material/src/main/java/gwt/material/design/client/async/loader/DefaultSwitchLoader.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package gwt.material.design.client.async.loader;
2121

2222
import com.google.gwt.dom.client.Style;
23+
import gwt.material.design.client.constants.SwitchType;
2324
import gwt.material.design.client.ui.MaterialLoader;
2425
import gwt.material.design.client.ui.MaterialSwitch;
2526

@@ -28,7 +29,8 @@ public class DefaultSwitchLoader implements AsyncDisplayLoader<Boolean> {
2829
private MaterialSwitch materialSwitch;
2930
private MaterialLoader loader;
3031

31-
protected DefaultSwitchLoader() {}
32+
protected DefaultSwitchLoader() {
33+
}
3234

3335
public DefaultSwitchLoader(MaterialSwitch materialSwitch) {
3436
this.materialSwitch = materialSwitch;
@@ -45,18 +47,20 @@ protected void setupLoader() {
4547
public void loading() {
4648
materialSwitch.setEnabled(false);
4749
materialSwitch.getLabel().setVisibility(Style.Visibility.HIDDEN);
50+
materialSwitch.clearErrorText();
4851
loader.show();
4952
}
5053

5154
@Override
5255
public void success(Boolean result) {
53-
materialSwitch.clearErrorText();
54-
materialSwitch.setValue(result, true);
56+
materialSwitch.setValue(result);
5557
}
5658

5759
@Override
5860
public void failure(String error) {
59-
materialSwitch.setErrorText(error);
61+
if (materialSwitch.getType().equals(SwitchType.DEFAULT)) {
62+
materialSwitch.setErrorText(error);
63+
}
6064
}
6165

6266
@Override

gwt-material/src/main/java/gwt/material/design/client/async/mixin/AsyncWidgetMixin.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class AsyncWidgetMixin<W extends Widget, V> implements IsAsyncWidget<W, V
3535
protected W widget;
3636
protected boolean loaded;
3737
protected AsyncDisplayLoader<V> displayLoader;
38-
protected AsyncWidgetCallback asyncCallback;
38+
protected AsyncWidgetCallback<W, V> asyncCallback;
3939

4040
private ToggleStyleMixin<MaterialWidget> asyncStyleMixin;
4141
private ToggleStyleMixin<MaterialWidget> loadingStyleMixin;
@@ -95,23 +95,22 @@ public boolean isAsynchronous() {
9595
}
9696

9797
@Override
98-
public void setAsyncCallback(AsyncWidgetCallback asyncCallback) {
98+
public void setAsyncCallback(AsyncWidgetCallback<W, V> asyncCallback) {
9999
this.asyncCallback = asyncCallback;
100100
}
101101

102102
@Override
103-
public AsyncWidgetCallback getAsyncCallback() {
103+
public AsyncWidgetCallback<W, V> getAsyncCallback() {
104104
return asyncCallback;
105105
}
106106

107107
@Override
108-
public void setAsyncDisplayLoader(AsyncDisplayLoader displayLoader) {
108+
public void setAsyncDisplayLoader(AsyncDisplayLoader<V> displayLoader) {
109109
this.displayLoader = displayLoader;
110110
}
111111

112112
@Override
113-
public AsyncDisplayLoader getAsyncDisplayLoader() {
114-
113+
public AsyncDisplayLoader<V> getAsyncDisplayLoader() {
115114
return displayLoader;
116115
}
117116

0 commit comments

Comments
 (0)