File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
src/main/java/gwt/material/design/client/ui Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 > = min and < = 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 < 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 > min
144144 */
145145 public void setMax (Integer max ) {
146146 if (max ==null )return ;
You can’t perform that action at this time.
0 commit comments