Skip to content

Commit d8f54d1

Browse files
authored
Merge pull request #942 from GwtMaterialDesign/release_2.3
Release 2.3
2 parents d0e40b3 + ec36b94 commit d8f54d1

File tree

70 files changed

+4659
-5848
lines changed

Some content is hidden

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

70 files changed

+4659
-5848
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sudo: false
2+
dist: trusty
23
language: java
34
jdk:
45
- oraclejdk8
@@ -7,7 +8,7 @@ cache:
78
- $HOME/.m2
89
before_install:
910
# install the gwt-material-jquery because it will depends on built in jquery
10-
- git clone -b release_2.2 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
11+
- git clone -b release_2.3 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
1112
- cd gwt-material-jquery
1213
- mvn install -DskipTests=true -DdryRun=true
1314
- cd ..

.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.2" ]; then
3+
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.3" ]; 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ We created <a href="http://gwtmaterialdesign.github.io/gwt-material-demo/apidocs
1919

2020

2121
## Maven
22-
### Current Version 2.2
22+
### Current Version 2.3
2323
```xml
2424
<dependency>
2525
<groupId>com.github.gwtmaterialdesign</groupId>
2626
<artifactId>gwt-material</artifactId>
27-
<version>2.2</version>
27+
<version>2.3</version>
2828
</dependency>
2929
```
3030
### Snapshot Version 2.3-SNAPSHOT

gwt-material/pom.xml

Lines changed: 1 addition & 1 deletion
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.2</version>
7+
<version>2.3</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2019 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.adaptive;
21+
22+
import com.google.gwt.dom.client.Document;
23+
import com.google.gwt.user.client.ui.Widget;
24+
import gwt.material.design.client.base.MaterialWidget;
25+
import gwt.material.design.client.base.viewport.Resolution;
26+
import gwt.material.design.client.base.viewport.ViewPort;
27+
import gwt.material.design.client.base.viewport.WidthBoundary;
28+
import gwt.material.design.client.js.Window;
29+
30+
//TODO: More usecase implementation
31+
public class AdaptiveWidget<T extends Widget> extends MaterialWidget {
32+
33+
private T widget;
34+
protected AdaptiveWidgetMap<T> widgetMap;
35+
36+
public AdaptiveWidget() {
37+
super(Document.get().createDivElement());
38+
}
39+
40+
@Override
41+
protected void onLoad() {
42+
super.onLoad();
43+
44+
load();
45+
}
46+
47+
public void load() {
48+
ViewPort.when(Resolution.ALL_DEVICES).then(viewPortChange -> loadViewPort());
49+
}
50+
51+
protected void loadViewPort() {
52+
for (WidthBoundary widthBoundary : getWidgetMap().keySet()) {
53+
if (Window.matchMedia(widthBoundary.asMediaQuery())) {
54+
T currentWidget = getWidgetMap().get(widthBoundary);
55+
setWidget(currentWidget);
56+
}
57+
}
58+
}
59+
60+
public AdaptiveWidget register(Resolution resolution, T widget) {
61+
if (widgetMap == null) {
62+
widgetMap = new AdaptiveWidgetMap<>();
63+
}
64+
65+
widgetMap.put(resolution, widget);
66+
return this;
67+
}
68+
69+
public AdaptiveWidget unregister(Resolution resolution) {
70+
if (widgetMap != null) {
71+
widgetMap.remove(resolution);
72+
}
73+
return this;
74+
}
75+
76+
public void setWidget(T widget) {
77+
this.widget = widget;
78+
79+
clear();
80+
add(widget);
81+
}
82+
83+
84+
@Override
85+
protected void onUnload() {
86+
super.onUnload();
87+
88+
unload();
89+
}
90+
91+
public void unload() {
92+
widgetMap.clear();
93+
}
94+
95+
public AdaptiveWidgetMap<T> getWidgetMap() {
96+
return widgetMap;
97+
}
98+
99+
public void setWidgetMap(AdaptiveWidgetMap<T> widgetMap) {
100+
this.widgetMap = widgetMap;
101+
}
102+
103+
public Widget getWidget() {
104+
return widget;
105+
}
106+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2019 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.adaptive;
21+
22+
import com.google.gwt.user.client.ui.Widget;
23+
import gwt.material.design.client.base.viewport.Resolution;
24+
import gwt.material.design.client.base.viewport.WidthBoundary;
25+
26+
import java.util.HashMap;
27+
28+
public class AdaptiveWidgetMap<T extends Widget> extends HashMap<WidthBoundary, T> {
29+
30+
public void put(Resolution resolution, T widget) {
31+
put(resolution.getBoundary(), widget);
32+
}
33+
}

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,12 @@ public class AsyncWidgetMixin<W extends Widget, V> implements IsAsyncWidget<W, V
4242

4343
public AsyncWidgetMixin(W widget) {
4444
this.widget = widget;
45+
this.displayLoader = new DefaultDisplayLoader();
4546
}
4647

4748
@Override
4849
public void load(AsyncWidgetCallback<W, V> asyncCallback) {
49-
if (displayLoader == null) {
50-
displayLoader = new DefaultDisplayLoader();
51-
GWT.log("Will be using the default display loader for asynchronous feature.");
52-
}
53-
54-
displayLoader.loading();
50+
loading();
5551
getLoadingStyleMixin().setOn(true);
5652
asyncCallback.load(new AsyncCallback<V>() {
5753
@Override
@@ -70,6 +66,14 @@ public void onSuccess(V result) {
7066
}, widget);
7167
}
7268

69+
public void loading() {
70+
displayLoader.loading();
71+
}
72+
73+
public void finalize() {
74+
displayLoader.finalize();
75+
}
76+
7377
@Override
7478
public void setLoaded(boolean loaded) {
7579
this.loaded = loaded;
@@ -107,6 +111,7 @@ public void setAsyncDisplayLoader(AsyncDisplayLoader displayLoader) {
107111

108112
@Override
109113
public AsyncDisplayLoader getAsyncDisplayLoader() {
114+
110115
return displayLoader;
111116
}
112117

gwt-material/src/main/java/gwt/material/design/client/base/AbstractSideNav.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ public void load() {
256256
@Override
257257
public void unload() {
258258
activator = null;
259+
$(".drag-target").remove();
259260
}
260261

261262
/**
@@ -342,8 +343,11 @@ protected void load(boolean strict) {
342343
@Override
343344
protected void onDetach() {
344345
super.onDetach();
345-
getNavMenu().removeStyleName(ShowOn.SHOW_ON_LARGE.getCssName());
346-
getNavMenu().removeStyleName(ShowOn.SHOW_ON_MED_DOWN.getCssName());
346+
MaterialWidget navMenu = getNavMenu();
347+
if (navMenu != null) {
348+
navMenu.removeStyleName(ShowOn.SHOW_ON_LARGE.getCssName());
349+
navMenu.removeStyleName(ShowOn.SHOW_ON_MED_DOWN.getCssName());
350+
}
347351
pushElement(getHeader(), 0);
348352
pushElement(getMain(), 0);
349353
pushElementMargin(getFooter(), 0);

gwt-material/src/main/java/gwt/material/design/client/base/AbstractValueWidget.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import gwt.material.design.client.base.validator.HasValidators;
3737
import gwt.material.design.client.base.validator.ValidationChangedEvent;
3838
import gwt.material.design.client.base.validator.Validator;
39+
import gwt.material.design.client.constants.Position;
3940
import gwt.material.design.client.constants.StatusDisplayType;
4041
import gwt.material.design.client.ui.MaterialLabel;
4142

@@ -328,6 +329,11 @@ public int getClearKeyCode() {
328329
return getClearOnKeyUpMixin().getClearKeyCode();
329330
}
330331

332+
@Override
333+
public void setStatusDisplayPosition(Position position) {
334+
getStatusTextMixin().setStatusDisplayPosition(position);
335+
}
336+
331337
@Override
332338
public HandlerRegistration addValidationChangedHandler(ValidationChangedEvent.ValidationChangedHandler handler) {
333339
return getValidatorMixin().addValidationChangedHandler(handler);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2019 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.base;
21+
22+
import jsinterop.annotations.JsMethod;
23+
import jsinterop.annotations.JsPackage;
24+
import jsinterop.annotations.JsType;
25+
26+
@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL)
27+
public class ClipboardDataTransfer {
28+
29+
@JsMethod
30+
public native String getData(String format);
31+
}

0 commit comments

Comments
 (0)