public abstract class AbstractScreenFacet<S extends Screen> extends AbstractFacet implements ScreenFacet<S>
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
actionId |
protected java.util.List<java.util.function.Consumer<Screen.AfterCloseEvent>> |
afterCloseListeners |
protected java.util.List<java.util.function.Consumer<Screen.AfterShowEvent>> |
afterShowListeners |
protected org.springframework.context.ApplicationContext |
applicationContext |
protected java.lang.String |
buttonId |
protected OpenMode |
openMode |
protected java.util.function.Supplier<ScreenOptions> |
optionsProvider |
protected java.util.Collection<UiControllerProperty> |
properties |
protected S |
screen |
protected java.lang.Class<S> |
screenClass |
protected java.lang.String |
screenId |
id, owner
Constructor and Description |
---|
AbstractScreenFacet() |
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addAfterCloseEventListener(java.util.function.Consumer<Screen.AfterCloseEvent> listener)
Adds the given
Consumer as screen after close event listener. |
io.jmix.core.common.event.Subscription |
addAfterShowEventListener(java.util.function.Consumer<Screen.AfterShowEvent> listener)
Adds the given
Consumer as screen after show event listener. |
java.lang.String |
getActionTarget() |
java.lang.String |
getButtonTarget() |
OpenMode |
getOpenMode() |
java.util.function.Supplier<ScreenOptions> |
getOptionsProvider() |
java.util.Collection<UiControllerProperty> |
getProperties() |
java.lang.Class<S> |
getScreenClass() |
java.lang.String |
getScreenId() |
protected ScreenOptions |
getScreenOptions() |
protected void |
initScreenListeners(Screen screen) |
protected void |
injectScreenProperties(S screen,
java.util.Collection<UiControllerProperty> properties) |
protected void |
internalRemoveAfterCloseEventListener(java.util.function.Consumer<Screen.AfterCloseEvent> listener) |
protected void |
internalRemoveAfterShowEventListener(java.util.function.Consumer<Screen.AfterShowEvent> listener) |
void |
setActionTarget(java.lang.String actionId)
Sets that screen should be shown when action with id
actionId is performed. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setButtonTarget(java.lang.String buttonId)
Sets that screen should be shown when button with id
actionId is clicked. |
void |
setOpenMode(OpenMode openMode)
Sets screen
OpenMode . |
void |
setOptionsProvider(java.util.function.Supplier<ScreenOptions> optionsProvider)
Sets the given
Supplier as screen options provider. |
void |
setOwner(Frame owner)
|
void |
setProperties(java.util.Collection<UiControllerProperty> properties)
Sets properties that will be injected into opened screen via public setters.
|
void |
setScreenClass(java.lang.Class<S> screenClass)
Sets class of screen to open.
|
void |
setScreenId(java.lang.String screenId)
Sets the id of screen to open.
|
protected void |
subscribe() |
protected void |
subscribeOnAction(Frame owner) |
protected void |
subscribeOnButton(Frame owner) |
getEventHub, getId, getOwner, hasSubscriptions, publish, setId, unsubscribe
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, show
protected org.springframework.context.ApplicationContext applicationContext
protected java.lang.String screenId
protected OpenMode openMode
protected java.util.function.Supplier<ScreenOptions> optionsProvider
protected java.util.Collection<UiControllerProperty> properties
protected java.lang.String actionId
protected java.lang.String buttonId
protected java.util.List<java.util.function.Consumer<Screen.AfterShowEvent>> afterShowListeners
protected java.util.List<java.util.function.Consumer<Screen.AfterCloseEvent>> afterCloseListeners
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
public void setScreenId(@Nullable java.lang.String screenId)
ScreenFacet
setScreenId
in interface ScreenFacet<S extends Screen>
screenId
- screen id@Nullable public java.lang.String getScreenId()
getScreenId
in interface ScreenFacet<S extends Screen>
public void setScreenClass(@Nullable java.lang.Class<S> screenClass)
ScreenFacet
setScreenClass
in interface ScreenFacet<S extends Screen>
screenClass
- screen class@Nullable public java.lang.Class<S> getScreenClass()
getScreenClass
in interface ScreenFacet<S extends Screen>
public OpenMode getOpenMode()
getOpenMode
in interface ScreenFacet<S extends Screen>
OpenMode
public void setOpenMode(OpenMode openMode)
ScreenFacet
OpenMode
.setOpenMode
in interface ScreenFacet<S extends Screen>
openMode
- an open mode to setpublic void setOptionsProvider(@Nullable java.util.function.Supplier<ScreenOptions> optionsProvider)
ScreenFacet
Supplier
as screen options provider.setOptionsProvider
in interface ScreenFacet<S extends Screen>
optionsProvider
- screen options provider@Nullable public java.util.function.Supplier<ScreenOptions> getOptionsProvider()
getOptionsProvider
in interface ScreenFacet<S extends Screen>
ScreenOptions
providerpublic void setProperties(java.util.Collection<UiControllerProperty> properties)
ScreenFacet
setProperties
in interface ScreenFacet<S extends Screen>
properties
- screen properties@Nullable public java.util.Collection<UiControllerProperty> getProperties()
getProperties
in interface ScreenFacet<S extends Screen>
@Nullable public java.lang.String getActionTarget()
getActionTarget
in interface ScreenFacet<S extends Screen>
public void setActionTarget(@Nullable java.lang.String actionId)
ScreenFacet
actionId
is performed.setActionTarget
in interface ScreenFacet<S extends Screen>
actionId
- action id@Nullable public java.lang.String getButtonTarget()
getButtonTarget
in interface ScreenFacet<S extends Screen>
public void setButtonTarget(@Nullable java.lang.String buttonId)
ScreenFacet
actionId
is clicked.setButtonTarget
in interface ScreenFacet<S extends Screen>
buttonId
- button idpublic void setOwner(@Nullable Frame owner)
Facet
setOwner
in interface Facet
setOwner
in class AbstractFacet
owner
- owner framepublic io.jmix.core.common.event.Subscription addAfterShowEventListener(java.util.function.Consumer<Screen.AfterShowEvent> listener)
ScreenFacet
Consumer
as screen after show event listener.addAfterShowEventListener
in interface ScreenFacet<S extends Screen>
listener
- listenerprotected void internalRemoveAfterShowEventListener(java.util.function.Consumer<Screen.AfterShowEvent> listener)
public io.jmix.core.common.event.Subscription addAfterCloseEventListener(java.util.function.Consumer<Screen.AfterCloseEvent> listener)
ScreenFacet
Consumer
as screen after close event listener.addAfterCloseEventListener
in interface ScreenFacet<S extends Screen>
listener
- listenerprotected void internalRemoveAfterCloseEventListener(java.util.function.Consumer<Screen.AfterCloseEvent> listener)
protected void initScreenListeners(Screen screen)
protected void subscribe()
protected void subscribeOnAction(Frame owner)
protected void subscribeOnButton(Frame owner)
protected void injectScreenProperties(S screen, java.util.Collection<UiControllerProperty> properties)
protected ScreenOptions getScreenOptions()