com.sksamuel.jqm4gwt.form.JQMFieldContainer 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.form;
import com.google.gwt.uibinder.client.UiChild;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Widget;
import com.sksamuel.jqm4gwt.JQMCommon;
import com.sksamuel.jqm4gwt.JQMWidget;
/**
* @author Stephen K Samuel [email protected] 24 Jul 2011 20:26:51
*
* An implementation of a div based panel that has data-role set to
* fieldcontain.
*
* This is convenience class intended to be used by form elements, which
* are mostly based around a field container parent div.
*
*/
public class JQMFieldContainer extends JQMWidget {
/**
* The panel to delegate this composite to
*/
protected final FlowPanel flow;
protected JQMFieldContainer() {
flow = new FlowPanel();
initWidget(flow);
setId();
addStyleName("jqm4gwt-fieldcontain");
addStyleName("ui-field-contain");
}
protected JQMFieldContainer(FlowPanel externFlow) {
flow = externFlow;
}
protected void add(Widget widget) {
flow.add(widget);
}
@UiChild(tagname = "widget")
public void addWidget(Widget widget) {
if (widget == null) return;
add(widget);
}
protected void remove(Widget widget) {
flow.remove(widget);
}
public boolean isLabelHidden() {
return JQMCommon.isLabelHidden(this);
}
/**
* Label/Legend/Text can be hidden for form elements.
*
*/
public void setLabelHidden(boolean value) {
JQMCommon.setLabelHidden(this, value);
}
}