Workaround for feature request #1154254 (sticky browser URL) that solves bug #1827766...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / ui / actions / OpenPHPPerspectiveAction.java
index 3da1363..1fc57ae 100644 (file)
@@ -12,7 +12,6 @@ package net.sourceforge.phpdt.ui.actions;
 
 import net.sourceforge.phpdt.internal.ui.actions.ActionMessages;
 import net.sourceforge.phpdt.internal.ui.util.ExceptionHandler;
-import net.sourceforge.phpdt.ui.JavaUI;
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
 
 import org.eclipse.core.resources.ResourcesPlugin;
@@ -38,24 +37,31 @@ public class OpenPHPPerspectiveAction extends Action {
         * Create a new <code>OpenPHPPerspectiveAction</code>.
         */
        public OpenPHPPerspectiveAction() {
-//             WorkbenchHelp.setHelp(this, IJavaHelpContextIds.OPEN_JAVA_PERSPECTIVE_ACTION);
+               // WorkbenchHelp.setHelp(this,
+               // IJavaHelpContextIds.OPEN_JAVA_PERSPECTIVE_ACTION);
        }
 
        public void run() {
-               IWorkbench workbench= PHPeclipsePlugin.getDefault().getWorkbench();
-               IWorkbenchWindow window= workbench.getActiveWorkbenchWindow();
-               IWorkbenchPage page= window.getActivePage();
+               IWorkbench workbench = PHPeclipsePlugin.getDefault().getWorkbench();
+               IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+               IWorkbenchPage page = window.getActivePage();
                IAdaptable input;
                if (page != null)
-                       input= page.getInput();
+                       input = page.getInput();
                else
-                       input= ResourcesPlugin.getWorkspace().getRoot();
+                       input = ResourcesPlugin.getWorkspace().getRoot();
                try {
-                       workbench.showPerspective(PHPeclipsePlugin.ID_PERSPECTIVE, window, input);
+                       workbench.showPerspective(PHPeclipsePlugin.ID_PERSPECTIVE, window,
+                                       input);
                } catch (WorkbenchException e) {
-                       ExceptionHandler.handle(e, window.getShell(), 
-                               ActionMessages.getString("OpenPHPPerspectiveAction.dialog.title"), //$NON-NLS-1$
-                               ActionMessages.getString("OpenPHPPerspectiveAction.error.open_failed")); //$NON-NLS-1$
+                       ExceptionHandler
+                                       .handle(
+                                                       e,
+                                                       window.getShell(),
+                                                       ActionMessages
+                                                                       .getString("OpenPHPPerspectiveAction.dialog.title"), //$NON-NLS-1$
+                                                       ActionMessages
+                                                                       .getString("OpenPHPPerspectiveAction.error.open_failed")); //$NON-NLS-1$
                }
        }
 }