Skip to content

Commit a157323

Browse files
Merge pull request #9 from angexis/add-gwt-history
Add gwt history - step 1
2 parents 881ace3 + 2bb4168 commit a157323

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class MaterialLink extends FocusPanel {
3030

3131
protected HTMLPanel panel = new HTMLPanel("");
3232
private String text = "";
33+
private String href;
3334
private String icon = "";
3435
private String iconPosition = "";
3536
private String textColor = "";
@@ -98,6 +99,15 @@ public void setText(String text) {
9899
generateLink();
99100
}
100101

102+
public String getHref() {
103+
return href;
104+
}
105+
106+
public void setHref(String href) {
107+
this.href = href;
108+
generateLink();
109+
}
110+
101111
public String getFontSize() {
102112
return fontSize;
103113
}
@@ -119,10 +129,14 @@ public void setIconPosition(String iconPosition) {
119129
public void generateLink() {
120130
this.clear();
121131
String iconMarkup = "";
132+
String hrefMarkup = "";
122133
if (!icon.isEmpty()) {
123134
iconMarkup = "<i class='" + icon + " " + iconPosition + "'></i>";
124135
}
125-
panel = new HTMLPanel("<a class='" + textColor + "-text'>" + iconMarkup + " " + text + "</a>");
136+
if (this.href != null) {
137+
hrefMarkup = "href='" + href + "' ";
138+
}
139+
panel = new HTMLPanel("<a " + hrefMarkup + "class='" + textColor + "-text'>" + iconMarkup + text + "</a>");
126140
panel.getElement().getStyle().setCursor(Cursor.POINTER);
127141
this.add(panel);
128142
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public Integer getValue() {
103103

104104
/**
105105
* Write the current value
106-
* @param value value must be >= min and <= max
106+
* @param value value must be &gt;= min and &lt;= max
107107
*/
108108
public void setValue(Integer value) {
109109
if (value==null)return;
@@ -122,7 +122,7 @@ public Integer getMin() {
122122

123123
/**
124124
* Write the current min value
125-
* @param min value must be < max
125+
* @param min value must be &lt; max
126126
*/
127127
public void setMin(Integer min) {
128128
if (min==null)return;
@@ -140,7 +140,7 @@ public Integer getMax() {
140140

141141
/**
142142
* Write the current max value
143-
* @param max value must be > min
143+
* @param max value must be &gt; min
144144
*/
145145
public void setMax(Integer max) {
146146
if (max==null)return;

0 commit comments

Comments
 (0)