Share this page

com.hp.lft.sdk.winforms

## Interface ToolBar

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

      public interface ToolBar
      extends UiObjectBase, TestObject

  A .NET Windows Forms toolbar.
  A .NET Windows Forms menu is also known as a ToolBar test object.

- - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getErrorText()` Returns the tooltip text of the error icon associated with this object.
    `ToolBarItem` | `getItem(java.lang.String text)` Returns the item with the specified text.
    `java.util.List<ToolBarItem>` | `getItems()` Returns the toolbar items in this toolbar.
    `java.util.List<ToolBarItem>` | `getSelectedItems()` Returns the selected items in this toolbar.
    `java.util.List<java.lang.String>` | `getTopMenuItems()` For menu: returns the names of all top menu items; For toolbar: returns the names of all toolbar items.
    `boolean` | `isItemExists(java.lang.String itemPath)` Indicates whether the specified toolbar button or menu button exists.
    `void` | `select(java.lang.String itemPath)` Selects the specified item in this menu.
    `void` | `showDropdown(int index)` Opens the dropdown menu associated with this toolbar button.
    `void` | `showDropdown(java.lang.String itemPath)` Opens the dropdown menu associated with this menu item or toolbar item.

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

      `fireEvent, getFullNamePath, getFullType, getObjectName, getObjectProperty, getText, getWindowClassRegExp, getWindowId, isChildWindow, isOwnedWindow`

    - ### 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

    - #### getTopMenuItems

          java.util.List<java.lang.String> getTopMenuItems()
                                                    throws GeneralLeanFtException

      For menu: returns the names of all top menu items; For toolbar: returns the names of all toolbar items.
      Returns:
        the names of top menu items
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getItems

          java.util.List<ToolBarItem> getItems()
                                        throws GeneralLeanFtException

      Returns the toolbar items in this toolbar.
      Do not invoke on a menu.
      Returns:
        the toolbar items
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getSelectedItems

          java.util.List<ToolBarItem> getSelectedItems()
                                                throws GeneralLeanFtException

      Returns the selected items in this toolbar.
      Do not invoke on a menu.
      Returns:
        the selected items
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### select

          void select(java.lang.String itemPath)
               throws GeneralLeanFtException

      Selects the specified item in this menu.
      Do not invoke on a toolbar.
      Only visible items can be selected. You can use `showDropdown(int)` or `showDropdown(String)` to make the button visible.
      Parameters:
        `itemPath` - The full path of the menu item is a list of menu button names separated by semicolons.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### showDropdown

          void showDropdown(java.lang.String itemPath)
                     throws GeneralLeanFtException

      Opens the dropdown menu associated with this menu item or toolbar item.
      Parameters:
        `itemPath` - The full path of the item. The full path of a menu item is a list of menu item names separated by semicolons.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### showDropdown

          void showDropdown(int index)
                     throws GeneralLeanFtException

      Opens the dropdown menu associated with this toolbar button.
      Do not invoke on a menu.
      Parameters:
        `index` - the 0-based index of the button
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### isItemExists

          boolean isItemExists(java.lang.String itemPath)
                        throws GeneralLeanFtException

      Indicates whether the specified toolbar button or menu button exists.
      Parameters:
        `itemPath` - the full path of the button. The full path of a menu button is a list of menu button names separated by semicolons.
      Returns:
        true if exists
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getErrorText

          java.lang.String getErrorText()
                                 throws GeneralLeanFtException

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

    - #### getItem

                                                      ToolBarItem getItem(java.lang.String text)
                       throws GeneralLeanFtException

      Returns the item with the specified text.
      Parameters:
        `text` - the item text
      Returns:
        the item with the specified text.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

Tips to improve your search results... UFT Developer Java SDK Reference Version 15.0-15.0.2 UFT Developer SDK Reference All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: