**********************************************************************/
package net.sourceforge.phpeclipse.actions;
-import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
-import java.io.InputStreamReader;
import java.text.MessageFormat;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import net.sourceforge.phpeclipse.views.PHPConsole;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
+
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
public class PHPStartApacheAction implements IWorkbenchWindowActionDelegate {
protected IWorkbenchWindow activeWindow = null;
// MessageDialog.openInformation(activeWindow.getShell(), "Exec command: ", command);
try {
PHPConsole console = PHPConsole.getInstance();
- console.write(consoleMessage + command + "\n");
+ if (console!=null) {
+ console.write(consoleMessage + command + "\n");
+ }
+
Runtime runtime = Runtime.getRuntime();
// runs the command
String consoleOutput = PHPConsole.getStringFromStream(stream);
// prints out the information
- console.write(consoleOutput);
+ if (console!=null) {
+ console.write(consoleOutput);
+ }
return consoleOutput;
} catch (IOException e) {