class Lebowski::SCUI::Views::ContentEditableView
Represents a proxy to a SCUI
content editable view (SCUI
.ContentEditableView)
Public Instance Methods
create_range(*params)
click to toggle source
# File lib/lebowski/scui/views/content_editable.rb, line 40 def create_range(*params) return ContentEditableViewSupport::Range.new frame, *params end
delete_all_content()
click to toggle source
# 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?()
click to toggle source
# 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)
click to toggle source
# 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)
click to toggle source
# File lib/lebowski/scui/views/content_editable.rb, line 30 def find_elements(selector) return ContentEditableViewSupport::DOMElementList.new self, selector end
hyperlink_selected?()
click to toggle source
# File lib/lebowski/scui/views/content_editable.rb, line 26 def hyperlink_selected?() return (not self['selectedHyperlink'].nil?) end
image_selected?()
click to toggle source
# File lib/lebowski/scui/views/content_editable.rb, line 22 def image_selected?() return (not self['selectedImage'].nil?) end
insert_content_at_end(content)
click to toggle source
# 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)
click to toggle source
# 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_all()
click to toggle source
# File lib/lebowski/scui/views/content_editable.rb, line 44 def select_all() body = find_element('body') body.select_content end
select_none()
click to toggle source
# File lib/lebowski/scui/views/content_editable.rb, line 49 def select_none() set_cursor_to_end end
set_cursor_to_end()
click to toggle source
# 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_start()
click to toggle source
# 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