Fix for bug #1839622 RSE Path error. You can now create a PHP Project and use RSE...
[phpeclipse.git] / net.sourceforge.phpeclipse.externaltools / src / net / sourceforge / phpdt / externaltools / actions / PHPStartApacheAction.java
index ebe3de7..28e2ed8 100644 (file)
@@ -20,57 +20,66 @@ import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
 
 public class PHPStartApacheAction implements IWorkbenchWindowActionDelegate {
-  protected IWorkbenchWindow activeWindow = null;
+       protected IWorkbenchWindow activeWindow = null;
 
-  public void run(IAction action) {
-       final IPreferenceStore webUIStore = WebUI.getDefault().getPreferenceStore();
+       public void run(IAction action) {
+               final IPreferenceStore webUIStore = WebUI.getDefault()
+                               .getPreferenceStore();
 
-       String documentRoot = webUIStore.getString(WebUI.PHP_DOCUMENTROOT_PREF);
-    final IPreferenceStore store = ExternalToolsPlugin.getDefault().getPreferenceStore();
+               String documentRoot = webUIStore.getString(WebUI.PHP_DOCUMENTROOT_PREF);
+               final IPreferenceStore store = ExternalToolsPlugin.getDefault()
+                               .getPreferenceStore();
 
-    // replace backslash with slash in the DocumentRoot under Windows
-    documentRoot = documentRoot.replace('\\', '/');
-    String[] arguments = { documentRoot };
-    MessageFormat form = new MessageFormat(store.getString(ExternalToolsPlugin.APACHE_START_PREF));
-    execute("apache_start", store.getString(ExternalToolsPlugin.APACHE_RUN_PREF), form.format(arguments), store
-        .getBoolean(ExternalToolsPlugin.APACHE_START_BACKGROUND));
-  }
+               // replace backslash with slash in the DocumentRoot under Windows
+               documentRoot = documentRoot.replace('\\', '/');
+               String[] arguments = { documentRoot };
+               MessageFormat form = new MessageFormat(store
+                               .getString(ExternalToolsPlugin.APACHE_START_PREF));
+               execute("apache_start", store
+                               .getString(ExternalToolsPlugin.APACHE_RUN_PREF), form
+                               .format(arguments), store
+                               .getBoolean(ExternalToolsPlugin.APACHE_START_BACKGROUND));
+       }
 
-  /**
-   * Executes an external progam and saves the LaunchConfiguration under external tools
-   *
-   * @param command
-   *          external tools command name
-   * @param executable
-   *          executable path i.e.c:\apache\apache.exe
-   * @param arguments
-   *          arguments for this configuration
-   * @param background
-   *          run this configuration in background mode
-   */
-  public static void execute(String command, String executable, String arguments, boolean background) {
-//    PHPConsole console = new PHPConsole();
-//    String consoleMessage;
-//    if (background) {
-//      consoleMessage = "run in background mode-" + command + ": " + executable + " " + arguments;
-//    } else {
-//      consoleMessage = "run in foreground mode-" + command + ": " + executable + " " + arguments;
-//    }
-//    console.println(consoleMessage);
+       /**
+        * Executes an external progam and saves the LaunchConfiguration under
+        * external tools
+        * 
+        * @param command
+        *            external tools command name
+        * @param executable
+        *            executable path i.e.c:\apache\apache.exe
+        * @param arguments
+        *            arguments for this configuration
+        * @param background
+        *            run this configuration in background mode
+        */
+       public static void execute(String command, String executable,
+                       String arguments, boolean background) {
+               // PHPConsole console = new PHPConsole();
+               // String consoleMessage;
+               // if (background) {
+               // consoleMessage = "run in background mode-" + command + ": " +
+               // executable + " " + arguments;
+               // } else {
+               // consoleMessage = "run in foreground mode-" + command + ": " +
+               // executable + " " + arguments;
+               // }
+               // console.println(consoleMessage);
 
-    ExternalToolsUtil.execute(command, executable, arguments, background);
-  }
+               ExternalToolsUtil.execute(command, executable, arguments, background);
+       }
 
-  public void selectionChanged(IAction action, ISelection selection) {
+       public void selectionChanged(IAction action, ISelection selection) {
 
-  }
+       }
 
-  public void init(IWorkbenchWindow window) {
-    this.activeWindow = window;
-  }
+       public void init(IWorkbenchWindow window) {
+               this.activeWindow = window;
+       }
 
-  public void dispose() {
+       public void dispose() {
 
-  }
+       }
 
 }
\ No newline at end of file