Skip to content

Commit 1b909f2

Browse files
authored
Merge pull request #1022 from GwtMaterialDesign/release_2.6.0
Release 2.6.0
2 parents 8a429df + 4be2a83 commit 1b909f2

Some content is hidden

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

51 files changed

+14829
-142
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ 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.5.0_rc1 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
11+
- git clone -b release_2.6.0 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
1212
- cd gwt-material-jquery
1313
- mvn install -DskipTests=true -DdryRun=true
1414
- 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.5.0_rc1" ]; then
3+
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.6.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.5.0
23+
### Current Version 2.6.0
2424
```xml
2525
<dependency>
2626
<groupId>com.github.gwtmaterialdesign</groupId>
2727
<artifactId>gwt-material</artifactId>
28-
<version>2.5.0</version>
28+
<version>2.6.0</version>
2929
</dependency>
3030
```
31-
### Snapshot Version 2.5.0
31+
### Snapshot Version 2.6.1-SNAPSHOT
3232
```xml
3333
<dependency>
3434
<groupId>com.github.gwtmaterialdesign</groupId>
3535
<artifactId>gwt-material</artifactId>
36-
<version>2.5.0</version>
36+
<version>2.6.1-SNAPSHOT</version>
3737
</dependency>
3838
```
3939

gwt-material/pom.xml

Lines changed: 21 additions & 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.5.0</version>
7+
<version>2.6.0</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

@@ -41,6 +41,26 @@
4141
<artifactId>htmlunit</artifactId>
4242
<version>${htmlunit.version}</version>
4343
</dependency>
44+
<dependency>
45+
<groupId>com.google.elemental2</groupId>
46+
<artifactId>elemental2-core</artifactId>
47+
<version>${elemental2.version}</version>
48+
</dependency>
49+
<dependency>
50+
<groupId>com.google.elemental2</groupId>
51+
<artifactId>elemental2-promise</artifactId>
52+
<version>${elemental2.version}</version>
53+
</dependency>
54+
<dependency>
55+
<groupId>com.google.elemental2</groupId>
56+
<artifactId>elemental2-dom</artifactId>
57+
<version>${elemental2.version}</version>
58+
</dependency>
59+
<dependency>
60+
<groupId>com.google.elemental2</groupId>
61+
<artifactId>elemental2-media</artifactId>
62+
<version>${elemental2.version}</version>
63+
</dependency>
4464
</dependencies>
4565

4666
<repositories>

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@
2121

2222
import gwt.material.design.client.base.AbstractIconButton;
2323
import gwt.material.design.client.constants.IconType;
24+
import gwt.material.design.client.ui.animate.MaterialAnimation;
25+
import gwt.material.design.client.ui.animate.Transition;
2426

2527
public class DefaultButtonLoader implements AsyncIconDisplayLoader<String> {
2628

2729
protected String initialText;
2830
protected IconType initialIcon;
2931
protected AbstractIconButton button;
32+
protected MaterialAnimation animation;
3033

3134
protected DefaultButtonLoader() {}
3235

@@ -43,8 +46,13 @@ public DefaultButtonLoader(AbstractIconButton button) {
4346
@Override
4447
public void loading() {
4548
button.setEnabled(false);
46-
button.setText("Loading");
4749
button.setIconType(getLoadingIcon());
50+
animation = new MaterialAnimation();
51+
animation.delay(0);
52+
animation.duration(600);
53+
animation.setTransition(Transition.SPIN);
54+
animation.setInfinite(true);
55+
animation.animate(button.getIcon());
4856
}
4957

5058
@Override
@@ -67,6 +75,10 @@ public void finalize() {
6775
if (initialIcon != null) {
6876
button.setIconType(initialIcon);
6977
}
78+
79+
if (animation != null) {
80+
animation.stopAnimation();
81+
}
7082
}
7183

7284

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ public String getCustomIconType() {
140140
return icon.getCustomIconType();
141141
}
142142

143+
@Override
144+
public void setIconDisplay(IconDisplay iconDisplay) {
145+
icon.setIconDisplay(iconDisplay);
146+
}
147+
148+
@Override
149+
public IconDisplay getIconDisplay() {
150+
return icon.getIconDisplay();
151+
}
152+
143153
/**
144154
* Ensure the icon is attached in slot 0.
145155
*/

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

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import gwt.material.design.client.base.mixin.DensityMixin;
3535
import gwt.material.design.client.base.mixin.OverlayStyleMixin;
3636
import gwt.material.design.client.base.mixin.StyleMixin;
37+
import gwt.material.design.client.base.mixin.ToggleStyleMixin;
3738
import gwt.material.design.client.base.viewport.ViewPort;
3839
import gwt.material.design.client.base.viewport.WidthBoundary;
3940
import gwt.material.design.client.constants.*;
@@ -62,7 +63,6 @@ public abstract class AbstractSideNav extends MaterialWidget
6263
protected int width = 240;
6364
protected int inDuration = 400;
6465
protected int outDuration = 200;
65-
protected boolean open;
6666
protected boolean closeOnClick;
6767
protected boolean alwaysShowActivator = true;
6868
protected boolean allowBodyScroll = true;
@@ -76,6 +76,7 @@ public abstract class AbstractSideNav extends MaterialWidget
7676
private StyleMixin<MaterialSideNav> typeMixin;
7777
private OverlayStyleMixin<AbstractSideNav> overlayStyleMixin;
7878
private DensityMixin<AbstractSideNav> densityMixin;
79+
private ToggleStyleMixin<AbstractSideNav> openMixin;
7980

8081
public AbstractSideNav() {
8182
super(Document.get().createULElement(), CssName.SIDE_NAV);
@@ -431,10 +432,8 @@ protected MaterialWidget getNavMenu() {
431432
}
432433

433434
protected void onClosing() {
434-
open = false;
435-
$("#sidenav-overlay").remove();
435+
getOpenMixin().setOn(false);
436436
SideNavClosingEvent.fire(this);
437-
438437
resetOverlayStyle();
439438
}
440439

@@ -443,14 +442,7 @@ protected void onClosed() {
443442
}
444443

445444
protected void onOpening() {
446-
open = true;
447-
448-
$("#sidenav-overlay").each((param1, element) -> {
449-
if (element != null) {
450-
element.removeFromParent();
451-
}
452-
});
453-
445+
getOpenMixin().setOn(true);
454446
SideNavOpeningEvent.fire(this);
455447
}
456448

@@ -472,7 +464,14 @@ protected void onOverlayAttached() {
472464
* Hide the overlay menu.
473465
*/
474466
public void hideOverlay() {
475-
$("#sidenav-overlay").remove();
467+
JQueryElement overlayElement = getOverlayElement();
468+
if (overlayElement != null) {
469+
overlayElement.each((param1, element) -> {
470+
if (element != null) {
471+
element.removeFromParent();
472+
}
473+
});
474+
}
476475
}
477476

478477
/**
@@ -488,8 +487,9 @@ public void show() {
488487
*/
489488
@Override
490489
public void open() {
491-
$("#sidenav-overlay").remove();
492-
$(activator).sideNav("show");
490+
if (!isOpen()) {
491+
$(activator).sideNav("show");
492+
}
493493
}
494494

495495
/**
@@ -510,7 +510,7 @@ public void close() {
510510

511511
@Override
512512
public boolean isOpen() {
513-
return open;
513+
return getOpenMixin().isOn();
514514
}
515515

516516
/**
@@ -696,4 +696,11 @@ protected DensityMixin<AbstractSideNav> getDensityMixin() {
696696
}
697697
return densityMixin;
698698
}
699+
700+
public ToggleStyleMixin<AbstractSideNav> getOpenMixin() {
701+
if (openMixin == null) {
702+
openMixin = new ToggleStyleMixin<>(this, "opened");
703+
}
704+
return openMixin;
705+
}
699706
}

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
package gwt.material.design.client.base;
2121

2222
import com.google.gwt.dom.client.Style;
23-
import gwt.material.design.client.constants.Color;
24-
import gwt.material.design.client.constants.IconPosition;
25-
import gwt.material.design.client.constants.IconSize;
26-
import gwt.material.design.client.constants.IconType;
23+
import gwt.material.design.client.constants.*;
2724
import gwt.material.design.client.ui.MaterialIcon;
2825

2926
public interface HasIcon {
@@ -84,4 +81,14 @@ public interface HasIcon {
8481
* Will get the css class for custom icons.
8582
*/
8683
String getCustomIconType();
84+
85+
/**
86+
* Will set the icon display structure.
87+
* OUTLINED, FILLED, ROUNDED, SHARP and TWO TONE
88+
*
89+
* @see <a href="https://fonts.google.com/icons">Example</a>
90+
*/
91+
void setIconDisplay(IconDisplay iconDisplay);
92+
93+
IconDisplay getIconDisplay();
8794
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2022 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 HasTruncate {
23+
24+
/**
25+
* If true the label inside this component will be truncated by ellipsis
26+
**/
27+
void setTruncate(boolean truncate);
28+
29+
boolean isTruncate();
30+
31+
/**
32+
* Will enable long texts to set the elements attribute when mouse overed the truncated text
33+
*/
34+
void setEnableTruncateTitle(boolean value);
35+
36+
boolean isEnableTruncateTitle();
37+
}

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

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class MaterialWidget extends ComplexPanel implements HasId, HasEnabled, H
5454
HasShadow, Focusable, HasInlineStyle, HasSeparator, HasScrollspy, HasHideOn, HasShowOn, HasCenterOn, HasCircle, HasWaves,
5555
HasDataAttributes, HasFloat, HasTooltip, HasFlexbox, HasHoverable, HasFontWeight, HasFontSize, HasDepth, HasInitialClasses,
5656
HasInteractionHandlers, HasAllFocusHandlers, HasFilterStyle, HasBorder, HasVerticalAlign, HasTransform, HasOrientation,
57-
HasContainer, HasWordBreak, HasZoom, HasGridLayout, HasResize, HasContentEditable {
57+
HasContainer, HasWordBreak, HasZoom, HasGridLayout, HasResize, HasContentEditable, HasTruncate {
5858

5959
private static JQueryElement window = null;
6060
private static JQueryElement body = null;
@@ -125,7 +125,7 @@ public Appender(Widget widget) {
125125
private FlexboxMixin<MaterialWidget> flexboxMixin;
126126
private ToggleStyleMixin<MaterialWidget> hoverableMixin;
127127
private CssNameMixin<MaterialWidget, FontWeight> fontWeightMixin;
128-
private ToggleStyleMixin<MaterialWidget> truncateMixin;
128+
private TruncateMixin<MaterialWidget> truncateMixin;
129129
private FilterStyleMixin<MaterialWidget> filterMixin;
130130
private BorderMixin<MaterialWidget> borderMixin;
131131
private DimensionMixin<MaterialWidget> dimensionMixin;
@@ -1065,15 +1065,25 @@ public String getFilterStyle() {
10651065
return getFilterStyleMixin().getFilterStyle();
10661066
}
10671067

1068-
/**
1069-
* If true the label inside this component will be truncated by ellipsis
1070-
**/
1068+
1069+
@Override
10711070
public void setTruncate(boolean truncate) {
1072-
getTruncateMixin().setOn(truncate);
1071+
getTruncateMixin().setTruncate(truncate);
10731072
}
10741073

1074+
@Override
10751075
public boolean isTruncate() {
1076-
return getTruncateMixin().isOn();
1076+
return getTruncateMixin().isTruncate();
1077+
}
1078+
1079+
@Override
1080+
public void setEnableTruncateTitle(boolean value) {
1081+
getTruncateMixin().setEnableTruncateTitle(value);
1082+
}
1083+
1084+
@Override
1085+
public boolean isEnableTruncateTitle() {
1086+
return getTruncateMixin().isEnableTruncateTitle();
10771087
}
10781088

10791089
@Override
@@ -1880,9 +1890,9 @@ protected CssNameMixin<MaterialWidget, FontWeight> getFontWeightMixin() {
18801890
return fontWeightMixin;
18811891
}
18821892

1883-
public ToggleStyleMixin<MaterialWidget> getTruncateMixin() {
1893+
public TruncateMixin<MaterialWidget> getTruncateMixin() {
18841894
if (truncateMixin == null) {
1885-
truncateMixin = new ToggleStyleMixin<>(this, CssName.TRUNCATE);
1895+
truncateMixin = new TruncateMixin<>(this);
18861896
}
18871897
return truncateMixin;
18881898
}

0 commit comments

Comments
 (0)