Package io.jmix.ui.component.impl
Class AbstractScreenFacet<S extends Screen>
java.lang.Object
io.jmix.ui.component.impl.AbstractFacet
io.jmix.ui.component.impl.AbstractScreenFacet<S>
- All Implemented Interfaces:
Facet,ScreenFacet<S>,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
AbstractEntityAwareScreenFacet,ScreenFacetImpl
public abstract class AbstractScreenFacet<S extends Screen>
extends AbstractFacet
implements ScreenFacet<S>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected List<Consumer<Screen.AfterCloseEvent>>protected List<Consumer<Screen.AfterShowEvent>>protected org.springframework.context.ApplicationContextprotected Stringprotected OpenModeprotected Supplier<ScreenOptions>protected Collection<UiControllerProperty>protected Sprotected StringFields inherited from class io.jmix.ui.component.impl.AbstractFacet
id, owner -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds the givenConsumeras screen after close event listener.Adds the givenConsumeras screen after show event listener.protected voidapplyScreenConfigurer(S screen) protected ScreenOptionsprotected voidinitScreenListeners(Screen screen) protected voidinjectScreenProperties(S screen, Collection<UiControllerProperty> properties) protected voidprotected voidvoidsetActionTarget(String actionId) Sets that screen should be shown when action with idactionIdis performed.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetButtonTarget(String buttonId) Sets that screen should be shown when button with idactionIdis clicked.voidsetOpenMode(OpenMode openMode) Sets screenOpenMode.voidsetOptionsProvider(Supplier<ScreenOptions> optionsProvider) Sets the givenSupplieras screen options provider.voidvoidsetProperties(Collection<UiControllerProperty> properties) Sets properties that will be injected into opened screen via public setters.voidsetScreenClass(Class<S> screenClass) Sets class of screen to open.voidsetScreenConfigurer(Consumer<S> screenConfigurer) Sets the screen configurer.voidsetScreenId(String screenId) Sets the id of screen to open.protected voidprotected voidsubscribeOnAction(Frame owner) protected voidsubscribeOnButton(Frame owner) Methods inherited from class io.jmix.ui.component.impl.AbstractFacet
getEventHub, getId, getOwner, hasSubscriptions, publish, setId, unsubscribeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.ui.component.ScreenFacet
create, show
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
screenId
-
screenClass
-
openMode
-
screenConfigurer
-
optionsProvider
-
properties
-
actionId
-
buttonId
-
afterShowListeners
-
afterCloseListeners
-
screen
-
-
Constructor Details
-
AbstractScreenFacet
public AbstractScreenFacet()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
setScreenId
Description copied from interface:ScreenFacetSets the id of screen to open.- Specified by:
setScreenIdin interfaceScreenFacet<S extends Screen>- Parameters:
screenId- screen id
-
getScreenId
- Specified by:
getScreenIdin interfaceScreenFacet<S extends Screen>- Returns:
- screen id
-
setScreenClass
Description copied from interface:ScreenFacetSets class of screen to open.- Specified by:
setScreenClassin interfaceScreenFacet<S extends Screen>- Parameters:
screenClass- screen class
-
getScreenClass
- Specified by:
getScreenClassin interfaceScreenFacet<S extends Screen>- Returns:
- class of screen to open
-
getOpenMode
- Specified by:
getOpenModein interfaceScreenFacet<S extends Screen>- Returns:
- screen
OpenMode
-
setOpenMode
Description copied from interface:ScreenFacetSets screenOpenMode.- Specified by:
setOpenModein interfaceScreenFacet<S extends Screen>- Parameters:
openMode- an open mode to set
-
setOptionsProvider
Description copied from interface:ScreenFacetSets the givenSupplieras screen options provider.- Specified by:
setOptionsProviderin interfaceScreenFacet<S extends Screen>- Parameters:
optionsProvider- screen options provider
-
getOptionsProvider
- Specified by:
getOptionsProviderin interfaceScreenFacet<S extends Screen>- Returns:
ScreenOptionsprovider
-
getScreenConfigurer
- Specified by:
getScreenConfigurerin interfaceScreenFacet<S extends Screen>- Returns:
- the screen configurer or
nullof not set
-
setScreenConfigurer
Description copied from interface:ScreenFacetSets the screen configurer. Use the configurer if you need to provide parameters to the opened screen through setters. The preferred way to set the configurer is using a controller method annotated withInstall, e.g.:@Install(to = "userBrowseFacet", subject = "screenConfigurer") private void userBrowseFacetScreenConfigurer(UserBrowse userBrowse) { userBrowse.setSomeParameter(someValue); }- Specified by:
setScreenConfigurerin interfaceScreenFacet<S extends Screen>- Parameters:
screenConfigurer- the configurer to set.
-
setProperties
Description copied from interface:ScreenFacetSets properties that will be injected into opened screen via public setters.- Specified by:
setPropertiesin interfaceScreenFacet<S extends Screen>- Parameters:
properties- screen properties
-
getProperties
- Specified by:
getPropertiesin interfaceScreenFacet<S extends Screen>- Returns:
- properties that will be injected into opened screen via public setters.
-
getActionTarget
- Specified by:
getActionTargetin interfaceScreenFacet<S extends Screen>- Returns:
- id of action that triggers screen
-
setActionTarget
Description copied from interface:ScreenFacetSets that screen should be shown when action with idactionIdis performed.- Specified by:
setActionTargetin interfaceScreenFacet<S extends Screen>- Parameters:
actionId- action id
-
getButtonTarget
- Specified by:
getButtonTargetin interfaceScreenFacet<S extends Screen>- Returns:
- id of button that triggers screen
-
setButtonTarget
Description copied from interface:ScreenFacetSets that screen should be shown when button with idactionIdis clicked.- Specified by:
setButtonTargetin interfaceScreenFacet<S extends Screen>- Parameters:
buttonId- button id
-
setOwner
Description copied from interface:Facet- Specified by:
setOwnerin interfaceFacet- Overrides:
setOwnerin classAbstractFacet- Parameters:
owner- owner frame
-
addAfterShowEventListener
Description copied from interface:ScreenFacetAdds the givenConsumeras screen after show event listener.- Specified by:
addAfterShowEventListenerin interfaceScreenFacet<S extends Screen>- Parameters:
listener- listener- Returns:
- after show event subscription
-
internalRemoveAfterShowEventListener
-
addAfterCloseEventListener
Description copied from interface:ScreenFacetAdds the givenConsumeras screen after close event listener.- Specified by:
addAfterCloseEventListenerin interfaceScreenFacet<S extends Screen>- Parameters:
listener- listener- Returns:
- after close event subscription
-
internalRemoveAfterCloseEventListener
-
initScreenListeners
-
subscribe
protected void subscribe() -
subscribeOnAction
-
subscribeOnButton
-
injectScreenProperties
-
applyScreenConfigurer
-
getScreenOptions
-