Package com.storedobject.ui
Class SteppedObjectForm<T extends StoredObject>
java.lang.Object
com.storedobject.vaadin.View
com.storedobject.ui.SteppedView
com.storedobject.ui.SteppedObjectForm<T>
- Type Parameters:
T- Type of object.
- All Implemented Interfaces:
Executable,Reentrant,HasLogic,ObjectSetter<T>,Transactional,ClickHandler,ExecutableView,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,Consumer<T>
public class SteppedObjectForm<T extends StoredObject>
extends SteppedView
implements ObjectSetter<T>
A Form for editing an object that has multiple steps of content views.
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.storedobject.vaadin.ClickHandler
ClickHandler.ModifiedClickEvent<C extends com.vaadin.flow.component.Component> -
Constructor Summary
ConstructorsConstructorDescriptionSteppedObjectForm(Class<T> objectClass, int numberOfSteps) Constructor.SteppedObjectForm(Class<T> objectClass, int numberOfSteps, String caption) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleancommit(int step) This method is invoked before invokingSteppedView.complete(int)and if it raises any error or returnsfalse, forward movement will be stopped.protected ObjectForm<T> createObjectForm(int step) Create the form for the step.protected voidenter(int step) This method is invoked when you enter into this step.protected voidOverride this if you want to do something before the View comes up on the screen.protected StringListgetFields(int step) Get field names for the step.protected IncludeFieldgetIncludeFieldChecker(int step) Return the "include field checker" for the step.Get the currenct object value.Get the class of the object.protected final ObjectForm<T> getObjectForm(int step) Get the form for the step.Get the Id of the current object value.protected final com.vaadin.flow.component.ComponentgetStepComponent(int step) Get the component to be used for the respective step.voidSet the object (to all the steps).Methods inherited from class com.storedobject.ui.SteppedView
addExtraButton, align, back, cancel, center, complete, complete, finish, formsConstructed, getStepCaption, getStepLabel, goToStep, hideBackButton, hideCancelButton, hideFinishButton, hideNextButton, initUI, isFinalStep, isFirstStep, justify, nextStep, previousStep, setBackLabel, setCancelLabel, setFinishLabel, setNextLabel, unhideBackButton, unhideCancelButton, unhideFinishButton, unhideNextButtonMethods inherited from class com.storedobject.vaadin.View
abort, aborted, addClosedListener, addOpenedListener, clean, close, createCloseableView, createWindow, decorateComponent, execute, execute, executing, focus, focus, focusAny, getApplication, getCaption, getComponent, getContent, getCreatedBy, getEmbeddedView, getMenuItem, getMenuItem, getView, invoke, isFullScreen, isScrollable, isWindowMode, select, setCaption, setComponent, setCreatedBy, setDefaultPadding, setEmbeddedView, setFirstFocus, setFullScreen, setScrollable, setWindowMode, skipFirstFocusMethods 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.common.Executable
actMethods inherited from interface com.storedobject.vaadin.ExecutableView
abort, clean, clearAlerts, clicked, close, createMenuItem, error, execute, getApplication, getCaption, getMenuIconName, getMenuItem, getView, getView, invoke, isCloseable, isFullScreen, isHomeView, log, log, message, returnedFrom, run, setCaption, setClickable, speak, trackValueChange, tray, valueChanged, warningMethods inherited from interface com.storedobject.core.ObjectSetter
accept, isAllowAny, setObjectMethods inherited from interface com.storedobject.common.Reentrant
isReentrantMethods inherited from interface com.storedobject.ui.Transactional
commit, execute, getLogic, getTransactionManager, run, setLogic, transact, transact, transactControl, transactControl, transactControl, transactControlMethods inherited from interface com.storedobject.vaadin.ValueChangeHandler
valueChanged
-
Constructor Details
-
SteppedObjectForm
-
SteppedObjectForm
-
-
Method Details
-
execute
Description copied from class:ViewOverride this if you want to do something before the View comes up on the screen. Call super.execute(parent, doNotLock) to make the View appear on the screen. Parent view is automatically selected when this view closes. -
commit
Description copied from class:SteppedViewThis method is invoked before invokingSteppedView.complete(int)and if it raises any error or returnsfalse, forward movement will be stopped.- Overrides:
commitin classSteppedView- Parameters:
step- Step- Returns:
- True if the commit operation is successful.
- Throws:
Exception- Any exception
-
getStepComponent
protected final com.vaadin.flow.component.Component getStepComponent(int step) Description copied from class:SteppedViewGet the component to be used for the respective step. (After creating your component, you may invoke one of these static methods to position the component if needed:SteppedView.align(Component, CSSGrid.Position),SteppedView.justify(Component, CSSGrid.Position),SteppedView.center(Component)).- Overrides:
getStepComponentin classSteppedView- Parameters:
step- Step- Returns:
- Component to be added. (Default implementation) returns
null.
-
getObjectForm
Get the form for the step.- Parameters:
step- Step- Returns:
- Form for the step.
-
createObjectForm
Create the form for the step.- Parameters:
step- Step- Returns:
- Form for the step. If returned
nulla default form will be created for the class of the object. Default implementation returnsnull.
-
getIncludeFieldChecker
Return the "include field checker" for the step. If this method returns anon-nullvalue, that will be used to filter out field names of the object in this step, otherwise,getFields(int)will be used to identify the fields.- Parameters:
step- Step- Returns:
- Default implementation returns
null.
-
getFields
Get field names for the step. This will be invoked only ifgetIncludeFieldChecker(int)returnsnull.- Parameters:
step- Step- Returns:
- Default implementation returns
null.
-
enter
protected void enter(int step) Description copied from class:SteppedViewThis method is invoked when you enter into this step.- Overrides:
enterin classSteppedView- Parameters:
step- Step
-
getObjectClass
Get the class of the object.- Specified by:
getObjectClassin interfaceObjectSetter<T extends StoredObject>- Returns:
- Class of the object.
-
setObject
Set the object (to all the steps).- Specified by:
setObjectin interfaceObjectSetter<T extends StoredObject>- Parameters:
object- Object to set
-
getObject
-
getObjectId
Get the Id of the current object value.- Returns:
- Id of the current object or
nullif the object value isnull.
-