Class WizardStep
- All Implemented Interfaces:
Animatable<WizardStep>
,CanDrop<WizardStep>
,Clickable<WizardStep>
,Draggable<WizardStep>
,HandleMouseEvents<WizardStep>
,Scrollable<WizardStep>
,Touchable<WizardStep>
Wizard step component
The component is not a standalone component, it is used by the Wizard
.
The component represents a wizard step.
You can use it to create components and forms, fill them with data, set them and add them to a wizard step.
The step is displayed and managed by the wizard component.
The step component has its own events implemented. The events handlers are associated with the events “leave step”, “show step” and “proceed to next one”. Event handlers enable you to validate the data entered by the user or to cancel navigation. If the user enters incorrect data, you can cancel navigation and the user is unable to leave the step until correct data is entered.
Supported events:
AnimationStart
AnimationEnd
,
Click
,
DoubleClick
,
MouseDown
,
MouseDown
,
MouseLeave
,
MouseMove
,
MouseOver
,
MouseOut
,
MouseUp
,
Wheel
,
Scrollable
TouchCancel
,
TouchEnd
,
TouchMove
,
TouchStart
,
Drop
,
DragStart
,
DragEnd
BackHandler
NextHandler
ShowHandler
LeaveHandler
InitHandler
- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Field Summary
Fields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
-
Constructor Summary
ConstructorDescriptionWizardStep
(String name) Creates a wizard step with the specified name.WizardStep
(String name, Icon icon) Creates a wizard step with the specified name and icon.WizardStep
(String name, Icon icon, String title) Creates a wizard step with the specified name, icon and title.WizardStep
(String name, Icon icon, String title, String description) Creates a wizard step with the specified name, icon, title and description.Creates a wizard step with the specified name, icon, title and description; adds components to the step. -
Method Summary
Modifier and TypeMethodDescriptionfinal StepBackHandler
Gets the event handler for the “previous step” event.final String
Gets the step icon.final Icon
getIcon()
Gets the step icon.protected Component<?>
final int
getIndex()
Gets the step index.final StepInitHandler
Gets the event handler for the “initialize step” event.final StepLeaveHandler
Gets the event handler for the “leave step” event.final String
getName()
Gets the wizard step name.final StepNextHandler
Gets the next step event handler.final StepShowHandler
Gets the event handler for the “show step” event.final WizardStepState
getState()
Gets the current step state.final String
getTitle()
Gets the wizard step title.boolean
Checks if the step is enabled.protected WizardStep
setActive
(boolean active) final WizardStep
setBackHandler
(StepBackHandler handler) Sets the event handler for the “previous step” event.final WizardStep
setDescription
(String description) Sets the step description.setEnabled
(boolean enabled) Enabling/disabling the step.final WizardStep
Sets the step icon.protected WizardStep
setIndex
(int index) final WizardStep
setInitHandler
(StepInitHandler handler) Sets the event handler for the “initialize step” event.final WizardStep
setLeaveHandler
(StepLeaveHandler handler) Sets the event handler for the “leave step” event.final WizardStep
setNextHandler
(StepNextHandler handler) Sets the event handler for the “Next” button.protected WizardStep
final WizardStep
setShowHandler
(StepShowHandler handler) Sets the event handler for the “show step” event.final WizardStep
setState
(WizardStepState state) final WizardStep
Specifies the wizard step title.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, afterDraw, 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, getParent, getParent, getRegisteredEvents, getStyle, getStyleClasses, getTextAlign, getTextColor, getToolTip, getToolTipPosition, getTypeName, getUI, init, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, 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, 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.Scrollable
addScrollHandler
Methods inherited from interface com.jbstrap.ui.Touchable
addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler
-
Constructor Details
-
WizardStep
Creates a wizard step with the specified name.- Parameters:
name
- Wizard step name, must be unique within theWizard
- Throws:
NullPointerException
- Thrown if the specified name isnull
-
WizardStep
Creates a wizard step with the specified name and icon.- Parameters:
name
- Wizard step name, must be unique within theWizard
icon
- Wizard step icon displayed in the header Available icons are listed in the enumIcon
. If not specified or set tonull
, no step icon is displayed.- Throws:
NullPointerException
- Thrown if the specified name isnull
-
WizardStep
Creates a wizard step with the specified name, icon and title.- Parameters:
name
- Wizard step name, must be unique within theWizard
icon
- Wizard step icon displayed in the header Available icons are listed in the enumIcon
. If not specified or set tonull
, no step icon is displayed.title
- Wizard step title, displayed when the user hovers with the mouse over the step icon If not specified or set tonull
, no step title is displayed- Throws:
NullPointerException
- Thrown if the specified name isnull
-
WizardStep
Creates a wizard step with the specified name, icon, title and description.- Parameters:
name
- Wizard step name, must be unique within theWizard
icon
- Wizard step icon displayed in the header Available icons are listed in the enumIcon
. If not specified or set tonull
, no step icon is displayed.title
- Wizard step title, displayed when the user hovers with the mouse over the step icon Ifnull
is displayed, no step title is displayed.description
- Step description The description specified here is displayed if the user hovers with the mouse over the step icon. If not specified or set tonull
, no step description is displayed.- Throws:
NullPointerException
- Thrown if the specified name isnull
-
WizardStep
public WizardStep(String name, Icon icon, String title, String description, Component<?>... content) Creates a wizard step with the specified name, icon, title and description; adds components to the step.- Parameters:
name
- Wizard step name, must be unique within theWizard
icon
- Wizard step icon displayed in the header Available icons are listed in the enumIcon
. If not specified or set tonull
, no wizard step is displayed.title
- Wizard step title, displayed when the user hovers with the mouse over the step icon If not specified ornull
, no step title is displayed.description
- Step description The description specified here is displayed if the user hovers with the mouse over the step icon. If not specified or set tonull
, no step description is displayed.content
- An enumeration of all components to be added to the step Components are added to the step following the order of this enumeration.- Throws:
NullPointerException
- Thrown if the specified name isnull
-
-
Method Details
-
getIcon
Gets the step icon.- Returns:
- Step icon or
null
if no icon is specified
-
setIcon
Sets the step icon.- Parameters:
icon
- Step icon Available icons are listed in the enumIcon
. Ifnull
is specified, no step icon is displayed.- Returns:
- Wizard step
-
getName
Gets the wizard step name.- Overrides:
getName
in classComponent<WizardStep>
- Returns:
- Wizard step name
-
getTitle
Gets the wizard step title.- Returns:
- Step title or
null
if no title is specified
-
setTitle
Specifies the wizard step title. The title specified here is displayed if the user hovers with the mouse over the icon.- Parameters:
title
- Step title * Ifnull
is specified, no step title is displayed.- Returns:
- Wizard step
-
getDescription
Gets the step icon.- Returns:
- Step description or
null
if no title is specified
-
setDescription
Sets the step description. The description specified here is displayed if the user hovers with the mouse over the icon.- Parameters:
description
- Step description Ifnull
is specified, no step description is displayed.- Returns:
- Wizard step
-
getIconComponent
- Returns:
- Icon component
-
getIndex
public final int getIndex()Gets the step index.- Returns:
- Step index within the wizard component Start index is 0. If the wizard step is not added to a component, the index has a value of -1.
-
setIndex
- Parameters:
index
- Step index If the step is removed from the wizard component, it must be set to -1.- Returns:
- Wizard step
-
setParent
- Parameters:
parent
- Wizard component instance associated with the step- Returns:
- Wizard step
-
setState
- Parameters:
state
- Step state Available states are listed in the enumWizardStepState
.- Returns:
- Wizard step
-
setActive
- Parameters:
active
- Iftrue
, the step is designated enabled, otherwise not- Returns:
- Wizard step
-
getState
Gets the current step state.- Returns:
- Current step state
- See Also:
-
setNextHandler
Sets the event handler for the “Next” button.- Parameters:
handler
- Event handler implementation for the “next step” event- Returns:
- Wizard step
- See Also:
-
getNextHandler
Gets the next step event handler.- Returns:
- An instance of the “next step” event or
null
if no “next step” event handler is set
-
setBackHandler
Sets the event handler for the “previous step” event.- Parameters:
handler
- Event handler implementation for the “previous step” event- Returns:
- Wizard step
- See Also:
-
getBackHandler
Gets the event handler for the “previous step” event.- Returns:
- An instance of the “previous step” event handler or
null
if no “previous step” event handler is set
-
setLeaveHandler
Sets the event handler for the “leave step” event.- Parameters:
handler
- Event handler implementation for the “leave step” event- Returns:
- Wizard step
- See Also:
-
getLeaveHandler
Gets the event handler for the “leave step” event.- Returns:
- Event handler instance or
null
if no “leave step” event is specified for the step
-
setShowHandler
Sets the event handler for the “show step” event.- Parameters:
handler
- Event handler implementation for the “show step” event- Returns:
- Wizard step
- See Also:
-
getShowHandler
Gets the event handler for the “show step” event.- Returns:
- Event handler instance or
null
if no “show step” event is specified for the step
-
setInitHandler
Sets the event handler for the “initialize step” event.- Parameters:
handler
- Event handler implementation for the “initialize step” event- Returns:
- Wizard step
- See Also:
-
getInitHandler
Gets the event handler for the “initialize step” event.- Returns:
- Event handler instance or
null
if no “initialize step” event is specified for the step
-
setEnabled
Enabling/disabling the step. By default, the step is enabled. If a step is disabled, the user is unable to select the it either by using the header or the navigation buttons. Upon using the navigation buttons, the wizard component skips the disabled steps.- Overrides:
setEnabled
in classComponent<WizardStep>
- Parameters:
enabled
- Iftrue
is set, the step is enabled. Iffalse
is specified, the step is disabled.- Returns:
- Wizard step
-
isEnabled
public boolean isEnabled()Checks if the step is enabled.- Overrides:
isEnabled
in classComponent<WizardStep>
- Returns:
- If
true
is set, the step is enabled. * Iffalse
is specified, the step is disabled.
-
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
.- Specified by:
writeHTML
in classComponent<WizardStep>
- Returns:
- If the componentwas drawn,
true
, otherwisefalse
-