Class: OperaWatir::QuickMenuItem
- Inherits:
-
QuickWidget
- Object
- QuickWidget
- OperaWatir::QuickMenuItem
- Defined in:
- lib/operawatir/quickwidgets/quick_menuitem.rb
Constant Summary
Constants inherited from QuickWidget
OperaWatir::QuickWidget::ConditionTimeout
Instance Method Summary collapse
-
#action ⇒ Object
The name of the action this item executes when selected.
-
#action_item? ⇒ Boolean
True if this item is a command/action item.
-
#action_params ⇒ Object
The parameters to the action that will be used for the action executed for this item when it is selected.
-
#bold? ⇒ Boolean
True if this menuitem has bold text, otherwise false.
-
#checked? ⇒ Boolean
True if element is a checkbox item that is checked, else false.
-
#close_menu_with_click(menu_name) ⇒ Object
Clicks item and waits for the menu to close.
-
#close_menu_with_key_press(menu_name, key, *modifiers) ⇒ Object
Clicks item and waits for the menu to close.
-
#height ⇒ Object
Height of the menuitem.
-
#load_page_with_click ⇒ int
Clicks the button, and waits for loading to finish.
-
#menu ⇒ Object
Name of the menu this menuitem is part of.
-
#name ⇒ Object
Returns the name of the menuitem.
-
#open_menu_with_click(menu_name) ⇒ Object
Clicks the item, and waits for the menu with menu with name menu_name to be shown.
-
#open_menu_with_hover(menu_name) ⇒ Object
Hovers the menuitem and waits for the menu with menu_name to open.
-
#open_window_with_click(win_name) ⇒ int
(also: #open_dialog_with_click)
Clicks the button, and waits for the window with window name win_name to be shown.
-
#pos ⇒ Object
browser.quick_menu(:name, “Browser Tools Menu”).quick_menuitem(:pos, 2).name.should == “Separator”.
-
#separator? ⇒ Boolean
True if this menuitem is a separator, else false.
-
#shortcut ⇒ Object
browser.quick_menuitem(:action, “Close page”).shortcut # Ctrl+W.
-
#shortcutletter ⇒ Object
(Note: not used on mac, so not a platform dependant feature).
-
#submenu ⇒ Object
(Note: an item will either have a submenu, or an action).
-
#submenu_item? ⇒ Boolean
True if this menuitem opens a submenu, otherwise false.
-
#text ⇒ Object
(Note: this should normally not be used to access the item, as it will be language dependent).
- #to_s ⇒ Object
-
#toggle_with_click ⇒ Object
Use to toggle a checkbox or radio item menuitem.
-
#width ⇒ Object
Width of the menuitem.
Methods inherited from QuickWidget
#click_with_condition, #double_click_with_condition, #enabled?, #exist?, #focus_with_click, #focus_with_hover, #has_ui_string?, #middle_click_with_condition, #open_menu_with_rightclick, #open_window_with_hover, #parent_name, #position, #quick_tabs, #quick_widgets, #right_click_with_condition, #type, #value, #verify_includes_text, #verify_text, #visible?, #widget_info_string
Methods included from DesktopContainer
#quick_addressfield, #quick_button, #quick_checkbox, #quick_dialogtab, #quick_dropdown, #quick_dropdownitem, #quick_editfield, #quick_find, #quick_griditem, #quick_gridlayout, #quick_label, #quick_menu, #quick_menuitem, #quick_radiobutton, #quick_searchfield, #quick_tab, #quick_thumbnail, #quick_toolbar, #quick_treeitem, #quick_treeview, #quick_window
Instance Method Details
#action ⇒ Object
Returns the name of the action this item executes when selected.
146 147 148 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 146 def action element.getActionName() end |
#action_item? ⇒ Boolean
Returns true if this item is a command/action item.
95 96 97 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 95 def action_item? action.length > 0 end |
#action_params ⇒ Object
Returns the parameters to the action that will be used for the action executed for this item when it is selected.
155 156 157 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 155 def action_params element.getActionParameter() end |
#bold? ⇒ Boolean
Returns true if this menuitem has bold text, otherwise false.
79 80 81 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 79 def bold? element.isBold() end |
#checked? ⇒ Boolean
Returns true if element is a checkbox item that is checked, else false.
71 72 73 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 71 def checked? element.isChecked() end |
#close_menu_with_click(menu_name) ⇒ Object
Clicks item and waits for the menu to close
331 332 333 334 335 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 331 def () wait_start click () end |
#close_menu_with_key_press(menu_name, key, *modifiers) ⇒ Object
Clicks item and waits for the menu to close
296 297 298 299 300 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 296 def (, key, *modifiers) wait_start key_press_direct(key, *modifiers) () end |
#height ⇒ Object
Returns height of the menuitem.
182 183 184 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 182 def height element.getRect().height end |
#load_page_with_click ⇒ int
Clicks the button, and waits for loading to finish
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 248 def load_page_with_click if mac_internal? wait_start wait_start # Just wait for the load wait_for_window_loaded("") else wait_start click # Just wait for the load wait_for_window_loaded("") end end |
#menu ⇒ Object
Returns name of the menu this menuitem is part of.
52 53 54 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 52 def element.getMenu() end |
#name ⇒ Object
Returns the name of the menuitem. The name is either the action name of the action the item performs, or the name of the submenu the item opens. If the item is a separator, the name is “Separator”
40 41 42 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 40 def name element.getName(); end |
#open_menu_with_click(menu_name) ⇒ Object
Clicks the item, and waits for the menu with menu with name menu_name to be shown
314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 314 def () if mac_internal? wait_start else wait_start click () end end |
#open_menu_with_hover(menu_name) ⇒ Object
Hovers the menuitem and waits for the menu with menu_name to open
207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 207 def () if mac_internal? wait_start else wait_start element.hover () end end |
#open_window_with_click(win_name) ⇒ int Also known as: open_dialog_with_click
Clicks the button, and waits for the window with window name win_name to be shown
275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 275 def open_window_with_click(win_name) if mac_internal? wait_start wait_start wait_for_window_shown(win_name) else wait_start click wait_for_window_shown(win_name) end end |
#pos ⇒ Object
browser.quick_menu(:name, “Browser Tools Menu”).quick_menuitem(:pos, 2).name.should == “Separator”
138 139 140 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 138 def pos element.getRow() end |
#separator? ⇒ Boolean
Returns true if this menuitem is a separator, else false.
87 88 89 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 87 def separator? element.isSeparator() end |
#shortcut ⇒ Object
browser.quick_menuitem(:action, “Close page”).shortcut # Ctrl+W
127 128 129 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 127 def shortcut element.getShortcut() end |
#shortcutletter ⇒ Object
(Note: not used on mac, so not a platform dependant feature)
117 118 119 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 117 def shortcutletter element.getShortcutLetter() end |
#submenu ⇒ Object
(Note: an item will either have a submenu, or an action)
165 166 167 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 165 def element.getSubMenu() end |
#submenu_item? ⇒ Boolean
Returns true if this menuitem opens a submenu, otherwise false.
103 104 105 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 103 def element.hasSubMenu() end |
#text ⇒ Object
(Note: this should normally not be used to access the item, as it will
be language dependent)
63 64 65 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 63 def text element.getText() end |
#to_s ⇒ Object
235 236 237 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 235 def to_s "QUICKMENUITEM #{name}, pos #{pos}, menu #{menu}, rect: #{x}, #{y}, #{width}, #{height}, checked? #{checked?}, pos #{pos}, acckey #{shortcutletter}, #{shortcut unless shortcut.nil?}, separator #{separator?}" end |
#toggle_with_click ⇒ Object
Use to toggle a checkbox or radio item menuitem
222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 222 def toggle_with_click if mac_internal? wait_start else click # Cheat since we don't have an event yet sleep(0.1) end end |
#width ⇒ Object
Returns width of the menuitem.
174 175 176 |
# File 'lib/operawatir/quickwidgets/quick_menuitem.rb', line 174 def width element.getRect().width end |