Package io.jmix.ui.presentation.facet
Class PresentationsFacetImpl
java.lang.Object
io.jmix.ui.component.impl.AbstractFacet
io.jmix.ui.presentation.facet.PresentationsFacetImpl
- All Implemented Interfaces:
Facet
,PresentationsFacet
,ScreenSettingsFacetResolver.AfterShowEventHandler
,ScreenSettingsFacetResolver.PostAfterShowEventHandler
public class PresentationsFacetImpl
extends AbstractFacet
implements PresentationsFacet, ScreenSettingsFacetResolver.AfterShowEventHandler, ScreenSettingsFacetResolver.PostAfterShowEventHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected boolean
protected PresentationsManager
protected ScreenSettingsFacetResolver
Fields inherited from class io.jmix.ui.component.impl.AbstractFacet
id, owner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addComponentIds
(String... ids) Adds component ids that should be handled whenPresentationsFacet.isAuto()
returns false.protected void
applyDefaultPresentation
(Collection<Component> components) protected void
protected void
commitPresentations
(Collection<Component> components) protected Collection<Component>
fillComponents
(Collection<Component> components) protected Collection<Component>
fillWithInnerComponents
(Collection<Component> components, HasInnerComponents hasInnerComponents) Collection depends onPresentationsFacet.isAuto()
property.protected Screen
boolean
isAuto()
protected boolean
void
void
void
setAuto
(boolean auto) Set to true if facet should apply and save presentations for all supported component in the screen.void
protected void
setupDefaultSettings
(Collection<Component> components) protected void
protected void
Methods inherited from class io.jmix.ui.component.impl.AbstractFacet
getEventHub, getId, getOwner, hasSubscriptions, publish, setId, unsubscribe
-
Field Details
-
settingsFacetResolver
-
presentationsManager
-
auto
protected boolean auto -
componentIds
-
isAfterShowHandled
protected boolean isAfterShowHandled -
isPostAfterShowHandled
protected boolean isPostAfterShowHandled
-
-
Constructor Details
-
PresentationsFacetImpl
public PresentationsFacetImpl()
-
-
Method Details
-
isAuto
public boolean isAuto()- Specified by:
isAuto
in interfacePresentationsFacet
- Returns:
- true if facet should apply and save presentations for all supported component in the screen. False by default.
-
setAuto
public void setAuto(boolean auto) Description copied from interface:PresentationsFacet
Set to true if facet should apply and save presentations for all supported component in the screen. False by default.- Specified by:
setAuto
in interfacePresentationsFacet
- Parameters:
auto
- whether facet should include all components for applying/saving presentations
-
addComponentIds
Description copied from interface:PresentationsFacet
Adds component ids that should be handled whenPresentationsFacet.isAuto()
returns false.Note, component must be attached to the Window, otherwise it will be ignored.
- Specified by:
addComponentIds
in interfacePresentationsFacet
- Parameters:
ids
- component ids
-
getComponentIds
- Specified by:
getComponentIds
in interfacePresentationsFacet
- Returns:
- list of component ids that should be handled when
PresentationsFacet.isAuto()
returns false.
-
getComponents
Description copied from interface:PresentationsFacet
Collection depends onPresentationsFacet.isAuto()
property. IfPresentationsFacet.isAuto()
returns true collection will be filled byWindow
's components, otherwise collection will be filled by components were added byPresentationsFacet.addComponentIds(String...)
.- Specified by:
getComponents
in interfacePresentationsFacet
- Returns:
- components collection that is used for applying and saving presentations.
-
setOwner
Description copied from interface:Facet
- Specified by:
setOwner
in interfaceFacet
- Overrides:
setOwner
in classAbstractFacet
- Parameters:
owner
- owner frame
-
setupDefaultSettings
-
applyDefaultPresentation
-
commitPresentations
-
subscribe
protected void subscribe() -
unsubscribe
protected void unsubscribe() -
onAfterShowEvent
- Specified by:
onAfterShowEvent
in interfaceScreenSettingsFacetResolver.AfterShowEventHandler
-
onPostAfterShow
public void onPostAfterShow()- Specified by:
onPostAfterShow
in interfaceScreenSettingsFacetResolver.PostAfterShowEventHandler
-
checkAttachedFrame
protected void checkAttachedFrame() -
getScreenOwner
-
isPresentationsEnabled
protected boolean isPresentationsEnabled() -
fillComponents
-
fillWithInnerComponents
protected Collection<Component> fillWithInnerComponents(Collection<Component> components, HasInnerComponents hasInnerComponents)
-