use of org.jowidgets.cap.common.api.filter.IOperator in project jo-client-platform by jo-source.
the class AttributeFilterControlImpl method setAttributeImpl.
private void setAttributeImpl(final IAttribute<?> attribute, final IFilterType filterType, final boolean setDefaultOperator) {
Assert.paramNotNull(attribute, "attribute");
Assert.paramNotNull(filterType, "filterType");
final IFilterPanelProvider<IOperator> filterPanelProvider = getFilterPanelProvider(attribute, filterType);
final ICustomWidgetCreator<IFilterControl<IOperator, Object, IUiConfigurableFilter<Object>>> creator;
creator = createPanelCreator(filterPanelProvider);
final IComposite composite = getWidget();
if (filterControl != null) {
filterControl.removeInputListener(inputListener);
composite.remove(filterControl);
}
filterControl = composite.add(creator, "growx, w 0::");
filterControl.setEditable(editable);
filterControl.addInputListener(inputListener);
filterControl.addValidationConditionListener(validationConditionListener);
this.operatorProvider = filterPanelProvider.getOperatorProvider();
cmbOperator.removeInputListener(operatorListener);
cmbOperator.setElements(operatorProvider.getOperators());
final IOperator defaultOperator = operatorProvider.getDefaultOperator();
if (defaultOperator != null) {
if (setDefaultOperator) {
cmbOperator.setValue(defaultOperator);
filterControl.setOperator(defaultOperator);
}
setCmbNotEnabledByOperator(defaultOperator);
}
cmbOperator.addInputListener(operatorListener);
}
use of org.jowidgets.cap.common.api.filter.IOperator 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