// Path: com.gregorbyte.designer.headless/src/com/gregorbyte/designer/headless/HeadlessServerActivator.java
// public class HeadlessServerActivator extends AbstractUIPlugin {
// 
// 	// The plug-in ID
// 	public static final String PLUGIN_ID = "com.gregorbyte.designer.headless"; //$NON-NLS-1$
// 
// 	public static HeadlessServerActivator INSTANCE = null;
// 
// 	private Thread serverThread;
// 	private HeadlessServerRunnable headlessServer;
// 
// 	// The shared instance
// 	private static HeadlessServerActivator plugin;
// 
// 	/**
// 	 * The constructor
// 	 */
// 	public HeadlessServerActivator() {
// 	}
// 
// 	public void startServer() {
// 		if (!isServerRunning()) {
// 			headlessServer = new HeadlessServerRunnable();
// 			serverThread = new Thread(headlessServer);
// 			serverThread.setName("Headless Nsf Server");
// 			serverThread.start();
// 		}
// 	}
// 
// 	public void stopServer() {
// 		if (isServerRunning())
// 			headlessServer.stopThread();
// 	}
// 
// 	public boolean isServerRunning() {
// 
// 		if (serverThread == null)
// 			return false;
// 		return serverThread.isAlive();
// 
// 	}
// 
// 	/*
// 	 * (non-Javadoc)
// 	 * 
// 	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.
// 	 * BundleContext)
// 	 */
// 	public void start(BundleContext context) throws Exception {
// 
// 		INSTANCE = this;
// 
// 		super.start(context);
// 		
// 		plugin = this;
// 
// 		try {
// 			Boolean autoStart = getDefault().getPreferenceStore().getBoolean(PreferenceConstants.P_START);
// 
// 			if (autoStart) {
// 				System.out.println("Attempting to Auto Start Gregorbyte Headless Server");
// 				startServer();
// 			}
// 
// 		} catch (Exception e) {
// 			System.err.println("Error attempting to auto start GregorbyteHeadless Server");
// 		}
// 
// 	}
// 
// 	/*
// 	 * (non-Javadoc)
// 	 * 
// 	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.
// 	 * BundleContext)
// 	 */
// 	public void stop(BundleContext context) throws Exception {
// 
// 		System.out.println("Stopping Headless Bundle");
// 
// 		stopServer();
// 
// 		plugin = null;
// 		super.stop(context);
// 	}
// 
// 	/**
// 	 * Returns the shared instance
// 	 *
// 	 * @return the shared instance
// 	 */
// 	public static HeadlessServerActivator getDefault() {
// 		return plugin;
// 	}
// 
// }


import org.eclipse.jface.preference.*;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbench;
import com.gregorbyte.designer.headless.HeadlessServerActivator;
package com.gregorbyte.designer.headless.preferences;



/**
 * This class represents a preference page that is contributed to the
 * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we
 * can use the field support built into JFace that allows us to create a page
 * that is small and knows how to save, restore and apply itself.
 * <p>
 * This page is used to modify preferences only. They are stored in the
 * preference store that belongs to the main plug-in class. That way,
 * preferences can be accessed directly via the preference store.
 */

public class HeadlessServerPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

	public HeadlessServerPreferencePage() {
		super(GRID);
// Path: com.gregorbyte.designer.headless/src/com/gregorbyte/designer/headless/HeadlessServerActivator.java
// public class HeadlessServerActivator extends AbstractUIPlugin {
// 
// 	// The plug-in ID
// 	public static final String PLUGIN_ID = "com.gregorbyte.designer.headless"; //$NON-NLS-1$
// 
// 	public static HeadlessServerActivator INSTANCE = null;
// 
// 	private Thread serverThread;
// 	private HeadlessServerRunnable headlessServer;
// 
// 	// The shared instance
// 	private static HeadlessServerActivator plugin;
// 
// 	/**
// 	 * The constructor
// 	 */
// 	public HeadlessServerActivator() {
// 	}
// 
// 	public void startServer() {
// 		if (!isServerRunning()) {
// 			headlessServer = new HeadlessServerRunnable();
// 			serverThread = new Thread(headlessServer);
// 			serverThread.setName("Headless Nsf Server");
// 			serverThread.start();
// 		}
// 	}
// 
// 	public void stopServer() {
// 		if (isServerRunning())
// 			headlessServer.stopThread();
// 	}
// 
// 	public boolean isServerRunning() {
// 
// 		if (serverThread == null)
// 			return false;
// 		return serverThread.isAlive();
// 
// 	}
// 
// 	/*
// 	 * (non-Javadoc)
// 	 * 
// 	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.
// 	 * BundleContext)
// 	 */
// 	public void start(BundleContext context) throws Exception {
// 
// 		INSTANCE = this;
// 
// 		super.start(context);
// 		
// 		plugin = this;
// 
// 		try {
// 			Boolean autoStart = getDefault().getPreferenceStore().getBoolean(PreferenceConstants.P_START);
// 
// 			if (autoStart) {
// 				System.out.println("Attempting to Auto Start Gregorbyte Headless Server");
// 				startServer();
// 			}
// 
// 		} catch (Exception e) {
// 			System.err.println("Error attempting to auto start GregorbyteHeadless Server");
// 		}
// 
// 	}
// 
// 	/*
// 	 * (non-Javadoc)
// 	 * 
// 	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.
// 	 * BundleContext)
// 	 */
// 	public void stop(BundleContext context) throws Exception {
// 
// 		System.out.println("Stopping Headless Bundle");
// 
// 		stopServer();
// 
// 		plugin = null;
// 		super.stop(context);
// 	}
// 
// 	/**
// 	 * Returns the shared instance
// 	 *
// 	 * @return the shared instance
// 	 */
// 	public static HeadlessServerActivator getDefault() {
// 		return plugin;
// 	}
// 
// }


// Path: com.gregorbyte.designer.headless/src/com/gregorbyte/designer/headless/preferences/HeadlessServerPreferencePage.java
import org.eclipse.jface.preference.*;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbench;
import com.gregorbyte.designer.headless.HeadlessServerActivator;

package com.gregorbyte.designer.headless.preferences;



/**
 * This class represents a preference page that is contributed to the
 * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we
 * can use the field support built into JFace that allows us to create a page
 * that is small and knows how to save, restore and apply itself.
 * <p>
 * This page is used to modify preferences only. They are stored in the
 * preference store that belongs to the main plug-in class. That way,
 * preferences can be accessed directly via the preference store.
 */

public class HeadlessServerPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

	public HeadlessServerPreferencePage() {
		super(GRID);
		setPreferenceStore(HeadlessServerActivator.getDefault().getPreferenceStore());