Class TourWindow

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClearHandlers, HasClickHandlers, HasCloseClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMaximizeClickHandlers, HasMinimizeClickHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRestoreClickHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers, HasMembersChangedHandlers

public class TourWindow extends Window
A specific purpose Window class for showing individual steps in a tour.
  • Constructor Details

    • TourWindow

      public TourWindow()
    • TourWindow

      public TourWindow(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static TourWindow getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class Window
    • getActionButton

      public IButton getActionButton() throws IllegalStateException
      Button show below contents that will call actionClick() when clicked.

      This component is an AutoChild named "actionButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current actionButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setActionButtonTitle

      public TourWindow setActionButtonTitle(String actionButtonTitle) throws IllegalStateException
      Title for the actionButton, shown if showActionButton is true.
      Parameters:
      actionButtonTitle - New actionButtonTitle value. Default value is "Next"
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getActionButtonTitle

      public String getActionButtonTitle()
      Title for the actionButton, shown if showActionButton is true.
      Returns:
      Current actionButtonTitle value. Default value is "Next"
      See Also:
    • setActionButtonURL

      public TourWindow setActionButtonURL(String actionButtonURL) throws IllegalStateException
      URL to open in another tab or window when the the actionButton is clicked. The normal actionClick() event is still called.
      Parameters:
      actionButtonURL - New actionButtonURL value. Default value is null
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getActionButtonURL

      public String getActionButtonURL()
      URL to open in another tab or window when the the actionButton is clicked. The normal actionClick() event is still called.
      Returns:
      Current actionButtonURL value. Default value is null
      See Also:
    • getCancelButton

      public IButton getCancelButton() throws IllegalStateException
      Button show below contents that will call cancelClick() when clicked.

      This component is an AutoChild named "cancelButton". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current cancelButton value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setCancelButtonDisabled

      public TourWindow setCancelButtonDisabled(Boolean cancelButtonDisabled) throws IllegalStateException
      Should cancel button be disabled?
      Parameters:
      cancelButtonDisabled - New cancelButtonDisabled value. Default value is null
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getCancelButtonDisabled

      public Boolean getCancelButtonDisabled()
      Should cancel button be disabled?
      Returns:
      Current cancelButtonDisabled value. Default value is null
      See Also:
    • setCancelButtonPrompt

      public TourWindow setCancelButtonPrompt(String cancelButtonPrompt) throws IllegalStateException
      Prompt displayed in hover for cancel button.
      Parameters:
      cancelButtonPrompt - New cancelButtonPrompt value. Default value is null
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getCancelButtonPrompt

      public String getCancelButtonPrompt()
      Prompt displayed in hover for cancel button.
      Returns:
      Current cancelButtonPrompt value. Default value is null
      See Also:
    • setCancelButtonTitle

      public TourWindow setCancelButtonTitle(String cancelButtonTitle) throws IllegalStateException
      Title for the cancelButton, shown if showCancelButton is true.
      Parameters:
      cancelButtonTitle - New cancelButtonTitle value. Default value is "Skip this tour"
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getCancelButtonTitle

      public String getCancelButtonTitle()
      Title for the cancelButton, shown if showCancelButton is true.
      Returns:
      Current cancelButtonTitle value. Default value is "Skip this tour"
      See Also:
    • setContentComponents

      public TourWindow setContentComponents(Canvas... contentComponents) throws IllegalStateException
      Additional content components to show below contents or title if there are no other content.
      Parameters:
      contentComponents - New contentComponents value. Default value is null
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getContentComponents

      public Canvas[] getContentComponents()
      Additional content components to show below contents or title if there are no other content.
      Returns:
      Current contentComponents value. Default value is null
    • setContents

      public TourWindow setContents(String contents) throws IllegalStateException
      Text to show in body of window.
      Overrides:
      setContents in class Canvas
      Parameters:
      contents - New contents value. Default value is null
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getContents

      public String getContents()
      Text to show in body of window.
      Overrides:
      getContents in class Canvas
      Returns:
      Current contents value. Default value is null
      See Also:
    • setShowActionButton

      public TourWindow setShowActionButton(Boolean showActionButton) throws IllegalStateException
      If true, show an action button below the contents which calls actionClick() when clicked.
      Parameters:
      showActionButton - New showActionButton value. Default value is true
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getShowActionButton

      public Boolean getShowActionButton()
      If true, show an action button below the contents which calls actionClick() when clicked.
      Returns:
      Current showActionButton value. Default value is true
      See Also:
    • setShowCancelButton

      public TourWindow setShowCancelButton(Boolean showCancelButton) throws IllegalStateException
      If true, show a cancel button below the contents which calls cancelClick() when clicked.
      Parameters:
      showCancelButton - New showCancelButton value. Default value is null
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getShowCancelButton

      public Boolean getShowCancelButton()
      If true, show a cancel button below the contents which calls cancelClick() when clicked.
      Returns:
      Current showCancelButton value. Default value is null
      See Also:
    • setShowProgress

      public TourWindow setShowProgress(Boolean showProgress) throws IllegalStateException
      Should a progress bar be shown to indicate progress through the tour?
      Parameters:
      showProgress - New showProgress value. Default value is null
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowProgress

      public Boolean getShowProgress()
      Should a progress bar be shown to indicate progress through the tour?
      Returns:
      Current showProgress value. Default value is null
    • setShowProgressPercent

      public TourWindow setShowProgressPercent(Boolean showProgressPercent) throws IllegalStateException
      Show progress percent next to progress bar when showProgress is enabled? The percent can also be shown over the progress bar by setting showProgressPercentInline.
      Parameters:
      showProgressPercent - New showProgressPercent value. Default value is null
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getShowProgressPercent

      public Boolean getShowProgressPercent()
      Show progress percent next to progress bar when showProgress is enabled? The percent can also be shown over the progress bar by setting showProgressPercentInline.
      Returns:
      Current showProgressPercent value. Default value is null
      See Also:
    • setShowProgressPercentInline

      public TourWindow setShowProgressPercentInline(Boolean showProgressPercentInline) throws IllegalStateException
      Show progress percent over the progress bar instead of next to it when showProgress is enabled?
      Parameters:
      showProgressPercentInline - New showProgressPercentInline value. Default value is null
      Returns:
      TourWindow instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowProgressPercentInline

      public Boolean getShowProgressPercentInline()
      Show progress percent over the progress bar instead of next to it when showProgress is enabled?
      Returns:
      Current showProgressPercentInline value. Default value is null
    • setTitle

      public void setTitle(String title) throws IllegalStateException
      Title for this Window, shown if showTitle is true.
      Overrides:
      setTitle in class Window
      Parameters:
      title - New title value. Default value is null
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getTitle

      public String getTitle()
      Title for this Window, shown if showTitle is true.
      Overrides:
      getTitle in class Window
      Returns:
      Current title value. Default value is null
      See Also:
    • actionClick

      public Boolean actionClick()
      Handles a click on the action button of this window. No default implementation.

      Developers may use addActionClickHandler() to provide custom handling when the user clicks this button.

      Returns:
      Return false to cancel bubbling the click event
    • cancelClick

      public Boolean cancelClick()
      Handles a click on the cancel button of this window. The default implementation calls close() and returns false to prevent bubbling of the click event.

      Developers may use addCancelClickHandler() to provide custom handling when the user clicks this button. Custom implementations may call close() to trigger the default behavior.

      Returns:
      Return false to cancel bubbling the click event
    • setDefaultProperties

      public static void setDefaultProperties(TourWindow tourWindowProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      tourWindowProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(TourWindowLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class Window