All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sksamuel.jqm4gwt.form.JQMFieldContainer Maven / Gradle / Ivy

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. *

* Field containers, hide label/legend

*/ public void setLabelHidden(boolean value) { JQMCommon.setLabelHidden(this, value); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy