Skip to content

Commit

Permalink
Merge pull request #971 from GwtMaterialDesign/release_2.4.0
Browse files Browse the repository at this point in the history
Release 2.4.0
  • Loading branch information
kevzlou7979 committed Jul 24, 2020
2 parents 580869f + 91fdde9 commit 934eae1
Show file tree
Hide file tree
Showing 107 changed files with 19,577 additions and 14,762 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Expand Up @@ -8,15 +8,14 @@ cache:
- $HOME/.m2
before_install:
# install the gwt-material-jquery because it will depends on built in jquery
- git clone -b release_2.3 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
- git clone -b release_2.4.0 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
- cd gwt-material-jquery
- mvn install -DskipTests=true -DdryRun=true
- cd ..
install: true
before_script:
- chmod +x .utility/*
script:
# TODO: Remove skip test
- mvn clean install -DdryRun=true -DskipTests=true
- mvn clean install -DdryRun=true
after_success:
- .utility/deploy.sh
2 changes: 1 addition & 1 deletion .utility/deploy.sh
@@ -1,6 +1,6 @@
#!/bin/bash
set -ev
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.3" ]; then
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.4.0" ]; then
echo "<settings><servers><server><id>ossrh</id><username>\${env.OSSRH_USER}</username><password>\${env.OSSRH_PASS}</password></server></servers></settings>" > ~/settings.xml
mvn deploy -DskipTests --settings ~/settings.xml
fi
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -20,20 +20,20 @@ We created <a href="http://gwtmaterialdesign.github.io/gwt-material-demo/apidocs


## Maven
### Current Version 2.3.0
### Current Version 2.4.0-rc1
```xml
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material</artifactId>
<version>2.3.0</version>
<version>2.4.0-rc1</version>
</dependency>
```
### Snapshot Version 2.3.1-SNAPSHOT
### Snapshot Version 2.4.0-SNAPSHOT
```xml
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material</artifactId>
<version>2.3.1-SNAPSHOT</version>
<version>2.4.0-SNAPSHOT</version>
</dependency>
```

Expand Down
64 changes: 54 additions & 10 deletions gwt-material/pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>gwt-material-parent</artifactId>
<groupId>com.github.gwtmaterialdesign</groupId>
<version>2.3.0</version>
<version>2.4.0-rc1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -33,9 +33,14 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>${htmlunit.version}</version>
</dependency>
</dependencies>

<repositories>
Expand All @@ -51,28 +56,42 @@
</repository>
</repositories>

<!-- TODO Update the testing -->
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<additionalClasspathElements>
<additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>
<additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement>
</additionalClasspathElements>
<useManifestOnlyJar>false</useManifestOnlyJar>
<forkMode>always</forkMode>
<argLine>-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog</argLine>
<excludes>
<exclude>**/**.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<!--
The integration-test phase runs after regular test phase (but before verify/install).
We use this to our advantage to peak at the compiled output from the GWTTestSuite
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven.failsafe.plugin}</version>
<configuration>
<includes>
<include>**/*.class</include>
</includes>
</configuration>
</plugin>

<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
Expand All @@ -93,16 +112,41 @@
<compilerArg>-compileReport</compilerArg>
<compilerArg>-XcompilerMetrics</compilerArg>
</compilerArgs>
<skipModule>true</skipModule>
<classpathScope>compile+runtime</classpathScope>
<failOnError>true</failOnError>
<skipModule>true</skipModule>
</configuration>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>default-test</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<!--
Because we expressly disable asserts in tests to avoid a compiler bug, we also must run surefire manually
on the JRE tests
-->
<excludes>
<exclude>**/ui/**.java</exclude>
</excludes>
<includes>
<include>**/MaterialWidgetTestSuite.java</include>
</includes>
<!-- disable JVM asserts, but enable JS asserts for tests -->
<enableAssertions>false</enableAssertions>
<testArgs>
<testArg>-checkAssertions</testArg>
</testArgs>
<style>OBFUSCATED</style>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down
@@ -0,0 +1,85 @@
/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2020 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%
*/
package gwt.material.design.client;

import gwt.material.design.client.resources.JQueryMigrateDebugResources;
import gwt.material.design.client.resources.JQueryMigrateResources;
import jsinterop.annotations.*;


@JsType(isNative = true, name = "jQuery", namespace = JsPackage.GLOBAL)
public class JQueryMigrate {

/**
* This property is an array of string warning messages that have been generated by the code on the page, in the
* order they were generated. Messages appear in the array only once, even if the condition has occurred multiple
* times, unless jQuery.migrateReset() is called.
*/
@JsProperty
public static boolean migrateWarnings;

/**
* Set this property to true to prevent console warnings from being generated in the development version.
* The jQuery.migrateWarnings array is still maintained when this property is set, which allows programmatic
* inspection without console output.
*/
@JsProperty
public static boolean migrateMute;

/**
* Set this property to false if you want warnings but do not want stack traces to appear on the console.
*/
@JsProperty
public static boolean migrateTrace;

/**
* This string property indicates the version of Migrate in use.
*/
@JsProperty
public static boolean migrateVersion;

/**
* By default, Migrate only gives a specific warning once. If you set this property to false it will give a warning
* for every occurrence each time it happens. Note that this can generate a lot of output, for example when a warning
* occurs in a loop.
*/
@JsProperty
public static boolean migrateDeduplicateWarnings;

/**
* This method clears the jQuery.migrateWarnings array and "forgets" the list of messages that have been seen already.
*/
@JsMethod
public static native void migrateReset();

@JsOverlay
public static void load() {
load(false);
}

@JsOverlay
public static void load(boolean debug) {
if (debug) {
MaterialDesign.injectJs(JQueryMigrateDebugResources.INSTANCE.jQueryMigrate());
} else {
MaterialDesign.injectJs(JQueryMigrateResources.INSTANCE.jQueryMigrate());
}
}
}
Expand Up @@ -135,10 +135,12 @@ public static boolean isProvidingJQuery() {
*
* @return true is jQuery is loaded, false otherwise
*/
//TODO: Convert to JSInterop
public static native boolean isjQueryLoaded() /*-{
return (typeof $wnd['jQuery'] !== 'undefined');
}-*/;

//TODO: Convert to JSInterop
public static native boolean isMaterializeLoaded() /*-{
return (typeof $wnd['Materialize'] !== 'undefined')
}-*/;
Expand Down
Expand Up @@ -21,9 +21,9 @@

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

public interface HasAsyncDisplayLoader {
public interface HasAsyncDisplayLoader<V> {

void setAsyncDisplayLoader(AsyncDisplayLoader displayLoader);
void setAsyncDisplayLoader(AsyncDisplayLoader<V> displayLoader);

AsyncDisplayLoader getAsyncDisplayLoader();
AsyncDisplayLoader<V> getAsyncDisplayLoader();
}
Expand Up @@ -21,7 +21,7 @@

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

public interface IsAsyncWidget<W extends Widget, V> extends HasAsyncCallback<W, V>, HasAsyncDisplayLoader {
public interface IsAsyncWidget<W extends Widget, V> extends HasAsyncCallback<W, V>, HasAsyncDisplayLoader<V> {

void setAsynchronous(boolean asynchronous);

Expand Down
Expand Up @@ -20,6 +20,7 @@
package gwt.material.design.client.async.loader;

import com.google.gwt.dom.client.Style;
import gwt.material.design.client.constants.SwitchType;
import gwt.material.design.client.ui.MaterialLoader;
import gwt.material.design.client.ui.MaterialSwitch;

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

protected DefaultSwitchLoader() {}
protected DefaultSwitchLoader() {
}

public DefaultSwitchLoader(MaterialSwitch materialSwitch) {
this.materialSwitch = materialSwitch;
Expand All @@ -45,18 +47,20 @@ protected void setupLoader() {
public void loading() {
materialSwitch.setEnabled(false);
materialSwitch.getLabel().setVisibility(Style.Visibility.HIDDEN);
materialSwitch.clearErrorText();
loader.show();
}

@Override
public void success(Boolean result) {
materialSwitch.clearErrorText();
materialSwitch.setValue(result, true);
materialSwitch.setValue(result);
}

@Override
public void failure(String error) {
materialSwitch.setErrorText(error);
if (materialSwitch.getType().equals(SwitchType.DEFAULT)) {
materialSwitch.setErrorText(error);
}
}

@Override
Expand Down
Expand Up @@ -35,7 +35,7 @@ public class AsyncWidgetMixin<W extends Widget, V> implements IsAsyncWidget<W, V
protected W widget;
protected boolean loaded;
protected AsyncDisplayLoader<V> displayLoader;
protected AsyncWidgetCallback asyncCallback;
protected AsyncWidgetCallback<W, V> asyncCallback;

private ToggleStyleMixin<MaterialWidget> asyncStyleMixin;
private ToggleStyleMixin<MaterialWidget> loadingStyleMixin;
Expand Down Expand Up @@ -95,23 +95,22 @@ public boolean isAsynchronous() {
}

@Override
public void setAsyncCallback(AsyncWidgetCallback asyncCallback) {
public void setAsyncCallback(AsyncWidgetCallback<W, V> asyncCallback) {
this.asyncCallback = asyncCallback;
}

@Override
public AsyncWidgetCallback getAsyncCallback() {
public AsyncWidgetCallback<W, V> getAsyncCallback() {
return asyncCallback;
}

@Override
public void setAsyncDisplayLoader(AsyncDisplayLoader displayLoader) {
public void setAsyncDisplayLoader(AsyncDisplayLoader<V> displayLoader) {
this.displayLoader = displayLoader;
}

@Override
public AsyncDisplayLoader getAsyncDisplayLoader() {

public AsyncDisplayLoader<V> getAsyncDisplayLoader() {
return displayLoader;
}

Expand Down
Expand Up @@ -271,13 +271,17 @@ public void reload() {
protected void load(boolean strict) {
try {
activator = DOMHelper.getElementByAttribute("data-activates", getId());
getNavMenu().setShowOn(ShowOn.SHOW_ON_MED_DOWN);
if (alwaysShowActivator && !getTypeMixin().getStyle().equals(SideNavType.FIXED.getCssName())) {
getNavMenu().setShowOn(ShowOn.SHOW_ON_LARGE);
} else {
getNavMenu().setHideOn(HideOn.HIDE_ON_LARGE);

MaterialWidget navMenu = getNavMenu();
if (navMenu != null) {
navMenu.setShowOn(ShowOn.SHOW_ON_MED_DOWN);
if (alwaysShowActivator && !getTypeMixin().getStyle().equals(SideNavType.FIXED.getCssName())) {
navMenu.setShowOn(ShowOn.SHOW_ON_LARGE);
} else {
navMenu.setHideOn(HideOn.HIDE_ON_LARGE);
}
navMenu.removeStyleName(CssName.NAVMENU_PERMANENT);
}
getNavMenu().removeStyleName(CssName.NAVMENU_PERMANENT);
} catch (Exception ex) {
if (strict) {
throw new IllegalArgumentException(
Expand Down

0 comments on commit 934eae1

Please sign in to comment.