@Component(value="ui_ScreenBuilders")
public class ScreenBuilders
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected EditorBuilderProcessor |
editorBuilderProcessor |
protected LookupBuilderProcessor |
lookupBuilderProcessor |
protected ScreenBuilderProcessor |
screenBuilderProcessor |
| Constructor and Description |
|---|
ScreenBuilders() |
| Modifier and Type | Method and Description |
|---|---|
<E> EditorBuilder<E> |
editor(java.lang.Class<E> entityClass,
FrameOwner origin)
Creates a screen builder.
|
<E> EditorBuilder<E> |
editor(EntityPicker<E> field)
Creates a screen builder using
EntityPicker component. |
<E> EditorBuilder<E> |
editor(ListComponent<E> listComponent)
Creates a screen builder using list component.
|
<E> LookupBuilder<E> |
lookup(java.lang.Class<E> entityClass,
FrameOwner origin)
Creates a screen builder.
|
<E> LookupBuilder<E> |
lookup(EntityPicker<E> field)
Creates a screen builder using
EntityPicker component. |
<E> LookupBuilder<E> |
lookup(ListComponent<E> listComponent)
Creates a screen builder using list component.
|
<E> LookupBuilder<E> |
lookup(TagPicker<E> field)
Creates a screen builder using
TagPicker component. |
ScreenBuilder |
screen(FrameOwner origin)
Creates a screen builder.
|
@Autowired protected EditorBuilderProcessor editorBuilderProcessor
@Autowired protected LookupBuilderProcessor lookupBuilderProcessor
@Autowired protected ScreenBuilderProcessor screenBuilderProcessor
public <E> EditorBuilder<E> editor(java.lang.Class<E> entityClass, FrameOwner origin)
Example of building a screen for editing an entity:
SomeCustomerEditor screen = screenBuilders.editor(Customer.class, this)
.withScreen(SomeCustomerEditor.class)
.withListComponent(customersTable)
.editEntity(customersTable.getSingleSelected())
.build();
Example of building a screen for creating a new entity instance:
SomeCustomerEditor screen = screenBuilders.editor(Customer.class, this)
.withScreen(SomeCustomerEditor.class)
.withListComponent(customersTable)
.newEntity()
.build();
entityClass - edited entity classorigin - invoking screeneditor(ListComponent)public <E> EditorBuilder<E> editor(ListComponent<E> listComponent)
Example of building a screen for editing a currently selected entity:
SomeCustomerEditor screen = screenBuilders.editor(customersTable)
.withScreen(SomeCustomerEditor.class)
.build();
Example of building a screen for creating a new entity instance:
SomeCustomerEditor screen = screenBuilders.editor(customersTable)
.withScreen(SomeCustomerEditor.class)
.newEntity()
.build();
listComponent - Table, DataGrid or another component containing the list of entitieseditor(Class, FrameOwner)public <E> EditorBuilder<E> editor(EntityPicker<E> field)
EntityPicker component.
Example of building a screen for editing a currently set value:
SomeCustomerEditor screen = screenBuilders.editor(customerPicker)
.withScreen(SomeCustomerEditor.class)
.build();
Example of building a screen for creating a new entity instance:
SomeCustomerEditor screen = screenBuilders.editor(customerPicker)
.withScreen(SomeCustomerEditor.class)
.newEntity()
.build();
field - EntityPicker, EntityComboBox or another picker componenteditor(Class, FrameOwner)public <E> LookupBuilder<E> lookup(java.lang.Class<E> entityClass, FrameOwner origin)
Example of building a lookup screen for adding instance to data container:
SomeCustomerListScreen screen = screenBuilders.lookup(Customer.class, this)
.withScreen(SomeCustomerListScreen.class)
.withOpenMode(OpenMode.DIALOG)
.withContainer(customersDc)
.build();
Example of building a lookup screen with custom select handler:
SomeCustomerListScreen screen = screenBuilders.lookup(Customer.class, this)
.withScreen(SomeCustomerListScreen.class)
.withOpenMode(OpenMode.DIALOG)
.withSelectHandler(customers -> {
// customers contains selected values
})
.build();
E - type of entityentityClass - entity classorigin - invoking screenpublic <E> LookupBuilder<E> lookup(ListComponent<E> listComponent)
Example of building a lookup screen for adding row to table / tree component:
SomeCustomerListScreen screen = screenBuilders.lookup(customersTable)
.withScreen(SomeCustomerListScreen.class)
.build();
E - type of entitylistComponent - Table, DataGrid or another component containing the list of entitieslookup(Class, FrameOwner)public <E> LookupBuilder<E> lookup(EntityPicker<E> field)
EntityPicker component.
Example of building a lookup screen for setting value to EntityPicker:
SomeCustomerListScreen screen = screenBuilders.lookup(customerPicker)
.withScreen(SomeCustomerListScreen.class)
.build();
E - type of entityfield - EntityPicker, EntityComboBox or another picker componentlookup(Class, FrameOwner)public <E> LookupBuilder<E> lookup(TagPicker<E> field)
TagPicker component.
Example of building a lookup screen for setting value to TagPicker:
SomeCustomerListScreen screen = screenBuilders.lookup(customerTagPicker)
.withScreen(SomeCustomerListScreen.class)
.build();
E - type of entityfield - TagPickerlookup(Class, FrameOwner)public ScreenBuilder screen(FrameOwner origin)
Example of building a screen:
SomeScreen screen = screenBuilders.screen(this)
.withScreen(SomeScreen.class)
.build();
origin - invoking screen