} else
performSave(false, progressMonitor);
}
-// IAction a = ShowExternalPreviewAction.getInstance();
-// if (a != null) {
-// a.run();
-// }
+ ShowExternalPreviewAction a = ShowExternalPreviewAction.getInstance();
+ if (a != null) {
+ a.refresh();
+ }
}
public boolean isSaveAsAllowed() {
}
}
((BrowserView) part).setUrl(localhostURL);
+
+ } catch (PartInitException e) {
+ PHPeclipsePlugin.log(e);
+ }
+ }
+ }
+ public void refresh() {
+ IFile fileToParse = getFile();
+ if (fileToParse == null) {
+ // should never happen
+ return;
+ }
+ boolean autoPreview = Util.getPreviewBooleanValue(fileToParse,
+ IPreferenceConstants.PHP_AUTO_PREVIEW_DEFAULT);
+ boolean bringToTopPreview = Util.getPreviewBooleanValue(fileToParse,
+ IPreferenceConstants.PHP_BRING_TO_TOP_PREVIEW_DEFAULT);
+ if (autoPreview) {
+ IWorkbenchPage page = PHPeclipsePlugin.getActivePage();
+ try {
+ IViewPart part = page.findView(BrowserView.ID_BROWSER);
+ if (part == null) {
+ part = page.showView(BrowserView.ID_BROWSER);
+ } else {
+ if (bringToTopPreview) {
+ page.bringToTop(part);
+ }
+ }
+ ((BrowserView) part).refresh();
+
} catch (PartInitException e) {
PHPeclipsePlugin.log(e);
}