Class: Lebowski::SCUI::Mixins::NodeItemViewSupport::Support::TerminalViewArray

Inherits:
Foundation::ObjectArray show all
Defined in:
lib/lebowski/scui/mixins/node_item_view_support.rb

Constant Summary

Constants included from Foundation

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

Instance Method Summary collapse

Methods inherited from Foundation::ObjectArray

#[], #all?, #any?, #count, #each, #empty?, #filter, #find_all, #find_first, #find_indexes, #find_last, #first, #index_of, #last, #member?, #none?, #one?, #prefilter

Constructor Details

#initialize(parent, *params) ⇒ TerminalViewArray

Returns a new instance of TerminalViewArray.



118
119
120
121
122
123
124
# File 'lib/lebowski/scui/mixins/node_item_view_support.rb', line 118

def initialize(parent, *params)
  if params.empty?
    super(parent, 'childViews', 'length', { :prefilter => { :isTerminal => true } })
  else
    super(parent, 'childViews', 'length', *params)
  end
end

Instance Method Details

#create_filtered_object_array(parent, array_rel_path, array_length_property_name, prefilter) ⇒ Object



140
141
142
143
# File 'lib/lebowski/scui/mixins/node_item_view_support.rb', line 140

def create_filtered_object_array(parent, array_rel_path, array_length_property_name, prefilter)
  klass = self.class
  return klass.new parent, prefilter
end

#create_object(index, expected_type = nil) ⇒ Object



126
127
128
129
130
131
132
# File 'lib/lebowski/scui/mixins/node_item_view_support.rb', line 126

def create_object(index, expected_type=nil)
  rel_path = "#{@array_rel_path}.#{index}"
  obj = @parent[rel_path, expected_type]

  mix_in_support_for_object obj
  return obj
end

#mix_in_support_for_object(obj) ⇒ Object



134
135
136
137
138
# File 'lib/lebowski/scui/mixins/node_item_view_support.rb', line 134

def mix_in_support_for_object(obj)
  if not obj.class.ancestors.member? Lebowski::SCUI::Mixins::TerminalViewSupport
    obj.extend Lebowski::SCUI::Mixins::TerminalViewSupport
  end
end