Class: Lebowski::SCUI::Views::ContentEditableView

Inherits:
Foundation::Views::WebView show all
Defined in:
lib/lebowski/scui/views/content_editable.rb

Overview

Represents a proxy to a SCUI content editable view (SCUI.ContentEditableView)

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

Constants included from Foundation::Mixins::StallSupport

Foundation::Mixins::StallSupport::DEFAULT_KEY_STALLS, Foundation::Mixins::StallSupport::DEFAULT_STALL

Constants included from Foundation::Mixins::WaitActions

Foundation::Mixins::WaitActions::DEFAULT_TIMEOUT

Instance Attribute Summary

Attributes inherited from Foundation::ProxyObject

#driver, #name, #parent, #rel_path

Instance Method Summary collapse

Methods inherited from Foundation::Views::WebView

#frame_app_context_locator

Methods included from Foundation::Mixins::FrameApplicationContextSupport

#frame, #frame_app_context_locator

Methods inherited from Foundation::Views::View

#abs_path, #action_locator_args, #action_target, #assigned_layer_id?, #child_views, #core_query, #frame, #height, #layer, #layer_id, #position, #scroll_to_visible, #scrollable_parent_view, #width

Methods included from Foundation::Mixins::DelegateSupport

#get_delegate_property

Methods included from Foundation::Mixins::UserActions

#basic_click, #click, #click_at, #double_click, #drag, #drag_after, #drag_before, #drag_on_to, #drag_to, #drag_to_end_of, #drag_to_start_of, #focus, #key_down, #key_up, #mouse_down, #mouse_down_at, #mouse_move, #mouse_move_at, #mouse_up, #mouse_up_at, #mouse_wheel_delta_x, #mouse_wheel_delta_y, #right_click, #right_click_at, #right_mouse_down, #right_mouse_down_at, #right_mouse_up, #right_mouse_up_at, #type, #type_key

Methods included from Foundation::Mixins::StallSupport

adjust_all_stalls, adjust_default_key_stall, adjust_default_stall, reset, #stall

Methods included from Foundation::Mixins::KeyCheck

#key_down?, #key_up?

Methods included from Foundation::Mixins::PositionedElement

#height, #position, #position_relative_to, #scroll_to_visible, #width

Methods inherited from Foundation::SCObject

#has_represented_sc_class?, #kind_of_represented_sc_class?, represented_sc_class, #represented_sc_class, representing_sc_class

Methods inherited from Foundation::ProxyObject

#==, #[], #abs_path, #abs_path_with, #define, #define_proxy, #init_ext, #initialize, #method_missing, #none?, #object?, #proxy, #represent_as, #sc_all_classes, #sc_class, #sc_guid, #sc_kind_of?, #sc_path_defined?, #sc_type_of, #unravel_relative_path

Methods included from Foundation::Mixins::DefinePathsSupport

#define_path, #define_paths_for, #defined_path, #defined_paths, #path_defined?, #root_defined_path_part, #root_defined_path_part=

Methods included from Foundation::Mixins::WaitActions

#wait_until

Constructor Details

This class inherits a constructor from Lebowski::Foundation::ProxyObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Lebowski::Foundation::ProxyObject

Instance Method Details

#create_range(*params) ⇒ Object



40
41
42
# File 'lib/lebowski/scui/views/content_editable.rb', line 40

def create_range(*params)
  return ContentEditableViewSupport::Range.new frame, *params
end

#delete_all_contentObject



72
73
74
75
76
77
78
79
# File 'lib/lebowski/scui/views/content_editable.rb', line 72

def delete_all_content()
  body = find_element('body')
  nodes = body.child_nodes_count
  range = create_range
  range.set_start body, 0
  range.set_end body, nodes
  range.delete_content
end

#empty_selection?Boolean

Returns:

  • (Boolean)


17
18
19
20
# File 'lib/lebowski/scui/views/content_editable.rb', line 17

def empty_selection?()
  value = self['selection']
  return (value == '' or value.nil?)
end

#find_element(selector) ⇒ Object



34
35
36
37
38
# File 'lib/lebowski/scui/views/content_editable.rb', line 34

def find_element(selector)
  elems = ContentEditableViewSupport::DOMElementList.new self, selector
  return nil if elems.empty?
  return elems[0]
end

#find_elements(selector) ⇒ Object



30
31
32
# File 'lib/lebowski/scui/views/content_editable.rb', line 30

def find_elements(selector)
  return ContentEditableViewSupport::DOMElementList.new self, selector
end

Returns:

  • (Boolean)


26
27
28
# File 'lib/lebowski/scui/views/content_editable.rb', line 26

def hyperlink_selected?()
  return (not self['selectedHyperlink'].nil?) 
end

#image_selected?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/lebowski/scui/views/content_editable.rb', line 22

def image_selected?()
  return (not self['selectedImage'].nil?)
end

#insert_content_at_end(content) ⇒ Object



86
87
88
89
# File 'lib/lebowski/scui/views/content_editable.rb', line 86

def insert_content_at_end(content)
  range = set_cursor_to_end
  range.insert_content content
end

#insert_content_at_start(content) ⇒ Object



81
82
83
84
# File 'lib/lebowski/scui/views/content_editable.rb', line 81

def insert_content_at_start(content)
  range = set_cursor_to_start
  range.insert_content content
end

#select_allObject



44
45
46
47
# File 'lib/lebowski/scui/views/content_editable.rb', line 44

def select_all()
  body = find_element('body')
  body.select_content
end

#select_noneObject



49
50
51
# File 'lib/lebowski/scui/views/content_editable.rb', line 49

def select_none()
  set_cursor_to_end
end

#set_cursor_to_endObject



62
63
64
65
66
67
68
69
70
# File 'lib/lebowski/scui/views/content_editable.rb', line 62

def set_cursor_to_end()
  body = find_element('body')
  nodes = body.child_nodes_count
  range = create_range
  range.set_start body, nodes
  range.set_end body, nodes
  range.collapse
  return range
end

#set_cursor_to_startObject



53
54
55
56
57
58
59
60
# File 'lib/lebowski/scui/views/content_editable.rb', line 53

def set_cursor_to_start()
  body = find_element('body')
  range = create_range
  range.set_start body, 0
  range.set_end body, 0
  range.collapse
  return range
end