Workaround for feature request #1154254 (sticky browser URL) that solves bug #1827766...
[phpeclipse.git] / net.sourceforge.phpeclipse.ui / src / net / sourceforge / phpeclipse / ui / editor / BrowserUtil.java
index 0282fd9..9634f2f 100644 (file)
@@ -157,8 +157,17 @@ public class BrowserUtil {
                                        }
                                        if (view != null) {
                                                IShowInTarget target = getShowInTarget(view);
-                                               if (target != null && target.show(context)) {
-                                                       // success
+                                               boolean stickyBrowserURL = ProjectPrefUtil.getPreviewBooleanValue(
+                                                               previewFile,
+                                                               IPreferenceConstants.PHP_STICKY_BROWSER_URL_DEFAULT);
+                                               if (target != null) {
+                                                       if (stickyBrowserURL
+                                                                       && ((BrowserView) target).getUrl() != null
+                                                                       && ((BrowserView) target).getUrl().length() > 0) {
+                                                               ((BrowserView) target).refresh();
+                                                       } else {
+                                                               target.show(context);
+                                                       }
                                                }
                                                ((WorkbenchPage) page)
                                                                .performedShowIn(BrowserView.ID_BROWSER);