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 boolean
commit
(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 void
enter
(int step) This method is invoked when you enter into this step.protected void
Override this if you want to do something before the View comes up on the screen.protected StringList
getFields
(int step) Get field names for the step.protected IncludeField
getIncludeFieldChecker
(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.Component
getStepComponent
(int step) Get the component to be used for the respective step.void
Set 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, unhideNextButton
Methods 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, skipFirstFocus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.storedobject.vaadin.ClickHandler
clicked, doubleClicked, onComponentEvent, rightClicked
Methods inherited from interface com.storedobject.common.Executable
act
Methods 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, warning
Methods inherited from interface com.storedobject.core.ObjectSetter
accept, isAllowAny, setObject
Methods inherited from interface com.storedobject.common.Reentrant
isReentrant
Methods inherited from interface com.storedobject.ui.Transactional
commit, execute, getLogic, getTransactionManager, run, setLogic, transact, transact, transactControl, transactControl
Methods inherited from interface com.storedobject.vaadin.ValueChangeHandler
valueChanged
-
Constructor Details
-
SteppedObjectForm
-
SteppedObjectForm
-
-
Method Details
-
execute
Description copied from class:View
Override 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:SteppedView
This method is invoked before invokingSteppedView.complete(int)
and if it raises any error or returnsfalse
, forward movement will be stopped.- Overrides:
commit
in 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:SteppedView
Get 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:
getStepComponent
in 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
null
a 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-null
value, 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:SteppedView
This method is invoked when you enter into this step.- Overrides:
enter
in classSteppedView
- Parameters:
step
- Step
-
getObjectClass
Get the class of the object.- Specified by:
getObjectClass
in interfaceObjectSetter<T extends StoredObject>
- Returns:
- Class of the object.
-
setObject
Set the object (to all the steps).- Specified by:
setObject
in 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
null
if the object value isnull
.
-