Skip to content

Commit 70add06

Browse files
authored
Merge pull request #87 from GwtMaterialDesign/release_2.0
Official 2.0 release
2 parents d281d9d + c942368 commit 70add06

File tree

10 files changed

+113
-71
lines changed

10 files changed

+113
-71
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
Demo application to show the features of the [gwt-material](https://github.com/GwtMaterialDesign/gwt-material) library.
88

9-
### Release 2.0-rc7 Demo
9+
### Release 2.0 Demo
1010
[http://gwtmaterialdesign.github.io/gwt-material-demo](http://gwtmaterialdesign.github.io/gwt-material-demo)
1111
```xml
1212
<dependency>
1313
<groupId>com.github.gwtmaterialdesign</groupId>
1414
<artifactId>gwt-material-demo</artifactId>
15-
<version>2.0-rc7</version>
15+
<version>2.0</version>
1616
</dependency>
1717
```
1818

@@ -22,7 +22,7 @@ Demo application to show the features of the [gwt-material](https://github.com/G
2222
<dependency>
2323
<groupId>com.github.gwtmaterialdesign</groupId>
2424
<artifactId>gwt-material-demo</artifactId>
25-
<version>2.0-SNAPSHOT</version>
25+
<version>2.1-SNAPSHOT</version>
2626
</dependency>
2727
```
2828

pom.xml

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

@@ -34,7 +34,7 @@
3434
<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-rc7</gwt-material.version>
37+
<gwt-material.version>2.0</gwt-material.version>
3838

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

src/main/java/gwt/material/design/demo/client/application/components/tabs/TabsView.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323

2424
import com.google.gwt.event.dom.client.ClickEvent;
25+
import com.google.gwt.event.logical.shared.ValueChangeEvent;
2526
import com.google.gwt.uibinder.client.UiBinder;
2627
import com.google.gwt.uibinder.client.UiField;
2728
import com.google.gwt.uibinder.client.UiHandler;
@@ -44,6 +45,9 @@ interface Binder extends UiBinder<Widget, TabsView> {
4445
@UiField
4546
MaterialRow dynamicTabsRow;
4647

48+
@UiField
49+
MaterialListBox lstTabIds;
50+
4751
private int index = 0;
4852

4953
@Inject
@@ -57,12 +61,19 @@ interface Binder extends UiBinder<Widget, TabsView> {
5761
protected void onAttach() {
5862
super.onAttach();
5963

64+
buildListTabIds();
65+
6066
tabSetIndex.setTabIndex(1);
6167
tabEvents.addSelectionHandler(selectionEvent -> MaterialToast.fireToast(selectionEvent.getSelectedItem() + " Selected Index"));
6268
}
6369

70+
@UiHandler("lstTabIds")
71+
void selectTab(ValueChangeEvent<String> e) {
72+
tabGetIndex.selectTab(e.getValue());
73+
}
74+
6475
@UiHandler("btnGetTabIndex")
65-
void getTabIndex(ClickEvent e) {
76+
void getTabInde1x(ClickEvent e) {
6677
MaterialToast.fireToast(tabGetIndex.getTabIndex() + "");
6778
}
6879

@@ -87,6 +98,13 @@ public void recalculateTabs() {
8798
dynamicTabs.reload();
8899
}
89100

101+
protected void buildListTabIds() {
102+
lstTabIds.clear();
103+
for (int i = 1; i <= 3; i++) {
104+
lstTabIds.addItem("item" + i, "Tab Item" + i);
105+
}
106+
}
107+
90108
protected void buildDynamicTab() {
91109
dynamicTabs.addSelectionHandler(selectionEvent -> MaterialToast.fireToast("Selected " + selectionEvent.getSelectedItem()));
92110
for (int i = 1; i <= 2; i++) {
@@ -107,4 +125,4 @@ protected MaterialTabItem newTabItem(int index) {
107125
dynamicTabsRow.add(content);
108126
return item;
109127
}
110-
}
128+
}

src/main/java/gwt/material/design/demo/client/application/components/tabs/TabsView.ui.xml

Lines changed: 57 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@
2626
<ui:with field='res' type='gwt.material.design.demo.client.resources.MaterialResources' />
2727

2828
<g:HTMLPanel>
29-
29+
3030
<m:MaterialRow addStyleNames="code">
3131
<m:MaterialTitle title="Introduction" description="You can add a Label as a Tab Item and for contents any Material Widget can be added as a Tab Content (e.g MaterialTopNav)"/>
3232
<m:MaterialRow>
3333
<m:MaterialColumn grid="s12">
34-
<m:MaterialTab ui:field="tabIntro" shadow="1" indicatorColor="YELLOW">
35-
<m:MaterialTabItem waves="YELLOW">
36-
<m:MaterialLink text="Tab 1" href="#tab1" textColor="WHITE"/>
37-
</m:MaterialTabItem>
38-
<m:MaterialTabItem waves="YELLOW">
39-
<m:MaterialLink text="Tab 2" href="#tab2" textColor="WHITE"/>
40-
</m:MaterialTabItem>
41-
<m:MaterialTabItem waves="YELLOW">
42-
<m:MaterialLink text="Tab 3" href="#tab3" textColor="WHITE"/>
43-
</m:MaterialTabItem>
44-
</m:MaterialTab>
34+
<m:MaterialTab ui:field="tabIntro" shadow="1" indicatorColor="YELLOW">
35+
<m:MaterialTabItem waves="YELLOW">
36+
<m:MaterialLink text="Tab 1" href="#tab1" textColor="WHITE"/>
37+
</m:MaterialTabItem>
38+
<m:MaterialTabItem waves="YELLOW">
39+
<m:MaterialLink text="Tab 2" href="#tab2" textColor="WHITE"/>
40+
</m:MaterialTabItem>
41+
<m:MaterialTabItem waves="YELLOW">
42+
<m:MaterialLink text="Tab 3" href="#tab3" textColor="WHITE"/>
43+
</m:MaterialTabItem>
44+
</m:MaterialTab>
4545
</m:MaterialColumn>
4646

4747
<m:MaterialColumn m:id="tab1" grid="s12">
@@ -54,7 +54,7 @@
5454
<m:MaterialLabel text="Tab 3 Content"/>
5555
</m:MaterialColumn>
5656
</m:MaterialRow>
57-
57+
5858
<demo:PrettyPre addStyleNames="lang-xml">
5959
&emsp;&lt;m:MaterialRow><br/>
6060
&emsp;&lt;m:MaterialColumn grid="s12"><br/>
@@ -111,7 +111,7 @@
111111
</m:MaterialRow>
112112
<demo:PrettyPre addStyleNames="code">
113113
&emsp;&lt;m:MaterialTab backgroundColor="PURPLE" indicatorColor="PINK" shadow="1"><br/>
114-
&emsp;&lt;m:MaterialTabItem waves="LIGHT" flex="NONE"><br/>
114+
&emsp;&lt;m:MaterialTabItem waves="LIGHT" flex="NONE"><br/>
115115
&emsp;&emsp;&lt;m:MaterialLink text="Tab 1" href="#tab1" textColor="WHITE"/><br/>
116116
&emsp;&lt;/m:MaterialTabItem><br/>
117117
&emsp;&lt;m:MaterialTabItem waves="YELLOW" flex="NONE"><br/>
@@ -200,68 +200,75 @@
200200

201201
<m:MaterialRow addStyleNames="code" >
202202
<m:MaterialTitle title="Dynamic Tabs" description="Note: Currently we dont support scrollable tabs. In the future we will implement it. So be smart for how many tabs you are going to implement." />
203-
203+
204204
<m:MaterialButton ui:field="addTab" text="Add other Tab" marginBottom="20" />
205-
205+
206206
<m:MaterialTab ui:field="dynamicTabs" indicatorColor="YELLOW" shadow="1" />
207-
207+
208208
<m:MaterialRow ui:field="dynamicTabsRow"/>
209-
209+
210210
<demo:PrettyPre addStyleNames="lang-java">
211-
@UiField<br/>
212-
MaterialTab dynamicTabs;<br/><br/>
213-
214-
@UiField<br/>
215-
MaterialRow dynamicRow;<br/><br/>
216-
217-
MaterialTabItem item = new MaterialTabItem();<br/>
218-
item.setWaves(WavesType.DEFAULT);<br/>
219-
MaterialLink link = new MaterialLink("Tab " index);<br/>
220-
link.setTextColor(Color.WHITE);<br/>
221-
link.setHref("#dynamicTab" index);<br/>
222-
item.add(link);<br/><br/>
223-
224-
// Adding a simple content<br/>
225-
MaterialLabel content = new MaterialLabel("Content " index);<br/>
226-
content.setId("dynamicTab" index);<br/>
227-
dynamicRow.add(content);<br/><br/>
228-
229-
// Adding the MaterialTabItem into MaterialTab::dynamicTab<br/>
230-
dynamicTabs.add(item);
231-
</demo:PrettyPre>
232-
</m:MaterialRow>
211+
@UiField<br/>
212+
MaterialTab dynamicTabs;<br/><br/>
213+
214+
@UiField<br/>
215+
MaterialRow dynamicRow;<br/><br/>
216+
217+
MaterialTabItem item = new MaterialTabItem();<br/>
218+
item.setWaves(WavesType.DEFAULT);<br/>
219+
MaterialLink link = new MaterialLink("Tab " index);<br/>
220+
link.setTextColor(Color.WHITE);<br/>
221+
link.setHref("#dynamicTab" index);<br/>
222+
item.add(link);<br/><br/>
223+
224+
// Adding a simple content<br/>
225+
MaterialLabel content = new MaterialLabel("Content " index);<br/>
226+
content.setId("dynamicTab" index);<br/>
227+
dynamicRow.add(content);<br/><br/>
228+
229+
// Adding the MaterialTabItem into MaterialTab::dynamicTab<br/>
230+
dynamicTabs.add(item);
231+
</demo:PrettyPre>
232+
</m:MaterialRow>
233233

234234
<m:MaterialRow addStyleNames="code">
235-
<m:MaterialTitle title="Get Tab Index Method" description="By calling this method, you can easily get the selected tab index."/>
235+
<m:MaterialTitle title="getTabIndex() and selecTab(tabId)" description="By calling this method, you can easily get the selected tab index."/>
236+
237+
<m:MaterialRow>
238+
<m:MaterialColumn grid="s12 m4 l4">
239+
<m:MaterialListBox ui:field="lstTabIds" placeholder="Select Tab" />
240+
</m:MaterialColumn>
241+
<m:MaterialColumn grid="s12 m3 l3">
242+
<m:MaterialButton ui:field="btnGetTabIndex" marginTop="20" text="Get Tab Index" />
243+
</m:MaterialColumn>
244+
</m:MaterialRow>
236245

237246
<m:MaterialRow>
238247
<m:MaterialColumn grid="s12">
239248
<m:MaterialTab ui:field="tabGetIndex" shadow="1" indicatorColor="YELLOW">
240249
<m:MaterialTabItem waves="YELLOW" grid="s4">
241-
<m:MaterialLink text="Tab 1" href="#tab211" textColor="WHITE"/>
250+
<m:MaterialLink text="Tab Item 1" href="#item1" textColor="WHITE"/>
242251
</m:MaterialTabItem>
243252
<m:MaterialTabItem waves="YELLOW" grid="s4">
244-
<m:MaterialLink text="Tab 2" href="#tab221" textColor="WHITE"/>
253+
<m:MaterialLink text="Tab Item 2" href="#item2" textColor="WHITE"/>
245254
</m:MaterialTabItem>
246255
<m:MaterialTabItem waves="YELLOW" grid="s4">
247-
<m:MaterialLink text="Tab 3" href="#tab231" textColor="WHITE"/>
256+
<m:MaterialLink text="Tab Item 3" href="#item3" textColor="WHITE"/>
248257
</m:MaterialTabItem>
249258
</m:MaterialTab>
250259
</m:MaterialColumn>
251260

252-
<m:MaterialColumn m:id="tab211" grid="s12">
261+
<m:MaterialColumn m:id="item1" grid="s12">
253262
<m:MaterialLabel text="Tab 1 Content"/>
254263
</m:MaterialColumn>
255-
<m:MaterialColumn m:id="tab221" grid="s12">
264+
<m:MaterialColumn m:id="item2" grid="s12">
256265
<m:MaterialLabel text="Tab 2 Content"/>
257266
</m:MaterialColumn>
258-
<m:MaterialColumn m:id="tab231" grid="s12">
267+
<m:MaterialColumn m:id="item3" grid="s12">
259268
<m:MaterialLabel text="Tab 3 Content"/>
260269
</m:MaterialColumn>
261270
</m:MaterialRow>
262271

263-
<m:MaterialButton ui:field="btnGetTabIndex" text="Get Tab Index" />
264-
265272
<demo:PrettyPre addStyleNames="lang-java">
266273
tab.getTabIndex()
267274
</demo:PrettyPre>
@@ -415,4 +422,4 @@
415422
</demo:PrettyPre>
416423
</m:MaterialRow>
417424
</g:HTMLPanel>
418-
</ui:UiBinder>
425+
</ui:UiBinder>

src/main/java/gwt/material/design/demo/client/application/dto/DataHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public static List<Hero> getAllHeroes(){
5353

5454
public static List<Version> getAllVersions() {
5555
List<Version> versions = new ArrayList<>();
56+
versions.add(new Version("2.0", "November 2017", Version.VersionLink.CORE_2_0.getName(), Version.VersionLink.ADDINS_2_0.getName(), Version.VersionLink.THEME_2_0.getName(), Version.VersionLink.JQUERY_2_0.getName(), Version.VersionLink.TABLE_2_0.getName(), Color.GREEN));
5657
versions.add(new Version("2.0-rc7", "October 2017", Version.VersionLink.CORE_2_0_RC7.getName(), Version.VersionLink.ADDINS_2_0_RC7.getName(), Version.VersionLink.THEME_2_0_RC7.getName(), Version.VersionLink.JQUERY_2_0_RC7.getName(), Version.VersionLink.TABLE_2_0_RC7.getName(), Color.GREEN));
5758
versions.add(new Version("2.0-rc6", "July 2017", Version.VersionLink.CORE_2_0_RC6.getName(), Version.VersionLink.ADDINS_2_0_RC6.getName(), Version.VersionLink.THEME_2_0_RC6.getName(), Version.VersionLink.JQUERY_2_0_RC6.getName(), Version.VersionLink.TABLE_2_0_RC6.getName(), Color.GREEN));
5859
versions.add(new Version("2.0-rc5", "May 2017", Version.VersionLink.CORE_2_0_RC5.getName(), Version.VersionLink.ADDINS_2_0_RC5.getName(), Version.VersionLink.THEME_2_0_RC5.getName(), Version.VersionLink.JQUERY_2_0_RC5.getName(), Version.VersionLink.TABLE_2_0_RC5.getName(), Color.GREEN));

src/main/java/gwt/material/design/demo/client/application/dto/Version.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class Version implements Serializable {
3434
public enum VersionLink{
3535

3636
// FOR gwt-material Core
37+
CORE_2_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material/2.0"),
3738
CORE_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material/2.0-rc7"),
3839
CORE_2_0_RC6("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material/2.0-rc6"),
3940
CORE_2_0_RC5("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material/2.0-rc5"),
@@ -70,6 +71,7 @@ public enum VersionLink{
7071
THEME_2_0_RC5("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-themes/2.0-rc5"),
7172
THEME_2_0_RC6("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-themes/2.0-rc6"),
7273
THEME_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-themes/2.0-rc7"),
74+
THEME_2_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-themes/2.0"),
7375

7476
// FOR gwt-material Addins
7577
ADDINS_1_5_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-addins/1.5.0"),
@@ -84,6 +86,7 @@ public enum VersionLink{
8486
ADDINS_2_0_RC5("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-addins/2.0-rc5"),
8587
ADDINS_2_0_RC6("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-addins/2.0-rc6"),
8688
ADDINS_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-addins/2.0-rc7"),
89+
ADDINS_2_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-addins/2.0"),
8790

8891
// FOR gwt-material JQuery
8992
JQUERY_1_0_RC1("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-jquery/1.0-rc1"),
@@ -93,6 +96,7 @@ public enum VersionLink{
9396
JQUERY_2_0_RC5("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-jquery/2.0-rc5"),
9497
JQUERY_2_0_RC6("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-jquery/2.0-rc6"),
9598
JQUERY_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-jquery/2.0-rc7"),
99+
JQUERY_2_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-jquery/2.0"),
96100

97101
// FOR gwt-material Table
98102
TABLE_1_0_RC1("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/1.0-rc1"),
@@ -101,7 +105,8 @@ public enum VersionLink{
101105
TABLE_1_0_RC4("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/1.0-rc4"),
102106
TABLE_2_0_RC5("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/2.0-rc5"),
103107
TABLE_2_0_RC6("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/2.0-rc6"),
104-
TABLE_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/2.0-rc7");
108+
TABLE_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/2.0-rc7"),
109+
TABLE_2_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/2.0");
105110

106111
String name;
107112
VersionLink(String name) {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<m:MaterialPanel addStyleNames="code">
3131
<m:MaterialTitle title="Setup using Maven Archetype" description="Run this project into cmd / terminal, just follow the prompts. Then once you're done open your project on Eclipse / Intelij IDEA.Gwt-material-archetype provides a faster way to create a GMD Project. You can also watch at the very bottom of this page about the real time procedure."/>
3232
<demo:PrettyPre addStyleNames="lang-xml-1">
33-
&emsp;mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign -DarchetypeArtifactId=gwt-material-archetype -DarchetypeVersion=2.0-rc7
33+
&emsp;mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign -DarchetypeArtifactId=gwt-material-archetype -DarchetypeVersion=2.0
3434
</demo:PrettyPre>
3535
</m:MaterialPanel>
3636
<m:MaterialPanel addStyleNames="code">
@@ -42,7 +42,7 @@
4242
&emsp;&lt;dependency><br/>
4343
&emsp;&lt;groupId>com.github.gwtmaterialdesign&lt;/groupId><br/>
4444
&emsp;&lt;artifactId>gwt-material&lt;/artifactId><br/>
45-
&emsp;&lt;version>2.0-rc7&lt;/version><br/>
45+
&emsp;&lt;version>2.0&lt;/version><br/>
4646
&lt;/dependency>
4747
</demo:PrettyPre>
4848
<m:MaterialRow>
@@ -52,7 +52,7 @@
5252
&emsp;&lt;dependency><br/>
5353
&emsp;&lt;groupId>com.github.gwtmaterialdesign&lt;/groupId><br/>
5454
&emsp;&lt;artifactId>gwt-material-addins&lt;/artifactId><br/>
55-
&emsp;&lt;version>2.0-rc7&lt;/version><br/>
55+
&emsp;&lt;version>2.0&lt;/version><br/>
5656
&lt;/dependency>
5757
</demo:PrettyPre>
5858
<m:MaterialRow>
@@ -62,7 +62,7 @@
6262
&emsp;&lt;dependency><br/>
6363
&emsp;&lt;groupId>com.github.gwtmaterialdesign&lt;/groupId><br/>
6464
&emsp;&lt;artifactId>gwt-material-themes&lt;/artifactId><br/>
65-
&emsp;&lt;version>2.0-rc7&lt;/version><br/>
65+
&emsp;&lt;version>2.0&lt;/version><br/>
6666
&lt;/dependency>
6767
</demo:PrettyPre>
6868

@@ -73,7 +73,7 @@
7373
&emsp;&lt;dependency><br/>
7474
&emsp;&lt;groupId>com.github.gwtmaterialdesign&lt;/groupId><br/>
7575
&emsp;&lt;artifactId>gwt-material-jquery&lt;/artifactId><br/>
76-
&emsp;&lt;version>2.0-rc7&lt;/version><br/>
76+
&emsp;&lt;version>2.0&lt;/version><br/>
7777
&lt;/dependency>
7878
</demo:PrettyPre>
7979

@@ -84,7 +84,7 @@
8484
&emsp;&lt;dependency><br/>
8585
&emsp;&lt;groupId>com.github.gwtmaterialdesign&lt;/groupId><br/>
8686
&emsp;&lt;artifactId>gwt-material-table&lt;/artifactId><br/>
87-
&emsp;&lt;version>2.0-rc7&lt;/version><br/>
87+
&emsp;&lt;version>2.0&lt;/version><br/>
8888
&lt;/dependency>
8989
</demo:PrettyPre>
9090
</m:MaterialPanel>

0 commit comments

Comments
 (0)