Sha256: 6bb34e62afab2ad33f7c061a467385c918cd3e81bfa0a1b00ce703f89a23837c
Contents?: true
Size: 1.41 KB
Versions: 14
Compression:
Stored size: 1.41 KB
Contents
RequireSupportFiles File.dirname(__FILE__) + "/../../../application/features/" module SwtTabHelpers def get_tab_folders(shell=active_shell) right_composite = shell.children.to_a.last notebook_sash_form = right_composite.children.to_a[0] tab_folders = notebook_sash_form.children.to_a.select do |c| c.class == Java::OrgEclipseSwtCustom::CTabFolder end end def get_tab_folder get_tab_folders.length.should == 1 get_tab_folders.first end def get_browser_contents live_document = "document.getElementsByTagName('html')[0].innerHTML" focussed_tab.html_view.controller.execute("return #{live_document};").join('') end def get_tab(tab_folder) item1 = tab_folder.getItems.to_a.first tab = Redcar.app.windows.first.notebooks.map{|n| n.tabs}.flatten.detect{|t| t.controller.item == item1} end def focussed_tab Redcar.app.focussed_window.focussed_notebook.focussed_tab end def get_tabs items = get_tab_folders.map{|f| f.getItems.to_a}.flatten items.map {|i| model_tab_for_item(i)} end def model_tab_for_item(item) model_tabs.detect {|t| t.controller.item == item} end def model_tabs Redcar.app.windows.first.notebooks.map{|n| n.tabs}.flatten end end World(SwtTabHelpers) def putsall p :all p Redcar.app.windows.first.notebooks p Redcar.app.windows.first.notebooks.first.tabs p Redcar.app.windows.first.notebooks.last.tabs end
Version data entries
14 entries across 14 versions & 1 rubygems