Skip to content

Commit

Permalink
Merge pull request #87 from GwtMaterialDesign/release_2.0
Browse files Browse the repository at this point in the history
Official 2.0 release
  • Loading branch information
kevzlou7979 authored Nov 5, 2017
2 parents d281d9d + c942368 commit 70add06
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 71 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material-demo</artifactId>
<version>2.0-rc7</version>
<version>2.0</version>
</dependency>
```

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

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<parent>
<artifactId>gwt-material-parent</artifactId>
<groupId>com.github.gwtmaterialdesign</groupId>
<version>2.0-rc7</version>
<version>2.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>gwt-material-demo</artifactId>
<packaging>war</packaging>
<version>2.0-rc7</version>
<version>2.0</version>
<name>Gwt Material Demo</name>
<description>Showcase for gwt-material</description>

Expand All @@ -34,7 +34,7 @@
<gwt.version>2.8.1</gwt.version>
<gwtp.version>1.5.3</gwtp.version>
<gin.version>2.1.2</gin.version>
<gwt-material.version>2.0-rc7</gwt-material.version>
<gwt-material.version>2.0</gwt-material.version>

<gwt.style>PRETTY</gwt.style>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -44,6 +45,9 @@ interface Binder extends UiBinder<Widget, TabsView> {
@UiField
MaterialRow dynamicTabsRow;

@UiField
MaterialListBox lstTabIds;

private int index = 0;

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

buildListTabIds();

tabSetIndex.setTabIndex(1);
tabEvents.addSelectionHandler(selectionEvent -> MaterialToast.fireToast(selectionEvent.getSelectedItem() + " Selected Index"));
}

@UiHandler("lstTabIds")
void selectTab(ValueChangeEvent<String> e) {
tabGetIndex.selectTab(e.getValue());
}

@UiHandler("btnGetTabIndex")
void getTabIndex(ClickEvent e) {
void getTabInde1x(ClickEvent e) {
MaterialToast.fireToast(tabGetIndex.getTabIndex() + "");
}

Expand All @@ -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++) {
Expand All @@ -107,4 +125,4 @@ protected MaterialTabItem newTabItem(int index) {
dynamicTabsRow.add(content);
return item;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@
<ui:with field='res' type='gwt.material.design.demo.client.resources.MaterialResources' />

<g:HTMLPanel>

<m:MaterialRow addStyleNames="code">
<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)"/>
<m:MaterialRow>
<m:MaterialColumn grid="s12">
<m:MaterialTab ui:field="tabIntro" shadow="1" indicatorColor="YELLOW">
<m:MaterialTabItem waves="YELLOW">
<m:MaterialLink text="Tab 1" href="#tab1" textColor="WHITE"/>
</m:MaterialTabItem>
<m:MaterialTabItem waves="YELLOW">
<m:MaterialLink text="Tab 2" href="#tab2" textColor="WHITE"/>
</m:MaterialTabItem>
<m:MaterialTabItem waves="YELLOW">
<m:MaterialLink text="Tab 3" href="#tab3" textColor="WHITE"/>
</m:MaterialTabItem>
</m:MaterialTab>
<m:MaterialTab ui:field="tabIntro" shadow="1" indicatorColor="YELLOW">
<m:MaterialTabItem waves="YELLOW">
<m:MaterialLink text="Tab 1" href="#tab1" textColor="WHITE"/>
</m:MaterialTabItem>
<m:MaterialTabItem waves="YELLOW">
<m:MaterialLink text="Tab 2" href="#tab2" textColor="WHITE"/>
</m:MaterialTabItem>
<m:MaterialTabItem waves="YELLOW">
<m:MaterialLink text="Tab 3" href="#tab3" textColor="WHITE"/>
</m:MaterialTabItem>
</m:MaterialTab>
</m:MaterialColumn>

<m:MaterialColumn m:id="tab1" grid="s12">
Expand All @@ -54,7 +54,7 @@
<m:MaterialLabel text="Tab 3 Content"/>
</m:MaterialColumn>
</m:MaterialRow>

<demo:PrettyPre addStyleNames="lang-xml">
&emsp;&lt;m:MaterialRow><br/>
&emsp;&lt;m:MaterialColumn grid="s12"><br/>
Expand Down Expand Up @@ -111,7 +111,7 @@
</m:MaterialRow>
<demo:PrettyPre addStyleNames="code">
&emsp;&lt;m:MaterialTab backgroundColor="PURPLE" indicatorColor="PINK" shadow="1"><br/>
&emsp;&lt;m:MaterialTabItem waves="LIGHT" flex="NONE"><br/>
&emsp;&lt;m:MaterialTabItem waves="LIGHT" flex="NONE"><br/>
&emsp;&emsp;&lt;m:MaterialLink text="Tab 1" href="#tab1" textColor="WHITE"/><br/>
&emsp;&lt;/m:MaterialTabItem><br/>
&emsp;&lt;m:MaterialTabItem waves="YELLOW" flex="NONE"><br/>
Expand Down Expand Up @@ -200,68 +200,75 @@

<m:MaterialRow addStyleNames="code" >
<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." />

<m:MaterialButton ui:field="addTab" text="Add other Tab" marginBottom="20" />

<m:MaterialTab ui:field="dynamicTabs" indicatorColor="YELLOW" shadow="1" />

<m:MaterialRow ui:field="dynamicTabsRow"/>

<demo:PrettyPre addStyleNames="lang-java">
@UiField<br/>
MaterialTab dynamicTabs;<br/><br/>
@UiField<br/>
MaterialRow dynamicRow;<br/><br/>
MaterialTabItem item = new MaterialTabItem();<br/>
item.setWaves(WavesType.DEFAULT);<br/>
MaterialLink link = new MaterialLink("Tab " index);<br/>
link.setTextColor(Color.WHITE);<br/>
link.setHref("#dynamicTab" index);<br/>
item.add(link);<br/><br/>
// Adding a simple content<br/>
MaterialLabel content = new MaterialLabel("Content " index);<br/>
content.setId("dynamicTab" index);<br/>
dynamicRow.add(content);<br/><br/>
// Adding the MaterialTabItem into MaterialTab::dynamicTab<br/>
dynamicTabs.add(item);
</demo:PrettyPre>
</m:MaterialRow>
@UiField<br/>
MaterialTab dynamicTabs;<br/><br/>

@UiField<br/>
MaterialRow dynamicRow;<br/><br/>

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

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

// Adding the MaterialTabItem into MaterialTab::dynamicTab<br/>
dynamicTabs.add(item);
</demo:PrettyPre>
</m:MaterialRow>

<m:MaterialRow addStyleNames="code">
<m:MaterialTitle title="Get Tab Index Method" description="By calling this method, you can easily get the selected tab index."/>
<m:MaterialTitle title="getTabIndex() and selecTab(tabId)" description="By calling this method, you can easily get the selected tab index."/>

<m:MaterialRow>
<m:MaterialColumn grid="s12 m4 l4">
<m:MaterialListBox ui:field="lstTabIds" placeholder="Select Tab" />
</m:MaterialColumn>
<m:MaterialColumn grid="s12 m3 l3">
<m:MaterialButton ui:field="btnGetTabIndex" marginTop="20" text="Get Tab Index" />
</m:MaterialColumn>
</m:MaterialRow>

<m:MaterialRow>
<m:MaterialColumn grid="s12">
<m:MaterialTab ui:field="tabGetIndex" shadow="1" indicatorColor="YELLOW">
<m:MaterialTabItem waves="YELLOW" grid="s4">
<m:MaterialLink text="Tab 1" href="#tab211" textColor="WHITE"/>
<m:MaterialLink text="Tab Item 1" href="#item1" textColor="WHITE"/>
</m:MaterialTabItem>
<m:MaterialTabItem waves="YELLOW" grid="s4">
<m:MaterialLink text="Tab 2" href="#tab221" textColor="WHITE"/>
<m:MaterialLink text="Tab Item 2" href="#item2" textColor="WHITE"/>
</m:MaterialTabItem>
<m:MaterialTabItem waves="YELLOW" grid="s4">
<m:MaterialLink text="Tab 3" href="#tab231" textColor="WHITE"/>
<m:MaterialLink text="Tab Item 3" href="#item3" textColor="WHITE"/>
</m:MaterialTabItem>
</m:MaterialTab>
</m:MaterialColumn>

<m:MaterialColumn m:id="tab211" grid="s12">
<m:MaterialColumn m:id="item1" grid="s12">
<m:MaterialLabel text="Tab 1 Content"/>
</m:MaterialColumn>
<m:MaterialColumn m:id="tab221" grid="s12">
<m:MaterialColumn m:id="item2" grid="s12">
<m:MaterialLabel text="Tab 2 Content"/>
</m:MaterialColumn>
<m:MaterialColumn m:id="tab231" grid="s12">
<m:MaterialColumn m:id="item3" grid="s12">
<m:MaterialLabel text="Tab 3 Content"/>
</m:MaterialColumn>
</m:MaterialRow>

<m:MaterialButton ui:field="btnGetTabIndex" text="Get Tab Index" />

<demo:PrettyPre addStyleNames="lang-java">
tab.getTabIndex()
</demo:PrettyPre>
Expand Down Expand Up @@ -415,4 +422,4 @@
</demo:PrettyPre>
</m:MaterialRow>
</g:HTMLPanel>
</ui:UiBinder>
</ui:UiBinder>
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public static List<Hero> getAllHeroes(){

public static List<Version> getAllVersions() {
List<Version> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand All @@ -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"),
Expand All @@ -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"),
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<m:MaterialPanel addStyleNames="code">
<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."/>
<demo:PrettyPre addStyleNames="lang-xml-1">
&emsp;mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign -DarchetypeArtifactId=gwt-material-archetype -DarchetypeVersion=2.0-rc7
&emsp;mvn archetype:generate -DarchetypeGroupId=com.github.gwtmaterialdesign -DarchetypeArtifactId=gwt-material-archetype -DarchetypeVersion=2.0
</demo:PrettyPre>
</m:MaterialPanel>
<m:MaterialPanel addStyleNames="code">
Expand All @@ -42,7 +42,7 @@
&emsp;&lt;dependency><br/>
&emsp;&lt;groupId>com.github.gwtmaterialdesign&lt;/groupId><br/>
&emsp;&lt;artifactId>gwt-material&lt;/artifactId><br/>
&emsp;&lt;version>2.0-rc7&lt;/version><br/>
&emsp;&lt;version>2.0&lt;/version><br/>
&lt;/dependency>
</demo:PrettyPre>
<m:MaterialRow>
Expand All @@ -52,7 +52,7 @@
&emsp;&lt;dependency><br/>
&emsp;&lt;groupId>com.github.gwtmaterialdesign&lt;/groupId><br/>
&emsp;&lt;artifactId>gwt-material-addins&lt;/artifactId><br/>
&emsp;&lt;version>2.0-rc7&lt;/version><br/>
&emsp;&lt;version>2.0&lt;/version><br/>
&lt;/dependency>
</demo:PrettyPre>
<m:MaterialRow>
Expand All @@ -62,7 +62,7 @@
&emsp;&lt;dependency><br/>
&emsp;&lt;groupId>com.github.gwtmaterialdesign&lt;/groupId><br/>
&emsp;&lt;artifactId>gwt-material-themes&lt;/artifactId><br/>
&emsp;&lt;version>2.0-rc7&lt;/version><br/>
&emsp;&lt;version>2.0&lt;/version><br/>
&lt;/dependency>
</demo:PrettyPre>

Expand All @@ -73,7 +73,7 @@
&emsp;&lt;dependency><br/>
&emsp;&lt;groupId>com.github.gwtmaterialdesign&lt;/groupId><br/>
&emsp;&lt;artifactId>gwt-material-jquery&lt;/artifactId><br/>
&emsp;&lt;version>2.0-rc7&lt;/version><br/>
&emsp;&lt;version>2.0&lt;/version><br/>
&lt;/dependency>
</demo:PrettyPre>

Expand All @@ -84,7 +84,7 @@
&emsp;&lt;dependency><br/>
&emsp;&lt;groupId>com.github.gwtmaterialdesign&lt;/groupId><br/>
&emsp;&lt;artifactId>gwt-material-table&lt;/artifactId><br/>
&emsp;&lt;version>2.0-rc7&lt;/version><br/>
&emsp;&lt;version>2.0&lt;/version><br/>
&lt;/dependency>
</demo:PrettyPre>
</m:MaterialPanel>
Expand Down
Loading

0 comments on commit 70add06

Please sign in to comment.