Class: Lebowski::Foundation::Views::Support::ListItemViewCheckbox

Inherits:
Object
  • Object
show all
Includes:
Lebowski::Foundation
Defined in:
lib/lebowski/foundation/views/list_item.rb

Constant Summary

Constants included from Lebowski::Foundation

SC_BRANCH_CLOSED, SC_BRANCH_OPEN, SC_BUTTON1_STATUS, SC_BUTTON2_STATUS, SC_BUTTON3_STATUS, SC_LEAF_NODE, SC_MIXED_STATE, SC_PICKER_FIXED, SC_PICKER_MENU, SC_PICKER_POINTER, SC_T_ARRAY, SC_T_BOOL, SC_T_CLASS, SC_T_ERROR, SC_T_FUNCTION, SC_T_HASH, SC_T_NULL, SC_T_NUMBER, SC_T_OBJECT, SC_T_STRING, SC_T_UNDEFINED

Instance Method Summary collapse

Constructor Details

#initialize(parent, selector) ⇒ ListItemViewCheckbox

Returns a new instance of ListItemViewCheckbox.



179
180
181
182
# File 'lib/lebowski/foundation/views/list_item.rb', line 179

def initialize(parent, selector)
  @parent = parent
  @selector = selector
end

Instance Method Details

#deselectObject



211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/lebowski/foundation/views/list_item.rb', line 211

def deselect()
  val = value
  return if val.nil?
  cq = @parent.core_query(@selector)
  if val == true
    @parent.scroll_to_visible
    cq[0].click
  elsif value == SC_MIXED_STATE
    @parent.scroll_to_visible
    cq[0].click
    cq[0].click
  end
  cq.done
end

#in_mixed_state?Boolean

Returns:

  • (Boolean)


196
197
198
# File 'lib/lebowski/foundation/views/list_item.rb', line 196

def in_mixed_state?()
  return (value == SC_MIXED_STATE)
end

#selectObject



200
201
202
203
204
205
206
207
208
209
# File 'lib/lebowski/foundation/views/list_item.rb', line 200

def select()
  val = value
  return if val.nil?
  if val != true
    @parent.scroll_to_visible
    cq = @parent.core_query(@selector)
    cq[0].click
    cq.done
  end
end

#selected?Boolean

Returns:

  • (Boolean)


191
192
193
194
# File 'lib/lebowski/foundation/views/list_item.rb', line 191

def selected?()
  val = value
  return (val == true or val == SC_MIXED_STATE)
end

#valueObject



184
185
186
187
188
189
# File 'lib/lebowski/foundation/views/list_item.rb', line 184

def value()
  key = @parent.content_checkbox_key
  return nil if key.nil?
  val = @parent["content.#{key}"]
  return val
end