Package io.jmix.flowui.facet
Interface SettingsFacet
- All Superinterfaces:
- Facet
- All Known Implementing Classes:
- SettingsFacetImpl
Provides ability to save component states when 
View is closed and restore them
 when it's opened again.
 
 For instance, it can be 'opened' state from JmixDetails or columns order in DataGrid.
 
 Note, facet works with components that contain an id and have ComponentSettingsBinder.
 Otherwise, it cannot match saved settings with component.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classProvides information about source component and components that should be managed by facet.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddComponentIds(String... ids) Adds component ids that should be managed whenisAuto()returnsfalse.voidaddExcludedComponentIds(String... ids) Adds component ids that should be excluded from applying and saving settings.voidRestores settings that related with data loading.voidRestores settings for components.Collection<com.vaadin.flow.component.Component>Collection depends onisAuto()property.booleanisAuto()voidPersists settings to store.voidSets handler that should be invoked instead of default facet's logic for applying data loading settings.voidSets handler that should be invoked instead of default facet's logic for applying settings.voidsetAuto(boolean auto) Defines in which mode facet will work.voidSets handler that should be invoked instead of default facet's logic for saving settings.
- 
Method Details- 
isAutoboolean isAuto()- Returns:
- the mode in which facet is worked. trueif facet includes all components andfalseif only specified components byaddComponentIds(String...)will be managed.
 
- 
setAutovoid setAuto(boolean auto) Defines in which mode facet will work. If 'auto' is set totrueit means that all components that contain an id and haveComponentSettingsBinderwill be managed by facet.If 'auto' mode is disabled (set to false), only specified components byaddComponentIds(String...)will be managed.The default value is false.- Parameters:
- auto- whether facet should include all components
 
- 
getSettings
- 
applySettingsvoid applySettings()Restores settings for components. Facet applies settings onView'sView.ReadyEvent.
- 
applyDataLoadingSettingsvoid applyDataLoadingSettings()Restores settings that related with data loading. For instance, it applies sort columns and its direction inDataGridbefore data loading.Facet applies data loading settings on View'sView.BeforeShowEvent.
- 
saveSettingsvoid saveSettings()Persists settings to store. Facet saves settings onView'sDetachEvent.
- 
addComponentIdsAdds component ids that should be managed whenisAuto()returnsfalse.Note, component must be attached to the View, otherwise it will be ignored.- Parameters:
- ids- component ids
 
- 
getComponentIds- Returns:
- set of component ids that should be handled when isAuto()returnsfalse
 
- 
addExcludedComponentIdsAdds 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
 
- 
getManagedComponentsCollection<com.vaadin.flow.component.Component> getManagedComponents()Collection depends onisAuto()property. IfisAuto()returnstrue, collection will be filled byView's components, otherwise collection will be filled by components that explicitly added byaddComponentIds(String...).- Returns:
- components collection that is used for applying and saving settings
 
- 
getApplySettingsDelegate- Returns:
- apply settings delegate or nullif not set
 
- 
setApplySettingsDelegateSets handler that should be invoked instead of default facet's logic for applying settings.For instance: @Install(to = "settingsFacet", subject = "applySettingsDelegate") private void onApplySettings(SettingsFacet.SettingsContext settingsContext) { settingsFacet.applySettings(); }- Parameters:
- delegate- handler to set
 
- 
getApplyDataLoadingSettingsDelegate- Returns:
- apply data loading settings delegate or nullif not set
 
- 
setApplyDataLoadingSettingsDelegatevoid setApplyDataLoadingSettingsDelegate(@Nullable Consumer<SettingsFacet.SettingsContext> delegate) Sets handler that should be invoked instead of default facet's logic for applying data loading settings.For instance: @Install(to = "settingsFacet", subject = "applyDataLoadingSettingsDelegate") private void onApplyDataLoadingSettings(SettingsFacet.SettingsContext settingsContext) { settingsFacet.applyDataLoadingSettings(); }- Parameters:
- delegate- handler to set
 
- 
getSaveSettingsDelegate- Returns:
- save settings delegate or nullif not set
 
- 
setSaveSettingsDelegateSets handler that should be invoked instead of default facet's logic for saving settings.For instance: @Install(to = "settingsFacet", subject = "saveSettingsDelegate") private void onSaveSettings(SettingsFacet.SettingsContext settingsContext) { settingsFacet.saveSettings(); }- Parameters:
- delegate- handler to set
 
 
-