public class LookupClassBuilder<E extends Entity,S extends Screen & LookupScreen<E>> extends LookupBuilder<E>
build()
method returns that class.Modifier and Type | Field and Description |
---|---|
protected java.util.function.Consumer<AfterScreenCloseEvent<S>> |
closeListener |
protected java.lang.Class<S> |
screenClass |
container, entityClass, field, handler, launchMode, listComponent, options, origin, screenId, selectHandler, selectValidator, transformation
Constructor and Description |
---|
LookupClassBuilder(LookupBuilder<E> builder,
java.lang.Class<S> screenClass) |
Modifier and Type | Method and Description |
---|---|
S |
build()
Builds the lookup screen.
|
java.util.function.Consumer<AfterScreenCloseEvent<S>> |
getCloseListener()
Returns screen close listener.
|
java.lang.Class<S> |
getScreenClass()
Returns lookup screen class.
|
S |
show()
Builds and shows the lookup screen.
|
LookupClassBuilder<E,S> |
withAfterCloseListener(java.util.function.Consumer<AfterScreenCloseEvent<S>> listener)
Adds
Screen.AfterCloseEvent listener to the screen. |
LookupClassBuilder<E,S> |
withContainer(CollectionContainer<E> container)
Sets
CollectionContainer and returns the builder for chaining. |
<T extends HasValue<E>> |
withField(T field)
Sets the field component and returns the builder for chaining.
|
LookupClassBuilder<E,S> |
withLaunchMode(Screens.LaunchMode launchMode)
Sets
Screens.LaunchMode for the lookup screen and returns the builder for chaining. |
LookupClassBuilder<E,S> |
withListComponent(ListComponent<E> target)
Sets list component and returns the builder for chaining.
|
LookupClassBuilder<E,S> |
withOpenMode(OpenMode openMode)
Sets
OpenMode for the lookup screen and returns the builder for chaining. |
LookupClassBuilder<E,S> |
withOptions(ScreenOptions options)
Sets
ScreenOptions for the lookup screen and returns the builder for chaining. |
LookupBuilder<E> |
withScreenId(java.lang.String screenId)
Sets screen id and returns the builder for chaining.
|
LookupClassBuilder<E,S> |
withSelectHandler(java.util.function.Consumer<java.util.Collection<E>> selectHandler)
Sets selection handler for the lookup screen and returns the builder for chaining.
|
LookupClassBuilder<E,S> |
withSelectValidator(java.util.function.Predicate<LookupScreen.ValidationContext<E>> selectValidator)
Sets selection validator for the lookup screen and returns the builder for chaining.
|
LookupClassBuilder<E,S> |
withTransformation(java.util.function.Function<java.util.Collection<E>,java.util.Collection<E>> transformation)
Sets code to transform the edited entity after editor commit and returns the builder for chaining.
|
getContainer, getEntityClass, getField, getLaunchMode, getListComponent, getOptions, getOrigin, getScreenId, getSelectHandler, getSelectValidator, getTransformation, withScreenClass
protected java.lang.Class<S extends Screen & LookupScreen<E>> screenClass
protected java.util.function.Consumer<AfterScreenCloseEvent<S extends Screen & LookupScreen<E>>> closeListener
public LookupClassBuilder(LookupBuilder<E> builder, java.lang.Class<S> screenClass)
public LookupClassBuilder<E,S> withLaunchMode(Screens.LaunchMode launchMode)
LookupBuilder
Screens.LaunchMode
for the lookup screen and returns the builder for chaining.
For example: builder.withLaunchMode(OpenMode.DIALOG).build();
withLaunchMode
in class LookupBuilder<E extends Entity>
public LookupClassBuilder<E,S> withOpenMode(OpenMode openMode)
LookupBuilder
OpenMode
for the lookup screen and returns the builder for chaining.
For example: builder.withOpenMode(OpenMode.DIALOG).build();
withOpenMode
in class LookupBuilder<E extends Entity>
public LookupClassBuilder<E,S> withOptions(ScreenOptions options)
LookupBuilder
ScreenOptions
for the lookup screen and returns the builder for chaining.withOptions
in class LookupBuilder<E extends Entity>
public LookupClassBuilder<E,S> withSelectValidator(java.util.function.Predicate<LookupScreen.ValidationContext<E>> selectValidator)
LookupBuilder
withSelectValidator
in class LookupBuilder<E extends Entity>
public LookupClassBuilder<E,S> withSelectHandler(java.util.function.Consumer<java.util.Collection<E>> selectHandler)
LookupBuilder
withSelectHandler
in class LookupBuilder<E extends Entity>
public <T extends HasValue<E>> LookupClassBuilder<E,S> withField(T field)
LookupBuilder
If the field is set, the framework sets the selected entity to the field after successful lookup.
withField
in class LookupBuilder<E extends Entity>
public LookupBuilder<E> withScreenId(java.lang.String screenId)
LookupBuilder
withScreenId
in class LookupBuilder<E extends Entity>
screenId
- identifier of the lookup screen as specified in the UiController
annotation
or screens.xml
.public LookupClassBuilder<E,S> withListComponent(ListComponent<E> target)
LookupBuilder
The component is used to get the container
if it is not set explicitly by
LookupBuilder.withContainer(CollectionContainer)
method. Usually, the list component is a Table
or DataGrid
displaying the list of entities.
withListComponent
in class LookupBuilder<E extends Entity>
public LookupClassBuilder<E,S> withContainer(CollectionContainer<E> container)
LookupBuilder
CollectionContainer
and returns the builder for chaining.
The container is updated after the lookup screen is closed. If the container is Nested
,
the framework automatically initializes the reference to the parent entity and sets up data contexts
for added One-To-Many and Many-To-Many relations.
withContainer
in class LookupBuilder<E extends Entity>
public LookupClassBuilder<E,S> withAfterCloseListener(java.util.function.Consumer<AfterScreenCloseEvent<S>> listener)
Screen.AfterCloseEvent
listener to the screen.listener
- listenerpublic LookupClassBuilder<E,S> withTransformation(java.util.function.Function<java.util.Collection<E>,java.util.Collection<E>> transformation)
LookupBuilder
withTransformation
in class LookupBuilder<E extends Entity>
transformation
- edited entity transformationLookupBuilder.withContainer(CollectionContainer)
,
LookupBuilder.withField(HasValue)
,
LookupBuilder.withListComponent(ListComponent)
public java.lang.Class<S> getScreenClass()
public java.util.function.Consumer<AfterScreenCloseEvent<S>> getCloseListener()
public S build()
LookupBuilder
Screen.show()
.build
in class LookupBuilder<E extends Entity>
public S show()
LookupBuilder
show
in class LookupBuilder<E extends Entity>