Open topic with navigation

com.hp.lft.sdk.sap.gui

## Interface TreeView

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

      public interface TreeView
      extends Element

  A tree control in a SAP GUI for Windows application.

- - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `void` | `activateNode(java.lang.String path)` Activates a node in a tree.
    `void` | `activateNode(TreeViewNode node)` Activates a node in a tree.
    `java.lang.String` | `buildNodePath(java.lang.Object... nodePathParts)` Returns the path of the specified tree node.
    `void` | `clickColumn(int columnIndex)` Clicks the specified column in a column tree or list tree.
    `void` | `clickColumn(java.lang.String column)` Clicks the specified column in a column tree or list tree.
    `TreeViewNode` | `getNode(java.lang.String path)` Returns the node with the specified path.
    `java.lang.String` | `getSelectedItem()` Returns the value of the selected item in the tree.
    `java.lang.String` | `getSelectedNodePath()` Returns the path of the selected node in the tree.
    `TreeSelectionMode` | `getSelectionMode()` Returns which selections can be made in the tree.
    `TreeType` | `getTreeType()` Returns the type of tree.
    `boolean` | `isEnabled()` Indicates whether the tree can accept user input.
    `void` | `openContextMenu()` Opens a tree's default context menu.
    `void` | `openHeaderContextMenu(int columnIndex)` Opens a context menu for a header in a column tree or list tree.
    `void` | `openHeaderContextMenu(java.lang.String column)` Opens a context menu for a header in a column tree or list tree.
    `void` | `pressEnter()` Presses the ENTER key.
    `void` | `selectMenuItemById(java.lang.String menuItemId)` Selects a menu item from a context menu by ID.
    `void` | `selectNode(java.lang.String path)` Selects a node in an SAP tree.
    `void` | `selectNode(TreeViewNode node)` Selects a node in an SAP tree.

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

    - #### activateNode

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

      Activates a node in a tree. You can use `buildNodePath(Object...)` to build the node path string to be used as the path argument for this method. You can also use regular expressions in the path name, using the format: RegExp:=(regular expression).
      Parameters:
        `path` - the path to the node. Separate nodes in the path can be specified by the name or 1-based index in the format "#index". Elements of the path are separated by semicolons(;).
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### activateNode

          void activateNode(TreeViewNode node)
                     throws GeneralLeanFtException

      Activates a node in a tree.
      Parameters:
        `node` - the node.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### clickColumn

          void clickColumn(java.lang.String column)
                    throws GeneralLeanFtException

      Clicks the specified column in a column tree or list tree.
      Parameters:
        `column` - the name of the column.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### clickColumn

          void clickColumn(int columnIndex)
                    throws GeneralLeanFtException

      Clicks the specified column in a column tree or list tree.
      Parameters:
        `columnIndex` - 1-based.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### selectNode

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

      Selects a node in an SAP tree. You can use the BuildNodePath method to build the node path string to be used as the path argument for this method. You can also use regular expressions in the path name, using the format: RegExp:=(regular expression).
      Parameters:
        `path` - the path to the node you want to select. Separate nodes in the path can be specified by the name or index number (in the format "#index") . Index values begin with 1.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### selectNode

          void selectNode(TreeViewNode node)
                   throws GeneralLeanFtException

      Selects a node in an SAP tree.
      Parameters:
        `node` - the node you want to select.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### openContextMenu

          void openContextMenu()
                        throws GeneralLeanFtException

      Opens a tree's default context menu. After opening a context menu, you can use `selectMenuItemById(String)` to select the menu item.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### openHeaderContextMenu

          void openHeaderContextMenu(java.lang.String column)
                              throws GeneralLeanFtException

      Opens a context menu for a header in a column tree or list tree. After opening a context menu, you can use `selectMenuItemById(String)` to select the menu item.
      Parameters:
        `column` - the column name.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### openHeaderContextMenu

          void openHeaderContextMenu(int columnIndex)
                              throws GeneralLeanFtException

      Opens a context menu for a header in a column tree or list tree. After opening a context menu, you use `selectMenuItemById(String)` to select the menu item.
      Parameters:
        `columnIndex` - the 1-based column index.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### selectMenuItemById

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

      Selects a menu item from a context menu by ID.
      Parameters:
        `menuItemId` - a string format ID for the menu item.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### pressEnter

          void pressEnter()
                   throws GeneralLeanFtException

      Presses the ENTER key. Set focus to to the tree before invoking.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### isEnabled

          boolean isEnabled()
                     throws GeneralLeanFtException

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

    - #### getSelectedItem

          java.lang.String getSelectedItem()
                                    throws GeneralLeanFtException

      Returns the value of the selected item in the tree.
      Returns:
        the value.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getSelectedNodePath

          java.lang.String getSelectedNodePath()
                                        throws GeneralLeanFtException

      Returns the path of the selected node in the tree.
      Returns:
        the path of the selected node.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getSelectionMode

                                                      TreeSelectionMode getSelectionMode()
                                      throws GeneralLeanFtException

      Returns which selections can be made in the tree.
      Returns:
        the selection mode.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getTreeType

                                                      TreeType getTreeType()
                        throws GeneralLeanFtException

      Returns the type of tree.
      Returns:
        the type.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getNode

                                                      TreeViewNode getNode(java.lang.String path)
                        throws GeneralLeanFtException

      Returns the node with the specified path. If the path is not unique, returns the first node with the specified path. You can use `buildNodePath(Object...)` to build the node path string to be used as the path argument for this method.
      Parameters:
        `path` - elements of the path are separated by semicolons(;).
      Returns:
        the node.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### buildNodePath

          java.lang.String buildNodePath(java.lang.Object... nodePathParts)
                                  throws GeneralLeanFtException

      Returns the path of the specified tree node.
      Parameters:
        `nodePathParts` - the node path parts can be: logical name(String), full path(String), or 1-based index(int). Elements of the path are separated by semicolons(;).
      Returns:
        the path.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.