public class ScreenSettingsFacetImpl extends AbstractFacet implements ScreenSettingsFacet, ScreenSettingsFacetResolver.AfterShowEventHandler
ScreenSettingsFacet.SettingsContext| Modifier and Type | Field and Description |
|---|---|
protected io.jmix.core.common.event.Subscription |
afterDetachedSubscription |
protected io.jmix.core.common.event.Subscription |
afterShowSubscription |
protected java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> |
applyDataLoadingSettingsDelegate |
protected java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> |
applySettingsDelegate |
protected boolean |
auto |
protected org.springframework.beans.factory.BeanFactory |
beanFactory |
protected io.jmix.core.common.event.Subscription |
beforeShowSubscription |
protected java.util.Set<java.lang.String> |
componentIds |
protected boolean |
isAfterShowHandled |
protected java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> |
saveSettingsDelegate |
protected ScreenSettings |
screenSettings |
protected ScreenSettingsFacetResolver |
settingsFacetResolver |
protected ScreenSettingsManager |
settingsManager |
id, owner| Constructor and Description |
|---|
ScreenSettingsFacetImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponentIds(java.lang.String... ids)
Adds component ids that should be handled when
ScreenSettingsFacet.isAuto() returns false. |
protected void |
applyDataLoadingScreenSettings(java.util.Collection<Component> components) |
void |
applyDataLoadingSettings()
Applies data loading settings.
|
void |
applyDataLoadingSettings(java.util.Collection<Component> components)
Applies data loading settings for the components collection.
|
protected void |
applyScreenSettings(java.util.Collection<Component> components) |
void |
applySettings()
Applies screen settings.
|
void |
applySettings(java.util.Collection<Component> components)
Applies screen settings for the components collection.
|
protected void |
checkAttachedFrame() |
protected java.util.Collection<Component> |
fillComponents(java.util.Collection<Component> components) |
protected java.util.Collection<Component> |
fillWithInnerComponents(java.util.Collection<Component> components,
HasInnerComponents hasInnerComponents) |
protected java.util.Collection<Component> |
filterByManagedComponents(java.util.Collection<Component> components) |
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
ScreenSettingsFacet.isAuto() property. |
java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> |
getSaveSettingsDelegate() |
protected Screen |
getScreenOwner() |
ScreenSettings |
getSettings() |
boolean |
isAuto() |
protected boolean |
isSettingsEnabled() |
protected void |
onAfterDetachEvent(Screen.AfterDetachEvent event) |
void |
onAfterShowEvent(Screen.AfterShowEvent event) |
protected void |
onBeforeShowEvent(Screen.BeforeShowEvent event) |
protected void |
saveScreenSettings(java.util.Collection<Component> components) |
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 |
setOwner(Frame owner)
|
void |
setSaveSettingsDelegate(java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> delegate)
Set save settings delegate.
|
protected void |
subscribe() |
protected void |
unsubscribe() |
getEventHub, getId, getOwner, hasSubscriptions, publish, setId, unsubscribeprotected java.util.Set<java.lang.String> componentIds
protected boolean auto
protected boolean isAfterShowHandled
protected ScreenSettings screenSettings
protected java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> applySettingsDelegate
protected java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> applyDataLoadingSettingsDelegate
protected java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> saveSettingsDelegate
protected io.jmix.core.common.event.Subscription beforeShowSubscription
protected io.jmix.core.common.event.Subscription afterShowSubscription
protected io.jmix.core.common.event.Subscription afterDetachedSubscription
@Autowired(required=false) protected ScreenSettingsManager settingsManager
@Autowired protected ScreenSettingsFacetResolver settingsFacetResolver
@Autowired protected org.springframework.beans.factory.BeanFactory beanFactory
public ScreenSettings getSettings()
getSettings in interface ScreenSettingsFacetpublic void applySettings()
ScreenSettingsFacetScreen.AfterShowEvent.applySettings in interface ScreenSettingsFacetpublic void applySettings(java.util.Collection<Component> components)
ScreenSettingsFacetapplySettings in interface ScreenSettingsFacetcomponents - components to applypublic void applyDataLoadingSettings()
ScreenSettingsFacetScreen.BeforeShowEvent.applyDataLoadingSettings in interface ScreenSettingsFacetpublic void applyDataLoadingSettings(java.util.Collection<Component> components)
ScreenSettingsFacetapplyDataLoadingSettings in interface ScreenSettingsFacetcomponents - components to applypublic void saveSettings()
ScreenSettingsFacetScreen.AfterDetachEvent.saveSettings in interface ScreenSettingsFacetpublic void saveSettings(java.util.Collection<Component> components)
ScreenSettingsFacetsaveSettings in interface ScreenSettingsFacetcomponents - components to savepublic boolean isAuto()
isAuto in interface ScreenSettingsFacetpublic void setAuto(boolean auto)
ScreenSettingsFacetsetAuto in interface ScreenSettingsFacetauto - whether facet should include all components for saving settingspublic void addComponentIds(java.lang.String... ids)
ScreenSettingsFacetScreenSettingsFacet.isAuto() returns false.
Note, component must be attached to the Window, otherwise it will be ignored.
addComponentIds in interface ScreenSettingsFacetids - component idspublic java.util.Set<java.lang.String> getComponentIds()
getComponentIds in interface ScreenSettingsFacetScreenSettingsFacet.isAuto() returns false.public java.util.Collection<Component> getComponents()
ScreenSettingsFacetScreenSettingsFacet.isAuto() property. If ScreenSettingsFacet.isAuto() returns true collection will be
filled by Window's components, otherwise collection will be filled by components were added by
ScreenSettingsFacet.addComponentIds(String...).getComponents in interface ScreenSettingsFacetpublic java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> getApplySettingsDelegate()
getApplySettingsDelegate in interface ScreenSettingsFacetpublic void setApplySettingsDelegate(java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> delegate)
ScreenSettingsFacetScreen.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);
}
setApplySettingsDelegate in interface ScreenSettingsFacetdelegate - apply settings delegatepublic java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> getApplyDataLoadingSettingsDelegate()
getApplyDataLoadingSettingsDelegate in interface ScreenSettingsFacetpublic void setApplyDataLoadingSettingsDelegate(java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> delegate)
ScreenSettingsFacetScreen.BeforeShowEvent.
For instance:
@Install(to = "settingsFacet", subject = "applyDataLoadingSettingsDelegate")
private void onApplyDataLoadingSetting(SettingsSet settings) {
settingsFacet.applyDataLoadingSettings(settings);
}
setApplyDataLoadingSettingsDelegate in interface ScreenSettingsFacetdelegate - apply settings delegatepublic java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> getSaveSettingsDelegate()
getSaveSettingsDelegate in interface ScreenSettingsFacetpublic void setSaveSettingsDelegate(java.util.function.Consumer<ScreenSettingsFacet.SettingsContext> delegate)
ScreenSettingsFacetScreen.AfterDetachEvent.
For instance:
@Install(to = "settingsFacet", subject = "saveSettingsDelegate")
private void onSaveSetting(SettingsSet settings) {
settingsFacet.saveSettings(settings);
}
setSaveSettingsDelegate in interface ScreenSettingsFacetdelegate - save settings delegatepublic void setOwner(@Nullable
Frame owner)
FacetsetOwner in interface FacetsetOwner in class AbstractFacetowner - owner frameprotected void subscribe()
protected void unsubscribe()
@Nullable protected Screen getScreenOwner()
protected void onBeforeShowEvent(Screen.BeforeShowEvent event)
public void onAfterShowEvent(Screen.AfterShowEvent event)
onAfterShowEvent in interface ScreenSettingsFacetResolver.AfterShowEventHandlerprotected void onAfterDetachEvent(Screen.AfterDetachEvent event)
protected void applyScreenSettings(java.util.Collection<Component> components)
protected void applyDataLoadingScreenSettings(java.util.Collection<Component> components)
protected void saveScreenSettings(java.util.Collection<Component> components)
protected boolean isSettingsEnabled()
protected java.util.Collection<Component> filterByManagedComponents(java.util.Collection<Component> components)
protected void checkAttachedFrame()
protected java.util.Collection<Component> fillComponents(java.util.Collection<Component> components)
protected java.util.Collection<Component> fillWithInnerComponents(java.util.Collection<Component> components, HasInnerComponents hasInnerComponents)