Search in sources :

Example 1 with IFilterControl

use of org.jowidgets.cap.ui.api.filter.IFilterControl 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);
}
Also used : IOperator(org.jowidgets.cap.common.api.filter.IOperator) IComposite(org.jowidgets.api.widgets.IComposite) IFilterControl(org.jowidgets.cap.ui.api.filter.IFilterControl)

Aggregations

IComposite (org.jowidgets.api.widgets.IComposite)1 IOperator (org.jowidgets.cap.common.api.filter.IOperator)1 IFilterControl (org.jowidgets.cap.ui.api.filter.IFilterControl)1