(new StringLabelProvider<>());
listBox.add("true");
listBox.add("false");
listBox.setAllowBlank(false);
listBox.setForceSelection(true);
listBox.setEditable(false);
listBox.setTriggerAction(TriggerAction.ALL);
if (p.getDefaultValue() != null&& !p.getDefaultValue().isEmpty()) {
Boolean b=Boolean.valueOf(p.getDefaultValue());
if(b){
listBox.setValue("true");
} else {
listBox.setValue("false");
}
} else {
listBox.setValue("false");
}
HtmlLayoutContainer descr;
if (p.getDescription() == null) {
descr = new HtmlLayoutContainer(
"");
descr.addStyleName("workflow-fieldDescription");
} else {
// listBox.setToolTip(p.getDescription());
descr = new HtmlLayoutContainer(
""
+ p.getDescription() + "
");
descr.addStyleName("workflow-fieldDescription");
}
horiz.add(listBox, new BoxLayoutData(new Margins()));
horiz.add(descr, new BoxLayoutData(new Margins()));
fieldContainer.add(horiz);
fieldContainer.forceLayout();
}
/**
*
*/
@Override
public String getValue() {
return listBox.getCurrentValue();
}
/**
*
*/
@Override
public Widget getWidget() {
return fieldContainer;
}
@Override
public boolean isValid() {
return listBox.isValid();
}
}