Open topic with navigation

com.hp.lft.sdk.sap.gui

## Interface ToolBar

- All Superinterfaces:
    Element, LocationInfoProvider, SupportsNativeObject, TestObject, TestObjectDescriber, WaitUntilEnabledProvider, EnabledProvider

      public interface ToolBar
      extends Element

  A toolbar control in a SAP GUI for Windows application,

- - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `buildMenuPath(java.lang.Object... menuPathParts)` Returns the path of the specified menu item.
    `boolean` | `isEnabled()` Indicates whether the object can accept user input.
    `void` | `pressButton(java.lang.String buttonId)` Presses the specified toolbar button.
    `void` | `pressContextButton(java.lang.String buttonId)` Presses the specified toolbar button to open the button's context menu.
    `void` | `selectMenuItem(int index)` Selects the specified menu item from the toolbar button context menu.
    `void` | `selectMenuItem(java.lang.String path)` Selects the specified menu item from the toolbar button context menu.
    `void` | `selectMenuItemById(java.lang.String id)` Selects the specified menu item from the toolbar button context menu by SAP ID.

    - ### Methods inherited from interface com.hp.lft.sdk.sap.gui.Element

      `getId, getName, getType`

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

      `getAbsoluteLocation, getLocation, getSize`

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

      `getNativeObject`

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

      `waitUntilEnabled, waitUntilEnabled`

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

      `isEnabled`

- - ### Method Detail

    - #### isEnabled

          boolean isEnabled()
                     throws GeneralLeanFtException

      Indicates whether the object can accept user input.
      Returns:
        true if enabled.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### buildMenuPath

          java.lang.String buildMenuPath(java.lang.Object... menuPathParts)
                                  throws GeneralLeanFtException

      Returns the path of the specified menu item.
      Parameters:
        `menuPathParts` - the menu path parts can be: logical name(String), full path(String), or 1-based index(Integer).
      Returns:
        the path of the specified menu item.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### pressButton

          void pressButton(java.lang.String buttonId)
                    throws GeneralLeanFtException

      Presses the specified toolbar button.
      Parameters:
        `buttonId` - the button's ID in text format.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### pressContextButton

          void pressContextButton(java.lang.String buttonId)
                           throws GeneralLeanFtException

      Presses the specified toolbar button to open the button's context menu.
      Parameters:
        `buttonId` - the button's ID in text format.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### selectMenuItem

          void selectMenuItem(java.lang.String path)
                       throws GeneralLeanFtException

      Selects the specified menu item from the toolbar button context menu. You can use `buildMenuPath(Object...)` to build the item path string to be used as the itemPath argument for this method.
      Parameters:
        `path` - the menu item name
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### selectMenuItem

          void selectMenuItem(int index)
                       throws GeneralLeanFtException

      Selects the specified menu item from the toolbar button context menu.
      Parameters:
        `index` - 1-based.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### selectMenuItemById

          void selectMenuItemById(java.lang.String id)
                           throws GeneralLeanFtException

      Selects the specified menu item from the toolbar button context menu by SAP ID.
      Parameters:
        `id` - the SAP ID of the context menu item.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.