1) Fixed issue #858: OpenPHPPerspectiveAction error when creating a new PHP project.
authorrobekras <robert.kraske@weihenstephan.org>
Fri, 31 May 2013 11:21:03 +0000 (13:21 +0200)
committerrobekras <robert.kraske@weihenstephan.org>
Fri, 31 May 2013 11:23:05 +0000 (13:23 +0200)
Signed-off-by: robekras <robert.kraske@weihenstephan.org>

net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/ui/actions/OpenPHPPerspectiveAction.java

index 1583139..266ba85 100644 (file)
@@ -1,10 +1,10 @@
 /*******************************************************************************
  * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials 
+ * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Common Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/cpl-v10.html
- * 
+ *
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
@@ -25,11 +25,11 @@ import org.eclipse.ui.WorkbenchException;
 
 /**
  * Action to programmatically open a Java perspective.
- * 
+ *
  * <p>
  * This class may be instantiated; it is not intended to be subclassed.
  * </p>
- * 
+ *
  * @since 2.0
  */
 public class OpenPHPPerspectiveAction extends Action {
@@ -43,26 +43,23 @@ public class OpenPHPPerspectiveAction extends Action {
        }
 
        public void run() {
-               IWorkbench workbench = PHPeclipsePlugin.getDefault().getWorkbench();
-               IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
-               IWorkbenchPage page = window.getActivePage();
-               IAdaptable input;
-               if (page != null)
+               IWorkbench                      workbench       = PHPeclipsePlugin.getDefault().getWorkbench();
+               IWorkbenchWindow        window          = workbench.getActiveWorkbenchWindow();
+               IWorkbenchPage          page            = window.getActivePage();
+               IAdaptable                      input;
+
+               if (page != null) {
                        input = page.getInput();
-               else
+               }
+               else {
                        input = ResourcesPlugin.getWorkspace().getRoot();
+               }
                try {
-                       workbench.showPerspective(JavaUI.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$
                }
        }
 }