Package io.jmix.flowui.view
Interface ReadView<E>
- Type Parameters:
E- type of entity
- All Known Implementing Classes:
StandardReadView,TemplateReadView
@NullMarked
public interface ReadView<E>
Interface of views that display an entity instance without editing it.
-
Method Summary
Modifier and TypeMethodDescriptiondefault EReturns the currently shown entity instance.@Nullable EReturns the currently shown entity instance ornullif it isn't loaded yet.voidsetEntityToRead(E entity) Sets the entity instance to show.
-
Method Details
-
setEntityToRead
Sets the entity instance to show. The view reloads the instance by its id, so what is displayed always matches the view's fetch plan.- Parameters:
entity- entity instance to show
-
getEntity
Returns the currently shown entity instance.- Returns:
- currently shown entity instance
- Throws:
IllegalStateException- if the entity isn't loaded yet, for example inView.InitEvent
-
getEntityOrNull
@Nullable E getEntityOrNull()Returns the currently shown entity instance ornullif it isn't loaded yet.- Returns:
- currently shown entity instance or
nullif it isn't loaded yet
-