return contentAnalyzer.findContentType(file);
}
private void openWebBrowser(IWorkbenchWindow window, String url, String title) {
IWorkbenchBrowserSupport browserSupport = window.getWorkbench().getBrowserSupport();
IWebBrowser browser;
URL targetURL = null;
try {
targetURL = new URL(url);
} catch (MalformedURLException e) {
String pluginID = EclipastiePlugin.PLUGINNAME;
IStatus status = new Status(IStatus.ERROR, pluginID, String.format(Messages.Message_ErrorReported, e.getLocalizedMessage()));
ErrorDialog.openError(window.getShell(),
String.format(Messages.Message_Error, EclipastiePlugin.PLUGINNAME),
String.format(Messages.Message_ErrorWhileOpeningInBrowser, url),
status);
return;
}
try {
browser = browserSupport.createBrowser(
IWorkbenchBrowserSupport.AS_EDITOR
| IWorkbenchBrowserSupport.LOCATION_BAR
| IWorkbenchBrowserSupport.NAVIGATION_BAR,
null,
title,
String.format(Messages.Message_Result, EclipastiePlugin.PLUGINNAME)
);
browser.openURL(targetURL);
} catch (PartInitException e) {
e.printStackTrace();
String pluginID = EclipastiePlugin.PLUGINNAME;
IStatus status = new Status(IStatus.ERROR, pluginID, String.format(Messages.Message_ErrorReported, e.getLocalizedMessage()));
ErrorDialog.openError(window.getShell(),