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
Modifier and TypeFieldDescriptionprotected String
protected List<Consumer<Screen.AfterCloseEvent>>
protected List<Consumer<Screen.AfterShowEvent>>
protected org.springframework.context.ApplicationContext
protected String
protected OpenMode
protected Supplier<ScreenOptions>
protected Collection<UiControllerProperty>
protected S
protected String
Fields inherited from class io.jmix.ui.component.impl.AbstractFacet
id, owner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds the givenConsumer
as screen after close event listener.Adds the givenConsumer
as screen after show event listener.protected void
applyScreenConfigurer
(S screen) protected ScreenOptions
protected void
initScreenListeners
(Screen screen) protected void
injectScreenProperties
(S screen, Collection<UiControllerProperty> properties) protected void
protected void
void
setActionTarget
(String actionId) Sets that screen should be shown when action with idactionId
is performed.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setButtonTarget
(String buttonId) Sets that screen should be shown when button with idactionId
is clicked.void
setOpenMode
(OpenMode openMode) Sets screenOpenMode
.void
setOptionsProvider
(Supplier<ScreenOptions> optionsProvider) Sets the givenSupplier
as screen options provider.void
void
setProperties
(Collection<UiControllerProperty> properties) Sets properties that will be injected into opened screen via public setters.void
setScreenClass
(Class<S> screenClass) Sets class of screen to open.void
setScreenConfigurer
(Consumer<S> screenConfigurer) Sets the screen configurer.void
setScreenId
(String screenId) Sets the id of screen to open.protected void
protected void
subscribeOnAction
(Frame owner) protected void
subscribeOnButton
(Frame owner) Methods inherited from class io.jmix.ui.component.impl.AbstractFacet
getEventHub, getId, getOwner, hasSubscriptions, publish, setId, unsubscribe
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
setScreenId
Description copied from interface:ScreenFacet
Sets the id of screen to open.- Specified by:
setScreenId
in interfaceScreenFacet<S extends Screen>
- Parameters:
screenId
- screen id
-
getScreenId
- Specified by:
getScreenId
in interfaceScreenFacet<S extends Screen>
- Returns:
- screen id
-
setScreenClass
Description copied from interface:ScreenFacet
Sets class of screen to open.- Specified by:
setScreenClass
in interfaceScreenFacet<S extends Screen>
- Parameters:
screenClass
- screen class
-
getScreenClass
- Specified by:
getScreenClass
in interfaceScreenFacet<S extends Screen>
- Returns:
- class of screen to open
-
getOpenMode
- Specified by:
getOpenMode
in interfaceScreenFacet<S extends Screen>
- Returns:
- screen
OpenMode
-
setOpenMode
Description copied from interface:ScreenFacet
Sets screenOpenMode
.- Specified by:
setOpenMode
in interfaceScreenFacet<S extends Screen>
- Parameters:
openMode
- an open mode to set
-
setOptionsProvider
Description copied from interface:ScreenFacet
Sets the givenSupplier
as screen options provider.- Specified by:
setOptionsProvider
in interfaceScreenFacet<S extends Screen>
- Parameters:
optionsProvider
- screen options provider
-
getOptionsProvider
- Specified by:
getOptionsProvider
in interfaceScreenFacet<S extends Screen>
- Returns:
ScreenOptions
provider
-
getScreenConfigurer
- Specified by:
getScreenConfigurer
in interfaceScreenFacet<S extends Screen>
- Returns:
- the screen configurer or
null
of not set
-
setScreenConfigurer
Description copied from interface:ScreenFacet
Sets 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:
setScreenConfigurer
in interfaceScreenFacet<S extends Screen>
- Parameters:
screenConfigurer
- the configurer to set.
-
setProperties
Description copied from interface:ScreenFacet
Sets properties that will be injected into opened screen via public setters.- Specified by:
setProperties
in interfaceScreenFacet<S extends Screen>
- Parameters:
properties
- screen properties
-
getProperties
- Specified by:
getProperties
in interfaceScreenFacet<S extends Screen>
- Returns:
- properties that will be injected into opened screen via public setters.
-
getActionTarget
- Specified by:
getActionTarget
in interfaceScreenFacet<S extends Screen>
- Returns:
- id of action that triggers screen
-
setActionTarget
Description copied from interface:ScreenFacet
Sets that screen should be shown when action with idactionId
is performed.- Specified by:
setActionTarget
in interfaceScreenFacet<S extends Screen>
- Parameters:
actionId
- action id
-
getButtonTarget
- Specified by:
getButtonTarget
in interfaceScreenFacet<S extends Screen>
- Returns:
- id of button that triggers screen
-
setButtonTarget
Description copied from interface:ScreenFacet
Sets that screen should be shown when button with idactionId
is clicked.- Specified by:
setButtonTarget
in interfaceScreenFacet<S extends Screen>
- Parameters:
buttonId
- button id
-
setOwner
Description copied from interface:Facet
- Specified by:
setOwner
in interfaceFacet
- Overrides:
setOwner
in classAbstractFacet
- Parameters:
owner
- owner frame
-
addAfterShowEventListener
Description copied from interface:ScreenFacet
Adds the givenConsumer
as screen after show event listener.- Specified by:
addAfterShowEventListener
in interfaceScreenFacet<S extends Screen>
- Parameters:
listener
- listener- Returns:
- after show event subscription
-
internalRemoveAfterShowEventListener
-
addAfterCloseEventListener
Description copied from interface:ScreenFacet
Adds the givenConsumer
as screen after close event listener.- Specified by:
addAfterCloseEventListener
in interfaceScreenFacet<S extends Screen>
- Parameters:
listener
- listener- Returns:
- after close event subscription
-
internalRemoveAfterCloseEventListener
-
initScreenListeners
-
subscribe
protected void subscribe() -
subscribeOnAction
-
subscribeOnButton
-
injectScreenProperties
-
applyScreenConfigurer
-
getScreenOptions
-