Open preview on editor open
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / PHPeclipsePlugin.java
index 555e20f..e4dba1d 100644 (file)
@@ -40,6 +40,7 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.update.internal.ui.UpdateUIPlugin;
 
 /**
  * The main plugin class to be used in the desktop.
@@ -192,9 +193,15 @@ public class PHPeclipsePlugin
   }
 
   public static IWorkbenchPage getActivePage() {
-    return PHPeclipsePlugin.getActivePage();
+       return getDefault().internalGetActivePage();
   }
 
+  private IWorkbenchPage internalGetActivePage() {
+         IWorkbenchWindow window = getWorkbench().getActiveWorkbenchWindow();
+         if (window!=null) return window.getActivePage();
+         return null;
+  }
+  
   public static IWorkbenchWindow getActiveWorkbenchWindow() {
     return getDefault().getWorkbench().getActiveWorkbenchWindow();
   }
@@ -275,6 +282,7 @@ public class PHPeclipsePlugin
     // windows preferences:
     store.setDefault(LOCALHOST_PREF, "http://localhost");
 
+    store.setDefault(SHOW_EXTERNAL_PREVIEW_PREF, "true");
     store.setDefault(USE_EXTERNAL_BROWSER_PREF, "false");
     store.setDefault(SHOW_OUTPUT_IN_CONSOLE, "true");