Revision 625 tmp/org.txm.groovy.core/src/groovy/org/txm/macro/debug/BrowserVersionMacro.groovy

BrowserVersionMacro.groovy (revision 625)
6 6
import org.eclipse.ui.browser.*
7 7
import org.eclipse.ui.internal.browser.*
8 8
import org.eclipse.ui.internal.browser.browsers.MozillaBrowser.*
9
import org.txm.rcpapplication.commands.*
9 10

  
10

  
11 11
b = PlatformUI.getWorkbench().getBrowserSupport().createBrowser(IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.STATUS, 'iname', 'name', 'longName')
12 12

  
13 13
println b.getClass()
14

  
15
monitor.syncExec(new Runnable() {
16
			public void run() {
17

  
18
				def editor = OpenBrowser.openfile("file:hello", "Hello");
19

  
20
				def script = """
21
return ""+navigator.appName+" "+navigator.appVersion
22
"""
23
				println editor.webBrowser.getBrowser().evaluate(script);
24
				
25
				editor.close()
26
			}});

Also available in: Unified diff