container.setWidget(0, 0, header);
container.setWidget(1, 0, formField.render().asWidget());
if (enableComparatorType) {
final PListBox listBox = new PListBox(false, false);
// for (String comparatorTypeName : ComparatorType.getNames()) {
// listBox.addItem(comparatorTypeName);
// }
listBox.addItem(ComparatorType.EQ.getName());
listBox.addItem(ComparatorType.GE.getName());
listBox.addItem(ComparatorType.GT.getName());
listBox.addItem(ComparatorType.LE.getName());
listBox.addItem(ComparatorType.LT.getName());
listBox.addChangeHandler(new PChangeHandler() {
@Override
public void onChange(final PChangeEvent event) {
final String selectedItem = listBox.getSelectedItem();
if (selectedItem == null) return;
fireComparatorTypeChange(pojoPropertyKey, ComparatorType.fromName(selectedItem));
}
});
formField.addResetHandler(new ResetHandler() {
@Override
public void onReset() {
listBox.setSelectedIndex(0);
}
});
container.setWidget(1, 1, listBox);
container.getFlexCellFormatter().setColSpan(0, 0, 2);