Search in sources :

Example 6 with ScreenSettingsFacet

use of io.jmix.ui.settings.facet.ScreenSettingsFacet in project jmix by jmix-framework.

the class UiDataFilterSupport method getFragmentFilterConfigurationModel.

protected FilterConfiguration getFragmentFilterConfigurationModel(Filter.Configuration configuration, ScreenFragment configurationFragment) {
    Filter filter = configuration.getOwner();
    FilterConfiguration configurationModel;
    if (configurationFragment instanceof UiDataFilterConfigurationModelFragment) {
        ScreenData screenData = UiControllerUtils.getScreenData(configurationFragment.getHostController());
        InstanceContainer<FilterConfiguration> configurationDc = screenData.getContainer(CONFIGURATION_CONTAINER_ID);
        configurationModel = configurationDc.getItem();
        if (filter.getId() != null && filter.getFrame() != null && ((UiDataFilterConfigurationModelFragment) configurationFragment).getDefaultForMeFieldVisible()) {
            ScreenSettingsFacet settingsFacet = UiControllerUtils.getFacet(filter.getFrame(), ScreenSettingsFacet.class);
            if (settingsFacet != null) {
                saveFilterSettings(settingsFacet, filter.getId(), configurationModel);
            }
        }
    } else {
        configurationModel = loadFilterConfigurationModel(filter, configuration.getId());
    }
    if (configurationModel == null) {
        configurationModel = createFilterConfigurationModel(configuration);
    }
    return configurationModel;
}
Also used : ScreenSettingsFacet(io.jmix.ui.settings.facet.ScreenSettingsFacet) Filter(io.jmix.ui.component.Filter) FilterConfiguration(io.jmix.uidata.entity.FilterConfiguration) UiDataFilterConfigurationModelFragment(io.jmix.uidata.app.filter.configuration.UiDataFilterConfigurationModelFragment) ScreenData(io.jmix.ui.model.ScreenData)

Aggregations

ScreenSettingsFacet (io.jmix.ui.settings.facet.ScreenSettingsFacet)6 LegacyFrame (com.haulmont.cuba.gui.screen.compatibility.LegacyFrame)2 FilterEntity (com.haulmont.cuba.security.entity.FilterEntity)2 Frame (io.jmix.ui.component.Frame)2 ScreenSettings (io.jmix.ui.settings.ScreenSettings)2 FilterSettings (io.jmix.ui.settings.component.FilterSettings)2 CubaProperties (com.haulmont.cuba.CubaProperties)1 com.haulmont.cuba.core.global (com.haulmont.cuba.core.global)1 AbstractWindow (com.haulmont.cuba.gui.components.AbstractWindow)1 Filter (com.haulmont.cuba.gui.components.Filter)1 AddConditionHelper (com.haulmont.cuba.gui.components.filter.AddConditionHelper)1 ConditionsTree (com.haulmont.cuba.gui.components.filter.ConditionsTree)1 FilterHelper (com.haulmont.cuba.gui.components.filter.FilterHelper)1 GroupType (com.haulmont.cuba.gui.components.filter.GroupType)1 com.haulmont.cuba.gui.components.filter.condition (com.haulmont.cuba.gui.components.filter.condition)1 GroupConditionDescriptor (com.haulmont.cuba.gui.components.filter.descriptor.GroupConditionDescriptor)1 CubaFilterSettings (com.haulmont.cuba.settings.component.CubaFilterSettings)1 Entity (io.jmix.core.Entity)1 FetchPlan (io.jmix.core.FetchPlan)1 Node (io.jmix.core.common.datastruct.Node)1