class Lebowski::Foundation::Application

Represents a SproutCore Application. This is a base class that is derived by other classes. The class provides the common data and behavior that all other classes representing an application must have.

Attributes

app_context_manager[R]
parent_app[R]

Public Class Methods

new(params) click to toggle source
Calls superclass method Lebowski::Foundation::ProxyObject::new
# File lib/lebowski/foundation/application.rb, line 24
def initialize(params)
  super()
  
  if params.nil?
    raise ArgumentError.new "must supply parameters to create application instance"
  end
  
  if not params.kind_of?(Hash)
    raise ArgumentError.new "must supply a hash containing parameters"
  end
  
  if not params[:parent_app].nil?
    @parent_app = params[:parent_app]
    @app_context_manager = @parent_app.app_context_manager
    @driver = @parent_app.driver
  end
end

Public Instance Methods

abs_path() click to toggle source
# File lib/lebowski/foundation/application.rb, line 42
def abs_path()
  return nil
end
acquire_application_context(app_name) click to toggle source
# File lib/lebowski/foundation/application.rb, line 81
def acquire_application_context(app_name)
  if app_name.nil?
    raise ArugmentError.new "app_name can not be nil"
  end
  app_context_manager.switch_application_context_to self, app_name
end
bundle_loaded?(bundle) click to toggle source
# File lib/lebowski/foundation/application.rb, line 71
def bundle_loaded?(bundle) 
  return @driver.is_sc_bundle_loaded(bundle)
end
define_framework(key, name, expected_type=nil)
Alias for: define_root_object
define_root_object(key, name, expected_type=nil) click to toggle source
# File lib/lebowski/foundation/application.rb, line 75
def define_root_object(key, name, expected_type=nil)
  return define_path(key, '$' + name, expected_type)
end
Also aliased as: define_framework
do_aquire_application_context() click to toggle source
# File lib/lebowski/foundation/application.rb, line 88
def do_aquire_application_context()
  # no-op
end
exec_driver_in_context(&block) click to toggle source
# File lib/lebowski/foundation/application.rb, line 103
def exec_driver_in_context(&block)
  app_context_manager.exec_driver_in_context self, &block
end
exec_in_context(app_name, &block) click to toggle source
# File lib/lebowski/foundation/application.rb, line 96
def exec_in_context(app_name, &block)
  if app_name.nil?
    raise ArgumentError.new "app_name can not be nil"
  end
  app_context_manager.exec_in_context self, app_name, &block
end
framework(name, expected_type=nil)
Alias for: root_object
has_current_application_context?() click to toggle source
# File lib/lebowski/foundation/application.rb, line 92
def has_current_application_context?()
  return app_context_manager.has_current_application_context?(self)
end
key_pane(expected_type=nil) click to toggle source
# File lib/lebowski/foundation/application.rb, line 56
def key_pane(expected_type=nil)
  return self['$SC.RootResponder.responder.keyPane', expected_type]
end
main_pane(expected_type=nil) click to toggle source
# File lib/lebowski/foundation/application.rb, line 52
def main_pane(expected_type=nil)
  return self['$SC.RootResponder.responder.mainPane', expected_type]
end
menu_pane(expected_type=nil) click to toggle source
responding_panes() click to toggle source
# File lib/lebowski/foundation/application.rb, line 64
def responding_panes()
  if @responding_panes.nil?
    @responding_panes = ObjectArray.new self, '$SC.RootResponder.responder.panes'
  end
  return @responding_panes
end
root_object(name, expected_type=nil) click to toggle source
# File lib/lebowski/foundation/application.rb, line 46
def root_object(name, expected_type=nil)
  return self['$' + name, expected_type]
end
Also aliased as: framework