com.sksamuel.jqm4gwt.html.Heading 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.HasText;
/**
* @author Stephen K Samuel [email protected] 11 Jul 2011 13:38:38
*
* An implementation of a H{n} element.
*
*/
public class Heading extends Widget implements HasText {
public Heading(int n) {
setElement(Document.get().createHElement(n));
}
public Heading(int i, String text) {
this(i);
setText(text);
}
@Override
public String getText() {
return getElement().getInnerText();
}
@Override
public void setText(String text) {
getElement().setInnerText(text);
}
@Override
public Heading withText(String text) {
setText(text);
return this;
}
public static class H1 extends Heading {
public H1() {
super(1);
}
}
public static class H2 extends Heading {
public H2() {
super(2);
}
}
public static class H3 extends Heading {
public H3() {
super(3);
}
}
public static class H4 extends Heading {
public H4() {
super(4);
}
}
public static class H5 extends Heading {
public H5() {
super(5);
}
}
public static class H6 extends Heading {
public H6() {
super(6);
}
}
}