SQL Plugin copied from Quantum plugin and refactored for PHPEclipse
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / actions / PHPEclipseShowAction.java
index f375331..13efe64 100644 (file)
@@ -18,6 +18,7 @@ import java.text.MessageFormat;
 import java.util.Iterator;
 
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import net.sourceforge.phpeclipse.views.PHPConsole;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IPath;
@@ -28,7 +29,6 @@ import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.program.Program;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;
@@ -67,6 +67,7 @@ public class PHPEclipseShowAction implements IObjectActionDelegate {
 
     StructuredSelection selection = null;
     selection = (StructuredSelection) selectionProvider.getSelection();
+    PHPConsole console = PHPConsole.getInstance();
 
     IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
 
@@ -111,13 +112,16 @@ public class PHPEclipseShowAction implements IObjectActionDelegate {
                 MessageFormat form = new MessageFormat(store.getString(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF));
 
                 Runtime runtime = Runtime.getRuntime();
-                runtime.exec(form.format(arguments));
+                String command = form.format(arguments);
+                console.write("External Browser command: "+command+"\n");
+                runtime.exec(command);
                 //                     runtime.exec(store.getString(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF) + " " + fileName);
                 //                                                             runtime.exec("command.com /c start iexplore " + fileName);
               } else {
             //    MessageDialog.openInformation(shell, "localhostURL", "localhostURL: " + localhostURL);
             //  this doesn't work under win98 ?
             //     Program.launch(localhostURL);
+                console.write("Internal Browser URL: "+localhostURL+"\n");
                 open(new URL(localhostURL), shell, localhostURL);
               }
             } catch (MalformedURLException e) {