use of org.jowidgets.api.convert.IObjectStringConverter in project jo-client-platform by jo-source.
the class AttributeFilterControlImpl method comboBoxNotBp.
private static IComboBoxSelectionBluePrint<Boolean> comboBoxNotBp() {
final IBluePrintFactory bpf = Toolkit.getBluePrintFactory();
final IObjectStringConverter<Boolean> converter = new IObjectStringConverter<Boolean>() {
@Override
public String convertToString(final Boolean bool) {
if (bool) {
return NOT.get();
} else {
return "";
}
}
@Override
public String getDescription(final Boolean bool) {
if (bool) {
return NOT.get();
} else {
return "";
}
}
};
final IComboBoxSelectionBluePrint<Boolean> result = bpf.comboBoxSelection(converter);
result.autoCompletionOff().autoSelectionOn().setElements(Boolean.FALSE, Boolean.TRUE);
return result;
}
use of org.jowidgets.api.convert.IObjectStringConverter in project jo-client-platform by jo-source.
the class AttributeFilterControlImpl method comboBoxOperatorBp.
private static IComboBoxSelectionBluePrint<IOperator> comboBoxOperatorBp() {
final IBluePrintFactory bpf = Toolkit.getBluePrintFactory();
final IObjectStringConverter<IOperator> converter = new IObjectStringConverter<IOperator>() {
@Override
public String convertToString(final IOperator value) {
if (value != null) {
return value.getLabelLong();
} else {
return null;
}
}
@Override
public String getDescription(final IOperator value) {
if (value != null) {
return value.getDescription();
} else {
return null;
}
}
};
return bpf.comboBoxSelection(converter).autoSelectionOn();
}
Aggregations