From e1d4d035efbb27deacfb816c6b8e552c1c28dfdb Mon Sep 17 00:00:00 2001 From: robekras Date: Sun, 3 Feb 2013 14:16:34 +0100 Subject: [PATCH] 1) Fixed the 'Save Failed' issue by uncommenting the incriminating code from showPreview. I don't know what this code is good for, but the fact is, that the current implementation causes an error. Signed-off-by: robekras --- .../phpeclipse/ui/editor/BrowserUtil.java | 25 +++++++++---------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/editor/BrowserUtil.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/editor/BrowserUtil.java index fa3be6f..f905c83 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/editor/BrowserUtil.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/editor/BrowserUtil.java @@ -127,34 +127,34 @@ public class BrowserUtil { // return; // } // localhostURL += postFix; - ShowInContext context = getShowInContext(previewFile, - forceDBGPreview, postFix); + ShowInContext context = getShowInContext (previewFile, forceDBGPreview, postFix); IWorkbenchPart sourcePart = page.getActivePart(); + if (sourcePart == null && context != null) { return; } // try { - Perspective persp = ((WorkbenchPage) page) - .getActivePerspective(); +/* Don't know what this is for, but I removed it by now because of some compile errors! + Perspective persp = ((WorkbenchPage) page).getActivePerspective(); if (persp != null) { - // If this view is already visible just return. - IViewReference ref = persp.findView(BrowserView.ID_BROWSER, - null); + IViewReference ref = persp.findView (BrowserView.ID_BROWSER, null); IViewPart view = null; + if (ref != null) { view = ref.getView(true); } + if (view == null && forceDBGPreview) { try { - view = persp.showView(BrowserView.ID_BROWSER, null); - persp.bringToTop(persp.findView( - BrowserView.ID_BROWSER, null)); + view = persp.showView (BrowserView.ID_BROWSER, null); + persp.bringToTop (persp.findView (BrowserView.ID_BROWSER, null)); } catch (PartInitException e) { WebUI.log(e); } } + if (view != null) { IShowInTarget target = getShowInTarget(view); boolean stickyBrowserURL = ProjectPrefUtil.getPreviewBooleanValue( @@ -169,11 +169,10 @@ public class BrowserUtil { target.show(context); } } - ((WorkbenchPage) page) - .performedShowIn(BrowserView.ID_BROWSER); + ((WorkbenchPage) page).performedShowIn (BrowserView.ID_BROWSER); } } - +*/ // IViewPart view = page.showView(BrowserView.ID_BROWSER); // IShowInTarget target = getShowInTarget(view); // if (target != null && target.show(new -- 1.7.1