Sha256: a87fa2bae13f0459622b3bbc267b31aad4047d853af6c034e94f6d5c18079dfb

Contents?: true

Size: 1.72 KB

Versions: 3

Compression:

Stored size: 1.72 KB

Contents

module OperaWatir
  class QuickCheckbox < QuickWidget
    
    # @private
    # Checks the type of the widget is correct
    def correct_type?
      @element.getType == WIDGET_ENUM_MAP[:checkbox]
    end

    ######################################################################
    # Checks if the checkbox is checked
    #
    # @return [Boolean] true if the checkbox is checked otherwise false
    #
    # @raise [Exceptions::UnknownObjectException] if the widget could not be found
    #           using the specified method
    def checked?
      element.isSelected
    end
    
    ######################################################################
    # Clicks a radio button or checkbox and toggles it state
    #
    # @return [Boolean] the new state of the radio button or checkbox,
    #               false for not checked, or true for checked
    #
    # @raise [DesktopExceptions::WidgetNotVisibleException] if the checkbox
    #            is not visible
    #
    def toggle_with_click
      click
      
      # Cheat since we don't have an even yet 
      sleep(0.1)

      element(true).isSelected
    end

    
    ######################################################################
    # Clicks the checkbox, and waits for the window with window name 
    # win_name to be shown
    #
    # @param [String] win_name name of the window that will be opened (Pass a blank string for any window)
    #
    # @return [int] Window ID of the window shown or 0 if no window is shown
    #
    # @raise [DesktopExceptions::WidgetNotVisibleException] if the checkbox
    #            is not visible
    #
    def open_dialog_with_click(win_name)
      super
      #wait_start
      #click
      #wait_for_window_shown(win_name)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
operawatir-0.4.1.pre5-jruby lib/operawatir/quickwidgets/quick_checkbox.rb
operawatir-0.4.1.pre4-jruby lib/operawatir/quickwidgets/quick_checkbox.rb
operawatir-0.4.1.pre3-jruby lib/operawatir/quickwidgets/quick_checkbox.rb