X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartApacheAction.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartApacheAction.java deleted file mode 100644 index 3f1839a..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPStartApacheAction.java +++ /dev/null @@ -1,85 +0,0 @@ -/********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. and others. -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 implementation - Klaus Hartlage - www.eclipseproject.de -**********************************************************************/ -package net.sourceforge.phpeclipse.actions; - -import java.io.IOException; -import java.io.InputStream; -import java.text.MessageFormat; - -import net.sourceforge.phpeclipse.PHPeclipsePlugin; -import net.sourceforge.phpeclipse.views.PHPConsole; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.action.IAction; -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; -import sun.security.krb5.internal.crypto.e; - -public class PHPStartApacheAction implements IWorkbenchWindowActionDelegate { - protected IWorkbenchWindow activeWindow = null; - - public void run(IAction action) { - final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - String documentRoot = store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF); - // replace backslash with slash in the DocumentRoot under Windows - documentRoot = documentRoot.replace('\\', '/'); - String[] arguments = { documentRoot }; - MessageFormat form = new MessageFormat(store.getString(PHPeclipsePlugin.APACHE_START_PREF)); - execute(form.format(arguments), "Start Apache: "); - } - - public static String execute(String command, String consoleMessage) { - // MessageDialog.openInformation(activeWindow.getShell(), "Exec command: ", command); - try { - PHPConsole.write(consoleMessage+command+"\n"); - Runtime runtime = Runtime.getRuntime(); - - // runs the command - Process p = runtime.exec(command); - - // gets the input stream to have the post-compile-time information - InputStream stream = p.getInputStream(); - - // get the string from Stream - String consoleOutput = PHPConsole.getStringFromStream(stream); - - // prints out the information - PHPConsole.write(consoleOutput); - return consoleOutput; - - } catch (IOException e) { - - System.err.println("Problem"); - e.printStackTrace(); - - } - return ""; - } - - public void selectionChanged(IAction action, ISelection selection) { - - } - - public void init(IWorkbenchWindow window) { - this.activeWindow = window; - } - - public void dispose() { - - } -}