Class: Lebowski::Foundation::Views::Support::ListItemViewDisclosure

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

Constant Summary

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

- (ListItemViewDisclosure) initialize(parent, selector)

A new instance of ListItemViewDisclosure



231
232
233
234
# File 'lib/lebowski/foundation/views/list_item.rb', line 231

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

Instance Method Details

- (Boolean) is_toggled_off? Also known as: is_collapsed?

Returns:

  • (Boolean)


244
245
246
# File 'lib/lebowski/foundation/views/list_item.rb', line 244

def is_toggled_off?()
  return (@parent['disclosureState'] == SC_BRANCH_CLOSED)
end

- (Boolean) is_toggled_on? Also known as: is_expanded?

Returns:

  • (Boolean)


240
241
242
# File 'lib/lebowski/foundation/views/list_item.rb', line 240

def is_toggled_on?()
  return (@parent['disclosureState'] == SC_BRANCH_OPEN)
end

- (Object) toggle_off Also known as: collapse



257
258
259
260
261
262
263
264
# File 'lib/lebowski/foundation/views/list_item.rb', line 257

def toggle_off()
  if is_toggled_on?
    @parent.scroll_to_visible
    cq = @parent.core_query(@selector)
    cq[0].click
    cq.done
  end
end

- (Object) toggle_on Also known as: expand



248
249
250
251
252
253
254
255
# File 'lib/lebowski/foundation/views/list_item.rb', line 248

def toggle_on()
  if is_toggled_off?
    @parent.scroll_to_visible
    cq = @parent.core_query(@selector)
    cq[0].click
    cq.done
  end
end

- (Object) value



236
237
238
# File 'lib/lebowski/foundation/views/list_item.rb', line 236

def value()
  return @parent['disclosureState']
end