code: def tree_view(name, locator)
        define_method("#{name}") do
          adapter.tree_view(locator).value
        end
        define_method("#{name}=") do |which_item|
          adapter.tree_view(locator).select which_item
        end
        define_method("#{name}_items") do
          adapter.tree_view(locator).items
        end
        define_method("expand_#{name}_item") do |which_item|
          adapter.tree_view(locator).expand which_item
        end
        define_method("collapse_#{name}_item") do |which_item|
          adapter.tree_view(locator).collapse which_item
        end
        define_method("#{name}_view") do
          adapter.tree_view(locator).view
        end
      end
docs: Generates methods for working with tree view controls
  
   @example
     tree_view(:tree, :id => "treeId")
     # will generate 'tree', 'tree=', 'tree_items', 'expand_tree_item' and 'collapse_tree_item'
     # methods to get the tree value, set the tree value (index or string), get all of the
     # items, expand an item (index or string) and collapse an item (index or string)
  
   @param  [String]  the name used for the generated methods
   @param  [Hash]  locator for how the label is found
  
   === Aliases
   * treeview
   * tree