Class ViewBuilders
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DetailViewBuilderProcessorprotected final LookupViewBuilderProcessorprotected final ReadViewBuilderProcessorprotected final ViewBuilderProcessorprotected final Views -
Constructor Summary
ConstructorsConstructorDescriptionViewBuilders(Views views, ViewBuilderProcessor viewBuilderProcessor, DetailViewBuilderProcessor detailViewBuilderProcessor, LookupViewBuilderProcessor lookupViewBuilderProcessor, ReadViewBuilderProcessor readViewBuilderProcessor) -
Method Summary
Modifier and TypeMethodDescription<E> DetailViewBuilder<E, ?> detail(EntityPickerComponent<E> picker) Creates a detail view builder using the entity picker component.<E,V extends View<?>>
DetailViewBuilder<E, V> detail(EntityPickerComponent<E> picker, Class<V> viewClass) Creates a detail view builder using the entity picker component.<E> DetailViewBuilder<E, ?> detail(EntityPickerComponent<E> picker, String viewId) Creates a detail view builder using the entity picker component.<E> DetailViewBuilder<E, ?> detail(ListDataComponent<E> listDataComponent) Creates a detail view builder using the list component.<E,V extends View<?>>
DetailViewBuilder<E, V> detail(ListDataComponent<E> listDataComponent, Class<V> viewClass) Creates a detail view builder using the list component.<E> DetailViewBuilder<E, ?> detail(ListDataComponent<E> listDataComponent, String viewId) Creates a detail view builder using the list component.<E> DetailViewBuilder<E, ?> Creates a detail view builder for entity class.<E,V extends View<?>>
DetailViewBuilder<E, V> Creates a detail view builder for entity class.<E> DetailViewBuilder<E, ?> Creates a detail view builder for entity class.protected <E> Class<E> getBeanType(ListDataComponent<E> listDataComponent) protected <E> Class<E> getBeanType(SupportsMetaClass component) protected <E,V extends View<?>>
voidinitDetailBuilder(DetailViewBuilder<E, V> builder, com.vaadin.flow.component.HasValue<?, E> valueComponent) protected <E,V extends View<?>>
voidinitDetailBuilder(DetailViewBuilder<E, V> builder, ListDataComponent<E> listDataComponent) protected <E,V extends View<?>>
voidinitReadBuilder(ReadViewBuilder<E, V> builder, com.vaadin.flow.component.HasValue<?, E> valueComponent) protected <E,V extends View<?>>
voidinitReadBuilder(ReadViewBuilder<E, V> builder, ListDataComponent<E> listDataComponent) <E> LookupViewBuilder<E, ?> lookup(EntityMultiPickerComponent<E> picker) Creates a lookup view builder using the entity multi picker component.<E,V extends View<?>>
LookupViewBuilder<E, V> lookup(EntityMultiPickerComponent<E> picker, Class<V> viewClass) Creates a lookup view builder using the entity multi picker component.<E> LookupViewBuilder<E, ?> lookup(EntityMultiPickerComponent<E> picker, String viewId) Creates a lookup view builder using the entity multi picker component.<E> LookupViewBuilder<E, ?> lookup(EntityPickerComponent<E> picker) Creates a lookup view builder using the entity picker component.<E,V extends View<?>>
LookupViewBuilder<E, V> lookup(EntityPickerComponent<E> picker, Class<V> viewClass) Creates a lookup view builder using the entity picker component.<E> LookupViewBuilder<E, ?> lookup(EntityPickerComponent<E> picker, String viewId) Creates a lookup view builder using the entity picker component.<E> LookupViewBuilder<E, ?> lookup(ListDataComponent<E> listDataComponent) Creates a lookup view builder using the list component.<E,V extends View<?>>
LookupViewBuilder<E, V> lookup(ListDataComponent<E> listDataComponent, Class<V> viewClass) Creates a lookup view builder using the list component.<E> LookupViewBuilder<E, ?> lookup(ListDataComponent<E> listDataComponent, String viewId) Creates a lookup view builder using the list component.<E> LookupViewBuilder<E, ?> Creates a lookup view builder for entity class.<E,V extends View<?>>
LookupViewBuilder<E, V> Creates a lookup view builder for entity class.<E> LookupViewBuilder<E, ?> Creates a lookup view builder for entity class.protected voidopenView(ViewOpeningContext context) <E> ReadViewBuilder<E, ?> read(EntityPickerComponent<E> picker) Creates a read view builder using the entity picker component.<E,V extends View<?>>
ReadViewBuilder<E, V> read(EntityPickerComponent<E> picker, Class<V> viewClass) Creates a read view builder using the entity picker component.<E> ReadViewBuilder<E, ?> read(EntityPickerComponent<E> picker, String viewId) Creates a read view builder using the entity picker component.<E> ReadViewBuilder<E, ?> read(ListDataComponent<E> listDataComponent) Creates a read view builder using the list component.<E,V extends View<?>>
ReadViewBuilder<E, V> read(ListDataComponent<E> listDataComponent, Class<V> viewClass) Creates a read view builder using the list component.<E> ReadViewBuilder<E, ?> read(ListDataComponent<E> listDataComponent, String viewId) Creates a read view builder using the list component.<E> ReadViewBuilder<E, ?> Creates a read view builder for an entity class.<E,V extends View<?>>
ReadViewBuilder<E, V> Creates a read view builder for an entity class.<E> ReadViewBuilder<E, ?> Creates a read view builder for an entity class.<V extends View<?>>
ViewBuilder<V> Creates a view builder.ViewBuilder<?> Creates a view builder.
-
Field Details
-
views
-
viewBuilderProcessor
-
detailViewBuilderProcessor
-
lookupViewBuilderProcessor
-
readViewBuilderProcessor
-
-
Constructor Details
-
ViewBuilders
public ViewBuilders(Views views, ViewBuilderProcessor viewBuilderProcessor, DetailViewBuilderProcessor detailViewBuilderProcessor, LookupViewBuilderProcessor lookupViewBuilderProcessor, ReadViewBuilderProcessor readViewBuilderProcessor)
-
-
Method Details
-
detail
Creates a detail view builder for entity class.Example of opening a view for editing an entity:
viewBuilders.detail(this, User.class) .editEntity(user) .open();Example of opening a view for creating a new entity instance:
viewBuilders.detail(this, User.class) .newEntity() .open();- Type Parameters:
E- entity type- Parameters:
origin- calling viewentityClass- edited entity class- Returns:
- detail view builder
- See Also:
-
detail
Creates a detail view builder for entity class. The opened view is defined by the passed view id.Example of opening a view for editing an entity:
viewBuilders.detail(this, User.class, "User.detail") .editEntity(user) .open();Example of opening a view for creating a new entity instance:
viewBuilders.detail(this, User.class, "User.detail") .newEntity() .open();- Type Parameters:
E- entity type- Parameters:
origin- calling viewentityClass- edited entity classviewId- opened view id- Returns:
- detail view builder
- See Also:
-
detail
public <E,V extends View<?>> DetailViewBuilder<E,V> detail(View<?> origin, Class<E> entityClass, Class<V> viewClass) Creates a detail view builder for entity class. The opened view is defined by the passed view class.Example of opening a view for editing an entity:
viewBuilders.detail(this, User.class, UserDetailView.class) .editEntity(user) .withAfterCloseListener(closeEvent -> { if (closeEvent.closedWith(StandardOutcome.SAVE)) { User editedEntity = closeEvent.getSource().getEditedEntity(); // ... } }) .open();Example of opening a view for creating a new entity instance:
viewBuilders.detail(this, User.class, UserDetailView.class) .newEntity() .withAfterCloseListener(closeEvent -> { if (closeEvent.closedWith(StandardOutcome.SAVE)) { User editedEntity = closeEvent.getSource().getEditedEntity(); // ... } }) .open();- Type Parameters:
E- entity typeV- view type- Parameters:
origin- calling viewentityClass- edited entity classviewClass- opened view class- Returns:
- detail view builder
- See Also:
-
detail
Creates a detail view builder using the list component.Example of building a view for editing a currently selected entity:
Example of building a view for creating a new entity instance:viewBuilders.detail(usersDataGrid) .open();viewBuilders.detail(usersDataGrid) .newEntity() .open();- Type Parameters:
E- entity type- Parameters:
listDataComponent- a component containing the list of entities- Returns:
- detail view builder
- See Also:
-
detail
Creates a detail view builder using the list component. The opened view is defined by the passed view id.Example of building a view for editing a currently selected entity:
Example of building a view for creating a new entity instance:viewBuilders.detail(usersDataGrid, "User.detail") .open();viewBuilders.detail(usersDataGrid, "User.detail") .newEntity() .open();- Type Parameters:
E- entity type- Parameters:
listDataComponent- a component containing the list of entitiesviewId- opened view id- Returns:
- detail view builder
- See Also:
-
detail
public <E,V extends View<?>> DetailViewBuilder<E,V> detail(ListDataComponent<E> listDataComponent, Class<V> viewClass) Creates a detail view builder using the list component. The opened view is defined by the passed view class.Example of building a view for editing a currently selected entity:
Example of building a view for creating a new entity instance:viewBuilders.detail(usersDataGrid, UserDetailView.class) .withAfterCloseListener(closeEvent -> { if (closeEvent.closedWith(StandardOutcome.SAVE)) { User editedEntity = closeEvent.getSource().getEditedEntity(); // ... } }) .open();viewBuilders.detail(usersDataGrid, UserDetailView.class) .newEntity() .withAfterCloseListener(closeEvent -> { if (closeEvent.closedWith(StandardOutcome.SAVE)) { User editedEntity = closeEvent.getSource().getEditedEntity(); // ... } }) .open();- Type Parameters:
E- entity typeV- view type- Parameters:
listDataComponent- a component containing the list of entitiesviewClass- opened view class- Returns:
- detail view builder
- See Also:
-
initDetailBuilder
protected <E,V extends View<?>> void initDetailBuilder(DetailViewBuilder<E, V> builder, ListDataComponent<E> listDataComponent) -
detail
Creates a detail view builder using the entity picker component.Example of building a view for editing a currently selected entity:
Example of building a view for creating a new entity instance:viewBuilders.detail(userPicker) .open();viewBuilders.detail(userPicker) .newEntity() .open();- Type Parameters:
E- entity type- Parameters:
picker- entity picker component- Returns:
- detail view builder
- See Also:
-
detail
Creates a detail view builder using the entity picker component. The opened view is defined by the passed view id.Example of building a view for editing a currently selected entity:
Example of building a view for creating a new entity instance:viewBuilders.detail(userPicker, "User. detail") .open();viewBuilders.detail(userPicker, "User. detail") .newEntity() .open();- Type Parameters:
E- entity type- Parameters:
picker- entity picker componentviewId- opened view id- Returns:
- detail view builder
- See Also:
-
detail
public <E,V extends View<?>> DetailViewBuilder<E,V> detail(EntityPickerComponent<E> picker, Class<V> viewClass) Creates a detail view builder using the entity picker component. The opened view is defined by the passed view class.Example of building a view for editing a currently selected entity:
Example of building a view for creating a new entity instance:viewBuilders.detail(userPicker, UserDetailView.class) .withAfterCloseListener(closeEvent -> { if (closeEvent.closedWith(StandardOutcome.SAVE)) { User editedEntity = closeEvent.getSource().getEditedEntity(); // ... } }) .open();viewBuilders.detail(userPicker, UserDetailView.class) .newEntity() .withAfterCloseListener(closeEvent -> { if (closeEvent.closedWith(StandardOutcome.SAVE)) { User editedEntity = closeEvent.getSource().getEditedEntity(); // ... } }) .open();- Type Parameters:
E- entity typeV- view type- Parameters:
picker- entity picker componentviewClass- opened view class- Returns:
- detail view builder
- See Also:
-
initDetailBuilder
protected <E,V extends View<?>> void initDetailBuilder(DetailViewBuilder<E, V> builder, com.vaadin.flow.component.HasValue<?, E> valueComponent) -
read
Creates a read view builder for an entity class.Example of opening a view showing an entity:
viewBuilders.read(this, User.class) .readEntity(user) .open();- Type Parameters:
E- entity type- Parameters:
origin- calling viewentityClass- shown entity class- Returns:
- read view builder
- See Also:
-
read
Creates a read view builder for an entity class. The opened view is defined by the passed view id.Example of opening a view showing an entity:
viewBuilders.read(this, User.class, "User.read") .readEntity(user) .open();- Type Parameters:
E- entity type- Parameters:
origin- calling viewentityClass- shown entity classviewId- opened view id- Returns:
- read view builder
- See Also:
-
read
public <E,V extends View<?>> ReadViewBuilder<E,V> read(View<?> origin, Class<E> entityClass, Class<V> viewClass) Creates a read view builder for an entity class. The opened view is defined by the passed view class.Example of opening a view showing an entity:
viewBuilders.read(this, User.class, UserReadView.class) .readEntity(user) .open();- Type Parameters:
E- entity typeV- view type- Parameters:
origin- calling viewentityClass- shown entity classviewClass- opened view class- Returns:
- read view builder
- See Also:
-
read
Creates a read view builder using the list component. The shown entity is the one currently selected in the component.Example of opening a view showing the selected entity:
viewBuilders.read(usersDataGrid) .open();- Type Parameters:
E- entity type- Parameters:
listDataComponent- a component containing the list of entities- Returns:
- read view builder
- See Also:
-
read
Creates a read view builder using the list component. The shown entity is the one currently selected in the component, the opened view is defined by the passed view id.Example of opening a view showing the selected entity:
viewBuilders.read(usersDataGrid, "User.read") .open();- Type Parameters:
E- entity type- Parameters:
listDataComponent- a component containing the list of entitiesviewId- opened view id- Returns:
- read view builder
- See Also:
-
read
public <E,V extends View<?>> ReadViewBuilder<E,V> read(ListDataComponent<E> listDataComponent, Class<V> viewClass) Creates a read view builder using the list component. The shown entity is the one currently selected in the component, the opened view is defined by the passed view class.Example of opening a view showing the selected entity:
viewBuilders.read(usersDataGrid, UserReadView.class) .open();- Type Parameters:
E- entity typeV- view type- Parameters:
listDataComponent- a component containing the list of entitiesviewClass- opened view class- Returns:
- read view builder
- See Also:
-
initReadBuilder
protected <E,V extends View<?>> void initReadBuilder(ReadViewBuilder<E, V> builder, ListDataComponent<E> listDataComponent) -
read
Creates a read view builder using the entity picker component. The shown entity is the component's value.Example of opening a view showing the entity set to the picker:
viewBuilders.read(userPicker) .open();- Type Parameters:
E- entity type- Parameters:
picker- entity picker component- Returns:
- read view builder
- See Also:
-
read
Creates a read view builder using the entity picker component. The shown entity is the component's value, the opened view is defined by the passed view id.Example of opening a view showing the entity set to the picker:
viewBuilders.read(userPicker, "User.read") .open();- Type Parameters:
E- entity type- Parameters:
picker- entity picker componentviewId- opened view id- Returns:
- read view builder
- See Also:
-
read
public <E,V extends View<?>> ReadViewBuilder<E,V> read(EntityPickerComponent<E> picker, Class<V> viewClass) Creates a read view builder using the entity picker component. The shown entity is the component's value, the opened view is defined by the passed view class.Example of opening a view showing the entity set to the picker:
viewBuilders.read(userPicker, UserReadView.class) .open();- Type Parameters:
E- entity typeV- view type- Parameters:
picker- entity picker componentviewClass- opened view class- Returns:
- read view builder
- See Also:
-
initReadBuilder
protected <E,V extends View<?>> void initReadBuilder(ReadViewBuilder<E, V> builder, com.vaadin.flow.component.HasValue<?, E> valueComponent) -
lookup
Creates a lookup view builder for entity class.Example of building a lookup view for adding an instance to a data container:
viewBuilders.lookup(this, User.class) .withContainer(usersDc) .open();- Type Parameters:
E- entity type- Parameters:
origin- calling viewentityClass- entity class- Returns:
- lookup builder
- See Also:
-
lookup
Creates a lookup view builder for entity class. The opened view is defined by the passed view id.Example of building a lookup view for adding an instance to a data container:
viewBuilders.lookup(this, User.class, "User.list") .withContainer(usersDc) .open();- Type Parameters:
E- entity type- Parameters:
origin- calling viewentityClass- entity classviewId- opened view id- Returns:
- lookup builder
- See Also:
-
lookup
public <E,V extends View<?>> LookupViewBuilder<E,V> lookup(View<?> origin, Class<E> entityClass, Class<V> viewClass) Creates a lookup view builder for entity class. The opened view is defined by the passed view class.Example of building a lookup view for adding an instance to a data container:
viewBuilders.lookup(this, User.class, UserListView.class) .withContainer(usersDc) .open();- Type Parameters:
E- entity typeV- view type- Parameters:
origin- calling viewentityClass- entity classviewClass- opened view class- Returns:
- lookup builder
- See Also:
-
lookup
Creates a lookup view builder using the list component.Example of building a lookup view for adding an instance to a list component:
viewBuilders.lookup(usersDataGrid) .open();- Type Parameters:
E- entity type- Parameters:
listDataComponent- a component containing the list of entities- Returns:
- lookup builder
- See Also:
-
lookup
Creates a lookup view builder using the list component. The opened view is defined by the passed view id.Example of building a lookup view for adding an instance to a list component:
viewBuilders.lookup(usersDataGrid, "User.list") .open();- Type Parameters:
E- entity type- Parameters:
listDataComponent- a component containing the list of entitiesviewId- opened view id- Returns:
- lookup builder
- See Also:
-
lookup
public <E,V extends View<?>> LookupViewBuilder<E,V> lookup(ListDataComponent<E> listDataComponent, Class<V> viewClass) Creates a lookup view builder using the list component. The opened view is defined by the passed view class.Example of building a lookup view for adding an instance to a list component:
viewBuilders.lookup(usersDataGrid, UserListView.class) .open();- Type Parameters:
E- entity typeV- view type- Parameters:
listDataComponent- a component containing the list of entitiesviewClass- opened view class- Returns:
- lookup builder
- See Also:
-
lookup
Creates a lookup view builder using the entity picker component.Example of building a lookup view for adding an instance to a list component:
viewBuilders.lookup(userPicker) .open();- Type Parameters:
E- entity type- Parameters:
picker- entity picker component- Returns:
- lookup builder
- See Also:
-
lookup
Creates a lookup view builder using the entity picker component. The opened view is defined by the passed view id.Example of building a lookup view for adding an instance to a list component:
viewBuilders.lookup(userPicker, "User.list") .open();- Type Parameters:
E- entity type- Parameters:
picker- entity picker componentviewId- opened view id- Returns:
- lookup builder
- See Also:
-
lookup
public <E,V extends View<?>> LookupViewBuilder<E,V> lookup(EntityPickerComponent<E> picker, Class<V> viewClass) Creates a lookup view builder using the entity picker component. The opened view is defined by the passed view class.Example of building a lookup view for adding an instance to a list component:
viewBuilders.lookup(userPicker, UserListView.class) .open();- Type Parameters:
E- entity typeV- view type- Parameters:
picker- entity picker componentviewClass- opened view class- Returns:
- lookup builder
- See Also:
-
lookup
Creates a lookup view builder using the entity multi picker component.Example of building a lookup view for adding an instance to a list component:
viewBuilders.lookup(usersPicker) .open();- Type Parameters:
E- entity type- Parameters:
picker- entity multi picker component- Returns:
- lookup builder
- See Also:
-
lookup
Creates a lookup view builder using the entity multi picker component. The opened view is defined by the passed view id.Example of building a lookup view for adding an instance to a list component:
viewBuilders.lookup(usersPicker, "User.list") .open();- Type Parameters:
E- entity type- Parameters:
picker- entity multi picker componentviewId- opened view id- Returns:
- lookup builder
- See Also:
-
lookup
public <E,V extends View<?>> LookupViewBuilder<E,V> lookup(EntityMultiPickerComponent<E> picker, Class<V> viewClass) Creates a lookup view builder using the entity multi picker component. The opened view is defined by the passed view class.Example of building a lookup view for adding an instance to a list component:
viewBuilders.lookup(usersPicker, UserListView.class) .open();- Type Parameters:
E- entity typeV- view type- Parameters:
picker- entity multi picker componentviewClass- opened view class- Returns:
- lookup builder
- See Also:
-
view
Creates a view builder. The opened view is defined by the passed view class.Example of opening a view:
viewBuilders.view(this, SandboxView.class) .open();- Type Parameters:
V- view type- Parameters:
origin- calling viewviewClass- opened view class- Returns:
- view builder
-
view
Creates a view builder. The opened view is defined by the passed view id.Example of opening a view:
viewBuilders.view(this, "FooView") .open();- Parameters:
origin- calling viewviewId- opened view id- Returns:
- view builder
-
getBeanType
-
getBeanType
-
openView
-