public class Tour extends Process
Tours are a specific type of Workflow Process
and consist of a series of TourSteps
. Typically each step refers to an element on the page, which is
either being highlighted for the user, or, for a tutorial, is an element that the user is being prompted to interact
with (see TourStep.clickTarget, for example).
Most steps have a TourWindow, which shows explanatory or instructional text. For tutorial steps that request a user action, the target can be highlighted and a large arrow is shown pointing at the target.
The placement of the TourWindow and arrow is automatic, and intelligently takes into account the type of interaction requested. For example, if a tutorial requires a user to change a value in a SelectItem, the TourWindow and arrow will avoid appearing underneath the select, where they could be occluded by the drop-down picklist. Similarly, for a drag and drop interaction, the TourWindow avoids overlapping both the drag source and the drop area.
Because of all this automatic behavior, a tutorial step typically consists of just:
1.
explanatory text (tourStep.title and tourStep.description)
2. the target
3. the expected interaction (eg click
the target, or type something in, or drag something to another widget)
4. validation of input (what was typed or
chosen), if applicable
Developers may use AutoTest locators
to
specify specific components or elements as action targets. Using locators means that tours and tutorials will typically
still work even if your application changes (for example, new controls are added). Note that we recommend making use
of the locator shortcut
to rapidly generate locators.
A tour is typically written as a .proc.xml
document stored in the folder configured via the
project.processes
setting in server.properties
(webroot/processes by default). They may be loaded via the loadTour()
method.
The Tour feature is available with Power or better licenses only See smartclient.com/product for details.
It requires the standard DataBinding
and optional
Tour
module.
config, configOnly, factoryCreated, factoryProperties, id, scClassName
Constructor and Description |
---|
Tour() |
Tour(com.google.gwt.core.client.JavaScriptObject jsObj) |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.core.client.JavaScriptObject |
create() |
boolean |
getAllowDropOnDescendants()
Default value for
TourStep.allowDropOnDescendants within this tour. |
java.lang.Boolean |
getAutoReset()
Should tour be auto-reset once it finishes in any manner so it can restarted?
|
ProcessElement[] |
getCancelSteps()
The
ProcessElement s representing steps that should be performed if the user
cancels the tour. |
java.lang.String |
getDropOutlineBorder()
Set the CSS border of the outline for drop targets as a CSS string including border-width, border-style, and/or color
(eg "1px dashed blue").
|
java.lang.String |
getFirstStepActionButtonTitle()
Default value of
TourStep.actionButtonTitle for the
first step in the tour. |
java.lang.String |
getFirstStepCancelButtonTitle()
Default value of
TourStep.cancelButtonTitle for the
first step in the tour. |
java.lang.String |
getLastStepActionButtonTitle()
Default value of
TourStep.actionButtonTitle for the
last step in the tour. |
TourMode |
getMode()
The tour mode allows step configuration to be simplified by using the context to apply appropriate defaults.
|
NotifySettings |
getNotifyMessageSettings()
Defaults settings for
notifyType message displayed by notifyValidationMessage . |
java.lang.String |
getNotifyType()
Category of message to use in +{notifyValidationMessage,notifyValidationMessage} by default.
|
static Tour |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
java.lang.String |
getOutlineBorder()
Set the CSS border of the outline of non-drop targets as a CSS string including border-width, border-style, and/or color
(eg "1px dashed blue").
|
java.lang.Boolean |
getShowInputValidationMessage()
Should
TourStep.inputValidationNotifyMessage be shown as detailed in TourInputValidationMode
for the entire tour? Set to false to suppress reporting messages to the user. |
java.lang.Boolean |
getShowProgress()
Should a progress bar be shown in each step to indicate progress through the tour?
|
java.lang.Boolean |
getShowProgressPercent()
Show progress percent next to progress bar when
showProgress
is enabled? |
java.lang.String |
getStepActionButtonTitle()
Default value for
TourStep.actionButtonTitle for
steps other than the first and last ones. |
java.lang.String |
getStepCancelButtonTitle()
Default value for
TourStep.cancelButtonTitle for all
steps where the cancel button is shown. |
ProcessElement[] |
getSteps()
The
ProcessElement s representing steps in this tour. |
static Tour |
getTour(java.lang.String tourId)
Get a Tour instance by it's ID.
|
Canvas |
getWindowDefaults()
Defaults for each
TourStep.targetView autoChild in the
tour. |
static void |
loadTour(java.lang.String tourId,
ProcessCallback callback)
Loads an XML tour definition stored in XML from the server.
|
void |
notifyValidationMessage(java.lang.String message)
Notify user of expected value entry validation message.
|
Tour |
setAllowDropOnDescendants(boolean allowDropOnDescendants)
Default value for
TourStep.allowDropOnDescendants within this tour. |
Tour |
setAutoReset(java.lang.Boolean autoReset)
Should tour be auto-reset once it finishes in any manner so it can restarted?
|
Tour |
setCancelSteps(ProcessElement... cancelSteps)
The
ProcessElement s representing steps that should be performed if the user
cancels the tour. |
Tour |
setDropOutlineBorder(java.lang.String dropOutlineBorder)
Set the CSS border of the outline for drop targets as a CSS string including border-width, border-style, and/or color
(eg "1px dashed blue").
|
Tour |
setFirstStepActionButtonTitle(java.lang.String firstStepActionButtonTitle)
Default value of
TourStep.actionButtonTitle for the
first step in the tour. |
Tour |
setFirstStepCancelButtonTitle(java.lang.String firstStepCancelButtonTitle)
Default value of
TourStep.cancelButtonTitle for the
first step in the tour. |
Tour |
setLastStepActionButtonTitle(java.lang.String lastStepActionButtonTitle)
Default value of
TourStep.actionButtonTitle for the
last step in the tour. |
Tour |
setMode(TourMode mode)
The tour mode allows step configuration to be simplified by using the context to apply appropriate defaults.
|
Tour |
setNotifyMessageSettings(NotifySettings notifyMessageSettings)
Defaults settings for
notifyType message displayed by notifyValidationMessage . |
Tour |
setNotifyType(java.lang.String notifyType)
Category of message to use in +{notifyValidationMessage,notifyValidationMessage} by default.
|
Tour |
setOutlineBorder(java.lang.String outlineBorder)
Set the CSS border of the outline of non-drop targets as a CSS string including border-width, border-style, and/or color
(eg "1px dashed blue").
|
Tour |
setShowInputValidationMessage(java.lang.Boolean showInputValidationMessage)
Should
TourStep.inputValidationNotifyMessage be shown as detailed in TourInputValidationMode
for the entire tour? Set to false to suppress reporting messages to the user. |
Tour |
setShowProgress(java.lang.Boolean showProgress)
Should a progress bar be shown in each step to indicate progress through the tour?
|
Tour |
setShowProgressPercent(java.lang.Boolean showProgressPercent)
Show progress percent next to progress bar when
showProgress
is enabled? |
Tour |
setStepActionButtonTitle(java.lang.String stepActionButtonTitle)
Default value for
TourStep.actionButtonTitle for
steps other than the first and last ones. |
Tour |
setStepCancelButtonTitle(java.lang.String stepCancelButtonTitle)
Default value for
TourStep.cancelButtonTitle for all
steps where the cancel button is shown. |
Tour |
setSteps(ProcessElement... steps)
The
ProcessElement s representing steps in this tour. |
Tour |
setWindowDefaults(Canvas windowDefaults)
Defaults for each
TourStep.targetView autoChild in the
tour. |
addFinishedHandler, addTraceElementHandler, getContainerId, getElement, getElements, getJsObj, getLastTaskOutput, getLastTaskOutput, getMockMode, getOrCreateJsObj, getProcess, getProcessElements, getRuleScope, getSequences, getStartElement, getState, getStateVariable, getTraceContext, getWizard, isCreated, loadProcess, onInit, passThruTaskOutput, reset, reset, setAttribute, setConfig, setContainerId, setElements, setJavaScriptObject, setMockMode, setNextElement, setNextElement, setRuleScope, setSequences, setStartElement, setStartElement, setState, setStateVariable, setTaskOutput, setTraceContext, setWizard, start
addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, asSGWTComponent, clearDynamicProperty, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getRef, getScClassName, getTestInstance, hasAutoAssignedID, hasDynamicProperty, internalSetID, internalSetID, isConfigOnly, isFactoryCreated, onBind, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfigOnly, setFactoryCreated, setID, setProperty, setProperty, setProperty, setProperty, setScClassName
public Tour()
public Tour(com.google.gwt.core.client.JavaScriptObject jsObj)
public static Tour getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public com.google.gwt.core.client.JavaScriptObject create()
public Tour setAllowDropOnDescendants(boolean allowDropOnDescendants)
TourStep.allowDropOnDescendants
within this tour.allowDropOnDescendants
- New allowDropOnDescendants value. Default value is falseTour
instance, for chaining setter callspublic boolean getAllowDropOnDescendants()
TourStep.allowDropOnDescendants
within this tour.public Tour setAutoReset(java.lang.Boolean autoReset) throws java.lang.IllegalStateException
autoReset
- New autoReset value. Default value is trueTour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.Boolean getAutoReset()
public Tour setCancelSteps(ProcessElement... cancelSteps) throws java.lang.IllegalStateException
ProcessElement
s representing steps that should be performed if the user
cancels the tour. These steps are typically TourStep
s. Alternately, or in
addition to these cancelation steps, the finished
method will be called once there are no more steps to process in the tour.
cancelSteps
- New cancelSteps value. Default value is nullTour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic ProcessElement[] getCancelSteps()
ProcessElement
s representing steps that should be performed if the user
cancels the tour. These steps are typically TourStep
s. Alternately, or in
addition to these cancelation steps, the finished
method will be called once there are no more steps to process in the tour.
public Tour setDropOutlineBorder(java.lang.String dropOutlineBorder)
outlineBorder
for properties
applied to non-drop targets. This property applies the same border to all four sides of the outlined component(s).
dropOutlineBorder
- New dropOutlineBorder value. Default value is "1px solid #44ff44"Tour
instance, for chaining setter callssetOutlineBorder(java.lang.String)
public java.lang.String getDropOutlineBorder()
outlineBorder
for properties
applied to non-drop targets. This property applies the same border to all four sides of the outlined component(s).
getOutlineBorder()
public Tour setFirstStepActionButtonTitle(java.lang.String firstStepActionButtonTitle) throws java.lang.IllegalStateException
TourStep.actionButtonTitle
for the
first step in the tour. Default titles for the middle and last steps are configured by stepActionButtonTitle
and lastStepActionButtonTitle
respectively.
firstStepActionButtonTitle
- New firstStepActionButtonTitle value. Default value is "Let's go!"Tour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getFirstStepActionButtonTitle()
TourStep.actionButtonTitle
for the
first step in the tour. Default titles for the middle and last steps are configured by stepActionButtonTitle
and lastStepActionButtonTitle
respectively.
public Tour setFirstStepCancelButtonTitle(java.lang.String firstStepCancelButtonTitle) throws java.lang.IllegalStateException
TourStep.cancelButtonTitle
for the
first step in the tour. Default title for the middle steps is configured by stepCancelButtonTitle
. No cancel button is shown for the
last step.
firstStepCancelButtonTitle
- New firstStepCancelButtonTitle value. Default value is "Skip this tour"Tour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getFirstStepCancelButtonTitle()
TourStep.cancelButtonTitle
for the
first step in the tour. Default title for the middle steps is configured by stepCancelButtonTitle
. No cancel button is shown for the
last step.
public Tour setLastStepActionButtonTitle(java.lang.String lastStepActionButtonTitle) throws java.lang.IllegalStateException
TourStep.actionButtonTitle
for the
last step in the tour. Default titles for the first and middle steps are configured by firstStepActionButtonTitle
and stepActionButtonTitle
respectively.
lastStepActionButtonTitle
- New lastStepActionButtonTitle value. Default value is "Done"Tour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getLastStepActionButtonTitle()
TourStep.actionButtonTitle
for the
last step in the tour. Default titles for the first and middle steps are configured by firstStepActionButtonTitle
and stepActionButtonTitle
respectively.
public Tour setMode(TourMode mode)
mode
- New mode value. Default value is "tour"Tour
instance, for chaining setter callspublic TourMode getMode()
public Tour setNotifyMessageSettings(NotifySettings notifyMessageSettings) throws java.lang.IllegalStateException
notifyType
message displayed by notifyValidationMessage
.notifyMessageSettings
- New notifyMessageSettings value. Default value is nullTour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic NotifySettings getNotifyMessageSettings()
notifyType
message displayed by notifyValidationMessage
.public Tour setNotifyType(java.lang.String notifyType) throws java.lang.IllegalStateException
If this category has
not been configured in Notify
it will be automatically configured using
+{notifyMessageSettings,notifyMessageSettings}.
notifyType
- New notifyType value. Default value is "tourExpectedValue"Tour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdNotifyType
public java.lang.String getNotifyType()
If this category has
not been configured in Notify
it will be automatically configured using
+{notifyMessageSettings,notifyMessageSettings}.
NotifyType
public Tour setOutlineBorder(java.lang.String outlineBorder)
dropOutlineBorder
for
properties applied to drop targets. This property applies the same border to all four sides of the outlined component(s).
outlineBorder
- New outlineBorder value. Default value is "1px solid red"Tour
instance, for chaining setter callssetDropOutlineBorder(java.lang.String)
public java.lang.String getOutlineBorder()
dropOutlineBorder
for
properties applied to drop targets. This property applies the same border to all four sides of the outlined component(s).
getDropOutlineBorder()
public Tour setShowInputValidationMessage(java.lang.Boolean showInputValidationMessage) throws java.lang.IllegalStateException
TourStep.inputValidationNotifyMessage
be shown as detailed in TourInputValidationMode
for the entire tour? Set to false
to suppress reporting messages to the user. notifyValidationMessage
will not be called. This setting
can be overridden for individual tourSteps
.
showInputValidationMessage
- New showInputValidationMessage value. Default value is nullTour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.Boolean getShowInputValidationMessage()
TourStep.inputValidationNotifyMessage
be shown as detailed in TourInputValidationMode
for the entire tour? Set to false
to suppress reporting messages to the user. notifyValidationMessage
will not be called. This setting
can be overridden for individual tourSteps
.
public Tour setShowProgress(java.lang.Boolean showProgress) throws java.lang.IllegalStateException
showProgress
- New showProgress value. Default value is nullTour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.Boolean getShowProgress()
public Tour setShowProgressPercent(java.lang.Boolean showProgressPercent) throws java.lang.IllegalStateException
showProgress
is enabled?showProgressPercent
- New showProgressPercent value. Default value is nullTour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.Boolean getShowProgressPercent()
showProgress
is enabled?public Tour setStepActionButtonTitle(java.lang.String stepActionButtonTitle) throws java.lang.IllegalStateException
TourStep.actionButtonTitle
for
steps other than the first and last ones. Default titles for the first and last steps are configured by firstStepActionButtonTitle
and lastStepActionButtonTitle
respectively.
stepActionButtonTitle
- New stepActionButtonTitle value. Default value is "Next"Tour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdsetStepCancelButtonTitle(java.lang.String)
public java.lang.String getStepActionButtonTitle()
TourStep.actionButtonTitle
for
steps other than the first and last ones. Default titles for the first and last steps are configured by firstStepActionButtonTitle
and lastStepActionButtonTitle
respectively.
getStepCancelButtonTitle()
public Tour setStepCancelButtonTitle(java.lang.String stepCancelButtonTitle) throws java.lang.IllegalStateException
TourStep.cancelButtonTitle
for all
steps where the cancel button is shown. Default title for the first step is configured by firstStepCancelButtonTitle
.
stepCancelButtonTitle
- New stepCancelButtonTitle value. Default value is "Skip this tour"Tour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdsetStepActionButtonTitle(java.lang.String)
public java.lang.String getStepCancelButtonTitle()
TourStep.cancelButtonTitle
for all
steps where the cancel button is shown. Default title for the first step is configured by firstStepCancelButtonTitle
.
getStepActionButtonTitle()
public Tour setSteps(ProcessElement... steps) throws java.lang.IllegalStateException
ProcessElement
s representing steps in this tour. These steps are typically
TourStep
s.steps
- New steps value. Default value is nullTour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic ProcessElement[] getSteps()
ProcessElement
s representing steps in this tour. These steps are typically
TourStep
s.public Tour setWindowDefaults(Canvas windowDefaults) throws java.lang.IllegalStateException
TourStep.targetView
autoChild in the
tour. These defaults are applied before TourStep.windowDefaults
if any.windowDefaults
- New windowDefaults value. Default value is {...}Tour
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdSGWTProperties
public Canvas getWindowDefaults()
TourStep.targetView
autoChild in the
tour. These defaults are applied before TourStep.windowDefaults
if any.public void notifyValidationMessage(java.lang.String message)
Notify system
to show the message in it's default position. See notifyType
for notification configuration details. message
- message provided by TourStep.inputValidationNotifyMessage
public static Tour getTour(java.lang.String tourId)
tourId
- tour ID to retrieve.
See Identifier
Identifier
public static void loadTour(java.lang.String tourId, ProcessCallback callback)
Tour files are stored as .proc.xml files in Component XML
format, in the directory indicated by the
project.processes
setting in server.properties
(webroot/processes
by default). To load a tour saved in a file tourId.proc.xml, pass just
tourId to this method.
tourId
- tour ID or IDs to load.
See Identifier
callback
- called when the tour is loaded with argument "process", the first tour. Other tours can be
looked up via getTour()
.