Package io.jmix.ui.settings.facet
Interface ScreenSettingsFacet
- All Superinterfaces:
Facet
- All Known Implementing Classes:
ScreenSettingsFacetImpl
@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",
documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/facets/screen-settings-facet.html")
public interface ScreenSettingsFacet
extends Facet
Provides ability to save and apply component settings.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Provides information about source component and its child components. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComponentIds
(String... ids) Adds component ids that should be handled whenisAuto()
returns false.void
Applies data loading settings.void
applyDataLoadingSettings
(Collection<Component> components) Applies data loading settings for the components collection.void
Applies screen settings.void
applySettings
(Collection<Component> components) Applies screen settings for the components collection.void
excludeComponentIds
(String... ids) Adds component ids that should be excluded from applying and saving settings.Collection depends onisAuto()
property.boolean
isAuto()
void
Saves and persist settings.void
saveSettings
(Collection<Component> components) Saves and persist settings for the components collection.void
Sets apply data loading settings delegate.void
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
Set save settings delegate.
-
Method Details
-
isAuto
boolean isAuto()- Returns:
- true if facet should apply and save settings for all supported component in the screen. False by default.
-
setAuto
Set to true if facet should apply and save settings for all supported component in the screen. False by default.- Parameters:
auto
- whether facet should include all components for saving settings
-
addComponentIds
Adds component ids that should be handled whenisAuto()
returns false.Note, component must be attached to the Window, otherwise it will be ignored.
- Parameters:
ids
- component ids
-
getComponentIds
- Returns:
- set of component ids that should be handled when
isAuto()
returns false.
-
excludeComponentIds
Adds component ids that should be excluded from applying and saving settings. Excluding is applied despiteisAuto()
mode and has priority over explicitly added component idsaddComponentIds(String...)
.- Parameters:
ids
- component ids to exclude
-
getExcludedComponentIds
- Returns:
- set of component ids that should be excluded from applying and saving settings.
-
getComponents
Collection<Component> getComponents()Collection depends onisAuto()
property. IfisAuto()
returns true collection will be filled byWindow
's components, otherwise collection will be filled by components were added byaddComponentIds(String...)
.- Returns:
- components collection that is used for applying and saving settings.
-
getSettings
- Returns:
- screen settings or
null
if facet is not attached to the screen
-
applySettings
void applySettings()Applies screen settings. By default facet applies setting onScreen.AfterShowEvent
. -
applySettings
Applies screen settings for the components collection. Window must contains these components, otherwise they will be ignored.- Parameters:
components
- components to apply
-
applyDataLoadingSettings
void applyDataLoadingSettings()Applies data loading settings. By default facet applies data loading settings onScreen.BeforeShowEvent
. -
applyDataLoadingSettings
Applies data loading settings for the components collection. Window must contains these components, otherwise they will be ignored.- Parameters:
components
- components to apply
-
saveSettings
void saveSettings()Saves and persist settings. By default facet saves settings onScreen.AfterDetachEvent
. -
saveSettings
Saves and persist settings for the components collection. Window must contains these components, otherwise they will be ignored.- Parameters:
components
- components to save
-
getApplySettingsDelegate
- Returns:
- apply settings delegate or
null
if not set
-
setApplySettingsDelegate
Sets apply settings delegate. It will replace default behavior of facet and will be invoked onScreen.AfterShowEvent
.Note, it also will be invoked when lazy tab from
TabSheet
orAccordion
is opened.For instance:
@Install(to = "settingsFacet", subject = "applySettingsDelegate") private void onApplySettings(ScreenSettingsFacet.SettingsContext settingsContext) { settingsFacet.applySettings(); }
- Parameters:
delegate
- apply settings delegate
-
getApplyDataLoadingSettingsDelegate
- Returns:
- apply data loading settings delegate or
null
if not set
-
setApplyDataLoadingSettingsDelegate
Sets apply data loading settings delegate. It will replace default behavior of facet and will be invoked onScreen.BeforeShowEvent
.For instance:
@Install(to = "settingsFacet", subject = "applyDataLoadingSettingsDelegate") private void onApplyDataLoadingSettings(ScreenSettingsFacet.SettingsContext settingsContext) { settingsFacet.applyDataLoadingSettings(); }
- Parameters:
delegate
- apply settings delegate
-
getSaveSettingsDelegate
- Returns:
- save settings delegate or
null
if not set
-
setSaveSettingsDelegate
Set save settings delegate. It will replace default behavior of facet and will be invoked onScreen.AfterDetachEvent
.For instance:
@Install(to = "settingsFacet", subject = "saveSettingsDelegate") private void onSaveSettings(ScreenSettingsFacet.SettingsContext settingsContext) { settingsFacet.saveSettings(); }
- Parameters:
delegate
- save settings delegate
-