@Component(value="cuba_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 extends Entity> |
editor(java.lang.Class<E> entityClass,
FrameOwner origin)
Creates a screen builder.
|
<E extends Entity> |
editor(ListComponent<E> listComponent)
Creates a screen builder using list component.
|
<E extends Entity> |
editor(PickerField<E> field)
Creates a screen builder using
PickerField component. |
<E extends Entity> |
lookup(java.lang.Class<E> entityClass,
FrameOwner origin)
Creates a screen builder.
|
<E extends Entity> |
lookup(ListComponent<E> listComponent)
Creates a screen builder using list component.
|
<E extends Entity> |
lookup(PickerField<E> field)
Creates a screen builder using
PickerField component. |
ScreenBuilder |
screen(FrameOwner origin)
Creates a screen builder.
|
@Inject protected EditorBuilderProcessor editorBuilderProcessor
@Inject protected LookupBuilderProcessor lookupBuilderProcessor
@Inject protected ScreenBuilderProcessor screenBuilderProcessor
public <E extends Entity> 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 extends Entity> 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 extends Entity> EditorBuilder<E> editor(PickerField<E> field)
PickerField
component.
Example of building a screen for editing a currently set value:
SomeCustomerEditor screen = screenBuilders.editor(customerPickerField)
.withScreen(SomeCustomerEditor.class)
.build();
Example of building a screen for creating a new entity instance:
SomeCustomerEditor screen = screenBuilders.editor(customerPickerField)
.withScreen(SomeCustomerEditor.class)
.newEntity()
.build();
field
- PickerField
, LookupPickerField
or another picker componenteditor(Class, FrameOwner)
public <E extends Entity> 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 extends Entity> 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 extends Entity> LookupBuilder<E> lookup(PickerField<E> field)
PickerField
component.
Example of building a lookup screen for setting value to PickerField:
SomeCustomerListScreen screen = screenBuilders.lookup(customerPickerField)
.withScreen(SomeCustomerListScreen.class)
.build();
E
- type of entityfield
- PickerField
, LookupPickerField
or another picker componentlookup(Class, FrameOwner)
public ScreenBuilder screen(FrameOwner origin)
Example of building a screen:
SomeScreen screen = screenBuilders.screen(this)
.withScreen(SomeScreen.class)
.build();
origin
- invoking screen