Class DateRangeDialog

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 DateRangeDialog extends Window
Simple modal dialog for collecting a date range from the end user.
  • Constructor Details

    • DateRangeDialog

      public DateRangeDialog()
    • DateRangeDialog

      public DateRangeDialog(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static DateRangeDialog 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
    • getCancelButton

      public IButton getCancelButton() throws IllegalStateException
      Button used for cancelling the dialog. Note that, since this is an com.smartgwt.client.types.AutoChild, it can be configured using cancelButtonDefaults and cancelButtonProperties.

      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.
    • setCancelButtonTitle

      public DateRangeDialog setCancelButtonTitle(String cancelButtonTitle) throws IllegalStateException
      The title for the "Cancel" button on this dialog.
      Parameters:
      cancelButtonTitle - New cancelButtonTitle value. Default value is "Cancel"
      Returns:
      DateRangeDialog instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getCancelButtonTitle

      public String getCancelButtonTitle()
      The title for the "Cancel" button on this dialog.
      Returns:
      Current cancelButtonTitle value. Default value is "Cancel"
    • getClearButton

      public IButton getClearButton() throws IllegalStateException
      Button used for clearing the dialog's values. Note that, since this is an com.smartgwt.client.types.AutoChild, it can be configured using clearButtonDefaults and clearButtonProperties.

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

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

      public DateRangeDialog setClearButtonTitle(String clearButtonTitle) throws IllegalStateException
      The title for the "Clear" button on this dialog.
      Parameters:
      clearButtonTitle - New clearButtonTitle value. Default value is "Clear"
      Returns:
      DateRangeDialog instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getClearButtonTitle

      public String getClearButtonTitle()
      The title for the "Clear" button on this dialog.
      Returns:
      Current clearButtonTitle value. Default value is "Clear"
    • setHeaderTitle

      public DateRangeDialog setHeaderTitle(String headerTitle) throws IllegalStateException
      The title to display in the header-bar of this Dialog.
      Parameters:
      headerTitle - New headerTitle value. Default value is "Select Date Range"
      Returns:
      DateRangeDialog instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getHeaderTitle

      public String getHeaderTitle()
      The title to display in the header-bar of this Dialog.
      Returns:
      Current headerTitle value. Default value is "Select Date Range"
    • getOkButton

      public IButton getOkButton() throws IllegalStateException
      Button used for accepting the values entered into the dialog. Note that, since this is an com.smartgwt.client.types.AutoChild, it can be configured using okButtonDefaults and okButtonProperties.

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

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

      public DateRangeDialog setOkButtonTitle(String okButtonTitle) throws IllegalStateException
      The title for the "OK" button on this dialog.
      Parameters:
      okButtonTitle - New okButtonTitle value. Default value is "OK"
      Returns:
      DateRangeDialog instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getOkButtonTitle

      public String getOkButtonTitle()
      The title for the "OK" button on this dialog.
      Returns:
      Current okButtonTitle value. Default value is "OK"
    • getRangeItem

      public DateRangeItem getRangeItem() throws IllegalStateException

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

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

      public static void askForRange(boolean allowRelativeDates, DateRangeItem rangeItemProperties, DateRangeDialog windowProperties, DateRangeCallback callback)
      Helper method to launch a DateRangeDialog to have a date range input by the user.
      Parameters:
      allowRelativeDates - whether to allow relative date entry via RelativeDateItems, default true
      rangeItemProperties - properties for the DateRangeItem
      windowProperties - properties for the Window
      callback - method to fire once user has input values, with a single parameter "criterion" of type Criterion
    • setDefaultProperties

      public static void setDefaultProperties(DateRangeDialog dateRangeDialogProperties)
      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:
      dateRangeDialogProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • askForRange

      @Deprecated public static void askForRange(boolean allowRelativeDates, DateRangeItem rangeItemProperties, DateRangeDialog windowProperties, String callback)
      Helper method to launch a DateRangeDialog to have a date range input by the user.
      Parameters:
      allowRelativeDates - whether to allow relative date entry via RelativeDateItems, default true
      rangeItemProperties - properties for the DateRangeItem
      windowProperties - properties for the Window
      callback - method to fire once user has input values, with a single parameter "criterion" of type Criterion. See Callback
    • setLogicalStructure

      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