// Path: com.polyhedral.security.testing.zedattackproxy/src/com/polyhedral/security/testing/zedattackproxy/actions/jobs/start/RunStartZAPJob.java
// public class RunStartZAPJob extends Job {
// 
// 	private Display display;
// 	private ZAPEventHandler eventHandler;
// 
// 	/**
// 	 * Default constructor.
// 	 * 
// 	 * @param name
// 	 *            The name to be displayed in the Eclipse progress view while
// 	 *            this is executing.
// 	 * @param display
// 	 *            the {@link Display} where this will trigger signal events.
// 	 * @param eventHandler
// 	 *            The event handler needed for signal events.
// 	 */
// 	public RunStartZAPJob(String name, Display display, ZAPEventHandler eventHandler) {
// 		super(name);
// 		this.display = display;
// 		this.eventHandler = eventHandler;
// 	}
// 
// 	/**
// 	 * Execution of the start ZAP job.
// 	 */
// 	@Override
// 	protected IStatus run(IProgressMonitor monitor) {
// 		// Signal that the ZAP start action is starting.
// 		Job signalZAPStartJob = new SignalZAPEventJob(display, "Signal ZAP Start...", ZAPEventType.SERVER_STARTED,
// 				eventHandler);
// 		signalZAPStartJob.setPriority(Job.INTERACTIVE);
// 		signalZAPStartJob.schedule();
// 
// 		// Run the start ZAP job.
// 		Job startZAPJob = new StartZAPJob("Running ZAP Start Job...");
// 		startZAPJob.setPriority(Job.LONG);
// 		startZAPJob.schedule();
// 		while (startZAPJob.getResult() == null) {
// 			try {
// 				Thread.sleep(1000);
// 			} catch (InterruptedException e) {
// 				ConsolePlugin.log(e);
// 			}
// 		}
// 
// 		// Signal that the ZAp start action is complete.
// 		Job signalZAPStartCompleteJob = new SignalZAPEventJob(display, "ZAP Start Complete",
// 				ZAPEventType.SERVER_STARTUP_COMPLETE, eventHandler);
// 		signalZAPStartCompleteJob.setPriority(Job.INTERACTIVE);
// 		signalZAPStartCompleteJob.schedule();
// 
// 		return Status.OK_STATUS;
// 	}
// }


import java.net.URL;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.ConsolePlugin;
import com.polyhedral.security.testing.zedattackproxy.actions.jobs.start.RunStartZAPJob;

package com.polyhedral.security.testing.zedattackproxy.actions;




/**
 * Eclipse {@link Action} for starting the ZAP server.
 */
public class StartZAPAction extends ZAPAction {

	/**
	 * Default constructor. Set the enabled/disabled icons for the action and
	 * the tool tip text.
	 */
	public StartZAPAction() {
		try {
			this.setImageDescriptor(ImageDescriptor.createFromURL(new URL(
					"platform:/plugin/com.polyhedral.security.testing.zedattackproxy/icons/enabled/start.gif")));
			this.setDisabledImageDescriptor(ImageDescriptor.createFromURL(new URL(
					"platform:/plugin/com.polyhedral.security.testing.zedattackproxy/icons/disabled/start.gif")));
			this.setToolTipText("Start ZAP Server");
		} catch (Exception e) {
			ConsolePlugin.log(e);
		}
	}

	/**
	 * {@link Job} to be performed when this action is clicked on.
	 */
	@Override
	public void run() {

// Path: com.polyhedral.security.testing.zedattackproxy/src/com/polyhedral/security/testing/zedattackproxy/actions/jobs/start/RunStartZAPJob.java
// public class RunStartZAPJob extends Job {
// 
// 	private Display display;
// 	private ZAPEventHandler eventHandler;
// 
// 	/**
// 	 * Default constructor.
// 	 * 
// 	 * @param name
// 	 *            The name to be displayed in the Eclipse progress view while
// 	 *            this is executing.
// 	 * @param display
// 	 *            the {@link Display} where this will trigger signal events.
// 	 * @param eventHandler
// 	 *            The event handler needed for signal events.
// 	 */
// 	public RunStartZAPJob(String name, Display display, ZAPEventHandler eventHandler) {
// 		super(name);
// 		this.display = display;
// 		this.eventHandler = eventHandler;
// 	}
// 
// 	/**
// 	 * Execution of the start ZAP job.
// 	 */
// 	@Override
// 	protected IStatus run(IProgressMonitor monitor) {
// 		// Signal that the ZAP start action is starting.
// 		Job signalZAPStartJob = new SignalZAPEventJob(display, "Signal ZAP Start...", ZAPEventType.SERVER_STARTED,
// 				eventHandler);
// 		signalZAPStartJob.setPriority(Job.INTERACTIVE);
// 		signalZAPStartJob.schedule();
// 
// 		// Run the start ZAP job.
// 		Job startZAPJob = new StartZAPJob("Running ZAP Start Job...");
// 		startZAPJob.setPriority(Job.LONG);
// 		startZAPJob.schedule();
// 		while (startZAPJob.getResult() == null) {
// 			try {
// 				Thread.sleep(1000);
// 			} catch (InterruptedException e) {
// 				ConsolePlugin.log(e);
// 			}
// 		}
// 
// 		// Signal that the ZAp start action is complete.
// 		Job signalZAPStartCompleteJob = new SignalZAPEventJob(display, "ZAP Start Complete",
// 				ZAPEventType.SERVER_STARTUP_COMPLETE, eventHandler);
// 		signalZAPStartCompleteJob.setPriority(Job.INTERACTIVE);
// 		signalZAPStartCompleteJob.schedule();
// 
// 		return Status.OK_STATUS;
// 	}
// }


// Path: com.polyhedral.security.testing.zedattackproxy/src/com/polyhedral/security/testing/zedattackproxy/actions/StartZAPAction.java
import java.net.URL;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.ConsolePlugin;
import com.polyhedral.security.testing.zedattackproxy.actions.jobs.start.RunStartZAPJob;

package com.polyhedral.security.testing.zedattackproxy.actions;




/**
 * Eclipse {@link Action} for starting the ZAP server.
 */
public class StartZAPAction extends ZAPAction {

	/**
	 * Default constructor. Set the enabled/disabled icons for the action and
	 * the tool tip text.
	 */
	public StartZAPAction() {
		try {
			this.setImageDescriptor(ImageDescriptor.createFromURL(new URL(
					"platform:/plugin/com.polyhedral.security.testing.zedattackproxy/icons/enabled/start.gif")));
			this.setDisabledImageDescriptor(ImageDescriptor.createFromURL(new URL(
					"platform:/plugin/com.polyhedral.security.testing.zedattackproxy/icons/disabled/start.gif")));
			this.setToolTipText("Start ZAP Server");
		} catch (Exception e) {
			ConsolePlugin.log(e);
		}
	}

	/**
	 * {@link Job} to be performed when this action is clicked on.
	 */
	@Override
	public void run() {

		Job runStartZAPJob = new RunStartZAPJob("Starting Zed Attack Proxy...", PlatformUI.getWorkbench().getDisplay(),
