public class PresentationsFacetImpl extends AbstractFacet implements PresentationsFacet, ScreenSettingsFacetResolver.AfterShowEventHandler, ScreenSettingsFacetResolver.PostAfterShowEventHandler
Modifier and Type | Field and Description |
---|---|
protected boolean |
auto |
protected java.util.Set<java.lang.String> |
componentIds |
protected boolean |
isAfterShowHandled |
protected boolean |
isPostAfterShowHandled |
protected PresentationsManager |
presentationsManager |
protected ScreenSettingsFacetResolver |
settingsFacetResolver |
id, owner
Constructor and Description |
---|
PresentationsFacetImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addComponentIds(java.lang.String... ids)
Adds component ids that should be handled when
PresentationsFacet.isAuto() returns false. |
protected void |
applyDefaultPresentation(java.util.Collection<Component> components) |
protected void |
checkAttachedFrame() |
protected void |
commitPresentations(java.util.Collection<Component> components) |
protected java.util.Collection<Component> |
fillComponents(java.util.Collection<Component> components) |
protected java.util.Collection<Component> |
fillWithInnerComponents(java.util.Collection<Component> components,
HasInnerComponents hasInnerComponents) |
java.util.Set<java.lang.String> |
getComponentIds() |
java.util.Collection<Component> |
getComponents()
Collection depends on
PresentationsFacet.isAuto() property. |
protected Screen |
getScreenOwner() |
boolean |
isAuto() |
protected boolean |
isPresentationsEnabled() |
void |
onAfterShowEvent(Screen.AfterShowEvent event) |
void |
onPostAfterShow() |
void |
setAuto(boolean auto)
Set to true if facet should apply and save presentations for all supported component in the screen.
|
void |
setOwner(Frame owner)
|
protected void |
setupDefaultSettings(java.util.Collection<Component> components) |
protected void |
subscribe() |
protected void |
unsubscribe() |
getEventHub, getId, getOwner, hasSubscriptions, publish, setId, unsubscribe
@Autowired protected ScreenSettingsFacetResolver settingsFacetResolver
@Autowired(required=false) protected PresentationsManager presentationsManager
protected boolean auto
protected java.util.Set<java.lang.String> componentIds
protected boolean isAfterShowHandled
protected boolean isPostAfterShowHandled
public boolean isAuto()
isAuto
in interface PresentationsFacet
public void setAuto(boolean auto)
PresentationsFacet
setAuto
in interface PresentationsFacet
auto
- whether facet should include all components for applying/saving presentationspublic void addComponentIds(java.lang.String... ids)
PresentationsFacet
PresentationsFacet.isAuto()
returns false.
Note, component must be attached to the Window, otherwise it will be ignored.
addComponentIds
in interface PresentationsFacet
ids
- component idspublic java.util.Set<java.lang.String> getComponentIds()
getComponentIds
in interface PresentationsFacet
PresentationsFacet.isAuto()
returns false.public java.util.Collection<Component> getComponents()
PresentationsFacet
PresentationsFacet.isAuto()
property. If PresentationsFacet.isAuto()
returns true collection will be
filled by Window
's components, otherwise collection will be filled by components were added by
PresentationsFacet.addComponentIds(String...)
.getComponents
in interface PresentationsFacet
public void setOwner(@Nullable Frame owner)
Facet
setOwner
in interface Facet
setOwner
in class AbstractFacet
owner
- owner frameprotected void setupDefaultSettings(java.util.Collection<Component> components)
protected void applyDefaultPresentation(java.util.Collection<Component> components)
protected void commitPresentations(java.util.Collection<Component> components)
protected void subscribe()
protected void unsubscribe()
public void onAfterShowEvent(Screen.AfterShowEvent event)
onAfterShowEvent
in interface ScreenSettingsFacetResolver.AfterShowEventHandler
public void onPostAfterShow()
onPostAfterShow
in interface ScreenSettingsFacetResolver.PostAfterShowEventHandler
protected void checkAttachedFrame()
@Nullable protected Screen getScreenOwner()
protected boolean isPresentationsEnabled()
protected java.util.Collection<Component> fillComponents(java.util.Collection<Component> components)
protected java.util.Collection<Component> fillWithInnerComponents(java.util.Collection<Component> components, HasInnerComponents hasInnerComponents)