class Lebowski::SCUI::ComboBoxList
Public Instance Methods
any?(item)
click to toggle source
# File lib/lebowski/scui/views/combo_box.rb, line 69 def any?(item) type(item) return item_views.any?({value_key => /#{item}/i}) end
Also aliased as: some?
count?(expected_count, item)
click to toggle source
# File lib/lebowski/scui/views/combo_box.rb, line 64 def count?(expected_count, item) type(item) return (item_views.count == expected_count) end
none?(item)
click to toggle source
# File lib/lebowski/scui/views/combo_box.rb, line 81 def none?(item) type(item) item_views.none?({value_key => /#{item}/i}) end
one?(item)
click to toggle source
# File lib/lebowski/scui/views/combo_box.rb, line 76 def one?(item) type(item) return item_views.one?({value_key => /#{item}/i}) end
select_item(item)
click to toggle source
# File lib/lebowski/scui/views/combo_box.rb, line 86 def select_item(item) @parent.display_list if item.kind_of? Integer select_item_by_index(item) elsif item.kind_of? String select_item_by_name(item) else raise ArgumentError.new "The argument must be either an integer or a string." end @parent.hide_list end
Private Instance Methods
select_item_by_index(index)
click to toggle source
# File lib/lebowski/scui/views/combo_box.rb, line 104 def select_item_by_index(index) raise ArgumentError.new "Index out of range. The item number must be greater than or equal to zero." if (index < 0) raise ArgumentError.new "Index out of range. There are fewer than #{index.to_s} items in the list." if (index >= item_views.count) item_views[index].select end
select_item_by_name(name)
click to toggle source
# File lib/lebowski/scui/views/combo_box.rb, line 110 def select_item_by_name(name) if any?(name) item_views.find_first({value_key => /#{name}/i}).select end end
type(text)
click to toggle source
# File lib/lebowski/scui/views/combo_box.rb, line 116 def type(text) @parent.child_views[0].type_keys(text) end
value_key()
click to toggle source
# File lib/lebowski/scui/views/combo_box.rb, line 99 def value_key @value_key = self['contentValueKey'] if @value_key.nil? return @value_key end