Eclipse 3.x compatible;
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / actions / PHPEclipseShowAction.java
index f12aa38..72fb11f 100644 (file)
@@ -37,10 +37,8 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.update.internal.ui.UpdatePerspective;
-import org.eclipse.update.internal.ui.views.IEmbeddedWebBrowser;
-//import org.eclipse.jdt.internal.ui.actions.OpenBrowserUtil;
-// import org.eclipse.help.ui.browser.LaunchURL;
+//import org.eclipse.update.internal.ui.UpdatePerspective;
+//import org.eclipse.update.internal.ui.views.IEmbeddedWebBrowser;
 
 public class PHPEclipseShowAction implements IObjectActionDelegate {
   private IWorkbenchPart workbenchPart;
@@ -85,9 +83,12 @@ public class PHPEclipseShowAction implements IObjectActionDelegate {
           case IResource.FILE :
             // single file:
             IFile file = (IFile) resource;
-          String localhostURL;
-            if ((localhostURL=getLocalhostURL(store, (IFile) resource)) == null) {
-              MessageDialog.openInformation(shell, "Couldn't create localhost URL", "Please configure your localhost and documentRoot");
+            String localhostURL;
+            if ((localhostURL = getLocalhostURL(store, (IFile) resource)) == null) {
+              MessageDialog.openInformation(
+                shell,
+                "Couldn't create localhost URL",
+                "Please configure your localhost and documentRoot");
               return;
             }
             try {
@@ -130,7 +131,7 @@ public class PHPEclipseShowAction implements IObjectActionDelegate {
       store = PHPeclipsePlugin.getDefault().getPreferenceStore();
     }
 
-   // IPath path = file.getFullPath();
+    // IPath path = file.getFullPath();
 
     String localhostURL = file.getLocation().toString();
     String lowerCaseFileName = localhostURL.toLowerCase();
@@ -144,30 +145,30 @@ public class PHPEclipseShowAction implements IObjectActionDelegate {
       return null;
     }
 
-    return store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + localhostURL; 
+    return store.getString(PHPeclipsePlugin.LOCALHOST_PREF) + localhostURL;
 
   }
 
   public static void open(final URL url, final Shell shell, final String dialogTitle) {
-    if (SWT.getPlatform().equals("win32")) {
-      IWorkbenchPage page = PHPeclipsePlugin.getActivePage();
-      try {
-        IViewPart part = page.findView(UpdatePerspective.ID_BROWSER);
-        if (part == null) {
-          part = page.showView(UpdatePerspective.ID_BROWSER);
-        } else
-          page.bringToTop(part);
-        ((IEmbeddedWebBrowser) part).openTo(url.toExternalForm());
-      } catch (PartInitException e) {
-        PHPeclipsePlugin.log(e);
-      }
+    //    if (SWT.getPlatform().equals("win32")) {
+    //      IWorkbenchPage page = PHPeclipsePlugin.getActivePage();
+    //      try {
+    //        IViewPart part = page.findView(UpdatePerspective.ID_BROWSER);
+    //        if (part == null) {
+    //          part = page.showView(UpdatePerspective.ID_BROWSER);
+    //        } else
+    //          page.bringToTop(part);
+    //        ((IEmbeddedWebBrowser) part).openTo(url.toExternalForm());
+    //      } catch (PartInitException e) {
+    //        PHPeclipsePlugin.log(e);
+    //      }
+    //    } else {
+    IHelp help = WorkbenchHelp.getHelpSupport();
+    if (help != null) {
+      WorkbenchHelp.getHelpSupport().displayHelpResource(url.toExternalForm());
     } else {
-      IHelp help = WorkbenchHelp.getHelpSupport();
-      if (help != null) {
-        WorkbenchHelp.getHelpSupport().displayHelpResource(url.toExternalForm());
-      } else {
-        //   showMessage(shell, dialogTitle, ActionMessages.getString("OpenBrowserUtil.help_not_available"), false); //$NON-NLS-1$
-      }
+      //   showMessage(shell, dialogTitle, ActionMessages.getString("OpenBrowserUtil.help_not_available"), false); //$NON-NLS-1$
     }
   }
+  //  }
 }