Package io.jmix.ui.settings.facet
Class ScreenSettingsFacetImpl
java.lang.Object
io.jmix.ui.component.impl.AbstractFacet
io.jmix.ui.settings.facet.ScreenSettingsFacetImpl
- All Implemented Interfaces:
Facet,ScreenSettingsFacet,ScreenSettingsFacetResolver.AfterShowEventHandler
public class ScreenSettingsFacetImpl
extends AbstractFacet
implements ScreenSettingsFacet, ScreenSettingsFacetResolver.AfterShowEventHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.ui.settings.facet.ScreenSettingsFacet
ScreenSettingsFacet.SettingsContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Subscriptionprotected Subscriptionprotected Consumer<ScreenSettingsFacet.SettingsContext>protected Consumer<ScreenSettingsFacet.SettingsContext>protected booleanprotected org.springframework.beans.factory.BeanFactoryprotected Subscriptionprotected booleanprotected Consumer<ScreenSettingsFacet.SettingsContext>protected ScreenSettingsprotected ScreenSettingsFacetResolverprotected ScreenSettingsManagerFields inherited from class io.jmix.ui.component.impl.AbstractFacet
id, owner -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponentIds(String... ids) Adds component ids that should be handled whenScreenSettingsFacet.isAuto()returns false.protected voidapplyDataLoadingScreenSettings(Collection<Component> components) voidApplies data loading settings.voidapplyDataLoadingSettings(Collection<Component> components) Applies data loading settings for the components collection.protected voidapplyScreenSettings(Collection<Component> components) voidApplies screen settings.voidapplySettings(Collection<Component> components) Applies screen settings for the components collection.protected voidprotected Collection<Component>fillComponents(Collection<Component> components) protected Collection<Component>fillWithInnerComponents(Collection<Component> components, HasInnerComponents hasInnerComponents) protected Collection<Component>filterByManagedComponents(Collection<Component> components) Collection depends onScreenSettingsFacet.isAuto()property.protected ScreenbooleanisAuto()protected booleanprotected voidvoidprotected voidprotected voidsaveScreenSettings(Collection<Component> components) voidSaves and persist settings.voidsaveSettings(Collection<Component> components) Saves and persist settings for the components collection.voidSets apply data loading settings delegate.voidSets apply settings delegate.voidsetAuto(boolean auto) Set to true if facet should apply and save settings for all supported component in the screen.voidvoidSet save settings delegate.protected voidprotected voidMethods inherited from class io.jmix.ui.component.impl.AbstractFacet
getEventHub, getId, getOwner, hasSubscriptions, publish, setId, unsubscribe
-
Field Details
-
componentIds
-
auto
protected boolean auto -
isAfterShowHandled
protected boolean isAfterShowHandled -
screenSettings
-
applySettingsDelegate
-
applyDataLoadingSettingsDelegate
-
saveSettingsDelegate
-
beforeShowSubscription
-
afterShowSubscription
-
afterDetachedSubscription
-
settingsManager
-
settingsFacetResolver
-
beanFactory
@Autowired protected org.springframework.beans.factory.BeanFactory beanFactory
-
-
Constructor Details
-
ScreenSettingsFacetImpl
public ScreenSettingsFacetImpl()
-
-
Method Details
-
getSettings
- Specified by:
getSettingsin interfaceScreenSettingsFacet- Returns:
- screen settings or
nullif facet is not attached to the screen
-
applySettings
public void applySettings()Description copied from interface:ScreenSettingsFacetApplies screen settings. By default facet applies setting onScreen.AfterShowEvent.- Specified by:
applySettingsin interfaceScreenSettingsFacet
-
applySettings
Description copied from interface:ScreenSettingsFacetApplies screen settings for the components collection. Window must contains these components, otherwise they will be ignored.- Specified by:
applySettingsin interfaceScreenSettingsFacet- Parameters:
components- components to apply
-
applyDataLoadingSettings
public void applyDataLoadingSettings()Description copied from interface:ScreenSettingsFacetApplies data loading settings. By default facet applies data loading settings onScreen.BeforeShowEvent.- Specified by:
applyDataLoadingSettingsin interfaceScreenSettingsFacet
-
applyDataLoadingSettings
Description copied from interface:ScreenSettingsFacetApplies data loading settings for the components collection. Window must contains these components, otherwise they will be ignored.- Specified by:
applyDataLoadingSettingsin interfaceScreenSettingsFacet- Parameters:
components- components to apply
-
saveSettings
public void saveSettings()Description copied from interface:ScreenSettingsFacetSaves and persist settings. By default facet saves settings onScreen.AfterDetachEvent.- Specified by:
saveSettingsin interfaceScreenSettingsFacet
-
saveSettings
Description copied from interface:ScreenSettingsFacetSaves and persist settings for the components collection. Window must contains these components, otherwise they will be ignored.- Specified by:
saveSettingsin interfaceScreenSettingsFacet- Parameters:
components- components to save
-
isAuto
public boolean isAuto()- Specified by:
isAutoin interfaceScreenSettingsFacet- Returns:
- true if facet should apply and save settings for all supported component in the screen. False by default.
-
setAuto
public void setAuto(boolean auto) Description copied from interface:ScreenSettingsFacetSet to true if facet should apply and save settings for all supported component in the screen. False by default.- Specified by:
setAutoin interfaceScreenSettingsFacet- Parameters:
auto- whether facet should include all components for saving settings
-
addComponentIds
Description copied from interface:ScreenSettingsFacetAdds component ids that should be handled whenScreenSettingsFacet.isAuto()returns false.Note, component must be attached to the Window, otherwise it will be ignored.
- Specified by:
addComponentIdsin interfaceScreenSettingsFacet- Parameters:
ids- component ids
-
getComponentIds
- Specified by:
getComponentIdsin interfaceScreenSettingsFacet- Returns:
- list of component ids that should be handled when
ScreenSettingsFacet.isAuto()returns false.
-
getComponents
Description copied from interface:ScreenSettingsFacetCollection depends onScreenSettingsFacet.isAuto()property. IfScreenSettingsFacet.isAuto()returns true collection will be filled byWindow's components, otherwise collection will be filled by components were added byScreenSettingsFacet.addComponentIds(String...).- Specified by:
getComponentsin interfaceScreenSettingsFacet- Returns:
- components collection that is used for applying and saving settings.
-
getApplySettingsDelegate
- Specified by:
getApplySettingsDelegatein interfaceScreenSettingsFacet- Returns:
- apply settings delegate or
nullif not set
-
setApplySettingsDelegate
Description copied from interface:ScreenSettingsFacetSets 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
TabSheetorAccordionis opened.For instance:
@Install(to = "settingsFacet", subject = "applySettingsDelegate") private void onApplySettings(ScreenSettingsFacet.SettingsContext settingsContext) { settingsFacet.applySettings(); }- Specified by:
setApplySettingsDelegatein interfaceScreenSettingsFacet- Parameters:
delegate- apply settings delegate
-
getApplyDataLoadingSettingsDelegate
- Specified by:
getApplyDataLoadingSettingsDelegatein interfaceScreenSettingsFacet- Returns:
- apply data loading settings delegate or
nullif not set
-
setApplyDataLoadingSettingsDelegate
public void setApplyDataLoadingSettingsDelegate(Consumer<ScreenSettingsFacet.SettingsContext> delegate) Description copied from interface:ScreenSettingsFacetSets 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(); }- Specified by:
setApplyDataLoadingSettingsDelegatein interfaceScreenSettingsFacet- Parameters:
delegate- apply settings delegate
-
getSaveSettingsDelegate
- Specified by:
getSaveSettingsDelegatein interfaceScreenSettingsFacet- Returns:
- save settings delegate or
nullif not set
-
setSaveSettingsDelegate
Description copied from interface:ScreenSettingsFacetSet 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(); }- Specified by:
setSaveSettingsDelegatein interfaceScreenSettingsFacet- Parameters:
delegate- save settings delegate
-
setOwner
Description copied from interface:Facet- Specified by:
setOwnerin interfaceFacet- Overrides:
setOwnerin classAbstractFacet- Parameters:
owner- owner frame
-
subscribe
protected void subscribe() -
unsubscribe
protected void unsubscribe() -
getScreenOwner
-
onBeforeShowEvent
-
onAfterShowEvent
- Specified by:
onAfterShowEventin interfaceScreenSettingsFacetResolver.AfterShowEventHandler
-
onAfterDetachEvent
-
applyScreenSettings
-
applyDataLoadingScreenSettings
-
saveScreenSettings
-
isSettingsEnabled
protected boolean isSettingsEnabled() -
filterByManagedComponents
-
checkAttachedFrame
protected void checkAttachedFrame() -
fillComponents
-
fillWithInnerComponents
protected Collection<Component> fillWithInnerComponents(Collection<Component> components, HasInnerComponents hasInnerComponents)
-