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
ConstructorsConstructorDescriptionWizardStep(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 StepBackHandlerGets the event handler for the “previous step” event.final StringGets the step icon.final IcongetIcon()Gets the step icon.protected Component<?>final intgetIndex()Gets the step index.final StepInitHandlerGets the event handler for the “initialize step” event.final StepLeaveHandlerGets the event handler for the “leave step” event.final StringgetName()Gets the wizard step name.final StepNextHandlerGets the next step event handler.final StepShowHandlerGets the event handler for the “show step” event.final WizardStepStategetState()Gets the current step state.final StringgetTitle()Gets the wizard step title.booleanChecks if the step is enabled.protected WizardStepsetActive(boolean active) final WizardStepsetBackHandler(StepBackHandler handler) Sets the event handler for the “previous step” event.final WizardStepsetDescription(String description) Sets the step description.setEnabled(boolean enabled) Enabling/disabling the step.final WizardStepSets the step icon.protected WizardStepsetIndex(int index) final WizardStepsetInitHandler(StepInitHandler handler) Sets the event handler for the “initialize step” event.final WizardStepsetLeaveHandler(StepLeaveHandler handler) Sets the event handler for the “leave step” event.final WizardStepsetNextHandler(StepNextHandler handler) Sets the event handler for the “Next” button.protected WizardStepfinal WizardStepsetShowHandler(StepShowHandler handler) Sets the event handler for the “show step” event.final WizardStepsetState(WizardStepState state) final WizardStepSpecifies the wizard step title.booleanwriteHTML(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, toggleStyleClassMethods inherited from class com.jbstrap.core.messagebus.MessageBus
closeMessageBus, messageBusOpened, openMessageBus, renewSubscription, sendMessageToMessageBus, subscribeMessageBus, unsubscribeAllListeners, unsubscribeMessageBusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jbstrap.ui.Animatable
addAnimationEndHandler, addAnimationStartHandler, getAnimation, removeAnimation, setAnimationMethods inherited from interface com.jbstrap.ui.CanDrop
addDropEventHandlerMethods inherited from interface com.jbstrap.ui.Clickable
addClickHandler, addDoubleClickHandlerMethods inherited from interface com.jbstrap.ui.Draggable
addDragEndEventHandler, addDragStartEventHandler, setDraggableMethods inherited from interface com.jbstrap.ui.HandleMouseEvents
addMouseDownHandler, addMouseEnterHandler, addMouseLeaveHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandlerMethods inherited from interface com.jbstrap.ui.Scrollable
addScrollHandlerMethods 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 theWizardicon- 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 theWizardicon- 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 theWizardicon- 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 Ifnullis 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 theWizardicon- 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
nullif no icon is specified
-
setIcon
Sets the step icon.- Parameters:
icon- Step icon Available icons are listed in the enumIcon. Ifnullis specified, no step icon is displayed.- Returns:
- Wizard step
-
getName
Gets the wizard step name.- Overrides:
getNamein classComponent<WizardStep>- Returns:
- Wizard step name
-
getTitle
Gets the wizard step title.- Returns:
- Step title or
nullif 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 * Ifnullis specified, no step title is displayed.- Returns:
- Wizard step
-
getDescription
Gets the step icon.- Returns:
- Step description or
nullif 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 Ifnullis 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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:
setEnabledin classComponent<WizardStep>- Parameters:
enabled- Iftrueis set, the step is enabled. Iffalseis specified, the step is disabled.- Returns:
- Wizard step
-
isEnabled
public boolean isEnabled()Checks if the step is enabled.- Overrides:
isEnabledin classComponent<WizardStep>- Returns:
- If
trueis set, the step is enabled. * Iffalseis specified, the step is disabled.
-
writeHTML
Description copied from class:ComponentCreates 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 (
StringWriterclass) 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:
writeHTMLin classComponent<WizardStep>- Returns:
- If the componentwas drawn,
true, otherwisefalse
-