Class Wizard
- All Implemented Interfaces:
Animatable<Wizard>
,CanDrop<Wizard>
,Clickable<Wizard>
,Draggable<Wizard>
,HandleMouseEvents<Wizard>
,Touchable<Wizard>
Wizard component
The component leads the user through a process consisting of multiple steps using a series of settngs. The wizard is capable of handling an arbitrary number of steps. You can define an icon, a title and a description for every step. These indicate the progress in the component header. You can track the current step status and the status of each step.
The component enables you to handle the step initialization, enter and exit events. It also handles the events next step, previous step and finish. You have the possibility to disable the individual steps which keeps the user at the specific step until the required data is entered.
Each step is added to the component as a standalone component by using the addStep(WizardStep)
component.
You can implement a step by instantiating and building the WizardStep
.
You can add any sort of component to the steps, so that each step has a custom appearance.
Supported events:
AnimationStart
AnimationEnd
,
Click
,
DoubleClick
,
MouseDown
,
MouseDown
,
MouseLeave
,
MouseMove
,
MouseOver
,
MouseOut
,
MouseUp
,
Wheel
,
TouchCancel
,
TouchEnd
,
TouchMove
,
TouchStart
,
Drop
,
DragStart
,
DragEnd
FinishHandler
- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal Wizard
addStep
(WizardStep step) Adds a step to the wizard component.final Wizard
addSteps
(WizardStep... steps) Adds multiple steps to the grid.void
The operations to be executed after the drawing of the componentfinal Wizard
back()
Steps back the wizard component.final WizardStep
Gets the wizard component’s current step.final WizardFinishHandler
Gets the event handler for the wizard finished event.Gets the wizard component’s footer.final WizardStep
getStepByIndex
(int index) Gets a wizard step by its index.getSteps()
Gets all steps of the wizard component.final Wizard
next()
Steps forward the wizard component.final Wizard
reset()
Resets the wizard component.protected void
setFinishHandler
(WizardFinishHandler handler) Event handler for the wizard finished event.final Wizard
setStep
(int index) The step with the specified index receives focus.final Wizard
The step with the specified name receives focus.boolean
writeHTML
(StringWriter writer) Creates the component's HTML equivalentMethods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, addComponent, addComponent, addComponents, addDeniedRole, addHandler, addStyle, addStyleClass, addStyleClasses, clearfix, closeTag, combinateAccess, containsStyle, containsStyleClass, draw, drawSubComponents, error, flattendComponentTree, getAccess, getAccessMode, getAllowedRoles, getAttribute, getAttributes, getBackgroundColor, getBorderColor, getClient, getComponentById, getComponents, getComponents, getComponentsByClass, getData, getDeniedRoles, getHandlers, getId, getLanguageCode, getName, getParent, getParent, getRegisteredEvents, getStyle, getStyleClasses, getTextAlign, getTextColor, getToolTip, getToolTipPosition, getTypeName, getUI, init, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, isEnabled, isEventBubbling, isVisible, onHide, onHotKeyEventHandler, onShow, openTag, redraw, removeAllComponents, removeAllowedRole, removeAllStyleClasses, removeAttribute, removeComponent, removeComponent, removeComponents, removeDeniedRole, removeHandler, removeStyle, removeStyle, removeStyleClass, removeStyleClasses, replaceComponent, replaceStyleClass, runAfterDraw, runJavaScript, runJavaScript, runJavaScript, runOnHide, runOnShow, say, setAttribute, setBackgroundColor, setBorder, setBorderColor, setData, setDisplayType, setEnabled, setEventBubbling, setFlex, setFloating, setHeight100, setHeight25, setHeight50, setHeight75, setHeightAuto, setLanguage, setMargin, setName, setOverflow, setPadding, setParent, setScrollable, setSelectionType, setShadow, setStyle, setTextAlign, setTextColor, setToolTip, setToolTipPosition, setVisible, setWidth100, setWidth25, setWidth50, setWidth75, setWidthAuto, showNotification, showNotification, showProcessIndicator, toggleStyleClass
Methods inherited from class com.jbstrap.core.messagebus.MessageBus
closeMessageBus, messageBusOpened, openMessageBus, renewSubscription, sendMessageToMessageBus, subscribeMessageBus, unsubscribeAllListeners, unsubscribeMessageBus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jbstrap.ui.Animatable
addAnimationEndHandler, addAnimationStartHandler, getAnimation, removeAnimation, setAnimation
Methods inherited from interface com.jbstrap.ui.CanDrop
addDropEventHandler
Methods inherited from interface com.jbstrap.ui.Clickable
addClickHandler, addDoubleClickHandler
Methods inherited from interface com.jbstrap.ui.Draggable
addDragEndEventHandler, addDragStartEventHandler, setDraggable
Methods inherited from interface com.jbstrap.ui.HandleMouseEvents
addMouseDownHandler, addMouseEnterHandler, addMouseLeaveHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler
Methods inherited from interface com.jbstrap.ui.Touchable
addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler
-
Constructor Details
-
Wizard
public Wizard()Creates an empty Wizard component. -
Wizard
Creates an empty Wizard component according to the specified language code.- Parameters:
language
- Language code according to which the component is created. If not specified ornull
is set, the framework’s default language code is used. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE
.
-
Wizard
Creates an empty Wizard component according to the specified language code.- Parameters:
id
- The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)language
- Language code according to which the component is created. If not specified ornull
is set, the framework’s default language code is used. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE
.
-
-
Method Details
-
addStep
Adds a step to the wizard component.- Parameters:
step
- Wizard step instance to be added- Returns:
- Wizard component
- Throws:
NullPointerException
- Thrown if the specified step isnull
-
addSteps
Adds multiple steps to the grid.- Parameters:
steps
- An enumeration of wizard steps to be added Steps are added to the wizard in the order the enumeration- Returns:
- Wizard component
- Throws:
NullPointerException
- Thrown if there is a step within the enumeration that isnull
-
getStepByIndex
Gets a wizard step by its index. Start index is 0.- Parameters:
index
- Step index- Returns:
- Step identified by the specified index or
null
if there is no step in the wizard component with the specified index
-
afterDraw
public void afterDraw()Description copied from class:Component
The operations to be executed after the drawing of the componentBy default, this is an empty method. It has to be overwritten on a component or page if additional operations have to be executed after the drawing process. One such operation is data retrieval, which shouldn't run in constructors so that the user could see results of an operation or navigation process.
-
back
Steps back the wizard component.
The method steps back the wizard component from the current step. When stepping back, the current step’s
StepBackHandler
is called. If the handler returnstrue
, the framework looks for the previous enabled step and makes it the current one.- Returns:
- Wizard component
- Throws:
IllegalArgumentException
- Thrown if no enabled steps precedes the enabled step in the wizard component
-
next
Steps forward the wizard component.
The method steps forward the wizard component from the current step. When stepping forward, the current step’s
StepNextHandler
is called. If the handler returnstrue
, the next enabled step is determined. If there are no enabled steps after the current one, the wizard finishes and theWizardFinishHandler
is called.- Returns:
- Wizard component
-
setStep
The step with the specified index receives focus.- Parameters:
index
- Step index- Returns:
- Wizard component
- Throws:
IllegalArgumentException
- Thrown if the step with the specified index is disabledNullPointerException
- Thrown if there is no step by the specified index in the wizard component
-
setStep
The step with the specified name receives focus.- Parameters:
name
- Step name- Returns:
- Wizard component
- Throws:
NullPointerException
- Thrown if there is no step with the specified index in the wizard componentIllegalArgumentException
- Thrown if the step with the specified name is disabled
-
reset
Resets the wizard component.- Returns:
- Wizard component
-
setFinishHandler
Event handler for the wizard finished event.- Parameters:
handler
- Event handler implementation for wizard finished event- Returns:
- Wizard component
-
getFinishHandler
Gets the event handler for the wizard finished event.- Returns:
- An instance of the event handler for the wizard finished event or
null
if there is no event handler set for the event
-
getCurrentStep
Gets the wizard component’s current step.- Returns:
- An instance of the current step or
null
if there are no steps in the component
-
getSteps
Gets all steps of the wizard component.- Returns:
- All steps of the wizard component in a collection or
null
if there are no steps in the component
-
writeHTML
Description copied from class:Component
Creates the component's HTML equivalentThis method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (
StringWriter
class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return withfalse
. Otherwise, it must return withtrue
. -
setButtonState
protected void setButtonState()
-