class Lebowski::Foundation::Views::View
Public Instance Methods
Lebowski::Foundation::ProxyObject#abs_path
# File lib/lebowski/foundation/views/view.rb, line 29 def abs_path() return rel_path if assigned_layer_id? return super end
@override Actions#action_locator_args
# File lib/lebowski/foundation/views/view.rb, line 35 def action_locator_args() return [abs_path] end
@override Actions#action_target
# File lib/lebowski/foundation/views/view.rb, line 40 def action_target() return :view end
# File lib/lebowski/foundation/views/view.rb, line 25 def assigned_layer_id?() return (not (rel_path =~ /^#/).nil?) end
# File lib/lebowski/foundation/views/view.rb, line 117 def child_views() if @child_views.nil? @child_views = ObjectArray.new self, 'childViews', 'length' end return @child_views end
Obtain a core query object from the view.
@param selector {String} a CSS selector that the core query object will use @return returns an instance of Lebowski::Foundation::CoreQuery
# File lib/lebowski/foundation/views/view.rb, line 112 def core_query(selector=nil) cq = Lebowski::Foundation::CoreQuery.new abs_path, selector, @driver return cq end
Gets the frame for this view.
@return {Lebowski::Rect}
# File lib/lebowski/foundation/views/view.rb, line 60 def frame() return @driver.get_sc_view_frame(abs_path) end
@override Lebowski::Foundation::Mixins::PositionedElement#height
# File lib/lebowski/foundation/views/view.rb, line 75 def height() return frame.height end
Gets the string representing of the view's layer. The layer in SproutCore is the root DOM element of the view. This method will return an HTML string representation of the entire layer that is equivalent to the following:
view.get('layer').outerHTML
# File lib/lebowski/foundation/views/view.rb, line 101 def layer() value = @driver.get_sc_view_layer(abs_path) return value end
Gets the remote layer ID for this view
@see SC.View.layerId
# File lib/lebowski/foundation/views/view.rb, line 49 def layer_id() # We only need to fetch the layer ID once since it never changes for a given instance @layer_id = @driver.get_sc_property_string_value(abs_path, "layerId") if @layer_id.nil? return @layer_id end
@override Lebowski::Foundation::Mixins::PositionedElement#position
# File lib/lebowski/foundation/views/view.rb, line 65 def position() return @driver.get_sc_element_window_position(action_target, *action_locator_args) end
@override Lebowski::Foundation::Mixins::PositionedElement#scroll_to_visible
# File lib/lebowski/foundation/views/view.rb, line 80 def scroll_to_visible() @driver.sc_view_scroll_to_visible(abs_path) end
Gets the parent view of this view that is scrollable. If this view has no parent that is scrollable then null is returned
# File lib/lebowski/foundation/views/view.rb, line 88 def scrollable_parent_view() layer_id = @driver.get_sc_scrollable_parent_view_layer_id(abs_path) app = Util::get_root_application_object(self) return app["##{layer_id}"] if (not layer_id.nil?) end
@override Lebowski::Foundation::Mixins::PositionedElement#width
# File lib/lebowski/foundation/views/view.rb, line 70 def width() return frame.width end