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;
}
Aggregations