Skip to content

Commit

Permalink
Merge pull request #632 from GwtMaterialDesign/release_2.0
Browse files Browse the repository at this point in the history
Release 2.0-rc6
  • Loading branch information
kevzlou7979 committed Jul 31, 2017
2 parents a600fa1 + f53abf3 commit 7b0ef83
Show file tree
Hide file tree
Showing 355 changed files with 701 additions and 591 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -7,7 +7,7 @@
<br/>

## Demo
* [2.0-rc5 Release Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/)
* [2.0-rc6 Release Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/)
* [2.0 Snapshot Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/snapshot/)
* [2.1 Snapshot Demo](http://gwtmaterialdesign.github.io/gwt-material-demo/2.1/)

Expand All @@ -17,12 +17,12 @@ We created <a href="http://gwtmaterialdesign.github.io/gwt-material-demo/apidocs


## Maven
### Current Version 2.0-rc5
### Current Version 2.0-rc6
```xml
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material</artifactId>
<version>2.0-rc5</version>
<version>2.0-rc6</version>
</dependency>
```
### Snapshot Version 2.0-SNAPSHOT
Expand Down
6 changes: 3 additions & 3 deletions gwt-material/pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>gwt-material-parent</artifactId>
<groupId>com.github.gwtmaterialdesign</groupId>
<version>2.0-rc5</version>
<version>2.0-rc6</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -17,7 +17,7 @@
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material-jquery</artifactId>
<version>2.0-rc5</version>
<version>2.0-rc6</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
Expand Down Expand Up @@ -75,7 +75,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwt-maven-plugin.version}</version>
<version>${gwt.version}</version>
<executions>
<execution>
<goals>
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 - 2016 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,10 +24,15 @@
import gwt.material.design.client.resources.WithJQueryDebugResources;
import gwt.material.design.client.resources.WithJQueryResources;

public class JQueryProvider {
public abstract class JQueryProvider {

public TextResource jQuery() {
return null;
public abstract TextResource jQuery();

public static class NoJQuery extends JQueryProvider {
@Override
public TextResource jQuery() {
return null;
}
}

public static class JQueryDebug extends JQueryProvider {
Expand Down
Expand Up @@ -4,7 +4,7 @@
* #%L
* GwtMaterialDesign
* %%
* Copyright (C) 2015 GwtMaterial
* Copyright (C) 2015 - 2017 GwtMaterial
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -4,7 +4,7 @@
* #%L
* GwtMaterialDesign
* %%
* Copyright (C) 2015 GwtMaterial
* Copyright (C) 2015 - 2017 GwtMaterial
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -44,6 +44,7 @@ public FutureResource(TextResource resource, boolean removeTag, boolean sourceUr

static final JQueryProvider jQueryProvider = GWT.create(JQueryProvider.class);
static List<FutureResource> futureResources;
static boolean jqueryWarning;

protected void load() {
checkJQuery(false);
Expand Down Expand Up @@ -78,35 +79,54 @@ public static void injectJs(TextResource resource, boolean removeTag, boolean so
}
futureResources.add(new FutureResource(resource, removeTag, sourceUrl));
} else {
String text = resource.getText() + (sourceUrl ?
"//# sourceURL=" + resource.getName() + ".js" : "");

// Inject the script resource
ScriptInjector.fromString(text)
.setWindow(ScriptInjector.TOP_WINDOW)
.setRemoveTag(removeTag)
.inject();
directInjectJs(resource, removeTag, sourceUrl);
}
}

protected static void directInjectJs(TextResource resource) {
directInjectJs(resource, true, false);
}

protected static void directInjectDebugJs(TextResource resource) {
directInjectJs(resource, false, true);
}

protected static void directInjectJs(TextResource resource, boolean removeTag, boolean sourceUrl) {
String text = resource.getText() + (sourceUrl ?
"//# sourceURL=" + resource.getName() + ".js" : "");

// Inject the script resource
ScriptInjector.fromString(text)
.setWindow(ScriptInjector.TOP_WINDOW)
.setRemoveTag(removeTag)
.inject();
}

public static void injectCss(TextResource resource) {
StyleInjector.inject(resource.getText());
}

protected static boolean checkJQuery(boolean debug) {
if (!isjQueryLoaded() && isProvidingJQuery()) {
if (debug) {
injectDebugJs(jQueryProvider.jQuery());
} else {
injectJs(jQueryProvider.jQuery());
if (!isjQueryLoaded()) {
if(isProvidingJQuery()) {
if (debug) {
directInjectDebugJs(jQueryProvider.jQuery());
} else {
directInjectJs(jQueryProvider.jQuery());
}
} else if(!jqueryWarning) {
GWT.log("Warning: GWT Material is not providing JQuery. You must ensure JQuery " +
"is loaded manually or use one of the GwtMaterialWithJQuery modules, failing " +
"to do so will result in an endless resource loop. This message can be ignored " +
"if you are doing so already (message will not appear in production).");
jqueryWarning = true;
}
}
return isjQueryLoaded();
}

public static boolean isProvidingJQuery() {
return jQueryProvider instanceof JQueryProvider.JQueryDebug ||
jQueryProvider instanceof JQueryProvider.JQueryCompressed;
return !(jQueryProvider instanceof JQueryProvider.NoJQuery);
}

/**
Expand Down
Expand Up @@ -4,7 +4,7 @@
* #%L
* GwtMaterialDesign
* %%
* Copyright (C) 2015 GwtMaterial
* Copyright (C) 2015 - 2017 GwtMaterial
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -4,7 +4,7 @@
* #%L
* GwtMaterialDesign
* %%
* Copyright (C) 2015 GwtMaterial
* Copyright (C) 2015 - 2017 GwtMaterial
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -4,7 +4,7 @@
* #%L
* GwtMaterialDesign
* %%
* Copyright (C) 2015 GwtMaterial
* Copyright (C) 2015 - 2017 GwtMaterial
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -4,7 +4,7 @@
* #%L
* GwtMaterialDesign
* %%
* Copyright (C) 2015 GwtMaterial
* Copyright (C) 2015 - 2017 GwtMaterial
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,6 +23,7 @@
import com.google.gwt.editor.client.Editor;
import com.google.gwt.editor.client.EditorError;
import com.google.gwt.editor.client.HasEditorErrors;
import com.google.gwt.editor.client.LeafValueEditor;
import com.google.gwt.event.logical.shared.AttachEvent;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
Expand All @@ -41,7 +42,7 @@

import java.util.List;

public abstract class AbstractValueWidget<V> extends MaterialWidget implements HasValue<V>, Editor<V>,
public abstract class AbstractValueWidget<V> extends MaterialWidget implements HasValue<V>, LeafValueEditor<V>,
HasEditorErrors<V>, HasErrorHandler, HasError, HasValidators<V> {

private boolean allowBlank = true;
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -2,7 +2,7 @@
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2016 GwtMaterialDesign
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 7b0ef83

Please sign in to comment.