public FieldSet(String label, Widget widget) {
this(label, false, widget);
}
public FieldSet(String label, boolean collapsible, Widget widget) {
FieldSetElement fieldSetElement = FieldSetElement.as(DOM.createFieldSet());
setElement(fieldSetElement);
legendElement = LegendElement.as(DOM.createLegend());
legendElement.setClassName("Legend");
fieldSetElement.appendChild(legendElement);
setCollapser(new DefaultCollapser());
labelElement = DOM.createSpan();
labelElement.setClassName("Label");
legendElement.appendChild(labelElement);
widgetContainerElement = preventBoxStyles(DOM.createDiv());
fieldSetElement.appendChild(widgetContainerElement);
setLabel(label);
setCollapsable(collapsible);
if (widget != null) {
setWidget(widget);