Package io.jmix.ui.component.impl
Class EditorScreenFacetImpl<E,S extends Screen & EditorScreen<E>>
java.lang.Object
io.jmix.ui.component.impl.AbstractFacet
io.jmix.ui.component.impl.AbstractScreenFacet<S>
io.jmix.ui.component.impl.AbstractEntityAwareScreenFacet<E,S>
io.jmix.ui.component.impl.EditorScreenFacetImpl<E,S>
- All Implemented Interfaces:
EditorScreenFacet<E,
,S> EntityAwareScreenFacet<E>
,Facet
,ScreenFacet<S>
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class EditorScreenFacetImpl<E,S extends Screen & EditorScreen<E>>
extends AbstractEntityAwareScreenFacet<E,S>
implements EditorScreenFacet<E,S>
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected EditMode
protected Supplier<DataContext>
Fields inherited from class io.jmix.ui.component.impl.AbstractEntityAwareScreenFacet
container, entityClass, entityPicker, listComponent
Fields inherited from class io.jmix.ui.component.impl.AbstractScreenFacet
actionId, afterCloseListeners, afterShowListeners, applicationContext, buttonId, openMode, optionsProvider, properties, screen, screenClass, screenConfigurer, screenId
Fields inherited from class io.jmix.ui.component.impl.AbstractFacet
id, owner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate()
protected EditorBuilder<E>
createEditorBuilder
(Frame owner, E entityToEdit) protected S
createScreen
(EditorBuilder<E> builder) boolean
protected E
protected DataContext
void
setAddFirst
(boolean addFirst) Defines whether a new item will be added to the beginning or to the end of collection.void
setEditMode
(EditMode editMode) SetsEditMode
to use in editor.void
setEntityProvider
(Supplier<E> entityProvider) Sets entity provider.void
setInitializer
(Consumer<E> initializer) Sets code to initialize a new entity instance.void
setParentDataContextProvider
(Supplier<DataContext> parentDataContextProvider) Sets parentDataContext
supplier for the editor screen.void
setTransformation
(Function<E, E> transformation) Sets code to transform the edited entity after editor commit.show()
Shows and returns screen.Methods inherited from class io.jmix.ui.component.impl.AbstractEntityAwareScreenFacet
getContainer, getEntityClass, getEntityPicker, getListComponent, setContainer, setEntityClass, setEntityPicker, setListComponent
Methods inherited from class io.jmix.ui.component.impl.AbstractScreenFacet
addAfterCloseEventListener, addAfterShowEventListener, applyScreenConfigurer, getActionTarget, getButtonTarget, getOpenMode, getOptionsProvider, getProperties, getScreenClass, getScreenConfigurer, getScreenId, getScreenOptions, initScreenListeners, injectScreenProperties, internalRemoveAfterCloseEventListener, internalRemoveAfterShowEventListener, setActionTarget, setApplicationContext, setButtonTarget, setOpenMode, setOptionsProvider, setOwner, setProperties, setScreenClass, setScreenConfigurer, setScreenId, subscribe, subscribeOnAction, subscribeOnButton
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 org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface io.jmix.ui.component.EntityAwareScreenFacet
getContainer, getEntityClass, getEntityPicker, getListComponent, setContainer, setEntityClass, setEntityPicker, setListComponent
Methods inherited from interface io.jmix.ui.component.ScreenFacet
addAfterCloseEventListener, addAfterShowEventListener, getActionTarget, getButtonTarget, getOpenMode, getOptionsProvider, getProperties, getScreenClass, getScreenConfigurer, getScreenId, setActionTarget, setButtonTarget, setOpenMode, setOptionsProvider, setProperties, setScreenClass, setScreenConfigurer, setScreenId
-
Field Details
-
entityProvider
-
parentDataContextProvider
-
initializer
-
transformation
-
editMode
-
addFirst
protected boolean addFirst
-
-
Constructor Details
-
EditorScreenFacetImpl
public EditorScreenFacetImpl()
-
-
Method Details
-
setEntityProvider
Description copied from interface:EditorScreenFacet
Sets entity provider.- Specified by:
setEntityProvider
in interfaceEditorScreenFacet<E,
S extends Screen & EditorScreen<E>> - Parameters:
entityProvider
- entity provider
-
getEntityProvider
- Specified by:
getEntityProvider
in interfaceEditorScreenFacet<E,
S extends Screen & EditorScreen<E>> - Returns:
- entity provider
-
setInitializer
Description copied from interface:EditorScreenFacet
Sets code to initialize a new entity instance.The initializer is invoked only when
EditMode
isCREATE
.- Specified by:
setInitializer
in interfaceEditorScreenFacet<E,
S extends Screen & EditorScreen<E>>
-
getInitializer
- Specified by:
getInitializer
in interfaceEditorScreenFacet<E,
S extends Screen & EditorScreen<E>> - Returns:
- entity initializer
-
setParentDataContextProvider
Description copied from interface:EditorScreenFacet
Sets parentDataContext
supplier for the editor screen.The screen will commit data to the parent context instead of directly to
DataManager
.- Specified by:
setParentDataContextProvider
in interfaceEditorScreenFacet<E,
S extends Screen & EditorScreen<E>>
-
getParentDataContextProvider
- Specified by:
getParentDataContextProvider
in interfaceEditorScreenFacet<E,
S extends Screen & EditorScreen<E>> - Returns:
- parent DataContext provider
-
setTransformation
Description copied from interface:EditorScreenFacet
Sets code to transform the edited entity after editor commit.Applied only if either field or container or listComponent is assigned.
- Specified by:
setTransformation
in interfaceEditorScreenFacet<E,
S extends Screen & EditorScreen<E>> - Parameters:
transformation
- transformation
-
setEditMode
Description copied from interface:EditorScreenFacet
SetsEditMode
to use in editor.- Specified by:
setEditMode
in interfaceEditorScreenFacet<E,
S extends Screen & EditorScreen<E>> - Parameters:
editMode
- edit mode
-
setAddFirst
public void setAddFirst(boolean addFirst) Description copied from interface:EditorScreenFacet
Defines whether a new item will be added to the beginning or to the end of collection. Affects only standalone containers, for nested containers new items are always added to the end.- Specified by:
setAddFirst
in interfaceEditorScreenFacet<E,
S extends Screen & EditorScreen<E>> - Parameters:
addFirst
- add first
-
getEditMode
- Specified by:
getEditMode
in interfaceEditorScreenFacet<E,
S extends Screen & EditorScreen<E>> - Returns:
- editor edit mode
-
getAddFirst
public boolean getAddFirst()- Specified by:
getAddFirst
in interfaceEditorScreenFacet<E,
S extends Screen & EditorScreen<E>> - Returns:
- whether a new item will be added to the beginning or to the end
-
create
- Specified by:
create
in interfaceScreenFacet<E>
- Returns:
- new screen instance
-
show
Description copied from interface:ScreenFacet
Shows and returns screen.- Specified by:
show
in interfaceScreenFacet<E>
-
createScreen
-
createEditorBuilder
-
getEntityToEdit
-
getParentDataContext
-