com.sksamuel.jqm4gwt.html.FormLabel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jqm4gwt-standalone Show documentation
Show all versions of jqm4gwt-standalone Show documentation
jqm4gwt bundled with all of its dependencies
The newest version!
package com.sksamuel.jqm4gwt.html;
import com.google.gwt.dom.client.Document;
import com.google.gwt.user.client.ui.Widget;
import com.sksamuel.jqm4gwt.HasHTML;
import com.sksamuel.jqm4gwt.HasText;
/**
* @author Stephen K Samuel [email protected] 11 Jul 2011 13:38:38
*
*
An implemenation of a <label> element
*
*/
public class FormLabel extends Widget implements HasText, HasHTML {
public FormLabel() {
setElement(Document.get().createLabelElement());
}
public String getFor() {
return getElement().getAttribute("for");
}
@Override
public String getText() {
return getElement().getInnerText();
}
public void setFor(String id) {
getElement().setAttribute("for", id);
}
@Override
public void setText(String text) {
getElement().setInnerText(text);
}
@Override
public FormLabel withText(String text) {
setText(text);
return this;
}
@Override
public String getHTML() {
return getElement().getInnerHTML();
}
@Override
public void setHTML(String html) {
getElement().setInnerHTML(html);
}
@Override
public FormLabel withHTML(String html) {
setHTML(html);
return this;
}
}