Skip to content

Commit 2b4ac45

Browse files
authored
Merge pull request #55 from GwtMaterialDesign/release_2.0
Release 2.0-rc5
2 parents fc00213 + 76c0589 commit 2b4ac45

File tree

126 files changed

+1415
-637
lines changed

Some content is hidden

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

126 files changed

+1415
-637
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ before_install:
2222
- mvn install -DskipTests=true -DdryRun=true
2323
- cd ..
2424
# install the gwt-material-table library before we build the demo
25-
- git clone -b release_1.0 https://github.com/GwtMaterialDesign/gwt-material-table.git
25+
- git clone -b release_2.0 https://github.com/GwtMaterialDesign/gwt-material-table.git
2626
- cd gwt-material-table
2727
- mvn install -DskipTests=true -DdryRun=true
2828
- cd ..

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<img src="http://i.imgur.com/EL4vCgx.png"/>
2-
#gwt-material-demo [![Build Status](https://travis-ci.org/GwtMaterialDesign/gwt-material-demo.svg?branch=master)](https://travis-ci.org/GwtMaterialDesign/gwt-material-demo)
2+
3+
#gwt-material-demo
4+
5+
[![Build Status](https://travis-ci.org/GwtMaterialDesign/gwt-material-demo.svg?branch=master)](https://travis-ci.org/GwtMaterialDesign/gwt-material-demo)
6+
37
Demo application to show the features of the [gwt-material](https://github.com/GwtMaterialDesign/gwt-material) library.
48

5-
### Release 2.0-rc4 Demo
9+
### Release 2.0-rc5 Demo
610
[http://gwtmaterialdesign.github.io/gwt-material-demo](http://gwtmaterialdesign.github.io/gwt-material-demo)
711
```xml
812
<dependency>
913
<groupId>com.github.gwtmaterialdesign</groupId>
1014
<artifactId>gwt-material-demo</artifactId>
11-
<version>2.0-rc4</version>
15+
<version>2.0-rc5</version>
1216
</dependency>
1317
```
1418

pom.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
<parent>
55
<artifactId>gwt-material-parent</artifactId>
66
<groupId>com.github.gwtmaterialdesign</groupId>
7-
<version>2.0-rc4</version>
7+
<version>2.0-rc5</version>
88
</parent>
99

1010
<modelVersion>4.0.0</modelVersion>
1111

1212
<artifactId>gwt-material-demo</artifactId>
1313
<packaging>war</packaging>
14-
<version>2.0-rc4</version>
14+
<version>2.0-rc5</version>
1515
<name>Gwt Material Demo</name>
1616
<description>Showcase for gwt-material</description>
1717

@@ -34,8 +34,7 @@
3434
<gwt.version>2.8.0</gwt.version>
3535
<gwtp.version>1.5.3</gwtp.version>
3636
<gin.version>2.1.2</gin.version>
37-
<gwt-material.version>2.0-rc4</gwt-material.version>
38-
<gwt-material-table.version>1.0-rc4</gwt-material-table.version>
37+
<gwt-material.version>2.0-rc5</gwt-material.version>
3938

4039
<gwt.style>PRETTY</gwt.style>
4140

@@ -267,7 +266,7 @@
267266
<dependency>
268267
<groupId>com.github.gwtmaterialdesign</groupId>
269268
<artifactId>gwt-material-table</artifactId>
270-
<version>${gwt-material-table.version}</version>
269+
<version>${gwt-material.version}</version>
271270
</dependency>
272271

273272
<!-- App Engine -->

src/main/java/gwt/material/design/demo/client/application/ApplicationPresenter.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@
3131
import com.gwtplatform.mvp.client.proxy.NavigationEvent;
3232
import com.gwtplatform.mvp.client.proxy.NavigationHandler;
3333
import com.gwtplatform.mvp.client.proxy.Proxy;
34-
import gwt.material.design.client.ui.MaterialToast;
3534
import gwt.material.design.demo.client.application.menu.MenuPresenter;
35+
import gwt.material.design.demo.client.event.ContentPushEvent;
36+
import gwt.material.design.demo.client.event.SetPageTitleEvent;
3637

3738
import javax.inject.Inject;
3839

3940
public class ApplicationPresenter extends Presenter<ApplicationPresenter.MyView, ApplicationPresenter.MyProxy>
40-
implements NavigationHandler {
41+
implements NavigationHandler, SetPageTitleEvent.SetPageTitleHandler {
42+
4143
public interface MyView extends View {
44+
void setPageTitle(String title, String description, String link, String specification);
4245
}
4346

4447
public static final PermanentSlot<MenuPresenter> SLOT_MENU = new PermanentSlot<>();
@@ -64,6 +67,7 @@ protected void onBind() {
6467
setInSlot(SLOT_MENU, menuPresenter);
6568

6669
addRegisteredHandler(NavigationEvent.getType(), this);
70+
addRegisteredHandler(SetPageTitleEvent.TYPE, this);
6771
}
6872

6973
@Override
@@ -75,4 +79,9 @@ protected void onReveal() {
7579
public void onNavigation(NavigationEvent navigationEvent) {
7680
Window.scrollTo(0, 0);
7781
}
82+
83+
@Override
84+
public void onSetPageTitle(SetPageTitleEvent event) {
85+
getView().setPageTitle(event.getTitle(), event.getDescription(), event.getLink(), event.getSpecification());
86+
}
7887
}

src/main/java/gwt/material/design/demo/client/application/ApplicationView.java

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* #L%
2121
*/
2222

23+
import com.google.gwt.dom.client.Style;
2324
import com.google.gwt.event.dom.client.ClickEvent;
2425
import com.google.gwt.uibinder.client.UiBinder;
2526
import com.google.gwt.uibinder.client.UiField;
@@ -30,8 +31,9 @@
3031
import com.google.gwt.user.client.ui.RootPanel;
3132
import com.google.gwt.user.client.ui.Widget;
3233
import com.gwtplatform.mvp.client.ViewImpl;
33-
import gwt.material.design.client.ui.MaterialFooter;
34-
import gwt.material.design.client.ui.MaterialFooterCopyright;
34+
import gwt.material.design.client.ui.*;
35+
import gwt.material.design.client.ui.animate.MaterialAnimator;
36+
import gwt.material.design.client.ui.animate.Transition;
3537
import gwt.material.design.demo.client.ThemeManager;
3638

3739
import javax.inject.Inject;
@@ -40,12 +42,23 @@ public class ApplicationView extends ViewImpl implements ApplicationPresenter.My
4042
public interface Binder extends UiBinder<Widget, ApplicationView> {
4143
}
4244

45+
private String link;
46+
private String specification;
47+
4348
@UiField HTMLPanel menu;
4449
@UiField HTMLPanel main;
4550

4651
@UiField MaterialFooter footer;
4752
@UiField MaterialFooterCopyright footerCopyRight;
4853

54+
@UiField
55+
MaterialPanel panel, titlePanel;
56+
@UiField
57+
MaterialLabel title, description;
58+
59+
@UiField
60+
MaterialChip chipXml, chipJava, chipSpecification;
61+
4962
@Inject
5063
ApplicationView(Binder uiBinder) {
5164
initWidget(uiBinder.createAndBindUi(this));
@@ -55,10 +68,58 @@ public interface Binder extends UiBinder<Widget, ApplicationView> {
5568
bindSlot(ApplicationPresenter.SLOT_MENU, menu);
5669
bindSlot(ApplicationPresenter.SLOT_MAIN, main);
5770
DOM.removeChild(RootPanel.getBodyElement(), DOM.getElementById("splashscreen"));
71+
72+
chipJava.getElement().getStyle().setCursor(Style.Cursor.POINTER);
73+
chipJava.addClickHandler(clickEvent -> {
74+
String java = "https://github.com/GwtMaterialDesign/gwt-material-demo/tree/master/src/main/java/gwt/material/design/demo/client/application/" + link + ".java";
75+
Window.open(java, "_blank", "");
76+
});
77+
78+
chipXml.getElement().getStyle().setCursor(Style.Cursor.POINTER);
79+
chipXml.addClickHandler(clickEvent -> {
80+
String xml = "https://github.com/GwtMaterialDesign/gwt-material-demo/tree/master/src/main/java/gwt/material/design/demo/client/application/" + link + ".ui.xml";
81+
Window.open(xml, "_blank", "");
82+
});
83+
chipSpecification.getElement().getStyle().setCursor(Style.Cursor.POINTER);
84+
chipSpecification.addClickHandler(clickEvent -> {
85+
Window.open(specification, "_blank", "");
86+
});
87+
ThemeManager.register(chipXml, ThemeManager.DARKER_SHADE);
88+
ThemeManager.register(chipXml.getLetterMixin().getSpan(), ThemeManager.LIGHTER_SHADE);
89+
ThemeManager.register(chipJava, ThemeManager.DARKER_SHADE);
90+
ThemeManager.register(chipJava.getLetterMixin().getSpan(), ThemeManager.LIGHTER_SHADE);
91+
ThemeManager.register(chipSpecification, ThemeManager.DARKER_SHADE);
92+
ThemeManager.register(chipSpecification.getLetterMixin().getSpan(), ThemeManager.LIGHTER_SHADE);
93+
ThemeManager.register(titlePanel);
5894
}
5995

6096
@UiHandler("imgGPlus")
6197
void onGPlus(ClickEvent e){
6298
Window.open("https://plus.google.com/communities/108005250093449814286", "", "_blank");
6399
}
100+
101+
@Override
102+
public void setPageTitle(String title, String description, String link, String specification) {
103+
this.title.setText(title);
104+
this.description.setText(description);
105+
this.link = link;
106+
this.specification = specification;
107+
108+
if (link.isEmpty()) {
109+
chipJava.setVisible(false);
110+
chipXml.setVisible(false);
111+
} else {
112+
chipJava.setVisible(true);
113+
chipXml.setVisible(true);
114+
}
115+
116+
if (specification.isEmpty()) {
117+
chipSpecification.setVisible(false);
118+
} else {
119+
chipSpecification.setVisible(true);
120+
}
121+
122+
MaterialAnimator.animate(Transition.BOUNCEINLEFT, this.title, 1000);
123+
MaterialAnimator.animate(Transition.BOUNCEINLEFT, this.description, 1000);
124+
}
64125
}

src/main/java/gwt/material/design/demo/client/application/ApplicationView.ui.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,19 @@
4747
<g:HTMLPanel>
4848

4949
<g:HTMLPanel ui:field="menu" />
50+
5051
<m:MaterialContainer>
52+
<m:MaterialPanel ui:field="titlePanel" backgroundColor="BLUE" textColor="WHITE" marginTop="56" padding="56" shadow="1">
53+
<m:MaterialPanel ui:field="panel">
54+
<m:MaterialLabel ui:field="title" text="GWT-Material" fontSize="2.3em"/>
55+
<m:MaterialLabel ui:field="description" text="A Material Design look and feel for GWT Apps plus Phonegap." fontSize="1.1em"/>
56+
<m:MaterialPanel marginTop="20">
57+
<m:MaterialChip ui:field="chipXml" letter="X" textColor="WHITE" margin="6" text="XML" />
58+
<m:MaterialChip ui:field="chipJava" letter="J" textColor="WHITE" text="JAVA" margin="6" />
59+
<m:MaterialChip ui:field="chipSpecification" letter="S" textColor="WHITE" text="SPECIFICATION" margin="6" />
60+
</m:MaterialPanel>
61+
</m:MaterialPanel>
62+
</m:MaterialPanel>
5163
<g:HTMLPanel ui:field="main" addStyleNames="{style.panel} panel" />
5264

5365
<m:MaterialPanel>

src/main/java/gwt/material/design/demo/client/application/about/AboutPresenter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ public interface MyProxy extends ProxyPlace<AboutPresenter> {
5050
protected void onReveal() {
5151
super.onReveal();
5252

53-
SetPageTitleEvent.fire("GWT Material", "A Material Design look and feel for GWT Apps plus Phonegap.", "", this);
53+
SetPageTitleEvent.fire("GWT Material", "A Material Design look and feel for GWT Apps plus Phonegap.", "", "", this);
5454
}
5555
}

src/main/java/gwt/material/design/demo/client/application/addins/autocomplete/AutoCompletePresenter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected void onReveal() {
5555
super.onReveal();
5656

5757
SetPageTitleEvent.fire("Autocomplete", "Autocompletes are best way for selecting item easily and " +
58-
"grouped them into chips for later search based on item values.", "addins/autocomplete/AutoCompleteView", this);
58+
"grouped them into chips for later search based on item values.", "addins/autocomplete/AutoCompleteView", "", this);
5959
}
6060

6161
}

src/main/java/gwt/material/design/demo/client/application/addins/avatar/AvatarPresenter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ interface MyProxy extends ProxyPlace<AvatarPresenter> {
5353
@Override
5454
protected void onReveal() {
5555
super.onReveal();
56-
SetPageTitleEvent.fire("Avatar", "Generated avatar based on JDenticon that provides a unique avatar based on unique name.", "addins/avatar/AvatarView", this);
56+
SetPageTitleEvent.fire("Avatar", "Generated avatar based on JDenticon that provides a unique avatar based on unique name.", "addins/avatar/AvatarView", "", this);
5757
}
5858

5959
}

src/main/java/gwt/material/design/demo/client/application/addins/avatar/AvatarView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ interface Binder extends UiBinder<Widget, AvatarView> {
5151
@UiHandler("txtAvatarName")
5252
void onUpdateAvatar(KeyUpEvent e) {
5353
avatar.setName(txtAvatarName.getText());
54-
avatar.initialize();
54+
avatar.reinitialize();
5555
}
5656
}

0 commit comments

Comments
 (0)