Skip to content

Commit 26223c5

Browse files
kevzlou7979kevzlou7979
authored andcommitted
Recode Slider, Added Java Docs
1 parent d376b89 commit 26223c5

18 files changed

+246
-326
lines changed

src/main/java/gwt/material/design/client/ui/MaterialDatePicker.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,34 @@
3131
import com.google.gwt.user.client.ui.FocusPanel;
3232
import com.google.gwt.user.client.ui.HTMLPanel;
3333

34+
//@formatter:off
35+
/**
36+
* Material Date Picker will provide a visual calendar to your apps.
37+
*
38+
* <p>
39+
* <h3>UiBinder Usage:</h3>
40+
*
41+
* <pre>
42+
* {@code
43+
*
44+
* <m:MaterialDatePicker ui:field="datePicker">
45+
* }
46+
* </pre>
47+
*
48+
* <h3>Java Usage:</h3>
49+
*
50+
* <pre>
51+
* {@code
52+
*
53+
* datePicker.setDate(new Date());
54+
* }
55+
* </pre>
56+
* </p>
57+
*
58+
* @author kevzlou7979
59+
* @see <a href="http://gwt-material-demo.herokuapp.com/#pickers">Material Date Picker</a>
60+
*/
61+
//@formatter:on
3462
public class MaterialDatePicker extends FocusPanel implements HasGrid, HasError{
3563

3664
/**

src/main/java/gwt/material/design/client/ui/MaterialDropDown.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@
3535
* <pre>
3636
* {@code
3737
*
38-
* <m:MaterialContainer>
39-
* <!--
40-
* Content goes here
41-
* -->
42-
* </m:MaterialContainer>
38+
* <m:MaterialDropDown>
39+
* <m:MaterialLink text="First" />
40+
<m:MaterialLink text="Second" />
41+
<m:MaterialLink text="Third" />
42+
* </m:MaterialDropDown>
4343
* }
4444
* </pre>
4545
* </p>
4646
*
4747
* @author kevzlou7979
48-
* @see <a href="http://gwt-material-demo.herokuapp.com/#grid">Material Column</a>
48+
* @see <a href="http://gwt-material-demo.herokuapp.com/#dropdowns">Material DropDowns</a>
4949
*/
5050
//@formatter:on
5151
public class MaterialDropDown extends ComplexNav implements HasGrid{

src/main/java/gwt/material/design/client/ui/MaterialFAB.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,32 @@
2424

2525
import com.google.gwt.dom.client.Document;
2626

27+
//@formatter:off
28+
/**
29+
* Floating action buttons are used for a promoted action. They are distinguished by a circled icon floating above the UI and have motion behaviors that include morphing, launching, and a transferring anchor point.
30+
*
31+
* <p>
32+
* <h3>UiBinder Usage:</h3>
33+
*
34+
* <pre>
35+
* {@code
36+
*
37+
<m:MaterialFAB>
38+
<m:MaterialButton type="FLOATING" backgroundColor="blue" icon="polymer" size="large"/>
39+
<m:MaterialFABList>
40+
<m:MaterialButton type="FLOATING" backgroundColor="red" icon="polymer"/>
41+
<m:MaterialButton type="FLOATING" backgroundColor="orange" icon="polymer"/>
42+
<m:MaterialButton type="FLOATING" backgroundColor="white" icon="polymer" iconColor="black"/>
43+
</m:MaterialFABList>
44+
</m:MaterialFAB>
45+
* }
46+
* </pre>
47+
* </p>
48+
*
49+
* @author kevzlou7979
50+
* @see <a href="http://gwt-material-demo.herokuapp.com/#buttons">Material FAB</a>
51+
*/
52+
//@formatter:on
2753
public class MaterialFAB extends ComplexWidget {
2854

2955
public MaterialFAB() {

src/main/java/gwt/material/design/client/ui/MaterialFABList.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
import com.google.gwt.dom.client.Document;
66
import com.google.gwt.user.client.ui.Widget;
77

8+
//@formatter:off
9+
/**
10+
* FABList container element to define every FAB items
11+
* @author kevzlou7979
12+
* @see <a href="http://gwt-material-demo.herokuapp.com/#buttons">Material FAB</a>
13+
*///@formatter:on
814
public class MaterialFABList extends ComplexWidget{
915

1016
public MaterialFABList() {

src/main/java/gwt/material/design/client/ui/MaterialFooterCopyright.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
import com.google.gwt.dom.client.Document;
88
import com.google.gwt.user.client.ui.Widget;
99

10+
//@formatter:off
11+
/**
12+
* Footer specific zone for copyright text
13+
* @author kevzlou7979
14+
* @see <a href="http://gwt-material-demo.herokuapp.com/#footer">Material Footer</a>
15+
*///@formatter:on
1016
public class MaterialFooterCopyright extends ComplexWidget implements HasColors{
1117

1218
CustomDiv container = new CustomDiv();

src/main/java/gwt/material/design/client/ui/MaterialIcon.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
* @see <a href="http://www.google.com/design/icons/">Search Google Icons</a>
4646
* @see <a href="http://gwt-material-demo.herokuapp.com/#icons">Material Icons Documentation</a>
4747
*/
48+
//@formatter:on
4849
public class MaterialIcon extends ButtonBase implements HasSeparator, HasIcons{
4950

5051
/**

src/main/java/gwt/material/design/client/ui/MaterialLabel.java

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

23+
import gwt.material.design.client.custom.HasColors;
2324
import gwt.material.design.client.custom.HasGrid;
2425
import gwt.material.design.client.custom.HasSeparator;
2526

@@ -28,7 +29,24 @@
2829
import com.google.gwt.i18n.shared.DirectionEstimator;
2930
import com.google.gwt.user.client.ui.Label;
3031

31-
public class MaterialLabel extends Label implements HasGrid, HasSeparator{
32+
//@formatter:off
33+
/**
34+
*
35+
* <p>Material Label will extend to GWT Label functionality with other material specifications
36+
* <h3>UiBinder Usage:</h3>
37+
*
38+
* <pre>
39+
* {@code
40+
<m:MaterialLabel text="I love material design" />
41+
}
42+
* </pre>
43+
* </p>
44+
*
45+
* @author kevzlou7979
46+
* @see <a href="http://gwt-material-demo.herokuapp.com/#buttons">Material Link</a>
47+
*/
48+
//@formatter:on
49+
public class MaterialLabel extends Label implements HasGrid, HasSeparator, HasColors{
3250

3351
String fontSize = "";
3452
String textColor = "";
@@ -62,8 +80,6 @@ public MaterialLabel(String text) {
6280
// TODO Auto-generated constructor stub
6381
}
6482

65-
66-
6783
@Override
6884
protected void onAttach() {
6985
// TODO Auto-generated method stub
@@ -79,15 +95,6 @@ public void setFontSize(String fontSize) {
7995
this.getElement().getStyle().setFontSize(Double.valueOf(fontSize), Unit.EM);
8096
}
8197

82-
public String getTextColor() {
83-
return textColor;
84-
}
85-
86-
public void setTextColor(String textColor) {
87-
this.textColor = textColor;
88-
this.addStyleName(textColor + "-text");
89-
}
90-
9198
@Override
9299
public void setGrid(String grid) {
93100
this.addStyleName("col " + grid);
@@ -109,6 +116,18 @@ public void setOffset(String offset) {
109116
}
110117
this.addStyleName(tobeadded);
111118
}
119+
120+
@Override
121+
public void setBackgroundColor(String bgColor) {
122+
// TODO Auto-generated method stub
123+
addStyleName(bgColor);
124+
}
125+
126+
@Override
127+
public void setTextColor(String textColor) {
128+
// TODO Auto-generated method stub
129+
addStyleName(textColor);
130+
}
112131

113132

114133
}

src/main/java/gwt/material/design/client/ui/MaterialLink.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
* @author kevzlou7979
5252
* @see <a href="http://gwt-material-demo.herokuapp.com/#buttons">Material Link</a>
5353
*/
54+
//@formatter:on
5455
public class MaterialLink extends ButtonBase implements HasIcons, HasSeparator{
5556

5657
private MaterialIcon iconElem = new MaterialIcon();

src/main/java/gwt/material/design/client/ui/MaterialListBox.java

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,42 @@
2020
* #L%
2121
*/
2222

23+
import gwt.material.design.client.custom.HasDisabled;
2324
import gwt.material.design.client.custom.HasGrid;
2425

2526
import com.google.gwt.dom.client.Document;
2627
import com.google.gwt.i18n.client.HasDirection.Direction;
2728
import com.google.gwt.user.client.DOM;
2829
import com.google.gwt.user.client.ui.ListBox;
2930

30-
public class MaterialListBox extends ListBox implements HasGrid{
31+
//@formatter:off
32+
/**
33+
*
34+
* <p>Material Listbox is another dropdown component that will set / get the value depends on the selected index
35+
* <h3>UiBinder Usage:</h3>
36+
*
37+
* <pre>
38+
* {@code
39+
<m:MaterialListBox ui:field="lstBox" />
40+
}
41+
* </pre>
42+
* <h3>Java Usage:</h3>
43+
*
44+
* <pre>
45+
* {@code
46+
* // functions
47+
lstBox.setSelectedIndex(2);
48+
lstBox.getSelectedIndex();
49+
lstBox.addChangeHandler(handler);
50+
}
51+
* </pre>
52+
* </p>
53+
*
54+
* @author kevzlou7979
55+
* @see <a href="http://gwt-material-demo.herokuapp.com/#forms">Material ListBoxt</a>
56+
*/
57+
//@formatter:on
58+
public class MaterialListBox extends ListBox implements HasGrid, HasDisabled{
3159

3260
private String id = "";
3361
private boolean old = false;
@@ -58,11 +86,13 @@ public void setTextColor(String textColor) {
5886
this.textColor = textColor;
5987
this.getElement().addClassName(textColor);
6088
}
61-
89+
90+
@Override
6291
public boolean isDisabled() {
6392
return disabled;
6493
}
65-
94+
95+
@Override
6696
public void setDisabled(boolean disabled) {
6797
this.disabled = disabled;
6898
if (disabled) {

src/main/java/gwt/material/design/client/ui/MaterialLoader.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,34 @@
2525
import com.google.gwt.user.client.ui.HTMLPanel;
2626
import com.google.gwt.user.client.ui.RootPanel;
2727

28+
//@formatter:off
29+
/**
30+
*
31+
* <p>If you have content that will take a long time to load, you should give the user feedback. For this reason we provide a number activity + progress indicators.
32+
* <h3>Java Usage:</h3>
33+
*
34+
* <pre>
35+
* {@code
36+
// FOR CIRCULAR LOADER
37+
MaterialLoader.showLoading(true);
38+
// FOR PROGRESS LOADER
39+
MaterialLoader.showProgress(true);
40+
41+
</pre>
42+
* </p>
43+
*
44+
* @author kevzlou7979
45+
* @see <a href="http://gwt-material-demo.herokuapp.com/#loaders">Material Loaders</a>
46+
*/
47+
//@formatter:on
2848
public class MaterialLoader {
2949
private static PreLoader preLoader = new PreLoader();
3050
private static HTMLPanel indeterminateProgress = new HTMLPanel("<div id='lean-overlay' style='display: block; opacity: 0.8; background: #fff;'></div><div class='progress' style='z-index: 1000; position: fixed !important;' ><div class='indeterminate' '></div></div>");
3151

52+
/**
53+
* Show a circular loader
54+
* @param isShow
55+
*/
3256
public static void showLoading(boolean isShow) {
3357
if (isShow) {
3458
RootPanel.get().add(preLoader);
@@ -38,7 +62,10 @@ public static void showLoading(boolean isShow) {
3862

3963
}
4064

41-
65+
/**
66+
* Show a progress loader
67+
* @param isShow
68+
*/
4269
public static void showProgress(boolean isShow){
4370
if(isShow){
4471
indeterminateProgress.getElement().getStyle().setPosition(Position.ABSOLUTE);

0 commit comments

Comments
 (0)