Package com.storedobject.vaadin
Class ActionForm
java.lang.Object
com.storedobject.vaadin.View
com.storedobject.vaadin.AbstractDataForm<Object>
com.storedobject.vaadin.DataForm
com.storedobject.vaadin.ActionForm
- All Implemented Interfaces:
ClickHandler,ExecutableView,HasContainer,ValueChangeHandler,com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<? extends com.vaadin.flow.component.Component>>,com.vaadin.flow.component.HasValue.ValueChangeListener,Serializable,Runnable,EventListener
- Direct Known Subclasses:
InformationMessage
Action form is used to execute some action if the user confirms it by pressing a "Yes" button.
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.vaadin.AbstractDataForm
AbstractDataForm.FieldErrorNested classes/interfaces inherited from interface com.storedobject.vaadin.ClickHandler
ClickHandler.ModifiedClickEvent<C extends com.vaadin.flow.component.Component> -
Field Summary
Fields inherited from class com.storedobject.vaadin.DataForm
buttonPanel, cancel, okFields inherited from class com.storedobject.vaadin.AbstractDataForm
form -
Constructor Summary
ConstructorsConstructorDescriptionActionForm(com.vaadin.flow.component.Component message, Runnable action) Constructor.ActionForm(com.vaadin.flow.component.Component message, Runnable actionYes, Runnable actionNo) Constructor.ActionForm(com.vaadin.flow.component.Component message, Runnable actionYes, Runnable actionNo, String labelYes, String labelNo) Constructor.ActionForm(com.vaadin.flow.component.Component message, Runnable action, String labelYes, String labelNo) Constructor.ActionForm(String message) Constructor without any action (can be set later).ActionForm(String caption, com.vaadin.flow.component.Component message, Runnable action) Constructor.ActionForm(String caption, com.vaadin.flow.component.Component message, Runnable actionYes, Runnable actionNo) Constructor.ActionForm(String caption, com.vaadin.flow.component.Component message, Runnable actionYes, Runnable actionNo, String labelYes, String labelNo) Constructor.ActionForm(String caption, com.vaadin.flow.component.Component message, Runnable action, String labelYes, String labelNo) Constructor.ActionForm(String message, Runnable action) Constructor.ActionForm(String message, Runnable actionYes, Runnable actionNo) Constructor.Constructor.ActionForm(String message, Runnable action, String labelYes, String labelNo) Constructor.ActionForm(String caption, String message, Runnable action) Constructor.ActionForm(String caption, String message, Runnable actionYes, Runnable actionNo) Constructor.ActionForm(String caption, String message, Runnable actionYes, Runnable actionNo, String labelYes, String labelNo) Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis is where the fields are built.protected final voidcancel()Action defined for "No" button (if any) is invoked here.protected com.vaadin.flow.component.HasComponentsADivcontainer is created.protected voidOverridden to implement "preconfirm" check.static voidExecute an action if the user confirms it.static voidExecute an action if the user confirms it.Get the cancel action.Get the confirm action.protected StringGet the default caption.protected StringGet the default "No" label.protected StringGet the default "Yes" label.protected final booleanprocess()Action defined for "Yes" button is invoked here.voidsetCancelAction(Runnable actionNo) Set the cancel action.voidsetConfirmAction(Runnable actionYes) Set the confirm action.voidsetPreconfirm(BooleanSupplier preconfirm) Set a "preconfirm" check.Methods inherited from class com.storedobject.vaadin.DataForm
buildButtons, clicked, getMaximumContentHeight, getMaximumContentWidth, getMinimumContentHeight, getMinimumContentWidth, initUI, setButtonsAtTop, setCloseable, setWindowMode, sizeSet, skipFirstFocus, validateDataMethods inherited from class com.storedobject.vaadin.AbstractDataForm
add, addConstructedListener, addField, addField, addIncludeFieldChecker, addValidator, addValidator, attachField, clean, clearAlerts, clearError, clearErrors, clearFields, commit, connect, connect, connect, createButtonLayout, createField, createField, createLayout, detachField, fieldAttached, fieldDetached, fireFormConstructed, formConstructed, getColumns, getColumnSpan, getContainer, getContent, getData, getErrorDisplay, getField, getFieldLabel, getFieldLabel, getFieldName, getFieldNames, getForm, getLabel, isFieldEditable, isFieldEditable, isFieldVisible, isFieldVisible, isReadOnly, load, markError, newLine, remove, removeAll, removeField, removeField, removeField, setColumns, setColumnSpan, setErrorDisplay, setFieldContainerProvider, setFieldCustomizer, setFieldEditable, setFieldEditable, setFieldHidden, setFieldHidden, setFieldLabel, setFieldLabel, setFieldReadOnly, setFieldReadOnly, setFieldReadOnly, setFieldReadOnly, setFieldVisible, setFieldVisible, setFieldVisible, setFieldVisible, setIncludeFieldChecker, setReadOnly, setRequired, setRequired, setRequired, setRequired, setRequired, setRequired, setRequired, setRequired, setRequired, streamFieldNamesCreated, streamFieldsCreatedMethods inherited from class com.storedobject.vaadin.View
abort, aborted, addClosedListener, addOpenedListener, close, createCloseableView, createWindow, decorateComponent, execute, execute, executing, focus, focus, focusAny, getApplication, getCaption, getComponent, getCreatedBy, getEmbeddedView, getMenuItem, getMenuItem, getView, invoke, isFullScreen, isScrollable, isWindowMode, select, setCaption, setComponent, setCreatedBy, setDefaultPadding, setEmbeddedView, setFirstFocus, setFullScreen, setScrollableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.vaadin.ClickHandler
clicked, doubleClicked, onComponentEvent, rightClickedMethods inherited from interface com.storedobject.vaadin.ExecutableView
createMenuItem, error, getMenuIconName, getView, isCloseable, isHomeView, log, log, message, returnedFrom, run, setClickable, speak, trackValueChange, tray, valueChanged, warningMethods inherited from interface com.storedobject.vaadin.ValueChangeHandler
valueChanged
-
Constructor Details
-
ActionForm
Constructor without any action (can be set later).- Parameters:
message- Message to be shown
-
ActionForm
-
ActionForm
Constructor.- Parameters:
message- Message to be shownaction- Action when "Yes" button is pressed
-
ActionForm
-
ActionForm
-
ActionForm
-
ActionForm
-
ActionForm
public ActionForm(String message, Runnable actionYes, Runnable actionNo, String labelYes, String labelNo) Constructor.- Parameters:
message- Message to be shownactionYes- Action when "Yes" button is pressedactionNo- Action when "No" button is pressedlabelYes- Label for "Yes" buttonlabelNo- Label for "No" button
-
ActionForm
public ActionForm(com.vaadin.flow.component.Component message, Runnable actionYes, Runnable actionNo, String labelYes, String labelNo) Constructor.- Parameters:
message- Message to be shownactionYes- Action when "Yes" button is pressedactionNo- Action when "No" button is pressedlabelYes- Label for "Yes" buttonlabelNo- Label for "No" button
-
ActionForm
-
ActionForm
-
ActionForm
-
ActionForm
public ActionForm(String caption, com.vaadin.flow.component.Component message, Runnable action, String labelYes, String labelNo) Constructor.- Parameters:
caption- Caption to be displayedmessage- Message to be shownaction- Action when "Yes" button is pressedlabelYes- Label for "Yes" buttonlabelNo- Label for "No" button
-
ActionForm
-
ActionForm
public ActionForm(String caption, com.vaadin.flow.component.Component message, Runnable actionYes, Runnable actionNo) Constructor.- Parameters:
caption- Caption to be displayedmessage- Message to be shownactionYes- Action when "Yes" button is pressedactionNo- Action when "No" button is pressed
-
ActionForm
public ActionForm(String caption, String message, Runnable actionYes, Runnable actionNo, String labelYes, String labelNo) Constructor.- Parameters:
caption- Caption to be displayedmessage- Message to be shownactionYes- Action when "Yes" button is pressedactionNo- Action when "No" button is pressedlabelYes- Label for "Yes" buttonlabelNo- Label for "No" button
-
ActionForm
public ActionForm(String caption, com.vaadin.flow.component.Component message, Runnable actionYes, Runnable actionNo, String labelYes, String labelNo) Constructor.- Parameters:
caption- Caption to be displayedmessage- Message to be shownactionYes- Action when "Yes" button is pressedactionNo- Action when "No" button is pressedlabelYes- Label for "Yes" buttonlabelNo- Label for "No" button
-
-
Method Details
-
getDefaultYesLabel
Get the default "Yes" label.- Returns:
- The default label for the "Yes" button.
-
getDefaultNoLabel
Get the default "No" label.- Returns:
- The default label for the "No" button.
-
getDefaultCaption
-
createFieldContainer
protected com.vaadin.flow.component.HasComponents createFieldContainer()ADivcontainer is created.- Overrides:
createFieldContainerin classAbstractDataForm<Object>- Returns:
Divcontainer.
-
buildFields
protected void buildFields()Description copied from class:DataFormThis is where the fields are built. Typically, we create the fields and add it usingAbstractDataForm.addField(HasValue...)orAbstractDataForm.addField(String, HasValue)methods.- Overrides:
buildFieldsin classDataForm
-
getConfirmAction
-
setConfirmAction
Set the confirm action.- Parameters:
actionYes- Action from "Yes" button is pressed
-
getCancelAction
-
setCancelAction
Set the cancel action.- Parameters:
actionNo- Action from "No" button is pressed
-
cancel
-
process
-
setPreconfirm
Set a "preconfirm" check. If this is set, confirm box is displayed only if the "preconfirm" returnstrue(BooleanSupplier.getAsBoolean()).- Parameters:
preconfirm- Preconfirm
-
execute
-
execute
-
execute
Execute an action if the user confirms it.- Parameters:
message- Message to be shownaction- Action to be executed
-