use of io.jmix.ui.settings.component.SettingsWrapperImpl in project jmix by jmix-framework.
the class LegacySettingsDelegate method applyDataLoadingSettings.
@Override
public void applyDataLoadingSettings(Element element) {
if (!isSettingsEnabled()) {
return;
}
ComponentSettings settings = settingsConverter.convertToComponentSettings(element);
((DataLoadingSettingsBinder) settingsBinder).applyDataLoadingSettings(component, new SettingsWrapperImpl(settings));
}
use of io.jmix.ui.settings.component.SettingsWrapperImpl in project jmix by jmix-framework.
the class LegacySettingsDelegate method saveSettings.
@Override
public boolean saveSettings(Element element) {
if (!isSettingsEnabled()) {
return false;
}
ComponentSettings settings = settingsConverter.convertToComponentSettings(element);
boolean modified = settingsBinder.saveSettings(component, new SettingsWrapperImpl(settings));
if (modified)
settingsConverter.copyToElement(settings, element);
return modified;
}
use of io.jmix.ui.settings.component.SettingsWrapperImpl in project jmix by jmix-framework.
the class AbstractTable method resetPresentation.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void resetPresentation() {
if (defaultTableSettings != null) {
DataLoadingSettingsBinder binder = (DataLoadingSettingsBinder) getSettingsBinder();
binder.applySettings(this, new SettingsWrapperImpl(defaultTableSettings));
binder.applyDataLoadingSettings(this, new SettingsWrapperImpl(defaultTableSettings));
if (presentations != null) {
presentations.setCurrent(null);
}
}
}
use of io.jmix.ui.settings.component.SettingsWrapperImpl in project jmix by jmix-framework.
the class PresentationsManagerImpl method setupDefaultSettings.
@Override
public void setupDefaultSettings(Collection<Component> components) {
for (Component component : components) {
if (Strings.isNullOrEmpty(component.getId()) || !settingsRegistry.isSettingsRegisteredFor(component.getClass()) || !(component instanceof HasTablePresentations)) {
continue;
}
ComponentSettingsBinder binder = settingsRegistry.getSettingsBinder(component.getClass());
ComponentSettings defaultSettings = binder.getSettings(component);
((HasTablePresentations) component).setDefaultSettings(new SettingsWrapperImpl(defaultSettings));
}
}
use of io.jmix.ui.settings.component.SettingsWrapperImpl in project jmix by jmix-framework.
the class ScreenSettingsManagerImpl method applySettings.
@Override
public void applySettings(Collection<Component> components, ScreenSettings screenSettings) {
Preconditions.checkNotNullArgument(components);
Preconditions.checkNotNullArgument(screenSettings);
for (Component component : components) {
if (Strings.isNullOrEmpty(component.getId()) || !settingsRegistry.isSettingsRegisteredFor(component.getClass())) {
continue;
}
log.trace("Applying settings for {} : {} ", getComponentPath(component), component);
ComponentSettingsBinder binder = settingsRegistry.getSettingsBinder(component.getClass());
Class<? extends ComponentSettings> settingsClass = settingsRegistry.getSettingsClass(component.getClass());
ComponentSettings settings = screenSettings.getSettingsOrCreate(component.getId(), settingsClass);
binder.applySettings(component, new SettingsWrapperImpl(settings));
}
}
Aggregations