use of org.eclipse.ui.browser.IWorkbenchBrowserSupport in project erlide_eclipse by erlang.
the class OpenResultsJob method openInBrowser.
private void openInBrowser(final IFile file) {
if (file == null) {
return;
}
final IWorkbench wbench = PlatformUI.getWorkbench();
final IWorkbenchBrowserSupport browserSupport = wbench.getBrowserSupport();
try {
file.refreshLocal(IResource.DEPTH_ZERO, null);
} catch (final CoreException e1) {
}
if (file.exists() && file.isAccessible()) {
try {
final int style = IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.AS_EDITOR;
final String name = file.getName();
final String browserId = getName() + "_" + name;
IWebBrowser browser;
browser = browserSupport.createBrowser(style, browserId, name, null);
try {
browser.openURL(file.getRawLocationURI().toURL());
} catch (final MalformedURLException e) {
// should not happen
ErlLogger.error(e);
}
} catch (final PartInitException e) {
ErlLogger.error(e);
}
}
}
Aggregations