Statistics
| Revision:

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

History | View | Annotate | Download (907 Bytes)

1
// Copyright © 2016 ENS de Lyon, CNRS, University of Franche-Comté
2
// Licensed under the terms of the GNU General Public License (http://www.gnu.org/licenses)
3
// @author sheiden
4

    
5
import org.eclipse.ui.*
6
import org.eclipse.ui.browser.*
7
import org.eclipse.ui.internal.browser.*
8
import org.eclipse.ui.internal.browser.browsers.MozillaBrowser.*
9
import org.txm.rcpapplication.commands.*
10

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

    
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
                        }});