@StudioFacet(xmlElement="screenSettings", caption="ScreenSettings", category="Facets", description="Provides ability to save and apply component settings", defaultProperty="auto", icon="io/jmix/ui/icon/facet/screenSettings.svg") public interface ScreenSettingsFacet extends Facet
ComponentSettings
,
ComponentSettingsBinder
Modifier and Type | Interface and Description |
---|---|
static class |
ScreenSettingsFacet.SettingsContext
Provides information about source component and its child components.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponentIds(java.lang.String... ids)
Adds component ids that should be handled when
isAuto() returns false. |
void |
applyDataLoadingSettings()
Applies data loading settings.
|
void |
applyDataLoadingSettings(java.util.Collection<Component> components)
Applies data loading settings for the components collection.
|
void |
applySettings()
Applies screen settings.
|
void |
applySettings(java.util.Collection<Component> components)
Applies screen settings for the components collection.
|
java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> |
getApplyDataLoadingSettingsDelegate() |
java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> |
getApplySettingsDelegate() |
java.util.Set<java.lang.String> |
getComponentIds() |
java.util.Collection<Component> |
getComponents()
Collection depends on
isAuto() property. |
java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> |
getSaveSettingsDelegate() |
ScreenSettings |
getSettings() |
boolean |
isAuto() |
void |
saveSettings()
Saves and persist settings.
|
void |
saveSettings(java.util.Collection<Component> components)
Saves and persist settings for the components collection.
|
void |
setApplyDataLoadingSettingsDelegate(java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> delegate)
Sets apply data loading settings delegate.
|
void |
setApplySettingsDelegate(java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> delegate)
Sets apply settings delegate.
|
void |
setAuto(boolean auto)
Set to true if facet should apply and save settings for all supported component in the screen.
|
void |
setSaveSettingsDelegate(java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> delegate)
Set save settings delegate.
|
boolean isAuto()
@StudioProperty(defaultValue="false", initialValue="true") void setAuto(boolean auto)
auto
- whether facet should include all components for saving settingsvoid addComponentIds(java.lang.String... ids)
isAuto()
returns false.
Note, component must be attached to the Window, otherwise it will be ignored.
ids
- component idsjava.util.Set<java.lang.String> getComponentIds()
isAuto()
returns false.java.util.Collection<Component> getComponents()
isAuto()
property. If isAuto()
returns true collection will be
filled by Window
's components, otherwise collection will be filled by components were added by
addComponentIds(String...)
.@Nullable ScreenSettings getSettings()
void applySettings()
Screen.AfterShowEvent
.void applySettings(java.util.Collection<Component> components)
components
- components to applyvoid applyDataLoadingSettings()
Screen.BeforeShowEvent
.void applyDataLoadingSettings(java.util.Collection<Component> components)
components
- components to applyvoid saveSettings()
Screen.AfterDetachEvent
.void saveSettings(java.util.Collection<Component> components)
components
- components to save@Nullable java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> getApplySettingsDelegate()
void setApplySettingsDelegate(java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> delegate)
Screen.AfterShowEvent
.
Note, it also will be invoked when lazy tab from TabSheet
or Accordion
is opened.
For instance:
@Install(to = "settingsFacet", subject = "applySettingsDelegate") private void onApplySetting(SettingsSet settings) { settingsFacet.applySettings(settings); }
delegate
- apply settings delegate@Nullable java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> getApplyDataLoadingSettingsDelegate()
void setApplyDataLoadingSettingsDelegate(java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> delegate)
Screen.BeforeShowEvent
.
For instance:
@Install(to = "settingsFacet", subject = "applyDataLoadingSettingsDelegate") private void onApplyDataLoadingSetting(SettingsSet settings) { settingsFacet.applyDataLoadingSettings(settings); }
delegate
- apply settings delegate@Nullable java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> getSaveSettingsDelegate()
void setSaveSettingsDelegate(java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> delegate)
Screen.AfterDetachEvent
.
For instance:
@Install(to = "settingsFacet", subject = "saveSettingsDelegate") private void onSaveSetting(SettingsSet settings) { settingsFacet.saveSettings(settings); }
delegate
- save settings delegate