Skip to content

Commit 4c7b3d3

Browse files
authored
Merge pull request #976 from GwtMaterialDesign/release_2.4.0
Official 2.4.0 Release
2 parents 9268511 + 65800dd commit 4c7b3d3

File tree

13 files changed

+77
-21
lines changed

13 files changed

+77
-21
lines changed

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.4.0-rc2
23+
### Current Version 2.4.0
2424
```xml
2525
<dependency>
2626
<groupId>com.github.gwtmaterialdesign</groupId>
2727
<artifactId>gwt-material</artifactId>
28-
<version>2.4.0-rc2</version>
28+
<version>2.4.0</version>
2929
</dependency>
3030
```
31-
### Snapshot Version 2.4.0-SNAPSHOT
31+
### Snapshot Version 2.5.0-SNAPSHOT
3232
```xml
3333
<dependency>
3434
<groupId>com.github.gwtmaterialdesign</groupId>
3535
<artifactId>gwt-material</artifactId>
36-
<version>2.4.0-SNAPSHOT</version>
36+
<version>2.5.0-SNAPSHOT</version>
3737
</dependency>
3838
```
3939

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.4.0-rc2</version>
7+
<version>2.4.0</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
*/
5757
//@formatter:on
5858
public abstract class AbstractSideNav extends MaterialWidget
59-
implements JsLoader, HasSelectables, HasInOutDurationTransition, HasSideNavHandlers, HasOverlayStyle, HasDensity {
59+
implements JsLoader, HasSelectables, HasInOutDurationTransition, HasSideNavHandlers, HasOverlayStyle, HasOpenClose, HasDensity {
6060

6161
protected int width = 240;
6262
protected int inDuration = 400;
@@ -482,6 +482,7 @@ public void show() {
482482
/**
483483
* Show the sidenav using the activator element
484484
*/
485+
@Override
485486
public void open() {
486487
$("#sidenav-overlay").remove();
487488
$(activator).sideNav("show");
@@ -498,10 +499,12 @@ public void hide() {
498499
/**
499500
* Hide the sidenav using the activator element
500501
*/
502+
@Override
501503
public void close() {
502504
$(activator).sideNav("hide");
503505
}
504506

507+
@Override
505508
public boolean isOpen() {
506509
return open;
507510
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ protected void onEnsureDebugId(String baseID) {
498498
*/
499499
@Override
500500
protected void onLoad() {
501+
super.onLoad();
501502
DOM.setEventListener(inputElem, this);
502503
}
503504

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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.base;
21+
22+
public interface HasOpenClose {
23+
24+
void open();
25+
26+
void close();
27+
28+
boolean isOpen();
29+
}

gwt-material/src/main/java/gwt/material/design/client/base/mixin/RequiredFieldMixin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
public class RequiredFieldMixin <T extends AbstractValueWidget & HasRequiredField, H extends UIObject>
3333
extends AbstractMixin<T> implements HasRequiredField {
3434

35-
private String REQUIRED = "required";
35+
private final String REQUIRED = "required";
3636
private H targetLabel;
3737
private boolean required;
3838
private ToggleStyleMixin<UIObject> toggleStyleMixin;
@@ -51,8 +51,8 @@ public RequiredFieldMixin(T uiObject, H targetLabel) {
5151
public void setRequired(boolean required) {
5252
this.required = required;
5353

54-
uiObject.setValidateOnBlur(true);
55-
uiObject.setAllowBlank(false);
54+
uiObject.setValidateOnBlur(required);
55+
uiObject.setAllowBlank(!required);
5656

5757
if (targetLabel != null) {
5858
getToggleStyleMixin().setOn(required);

gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
//@formatter:on
6868
public class MaterialDatePicker extends AbstractValueWidget<Date> implements JsLoader, HasPlaceholder,
6969
HasOpenHandlers<MaterialDatePicker>, HasCloseHandlers<MaterialDatePicker>, HasIcon, HasReadOnly,
70-
HasFieldTypes, HasLabel {
70+
HasFieldTypes, HasLabel, HasOpenClose {
7171

7272
/**
7373
* Enum for identifying various selection types for the picker.
@@ -636,17 +636,20 @@ public MaterialLabel getErrorLabel() {
636636
/**
637637
* Programmatically close the date picker component
638638
*/
639+
@Override
639640
public void close() {
640641
Scheduler.get().scheduleDeferred(() -> getPicker().close());
641642
}
642643

643644
/**
644645
* Programmatically open the date picker component
645646
*/
647+
@Override
646648
public void open() {
647649
Scheduler.get().scheduleDeferred(() -> getPicker().open());
648650
}
649651

652+
@Override
650653
public boolean isOpen() {
651654
return Boolean.parseBoolean(getPicker().get("open").toString());
652655
}

gwt-material/src/main/java/gwt/material/design/client/ui/MaterialDialog.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@
7777
*/
7878
// @formatter:on
7979
public class MaterialDialog extends MaterialWidget implements HasType<DialogType>, HasInOutDurationTransition,
80-
HasDismissible, HasCloseHandlers<MaterialDialog>, HasOpenHandlers<MaterialDialog>, HasFullscreen, HasOverlayStyle {
80+
HasDismissible, HasCloseHandlers<MaterialDialog>, HasOpenHandlers<MaterialDialog>, HasFullscreen, HasOverlayStyle,
81+
HasOpenClose {
8182

8283
private JsModalOptions options = new JsModalOptions();
8384

@@ -232,6 +233,7 @@ public boolean isFullscreen() {
232233
*
233234
* @throws IllegalStateException If the MaterialDialog is not added to the document
234235
*/
236+
@Override
235237
public void open() {
236238
open(true);
237239
}
@@ -296,6 +298,7 @@ protected void onNativeClose(boolean autoClosed, boolean fireEvent) {
296298
* are not using UiBinder. See {@link #open()}.
297299
* </p>
298300
*/
301+
@Override
299302
public void close() {
300303
close(false);
301304
}
@@ -337,6 +340,7 @@ protected void close(Element e, boolean autoClosed, boolean fireEvent) {
337340
}
338341
}
339342

343+
@Override
340344
public boolean isOpen() {
341345
return open;
342346
}

gwt-material/src/main/java/gwt/material/design/client/ui/MaterialFAB.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.google.gwt.event.logical.shared.*;
2424
import com.google.gwt.event.shared.HandlerRegistration;
2525
import gwt.material.design.client.base.HasAxis;
26+
import gwt.material.design.client.base.HasOpenClose;
2627
import gwt.material.design.client.base.HasType;
2728
import gwt.material.design.client.base.MaterialWidget;
2829
import gwt.material.design.client.base.mixin.CssNameMixin;
@@ -61,7 +62,7 @@
6162
*/
6263
//@formatter:on
6364
public class MaterialFAB extends MaterialWidget implements HasType<FABType>, HasAxis, HasCloseHandlers<MaterialFAB>,
64-
HasOpenHandlers<MaterialFAB> {
65+
HasOpenHandlers<MaterialFAB>, HasOpenClose {
6566

6667
private CssTypeMixin<FABType, MaterialFAB> typeMixin;
6768
private CssNameMixin<MaterialFAB, Axis> axisMixin;
@@ -93,6 +94,7 @@ protected void onLoad() {
9394
/**
9495
* Open the FAB programmatically
9596
*/
97+
@Override
9698
public void open() {
9799
open(true);
98100
}
@@ -112,6 +114,7 @@ public void open(boolean fireEvent) {
112114
/**
113115
* Close the FAB programmatically
114116
*/
117+
@Override
115118
public void close() {
116119
close(true);
117120
}
@@ -128,6 +131,11 @@ public void close(boolean fireEvent) {
128131
$(getElement()).closeFAB();
129132
}
130133

134+
@Override
135+
public boolean isOpen() {
136+
return getElement().hasClassName(CssName.ACTIVE);
137+
}
138+
131139
@Override
132140
public void setType(FABType type) {
133141
getTypeMixin().setType(type);
@@ -148,10 +156,6 @@ public Axis getAxis() {
148156
return getAxisMixin().getCssName();
149157
}
150158

151-
public boolean isOpen() {
152-
return getElement().hasClassName(CssName.ACTIVE);
153-
}
154-
155159
@Override
156160
public HandlerRegistration addCloseHandler(CloseHandler<MaterialFAB> handler) {
157161
return addHandler(handler, CloseEvent.getType());

gwt-material/src/main/java/gwt/material/design/client/ui/MaterialNavBar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import com.google.gwt.dom.client.Element;
2323
import com.google.gwt.dom.client.Style;
24+
import com.google.gwt.user.client.DOM;
2425
import com.google.gwt.user.client.ui.Widget;
2526
import gwt.material.design.client.base.HasActivates;
2627
import gwt.material.design.client.base.HasProgress;
@@ -88,8 +89,7 @@ protected void onLoad() {
8889
navMenu.setIconPosition(IconPosition.NONE);
8990

9091
// Check whether the SideNav is attached or not. If not attached Hide the NavMenu
91-
Element sideNavElement = $("\\#" + getActivatesMixin().getActivates()).asElement();
92-
92+
Element sideNavElement = $(DOM.getElementById(getActivatesMixin().getActivates())).asElement();
9393
navMenu.setDisplay(sideNavElement == null ? Display.NONE : Display.INITIAL);
9494
}
9595

0 commit comments

Comments
 (0)