From 1d1e324eb8a342a8ecbd3078320856597348531b Mon Sep 17 00:00:00 2001 From: kevzlou7979 Date: Wed, 25 Oct 2017 11:19:29 +0800 Subject: [PATCH 1/3] Added demo for MaterialTabItem#selectTab() --- .../application/components/tabs/TabsView.java | 22 +++- .../components/tabs/TabsView.ui.xml | 107 ++++++++++-------- 2 files changed, 77 insertions(+), 52 deletions(-) diff --git a/src/main/java/gwt/material/design/demo/client/application/components/tabs/TabsView.java b/src/main/java/gwt/material/design/demo/client/application/components/tabs/TabsView.java index c0ee4fac3..b6c888b93 100644 --- a/src/main/java/gwt/material/design/demo/client/application/components/tabs/TabsView.java +++ b/src/main/java/gwt/material/design/demo/client/application/components/tabs/TabsView.java @@ -22,6 +22,7 @@ import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiHandler; @@ -44,6 +45,9 @@ interface Binder extends UiBinder { @UiField MaterialRow dynamicTabsRow; + @UiField + MaterialListBox lstTabIds; + private int index = 0; @Inject @@ -57,12 +61,19 @@ interface Binder extends UiBinder { protected void onAttach() { super.onAttach(); + buildListTabIds(); + tabSetIndex.setTabIndex(1); tabEvents.addSelectionHandler(selectionEvent -> MaterialToast.fireToast(selectionEvent.getSelectedItem() + " Selected Index")); } + @UiHandler("lstTabIds") + void selectTab(ValueChangeEvent e) { + tabGetIndex.selectTab(e.getValue()); + } + @UiHandler("btnGetTabIndex") - void getTabIndex(ClickEvent e) { + void getTabInde1x(ClickEvent e) { MaterialToast.fireToast(tabGetIndex.getTabIndex() + ""); } @@ -87,6 +98,13 @@ public void recalculateTabs() { dynamicTabs.reload(); } + protected void buildListTabIds() { + lstTabIds.clear(); + for (int i = 1; i <= 3; i++) { + lstTabIds.addItem("item" + i, "Tab Item" + i); + } + } + protected void buildDynamicTab() { dynamicTabs.addSelectionHandler(selectionEvent -> MaterialToast.fireToast("Selected " + selectionEvent.getSelectedItem())); for (int i = 1; i <= 2; i++) { @@ -107,4 +125,4 @@ protected MaterialTabItem newTabItem(int index) { dynamicTabsRow.add(content); return item; } -} +} \ No newline at end of file diff --git a/src/main/java/gwt/material/design/demo/client/application/components/tabs/TabsView.ui.xml b/src/main/java/gwt/material/design/demo/client/application/components/tabs/TabsView.ui.xml index eb46b7b28..4c9683168 100644 --- a/src/main/java/gwt/material/design/demo/client/application/components/tabs/TabsView.ui.xml +++ b/src/main/java/gwt/material/design/demo/client/application/components/tabs/TabsView.ui.xml @@ -26,22 +26,22 @@ - + - - - - - - - - - - - + + + + + + + + + + + @@ -54,7 +54,7 @@ - +  <m:MaterialRow>
 <m:MaterialColumn grid="s12">
@@ -111,7 +111,7 @@
 <m:MaterialTab backgroundColor="PURPLE" indicatorColor="PINK" shadow="1">
-  <m:MaterialTabItem waves="LIGHT" flex="NONE">
+  <m:MaterialTabItem waves="LIGHT" flex="NONE">
  <m:MaterialLink text="Tab 1" href="#tab1" textColor="WHITE"/>
 </m:MaterialTabItem>
 <m:MaterialTabItem waves="YELLOW" flex="NONE">
@@ -200,68 +200,75 @@ - + - + - + - + - @UiField
- MaterialTab dynamicTabs;

- - @UiField
- MaterialRow dynamicRow;

- - MaterialTabItem item = new MaterialTabItem();
- item.setWaves(WavesType.DEFAULT);
- MaterialLink link = new MaterialLink("Tab " index);
- link.setTextColor(Color.WHITE);
- link.setHref("#dynamicTab" index);
- item.add(link);

- - // Adding a simple content
- MaterialLabel content = new MaterialLabel("Content " index);
- content.setId("dynamicTab" index);
- dynamicRow.add(content);

- - // Adding the MaterialTabItem into MaterialTab::dynamicTab
- dynamicTabs.add(item); -
-
+ @UiField
+ MaterialTab dynamicTabs;

+ + @UiField
+ MaterialRow dynamicRow;

+ + MaterialTabItem item = new MaterialTabItem();
+ item.setWaves(WavesType.DEFAULT);
+ MaterialLink link = new MaterialLink("Tab " index);
+ link.setTextColor(Color.WHITE);
+ link.setHref("#dynamicTab" index);
+ item.add(link);

+ + // Adding a simple content
+ MaterialLabel content = new MaterialLabel("Content " index);
+ content.setId("dynamicTab" index);
+ dynamicRow.add(content);

+ + // Adding the MaterialTabItem into MaterialTab::dynamicTab
+ dynamicTabs.add(item); +
+ - + + + + + + + + + + - + - + - + - + - + - + - - tab.getTabIndex() @@ -415,4 +422,4 @@
- + \ No newline at end of file From 26bc3d5f9d9b7b64905d06831c1c6cd9a2a460ed Mon Sep 17 00:00:00 2001 From: kevzlou7979 Date: Thu, 2 Nov 2017 10:05:16 +0800 Subject: [PATCH 2/3] Fixed AbstractSideNav implementation. --- .../design/demo/client/application/menu/MenuView.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/gwt/material/design/demo/client/application/menu/MenuView.java b/src/main/java/gwt/material/design/demo/client/application/menu/MenuView.java index f9a8b8ac1..6d4f7cc3b 100644 --- a/src/main/java/gwt/material/design/demo/client/application/menu/MenuView.java +++ b/src/main/java/gwt/material/design/demo/client/application/menu/MenuView.java @@ -30,10 +30,7 @@ import gwt.material.design.addins.client.combobox.MaterialComboBox; import gwt.material.design.client.base.SearchObject; import gwt.material.design.client.constants.IconType; -import gwt.material.design.client.ui.MaterialHeader; -import gwt.material.design.client.ui.MaterialNavBar; -import gwt.material.design.client.ui.MaterialSearch; -import gwt.material.design.client.ui.MaterialSideNav; +import gwt.material.design.client.ui.*; import gwt.material.design.demo.client.ThemeManager; import gwt.material.design.demo.client.place.NameTokens; import gwt.material.design.themes.amber.ThemeAmber; @@ -62,7 +59,8 @@ interface Binder extends UiBinder { @UiField MaterialHeader header; @UiField MaterialNavBar navBar, navBarSearch; - @UiField MaterialSideNav sideNav; + @UiField + MaterialSideNavPush sideNav; @UiField MaterialSearch txtSearch; @UiField MaterialComboBox comboThemes; From 315c2e485b9790d67b8836790f5df0d25e6e3b8b Mon Sep 17 00:00:00 2001 From: kevzlou7979 Date: Sat, 4 Nov 2017 20:00:18 +0800 Subject: [PATCH 3/3] Official 2.0 release demo --- README.md | 6 +++--- pom.xml | 6 +++--- .../demo/client/application/dto/DataHelper.java | 1 + .../design/demo/client/application/dto/Version.java | 7 ++++++- .../gettingstarted/GettingStartedView.ui.xml | 12 ++++++------ .../demo/client/application/menu/MenuView.ui.xml | 2 +- .../client/application/roadmap/RoadMapView.ui.xml | 13 +++++++++++++ 7 files changed, 33 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d87545c93..39e2967e4 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ Demo application to show the features of the [gwt-material](https://github.com/GwtMaterialDesign/gwt-material) library. -### Release 2.0-rc7 Demo +### Release 2.0 Demo [http://gwtmaterialdesign.github.io/gwt-material-demo](http://gwtmaterialdesign.github.io/gwt-material-demo) ```xml com.github.gwtmaterialdesign gwt-material-demo - 2.0-rc7 + 2.0 ``` @@ -22,7 +22,7 @@ Demo application to show the features of the [gwt-material](https://github.com/G com.github.gwtmaterialdesign gwt-material-demo - 2.0-SNAPSHOT + 2.1-SNAPSHOT ``` diff --git a/pom.xml b/pom.xml index a824d4830..e5d1f8055 100644 --- a/pom.xml +++ b/pom.xml @@ -4,14 +4,14 @@ gwt-material-parent com.github.gwtmaterialdesign - 2.0-SNAPSHOT + 2.0 4.0.0 gwt-material-demo war - 2.0-SNAPSHOT + 2.0 Gwt Material Demo Showcase for gwt-material @@ -34,7 +34,7 @@ 2.8.1 1.5.3 2.1.2 - 2.0-SNAPSHOT + 2.0 PRETTY diff --git a/src/main/java/gwt/material/design/demo/client/application/dto/DataHelper.java b/src/main/java/gwt/material/design/demo/client/application/dto/DataHelper.java index 24ffecbd0..6243c216a 100644 --- a/src/main/java/gwt/material/design/demo/client/application/dto/DataHelper.java +++ b/src/main/java/gwt/material/design/demo/client/application/dto/DataHelper.java @@ -53,6 +53,7 @@ public static List getAllHeroes(){ public static List getAllVersions() { List versions = new ArrayList<>(); + 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)); 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)); 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)); 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)); diff --git a/src/main/java/gwt/material/design/demo/client/application/dto/Version.java b/src/main/java/gwt/material/design/demo/client/application/dto/Version.java index d5cd4ee56..48c1f3bbd 100644 --- a/src/main/java/gwt/material/design/demo/client/application/dto/Version.java +++ b/src/main/java/gwt/material/design/demo/client/application/dto/Version.java @@ -34,6 +34,7 @@ public class Version implements Serializable { public enum VersionLink{ // FOR gwt-material Core + CORE_2_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material/2.0"), CORE_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material/2.0-rc7"), CORE_2_0_RC6("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material/2.0-rc6"), CORE_2_0_RC5("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material/2.0-rc5"), @@ -70,6 +71,7 @@ public enum VersionLink{ THEME_2_0_RC5("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-themes/2.0-rc5"), THEME_2_0_RC6("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-themes/2.0-rc6"), THEME_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-themes/2.0-rc7"), + THEME_2_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-themes/2.0"), // FOR gwt-material Addins ADDINS_1_5_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-addins/1.5.0"), @@ -84,6 +86,7 @@ public enum VersionLink{ ADDINS_2_0_RC5("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-addins/2.0-rc5"), ADDINS_2_0_RC6("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-addins/2.0-rc6"), ADDINS_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-addins/2.0-rc7"), + ADDINS_2_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-addins/2.0"), // FOR gwt-material JQuery JQUERY_1_0_RC1("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-jquery/1.0-rc1"), @@ -93,6 +96,7 @@ public enum VersionLink{ JQUERY_2_0_RC5("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-jquery/2.0-rc5"), JQUERY_2_0_RC6("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-jquery/2.0-rc6"), JQUERY_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-jquery/2.0-rc7"), + JQUERY_2_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-jquery/2.0"), // FOR gwt-material Table TABLE_1_0_RC1("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/1.0-rc1"), @@ -101,7 +105,8 @@ public enum VersionLink{ TABLE_1_0_RC4("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/1.0-rc4"), TABLE_2_0_RC5("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/2.0-rc5"), TABLE_2_0_RC6("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/2.0-rc6"), - TABLE_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/2.0-rc7"); + TABLE_2_0_RC7("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/2.0-rc7"), + TABLE_2_0("http://mvnrepository.com/artifact/com.github.gwtmaterialdesign/gwt-material-table/2.0"); String name; VersionLink(String name) { diff --git a/src/main/java/gwt/material/design/demo/client/application/gettingstarted/GettingStartedView.ui.xml b/src/main/java/gwt/material/design/demo/client/application/gettingstarted/GettingStartedView.ui.xml index 984263402..7b8ae7d07 100644 --- a/src/main/java/gwt/material/design/demo/client/application/gettingstarted/GettingStartedView.ui.xml +++ b/src/main/java/gwt/material/design/demo/client/application/gettingstarted/GettingStartedView.ui.xml @@ -30,7 +30,7 @@ -  mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign -DarchetypeArtifactId=gwt-material-archetype -DarchetypeVersion=2.0-rc7 +  mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign -DarchetypeArtifactId=gwt-material-archetype -DarchetypeVersion=2.0 @@ -42,7 +42,7 @@  <dependency>
 <groupId>com.github.gwtmaterialdesign</groupId>
 <artifactId>gwt-material</artifactId>
-  <version>2.0-rc7</version>
+  <version>2.0</version>
</dependency> @@ -52,7 +52,7 @@  <dependency>
 <groupId>com.github.gwtmaterialdesign</groupId>
 <artifactId>gwt-material-addins</artifactId>
-  <version>2.0-rc7</version>
+  <version>2.0</version>
</dependency> @@ -62,7 +62,7 @@  <dependency>
 <groupId>com.github.gwtmaterialdesign</groupId>
 <artifactId>gwt-material-themes</artifactId>
-  <version>2.0-rc7</version>
+  <version>2.0</version>
</dependency> @@ -73,7 +73,7 @@  <dependency>
 <groupId>com.github.gwtmaterialdesign</groupId>
 <artifactId>gwt-material-jquery</artifactId>
-  <version>2.0-rc7</version>
+  <version>2.0</version>
</dependency> @@ -84,7 +84,7 @@  <dependency>
 <groupId>com.github.gwtmaterialdesign</groupId>
 <artifactId>gwt-material-table</artifactId>
-  <version>2.0-rc7</version>
+  <version>2.0</version>
</dependency>
diff --git a/src/main/java/gwt/material/design/demo/client/application/menu/MenuView.ui.xml b/src/main/java/gwt/material/design/demo/client/application/menu/MenuView.ui.xml index c7d6ab7b6..ee133f0c7 100644 --- a/src/main/java/gwt/material/design/demo/client/application/menu/MenuView.ui.xml +++ b/src/main/java/gwt/material/design/demo/client/application/menu/MenuView.ui.xml @@ -82,7 +82,7 @@ - + diff --git a/src/main/java/gwt/material/design/demo/client/application/roadmap/RoadMapView.ui.xml b/src/main/java/gwt/material/design/demo/client/application/roadmap/RoadMapView.ui.xml index 27506716b..6e33544fa 100644 --- a/src/main/java/gwt/material/design/demo/client/application/roadmap/RoadMapView.ui.xml +++ b/src/main/java/gwt/material/design/demo/client/application/roadmap/RoadMapView.ui.xml @@ -29,6 +29,19 @@ } + + + + + + + + + + + + +