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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected EditModeprotected Supplier<DataContext>Fields inherited from class io.jmix.ui.component.impl.AbstractEntityAwareScreenFacet
container, entityClass, entityPicker, listComponentFields inherited from class io.jmix.ui.component.impl.AbstractScreenFacet
actionId, afterCloseListeners, afterShowListeners, applicationContext, buttonId, openMode, optionsProvider, properties, screen, screenClass, screenConfigurer, screenIdFields inherited from class io.jmix.ui.component.impl.AbstractFacet
id, owner -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()protected EditorBuilder<E>createEditorBuilder(Frame owner, E entityToEdit) protected ScreateScreen(EditorBuilder<E> builder) booleanprotected Eprotected DataContextvoidsetAddFirst(boolean addFirst) Defines whether a new item will be added to the beginning or to the end of collection.voidsetEditMode(EditMode editMode) SetsEditModeto use in editor.voidsetEntityProvider(Supplier<E> entityProvider) Sets entity provider.voidsetInitializer(Consumer<E> initializer) Sets code to initialize a new entity instance.voidsetParentDataContextProvider(Supplier<DataContext> parentDataContextProvider) Sets parentDataContextsupplier for the editor screen.voidsetTransformation(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, setListComponentMethods 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, subscribeOnButtonMethods 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 org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface io.jmix.ui.component.EntityAwareScreenFacet
getContainer, getEntityClass, getEntityPicker, getListComponent, setContainer, setEntityClass, setEntityPicker, setListComponentMethods 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:EditorScreenFacetSets entity provider.- Specified by:
setEntityProviderin interfaceEditorScreenFacet<E,S extends Screen & EditorScreen<E>> - Parameters:
entityProvider- entity provider
-
getEntityProvider
- Specified by:
getEntityProviderin interfaceEditorScreenFacet<E,S extends Screen & EditorScreen<E>> - Returns:
- entity provider
-
setInitializer
Description copied from interface:EditorScreenFacetSets code to initialize a new entity instance.The initializer is invoked only when
EditModeisCREATE.- Specified by:
setInitializerin interfaceEditorScreenFacet<E,S extends Screen & EditorScreen<E>>
-
getInitializer
- Specified by:
getInitializerin interfaceEditorScreenFacet<E,S extends Screen & EditorScreen<E>> - Returns:
- entity initializer
-
setParentDataContextProvider
Description copied from interface:EditorScreenFacetSets parentDataContextsupplier for the editor screen.The screen will commit data to the parent context instead of directly to
DataManager.- Specified by:
setParentDataContextProviderin interfaceEditorScreenFacet<E,S extends Screen & EditorScreen<E>>
-
getParentDataContextProvider
- Specified by:
getParentDataContextProviderin interfaceEditorScreenFacet<E,S extends Screen & EditorScreen<E>> - Returns:
- parent DataContext provider
-
setTransformation
Description copied from interface:EditorScreenFacetSets code to transform the edited entity after editor commit.Applied only if either field or container or listComponent is assigned.
- Specified by:
setTransformationin interfaceEditorScreenFacet<E,S extends Screen & EditorScreen<E>> - Parameters:
transformation- transformation
-
setEditMode
Description copied from interface:EditorScreenFacetSetsEditModeto use in editor.- Specified by:
setEditModein interfaceEditorScreenFacet<E,S extends Screen & EditorScreen<E>> - Parameters:
editMode- edit mode
-
setAddFirst
public void setAddFirst(boolean addFirst) Description copied from interface:EditorScreenFacetDefines 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:
setAddFirstin interfaceEditorScreenFacet<E,S extends Screen & EditorScreen<E>> - Parameters:
addFirst- add first
-
getEditMode
- Specified by:
getEditModein interfaceEditorScreenFacet<E,S extends Screen & EditorScreen<E>> - Returns:
- editor edit mode
-
getAddFirst
public boolean getAddFirst()- Specified by:
getAddFirstin 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:
createin interfaceScreenFacet<E>- Returns:
- new screen instance
-
show
Description copied from interface:ScreenFacetShows and returns screen.- Specified by:
showin interfaceScreenFacet<E>
-
createScreen
-
createEditorBuilder
-
getEntityToEdit
-
getParentDataContext
-