Skip to content

Commit fb471a4

Browse files
authored
Merge pull request #63 from GwtMaterialDesign/release_2.0
Release 2.0-rc6
2 parents 057793c + 0f3d29a commit fb471a4

32 files changed

+765
-272
lines changed

.utility/update_demo_site.sh

Lines changed: 12 additions & 12 deletions
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" == "master" ]; then
3+
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.0" ]; then
44

55
if [[ -z "$GH_TOKEN" ]]; then
66
echo -e "GH_TOKEN is not set"
@@ -24,23 +24,23 @@ git clone --quiet --branch=gh-pages https://[email protected]/GwtMaterialDesi
2424
cd gh-pages
2525

2626
# remove the GwtMaterialDemo directories from git.
27-
if [[ -d ./gwtmaterialdemo ]]; then
28-
git rm -rf ./gwtmaterialdemo
27+
if [[ -d ./snapshot/gwtmaterialdemo ]]; then
28+
git rm -rf ./snapshot/gwtmaterialdemo
2929
fi
30-
if [[ -f ./index.html ]]; then
31-
git rm -rf ./index.html
30+
if [[ -f ./snapshot/index.html ]]; then
31+
git rm -rf ./snapshot/index.html
3232
fi
33-
if [[ -d ./META-INF ]]; then
34-
git rm -rf ./META-INF
33+
if [[ -d ./snapshot/META-INF ]]; then
34+
git rm -rf ./snapshot/META-INF
3535
fi
36-
if [[ -d ./WEB-INF ]]; then
37-
git rm -rf ./WEB-INF
36+
if [[ -d ./snapshot/WEB-INF ]]; then
37+
git rm -rf ./snapshot/WEB-INF
3838
fi
3939

4040
# copy the new GwtMaterialDemo the snapshot dir.
41-
unzip -u $TRAVIS_BUILD_DIR/target/gwt-material-demo-*.war -d ./
42-
rm -rf ./META-INF
43-
rm -rf ./WEB-INF
41+
unzip -u $TRAVIS_BUILD_DIR/target/gwt-material-demo-*.war -d ./snapshot/
42+
rm -rf ./snapshot/META-INF
43+
rm -rf ./snapshot/WEB-INF
4444

4545
git add -f .
4646
git commit -m "Auto-push demo to gh-pages successful. (Travis build: $TRAVIS_BUILD_NUMBER)"

pom.xml

Lines changed: 4 additions & 4 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-rc5</version>
7+
<version>2.0-rc6</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-rc5</version>
14+
<version>2.0-rc6</version>
1515
<name>Gwt Material Demo</name>
1616
<description>Showcase for gwt-material</description>
1717

@@ -31,10 +31,10 @@
3131
<project.encoding>UTF-8</project.encoding>
3232

3333
<!-- GWT -->
34-
<gwt.version>2.8.0</gwt.version>
34+
<gwt.version>2.8.1</gwt.version>
3535
<gwtp.version>1.5.3</gwtp.version>
3636
<gin.version>2.1.2</gin.version>
37-
<gwt-material.version>2.0-rc5</gwt-material.version>
37+
<gwt-material.version>2.0-rc6</gwt-material.version>
3838

3939
<gwt.style>PRETTY</gwt.style>
4040

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import gwt.material.design.demo.client.application.addins.datatable.DataTableModule;
3333
import gwt.material.design.demo.client.application.addins.dnd.DndModule;
3434
import gwt.material.design.demo.client.application.addins.docviewer.DocViewerModule;
35+
import gwt.material.design.demo.client.application.addins.emptystates.EmptyStatesModule;
3536
import gwt.material.design.demo.client.application.addins.fileuploader.FileUploaderModule;
3637
import gwt.material.design.demo.client.application.addins.iconmorph.IconMorphModule;
3738
import gwt.material.design.demo.client.application.addins.masonry.MasonryModule;
@@ -83,5 +84,6 @@ protected void configure() {
8384
install(new ComboBoxModule());
8485
install(new DataTableModule());
8586
install(new OverlayModule());
87+
install(new EmptyStatesModule());
8688
}
8789
}

src/main/java/gwt/material/design/demo/client/application/addins/datatable/DataTableView.ui.xml

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
</m:MaterialRow>
4949

5050
<m:MaterialRow addStyleNames="code">
51+
<m:MaterialBadge text="FEATURE UPDATE" textColor="AMBER" shadow="1" layoutPosition="RELATIVE" float="RIGHT" backgroundColor="AMBER_LIGHTEN_5" />
5152
<m:MaterialTitle scrollspy="standard_table" title="Standard Table" description="You can filter any options below." />
5253
<m:MaterialPanel ui:field="standardTablePanel" />
5354
</m:MaterialRow>
@@ -67,6 +68,7 @@
6768
</m:MaterialRow>
6869

6970
<m:MaterialRow addStyleNames="code">
71+
<m:MaterialBadge text="FEATURE UPDATE" textColor="AMBER" shadow="1" layoutPosition="RELATIVE" float="RIGHT" backgroundColor="AMBER_LIGHTEN_5" />
7072
<m:MaterialTitle scrollspy="datatable_events" title="DataTable Events" />
7173
<g:HTMLPanel>
7274
<blockquote>
@@ -81,7 +83,9 @@
8183
<p><b>Row Short Press Event - </b>Add a row short press handler, called when a row is short pressed.</p>
8284
<p><b>Selection Event - </b>Add a selection handler, called when a row is selected</p>
8385
<p><b>Row Context Menu - </b>Add a row context menu handler, called when user right click a row to open context menu.</p>
84-
</blockquote>
86+
87+
<p><b>Rendered Event - </b>Add a row context menu handler, called when user right click a row to open context menu.</p>
88+
<p><b>Components Rendered Event - </b>Called each time when components are rendered, which includes sorting renders and refreshView() renders.</p></blockquote>
8589
</g:HTMLPanel>
8690
</m:MaterialRow>
8791

@@ -92,6 +96,22 @@
9296
</demo:PrettyPre>
9397
<m:MaterialLink iconType="LINK" href="https://github.com/GwtMaterialDesign/gwt-material-table-sample/blob/master/src/main/java/gwt/material/design/sample/client/ui/factory/PersonRowFactory.java" target="_blank" text="Link to Person Row Factory" />
9498
</m:MaterialRow>
99+
100+
<m:MaterialRow addStyleNames="code">
101+
<m:MaterialBadge text="FEATURE UPDATE" textColor="AMBER" shadow="1" layoutPosition="RELATIVE" float="RIGHT" backgroundColor="AMBER_LIGHTEN_5" />
102+
<m:MaterialTitle scrollspy="row_api" title="updateRow(model) and getRowByModel(model)" description="Using these Row Apis, you can now easily access the update / refresh the row realtime and also get the row component." />
103+
<demo:PrettyPre addStyleNames="lang-java">
104+
&emsp;// Get the Row <br/>
105+
table.getByModelRow(person); <br/><br/>
106+
107+
// Update the row model <br/>
108+
Person firstPerson = people.get(0); <br/>
109+
firstPerson.setFirstName(firstName); <br/>
110+
firstPerson.setLastName(lastName); <br/>
111+
firstPerson.setEmail(email); <br/>
112+
table.updateRow(firstPerson);
113+
</demo:PrettyPre>
114+
</m:MaterialRow>
95115

96116
<m:MaterialRow addStyleNames="code">
97117
<m:MaterialTitle scrollspy="category_factory" title="Category Factory" description="If we want to generate all our categories using CustomCategoryComponent We can define our own CategoryComponentFactory. There we can define our own CategoryComponent implementations." />
@@ -100,7 +120,40 @@
100120
</demo:PrettyPre>
101121
<m:MaterialLink iconType="LINK" href="https://github.com/GwtMaterialDesign/gwt-material-table-sample/blob/master/src/main/java/gwt/material/design/sample/client/ui/factory/CustomCategoryFactory.java" target="_blank" text="Link to Category Factory" />
102122
</m:MaterialRow>
103-
123+
124+
<m:MaterialRow addStyleNames="code">
125+
<m:MaterialBadge text="FEATURE UPDATE" textColor="AMBER" shadow="1" layoutPosition="RELATIVE" float="RIGHT" backgroundColor="AMBER_LIGHTEN_5" />
126+
<m:MaterialTitle scrollspy="adding_categories" title="Adding Categories" description="You can easily add categories by calling table.addCategory(String)." />
127+
<demo:PrettyPre addStyleNames="lang-java">
128+
&emsp;String newCategory = "New Category"; <br/>
129+
table.addCategory(newCategory);
130+
</demo:PrettyPre>
131+
</m:MaterialRow>
132+
133+
<m:MaterialRow addStyleNames="code">
134+
<m:MaterialBadge text="FEATURE UPDATE" textColor="AMBER" shadow="1" layoutPosition="RELATIVE" float="RIGHT" backgroundColor="AMBER_LIGHTEN_5" />
135+
<m:MaterialTitle scrollspy="category_thead" title="Adding Category Columns" description="You can easily add columns inside the Category Subheader." />
136+
<demo:PrettyPre addStyleNames="lang-java">
137+
&emsp;public static class CustomCategoryComponent extends CategoryComponent { <br/>
138+
&emsp;public CustomCategoryComponent(String category) { <br/>
139+
&emsp;&emsp;super(category); <br/>
140+
&emsp;} <br/><br/>
141+
142+
&emsp;@Override <br/>
143+
&emsp;protected void render(TableSubHeader subheader) { <br/>
144+
&emsp;&emsp;super.render(subheader); <br/><br/>
145+
146+
&emsp;&emsp;subheader.setOpenIcon(IconType.FOLDER_OPEN); <br/>
147+
&emsp;&emsp;subheader.setCloseIcon(IconType.FOLDER); <br/><br/>
148+
149+
&emsp;&emsp;TableHeader badgeTh = new TableHeader(); <br/>
150+
&emsp;&emsp;badgeTh.add(new MaterialBadge("Some badge")); <br/>
151+
&emsp;&emsp;subheader.add(badgeTh); <br/>
152+
&emsp;} <br/>
153+
}
154+
</demo:PrettyPre>
155+
</m:MaterialRow>
156+
104157
<m:MaterialRow addStyleNames="code">
105158
<m:MaterialTitle scrollspy="renderer" title="Renderer" description="It is possible to create your own custom renderer per table When you use the BaseRenderer you can override certain draw methods to create elements the way you would like." />
106159
<demo:PrettyPre addStyleNames="lang-java">
@@ -114,7 +167,7 @@
114167
<demo:PrettyPre addStyleNames="lang-java">
115168
&emsp;table.addColumn(new TextColumn&lt;Person>() {<br/>
116169
&emsp;@Override<br/>
117-
&emsp;public Comparator&lt;? super RowComponent&lt;Person>> getSortComparator() {<br/>
170+
&emsp;public Comparator&lt;? super RowComponent&lt;Person>> sortComparator() {<br/>
118171
&emsp;&emsp;return (o1, o2) -> o1.getData().getFirstName().compareToIgnoreCase(o2.getData().getFirstName());<br/>
119172
&emsp;}<br/>
120173
&emsp;@Override<br/>
@@ -144,6 +197,29 @@
144197
});
145198
</demo:PrettyPre>
146199
</m:MaterialRow>
200+
201+
<m:MaterialRow addStyleNames="code">
202+
<m:MaterialBadge text="FEATURE UPDATE" textColor="AMBER" shadow="1" layoutPosition="RELATIVE" float="RIGHT" backgroundColor="AMBER_LIGHTEN_5" />
203+
<m:MaterialTitle scrollspy="columns_auto_sort" title="Auto Sort Columns" description="Make this column auto sort on rendering, if multiple columns are auto sorting it will be based on the first one set to auto sort." />
204+
<demo:PrettyPre addStyleNames="lang-java">
205+
&emsp;table.addColumn(new TextColumn&lt;Person>() { <br/>
206+
&emsp;@Override <br/>
207+
&emsp;public boolean autoSort() { <br/>
208+
&emsp;&emsp;return true; <br/>
209+
&emsp;} <br/><br/>
210+
211+
&emsp;@Override <br/>
212+
&emsp;public Comparator&lt;? super RowComponent&lt;Person>> sortComparator() { <br/>
213+
&emsp;&emsp;return (o1, o2) -> o1.getData().getFirstName().compareToIgnoreCase(o2.getData().getFirstName()); <br/>
214+
&emsp;} <br/><br/>
215+
216+
&emsp;@Override <br/>
217+
&emsp;public String getValue(Person object) { <br/>
218+
&emsp;&emsp;return object.getFirstName(); <br/>
219+
&emsp;} <br/>
220+
}, "First Name");
221+
</demo:PrettyPre>
222+
</m:MaterialRow>
147223

148224
<m:MaterialRow addStyleNames="code">
149225
<m:MaterialTitle scrollspy="visible_range" title="Set Visible Range" description="Set the visible range of the table for pager." />

src/main/java/gwt/material/design/demo/client/application/addins/datatable/table/CustomTable.java

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public MaterialImage getValue(Person object) {
133133
// There are a number of methods that can provide custom column configurations.
134134
table.addColumn(new TextColumn<Person>() {
135135
@Override
136-
public Comparator<? super RowComponent<Person>> getSortComparator() {
136+
public Comparator<? super RowComponent<Person>> sortComparator() {
137137
return (o1, o2) -> o1.getData().getFirstName().compareToIgnoreCase(o2.getData().getFirstName());
138138
}
139139

@@ -145,7 +145,7 @@ public String getValue(Person object) {
145145

146146
table.addColumn(new TextColumn<Person>() {
147147
@Override
148-
public Comparator<? super RowComponent<Person>> getSortComparator() {
148+
public Comparator<? super RowComponent<Person>> sortComparator() {
149149
return (o1, o2) -> o1.getData().getLastName().compareToIgnoreCase(o2.getData().getLastName());
150150
}
151151

@@ -157,7 +157,7 @@ public String getValue(Person object) {
157157

158158
table.addColumn(new TextColumn<Person>() {
159159
@Override
160-
public Comparator<? super RowComponent<Person>> getSortComparator() {
160+
public Comparator<? super RowComponent<Person>> sortComparator() {
161161
return (o1, o2) -> o1.getData().getEmail().compareToIgnoreCase(o2.getData().getEmail());
162162
}
163163

@@ -169,17 +169,17 @@ public String getValue(Person object) {
169169

170170
table.addColumn(new TextColumn<Person>() {
171171
@Override
172-
public boolean isNumeric() {
172+
public boolean numeric() {
173173
return true;
174174
}
175175

176176
@Override
177-
public HideOn getHideOn() {
177+
public HideOn hideOn() {
178178
return HideOn.HIDE_ON_MED_DOWN;
179179
}
180180

181181
@Override
182-
public Comparator<? super RowComponent<Person>> getSortComparator() {
182+
public Comparator<? super RowComponent<Person>> sortComparator() {
183183
return (o1, o2) -> o1.getData().getPhone().compareToIgnoreCase(o2.getData().getPhone());
184184
}
185185

@@ -207,7 +207,7 @@ public MaterialComboBox getValue(Person object) {
207207
// You can add any handler to the column cells widget.
208208
table.addColumn(new WidgetColumn<Person, MaterialBadge>() {
209209
@Override
210-
public TextAlign getTextAlign() {
210+
public TextAlign textAlign() {
211211
return TextAlign.CENTER;
212212
}
213213

@@ -240,46 +240,44 @@ public MaterialBadge getValue(Person object) {
240240
table.addRowExpandHandler((e, rowExpand) -> {
241241
JQueryElement section = rowExpand.getOverlay();
242242

243-
if (rowExpand.isExpand()) {
244-
// Fake Async Task
245-
// This is demonstrating a fake asynchronous call to load
246-
// the data inside the expansion element.
247-
new Timer() {
248-
@Override
249-
public void run() {
250-
// Clear the content first.
251-
JQueryElement element = rowExpand.getRow().find(".content").empty();
252-
// Assign the jquery element to a GMD Widget
253-
MaterialWidget content = new MaterialWidget(element);
254-
255-
// Add new content.
256-
MaterialBadge badge = new MaterialBadge("This content", Color.WHITE, Color.BLUE);
257-
badge.getElement().getStyle().setPosition(Position.RELATIVE);
258-
badge.getElement().getStyle().setRight(0, Unit.PX);
259-
badge.setFontSize(12, Unit.PX);
260-
content.add(badge);
261-
262-
MaterialButton btn = new MaterialButton("was made", ButtonType.RAISED,
263-
new MaterialIcon(IconType.FULLSCREEN));
264-
content.add(btn);
265-
266-
MaterialTextBox textBox = new MaterialTextBox();
267-
textBox.setText(" from an asynchronous");
268-
textBox.setGwtDisplay(Display.INLINE_TABLE);
269-
textBox.setWidth("200px");
270-
content.add(textBox);
271-
272-
MaterialIcon icon = new MaterialIcon(IconType.CALL);
273-
icon.getElement().getStyle().setPosition(Position.RELATIVE);
274-
icon.getElement().getStyle().setTop(12, Unit.PX);
275-
content.add(icon);
276-
277-
// Hide the expansion elements overlay section.
278-
// The overlay is retrieved using EowExpand#getOverlay()
279-
section.css("display", "none");
280-
}
281-
}.schedule(2000);
282-
}
243+
// Fake Async Task
244+
// This is demonstrating a fake asynchronous call to load
245+
// the data inside the expansion element.
246+
new Timer() {
247+
@Override
248+
public void run() {
249+
// Clear the content first.
250+
JQueryElement element = rowExpand.getRow().find(".content").empty();
251+
// Assign the jquery element to a GMD Widget
252+
MaterialWidget content = new MaterialWidget(element);
253+
254+
// Add new content.
255+
MaterialBadge badge = new MaterialBadge("This content", Color.WHITE, Color.BLUE);
256+
badge.getElement().getStyle().setPosition(Position.RELATIVE);
257+
badge.getElement().getStyle().setRight(0, Unit.PX);
258+
badge.setFontSize(12, Unit.PX);
259+
content.add(badge);
260+
261+
MaterialButton btn = new MaterialButton("was made", ButtonType.RAISED,
262+
new MaterialIcon(IconType.FULLSCREEN));
263+
content.add(btn);
264+
265+
MaterialTextBox textBox = new MaterialTextBox();
266+
textBox.setText(" from an asynchronous");
267+
textBox.setGwtDisplay(Display.INLINE_TABLE);
268+
textBox.setWidth("200px");
269+
content.add(textBox);
270+
271+
MaterialIcon icon = new MaterialIcon(IconType.CALL);
272+
icon.getElement().getStyle().setPosition(Position.RELATIVE);
273+
icon.getElement().getStyle().setTop(12, Unit.PX);
274+
content.add(icon);
275+
276+
// Hide the expansion elements overlay section.
277+
// The overlay is retrieved using EowExpand#getOverlay()
278+
section.css("display", "none");
279+
}
280+
}.schedule(2000);
283281
return true;
284282
});
285283

0 commit comments

Comments
 (0)