Open topic with navigation

com.hp.lft.sdk.wpf

## Interface Calendar

- All Superinterfaces:
    Clickable, DoubleClickable, LocationInfoProvider, SupportDragAndDrop, SupportSendKeys, SupportsNativeObject, TestObject, TestObjectDescriber, UiObjectBase, VisibleProvider, WaitUntilVisibleProvider, WaitUntilEnabledProvider, EnabledProvider

      public interface Calendar
      extends UiObjectBase, TestObject

  A calendar or a date picker .NET WPF object.

- - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `java.util.Date` | `getDate()` Returns the date associated with this calendar.
    `DateFormatType` | `getDateFormatType()` Returns the date format type.
    `DateRange[]` | `getDateRanges()` Returns the selected date ranges of this Month Calendar control in multi-selection mode.
    `java.lang.String` | `getHelpText()` Returns the help text associated with this object.
    `java.lang.String` | `getParentText()` Returns the text associated with the parent object of this object.
    `void` | `setDate(java.util.Date date)` Sets the date of this calendar.
    `void` | `setDateRange(java.util.Date startDate, java.util.Date endDate)` Sets the date range of this calendar or the date of this date picker.
    `void` | `setDateRange(DateRange dateRange)` Sets the date range of this calendar or the date of this date picker.
    `void` | LeanFT 14.50: `setDateRanges(DateRange[] dateRanges)` From LeanFT 14.51: `setDateRanges(DateRange... dateRanges)` Sets the date ranges of this calendar or the dates of this date picker.
    `void` | `setMonth(int month)` Sets the month in this calendar.
    `void` | `setYear(int year)` Sets the year in this calendar.

    - ### Methods inherited from interface com.hp.lft.sdk.wpf.UiObjectBase

      `canFocus, getAttachedText, getFullNamePath, getFullType, getObjectName, getObjectProperty, getText, makeVisible, showContextMenu`

    - ### Methods inherited from interface com.hp.lft.sdk.UiObjectBase

      `getHandle, getNativeClass, getWindowTitleRegExp, isEnabled, isFocused, isVisible, mouseMove`

    - ### Methods inherited from interface com.hp.lft.sdk.Clickable

      `click, click, click`

    - ### Methods inherited from interface com.hp.lft.sdk.DoubleClickable

      `doubleClick, doubleClick, doubleClick`

    - ### Methods inherited from interface com.hp.lft.sdk.LocationInfoProvider

      `getAbsoluteLocation, getLocation, getSize`

    - ### Methods inherited from interface com.hp.lft.sdk.SupportSendKeys

      `sendKeys, sendKeys`

    - ### Methods inherited from interface com.hp.lft.sdk.SupportDragAndDrop

      `dragAndDropOn, dragAndDropOn`

    - ### Methods inherited from interface com.hp.lft.sdk.SupportsNativeObject

      `getNativeObject`

    - ### Methods inherited from interface com.hp.lft.sdk.TestObject

      `exists, exists, findChildren, getDescription, getDisplayName, getParent, getSnapshot, getTextLocations, getTextLocations, getVisibleText, getVisibleText, highlight, highlightMatches, setDescription, setDisplayName, verifyImageExists, verifyImageExists, verifyImageMatch, verifyImageMatch, verifyImageMatch, verifyImageMatch, verifyImageMatch, verifyImageMatch, waitUntilExists, waitUntilExists`

    - ### Methods inherited from interface com.hp.lft.sdk.TestObjectDescriber

      `describe`

    - ### Methods inherited from interface com.hp.lft.sdk.WaitUntilEnabledProvider

      `waitUntilEnabled, waitUntilEnabled`

    - ### Methods inherited from interface com.hp.lft.sdk.EnabledProvider

      `isEnabled`

    - ### Methods inherited from interface com.hp.lft.sdk.WaitUntilVisibleProvider

      `waitUntilVisible, waitUntilVisible`

    - ### Methods inherited from interface com.hp.lft.sdk.VisibleProvider

      `isVisible`

- - ### Method Detail

    - #### getDate

          java.util.Date getDate()
                          throws GeneralLeanFtException

      Returns the date associated with this calendar. If a date range is associated, returns the start date.
      Note: If you try to retrieve a date value from a WPF calendar object before performing an operation on it, LeanFT returns an exception.
      Therefore, make sure to precede the retrieve value step with a step that performs an operation on the calendar, such as setting the date on the calendar to the current date.
      Returns:
        the date
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### setDate

          void setDate(java.util.Date date)
                throws GeneralLeanFtException

      Sets the date of this calendar.
      Parameters:
        `date` - the date of the calendar
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getDateRanges

                                                      DateRange[] getDateRanges()
                             throws GeneralLeanFtException

      Returns the selected date ranges of this Month Calendar control in multi-selection mode.
      If a single date is selected in the calendar:
      - DateRanges returns an array with a single element.
      - Both DateRange.getStartDate() and DateRange.getEndDate() are equal to the selected date.
      Returns:
        ranges of dates
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### setDateRange

          void setDateRange(DateRange dateRange)
                     throws GeneralLeanFtException

      Sets the date range of this calendar or the date of this date picker.
      If a single date is selected in the calendar, the getDateRanges method will return a DateRange array with a single element, where both DateRange.getStartDate() and DateRange.getEndDate() of the element are equal to the selected date.
      Parameters:
        `dateRange` - the date range
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### setDateRange

          void setDateRange(java.util.Date startDate,
                            java.util.Date endDate)
                     throws GeneralLeanFtException

      Sets the date range of this calendar or the date of this date picker.
      Parameters:
        `startDate` - the start of the range
        `endDate` - the end of the range
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### setDateRanges

          LeanFT 14.50: void setDateRanges(DateRange[] dateRanges)
                      throws GeneralLeanFtException

          From LeanFT 14.51: void setDateRanges(DateRange... dateRanges)
                      throws GeneralLeanFtException

      Sets the date ranges of this calendar or the dates of this date picker.
      Parameters:
        `dateRanges` - the date ranges
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### setMonth

          void setMonth(int month)
                 throws GeneralLeanFtException

      Sets the month in this calendar.
      Parameters:
        `month` - a number from 1 to 12
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### setYear

          void setYear(int year)
                throws GeneralLeanFtException

      Sets the year in this calendar.
      Parameters:
        `year` - the year
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getDateFormatType

                                                      DateFormatType getDateFormatType()
                                    throws GeneralLeanFtException

      Returns the date format type.
      Returns:
        the DateFormateType
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getParentText

          java.lang.String getParentText()
                                  throws GeneralLeanFtException

      Returns the text associated with the parent object of this object.
      Returns:
        the text
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getHelpText

          java.lang.String getHelpText()
                                throws GeneralLeanFtException

      Returns the help text associated with this object.
      Returns:
        the help text
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.