Class DraftCardFragment
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.HorizontalLayout>
io.jmix.flowui.fragment.Fragment<com.vaadin.flow.component.orderedlayout.HorizontalLayout>
io.jmix.flowui.fragmentrenderer.FragmentRenderer<com.vaadin.flow.component.orderedlayout.HorizontalLayout,DraftInfo>
io.jmix.uirecoveryflowui.view.draft.DraftCardFragment
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,FacetOwner,FragmentOwner,Serializable
public class DraftCardFragment
extends FragmentRenderer<com.vaadin.flow.component.orderedlayout.HorizontalLayout,DraftInfo>
Renders one card of the drafts list view: the view title, the drafted record and the save date,
with a discard button that asks for confirmation before deleting the draft.
The card body is an Anchor pointing at the view the draft belongs to, so opening in a new
browser tab, copying the address and keyboard activation work. It carries Vaadin's
router-link attribute, so a plain click navigates inside the application instead of
reloading the page. When the draft has no address the body stays plain text.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.fragment.Fragment
Fragment.ReadyEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.vaadin.flow.component.html.Anchorprotected com.vaadin.flow.component.html.Spanprotected Dialogsprotected MessageBundleprotected com.vaadin.flow.component.html.Spanprotected com.vaadin.flow.component.html.SpanFields inherited from class io.jmix.flowui.fragmentrenderer.FragmentRenderer
itemFields inherited from class io.jmix.flowui.fragment.Fragment
fragmentActions, fragmentData, fragmentFacets, parentController, uiComponents -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddiscard()voidonDiscardButtonClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected voidPoints the body at the drafted view and marks the anchor as a router link.voidSets the corresponding item for the rendered fragment component.protected voidSets the text of a line and hides the line when there is none.Methods inherited from class io.jmix.flowui.fragmentrenderer.FragmentRenderer
getItem, getItemRendererContainerMethods inherited from class io.jmix.flowui.fragment.Fragment
addReadyListener, findInnerComponent, getFragmentActions, getFragmentData, getFragmentFacets, getInnerComponent, getParentController, initContent, onAttach, onDetach, setFragmentActions, setFragmentData, setFragmentFacets, setParentController, setUiComponentsMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, 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 io.jmix.flowui.facet.FacetOwner
getIdMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
bodyAnchor
-
titleSpan
-
recordSpan
-
dateSpan
-
messageBundle
-
dialogs
-
-
Constructor Details
-
DraftCardFragment
public DraftCardFragment()
-
-
Method Details
-
onDiscardButtonClick
@Subscribe("discardButton") public void onDiscardButtonClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) -
setItem
Description copied from class:FragmentRendererSets the corresponding item for the rendered fragment component.- Overrides:
setItemin classFragmentRenderer<com.vaadin.flow.component.orderedlayout.HorizontalLayout,DraftInfo> - Parameters:
item- the item for the rendered fragment component
-
setHref
Points the body at the drafted view and marks the anchor as a router link. Without an address the body is left as plain text.- Parameters:
url- address of the drafted view, ornullif there is none
-
setText
Sets the text of a line and hides the line when there is none.- Parameters:
span- line to filltext- text of the line, ornullto hide it
-
discard
protected void discard()
-