Created
April 20, 2015 13:36
-
-
Save fbricon/59581e03c8f534d80e55 to your computer and use it in GitHub Desktop.
swt browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| browser.registerBrowserFunction("openInIDE", new IBrowserFunction() { | |
| @Override | |
| public Object function(Object[] browserArgs) { | |
| String function = browserArgs[0].toString(); | |
| String arg = browserArgs[1].toString(); | |
| switch (function) { | |
| case "quickstart": | |
| openQuickstart(parent.getShell(), arg); | |
| break; | |
| case "wizard": | |
| openProxyWizard(parent.getShell(), arg); | |
| break; | |
| case "openlink": | |
| JBossCentralActivator.openUrl(arg, parent.getShell()); | |
| break; | |
| case "openpage": | |
| getEditor().setActivePage(arg); | |
| default: | |
| break; | |
| } | |
| return null; | |
| } | |
| }); | |
| browser.registerBrowserFunction("initialize", new IBrowserFunction() { | |
| @Override | |
| public Object function(Object[] browserArgs) { | |
| String script; | |
| script = "loadBuzz(" + JsonUtil.jsonifyBuzz(RefreshBuzzJob.INSTANCE.getEntries()) + ");"; | |
| browser.execute(script); | |
| final Collection<ProxyWizard> proxyWizards = displayedWizardsMap.values(); | |
| String wizardsJson = JsonUtil.jsonifyWizards(proxyWizards); | |
| script = "loadWizards(" + wizardsJson + ");"; | |
| System.err.println(wizardsJson); | |
| browser.execute(script); | |
| String quickstartJson = JsonUtil.jsonifyExamples(examples.values()); | |
| System.err.println(quickstartJson); | |
| script = "loadQuickstarts(" + quickstartJson + ");"; | |
| browser.execute(script); | |
| return null; | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment