Class DraftListView
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<ViewLayout>
io.jmix.flowui.view.View<ViewLayout>
io.jmix.flowui.view.StandardView
io.jmix.uirecoveryflowui.view.draft.DraftListView
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,com.vaadin.flow.router.AfterNavigationObserver,com.vaadin.flow.router.BeforeEnterObserver,com.vaadin.flow.router.BeforeLeaveObserver,com.vaadin.flow.router.HasDynamicTitle,com.vaadin.flow.router.internal.AfterNavigationHandler,com.vaadin.flow.router.internal.BeforeEnterHandler,com.vaadin.flow.router.internal.BeforeLeaveHandler,FacetOwner,FragmentOwner,Serializable
@Route(value="uirec/drafts",
layout=DefaultMainViewParent.class)
@ViewController(id="uirec_DraftListView")
@ViewDescriptor(path="draft-list-view.xml")
@PermitAll
public class DraftListView
extends StandardView
Lists the current user's unsaved drafts as cards, each linking to the view the draft belongs to, so
that opening it offers the draft back through that view's
drafts facet.
The application shows this view right after login when
jmix.uirecovery.drafts.show-on-login is enabled and the user has drafts; it is also reachable
by its own route at any time, and by every authenticated user.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.view.View
View.AfterCloseEvent, View.BeforeCloseEvent, View.BeforeShowEvent, View.InitEvent, View.PostReadyEvent, View.QueryParametersChangeEvent, View.ReadyEvent, View.RestoreComponentsStateEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Dialogsprotected com.vaadin.flow.component.button.Buttonprotected GridLayout<DraftInfo> protected com.vaadin.flow.component.html.Spanprotected com.vaadin.flow.component.html.Spanprotected MessageBundleprotected UiPropertiesprotected DraftInfoSupportprotected ViewDraftServiceprotected ViewNavigators -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoiddiscardDraft(DraftInfo info) Deletes one listed draft and rebuilds the list.protected voidvoidonBeforeShow(View.BeforeShowEvent event) voidonContinueButtonClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) voidonDiscardAllButtonClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected voidReads the drafts again and rebuilds the cards.Methods inherited from class io.jmix.flowui.view.View
addAfterCloseListener, addApplicationListeners, addBeforeCloseListener, addBeforeShowListener, addInitListener, addQueryParametersChangeListener, addReadyListener, addRestoreComponentsStateEventListener, afterNavigation, beforeEnter, beforeLeave, close, close, closeWithDefaultAction, configureDialogWindowFooter, configureDialogWindowHeader, getApplicationContext, getEventBus, getId, getPageTitle, getReturnParameters, getViewActions, getViewAttributes, getViewData, getViewFacets, getViewSupport, isPreventBrowserTabClosing, onAttach, onAttachInternal, onDetach, onDetachInternal, processBeforeEnterInternal, removeApplicationListeners, removeViewAttributes, setAfterNavigationHandler, setApplicationContext, setId, setPageTitle, setPreventBrowserTabClosing, setViewActions, setViewData, setViewFacets, unregisterBackNavigationMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement, initContentMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setTestId, setVisible, whenAttachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
draftsGridLayout
-
hintLabel
-
emptyLabel
-
discardAllButton
-
viewDraftService
-
viewDraftInfoSupport
-
uiProperties
-
dialogs
-
messageBundle
-
-
Constructor Details
-
DraftListView
public DraftListView()
-
-
Method Details
-
onBeforeShow
-
onContinueButtonClick
@Subscribe("continueButton") public void onContinueButtonClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) -
onDiscardAllButtonClick
@Subscribe("discardAllButton") public void onDiscardAllButtonClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) -
reloadDrafts
protected void reloadDrafts()Reads the drafts again and rebuilds the cards. The hint and the discard-all button are shown only while there is something to act on, and the empty text only while there is not. -
discardDraft
Deletes one listed draft and rebuilds the list. Called by a card's discard button.- Parameters:
info- the draft to discard
-
discardAll
protected void discardAll()
-