// Path: src/eclipse/spellchecker/Activator.java
// public class Activator extends AbstractUIPlugin {
// 
// 	public static final String ID_PLUGIN = "eclipse.spellchecker";
// 	private static Activator plugin; // The shared instance.
// 
// 	/**
// 	 * The constructor.
// 	 */
// 	public Activator() {
// 		super();
// 		plugin = this;
// 	}
// 
// 	@Override
// 	public void start(BundleContext context) throws Exception {
// 		super.start(context);
// 	}
// 
// 	/**
// 	 * This is called when the plugin is being stopped.
// 	 *
// 	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
// 	 */
// 	@Override
// 	public void stop(BundleContext context) throws Exception {
// 		try {
// 			if (fDialogsFormToolkit != null) {
// 				fDialogsFormToolkit.dispose();
// 				fDialogsFormToolkit = null;
// 			}
// 
// 		} finally {
// 			super.stop(context);
// 		}
// 	}
// 
// 	public static Activator getDefault() {
// 		return plugin;
// 	}
// 
// 	public static void logErrorMessage(String message) {
// 		IStatus s = new Status(IStatus.ERROR, ID_PLUGIN, message);
// 		plugin.getLog().log(s);
// 	}
// 
// 	public static IWorkbenchWindow getActiveWorkbenchWindow() {
// 		return getDefault().getWorkbench().getActiveWorkbenchWindow();
// 	}
// 
// 	public static Shell getActiveWorkbenchShell() {
// 		IWorkbenchWindow window = getActiveWorkbenchWindow();
// 		if (window != null) {
// 			return window.getShell();
// 		}
// 		return null;
// 	}
// 
// 	public static void log(Exception ex) {
// 		IStatus s = new Status(IStatus.ERROR, ID_PLUGIN, ex.getMessage(), ex);
// 		plugin.getLog().log(s);
// 	}
// 
// 	public static void log(IStatus status) {
// 		plugin.getLog().log(status);
// 	}
// 
// 	private FormToolkit fDialogsFormToolkit;
// 
// 	public FormToolkit getDialogsFormToolkit() {
// 		if (fDialogsFormToolkit == null) {
// 			FormColors colors = new FormColors(Display.getCurrent());
// 			colors.setBackground(null);
// 			colors.setForeground(null);
// 			fDialogsFormToolkit = new FormToolkit(colors);
// 		}
// 		return fDialogsFormToolkit;
// 	}
// 
// 	public static IWorkspace getWorkspace() {
// 		return ResourcesPlugin.getWorkspace();
// 	}
// 
// }


import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import org.osgi.framework.Bundle;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import eclipse.spellchecker.Activator;
	//---- Helper methods to access icons on the file system --------------------------------------

	private static void setImageDescriptors(IAction action, String type, String relPath) {
		ImageDescriptor id= create("d" + type, relPath, false); //$NON-NLS-1$
		if (id != null)
			action.setDisabledImageDescriptor(id);

		/*
		 * id= create("c" + type, relPath, false); //$NON-NLS-1$
		 * if (id != null)
		 * 		action.setHoverImageDescriptor(id);
		 */

		ImageDescriptor descriptor= create("e" + type, relPath, true); //$NON-NLS-1$
		action.setHoverImageDescriptor(descriptor);
		action.setImageDescriptor(descriptor);
	}

	private static ImageDescriptor createManagedFromKey(String prefix, String key) {
		return createManaged(prefix, key.substring(NAME_PREFIX_LENGTH), key);
	}

	private static ImageDescriptor createManaged(String prefix, String name, String key) {
		ImageDescriptor result= create(prefix, name, true);

		if (fgAvoidSWTErrorMap == null) {
			fgAvoidSWTErrorMap= new HashMap<String, ImageDescriptor>();
		}
		fgAvoidSWTErrorMap.put(key, result);
		if (fgImageRegistry != null) {
// Path: src/eclipse/spellchecker/Activator.java
// public class Activator extends AbstractUIPlugin {
// 
// 	public static final String ID_PLUGIN = "eclipse.spellchecker";
// 	private static Activator plugin; // The shared instance.
// 
// 	/**
// 	 * The constructor.
// 	 */
// 	public Activator() {
// 		super();
// 		plugin = this;
// 	}
// 
// 	@Override
// 	public void start(BundleContext context) throws Exception {
// 		super.start(context);
// 	}
// 
// 	/**
// 	 * This is called when the plugin is being stopped.
// 	 *
// 	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
// 	 */
// 	@Override
// 	public void stop(BundleContext context) throws Exception {
// 		try {
// 			if (fDialogsFormToolkit != null) {
// 				fDialogsFormToolkit.dispose();
// 				fDialogsFormToolkit = null;
// 			}
// 
// 		} finally {
// 			super.stop(context);
// 		}
// 	}
// 
// 	public static Activator getDefault() {
// 		return plugin;
// 	}
// 
// 	public static void logErrorMessage(String message) {
// 		IStatus s = new Status(IStatus.ERROR, ID_PLUGIN, message);
// 		plugin.getLog().log(s);
// 	}
// 
// 	public static IWorkbenchWindow getActiveWorkbenchWindow() {
// 		return getDefault().getWorkbench().getActiveWorkbenchWindow();
// 	}
// 
// 	public static Shell getActiveWorkbenchShell() {
// 		IWorkbenchWindow window = getActiveWorkbenchWindow();
// 		if (window != null) {
// 			return window.getShell();
// 		}
// 		return null;
// 	}
// 
// 	public static void log(Exception ex) {
// 		IStatus s = new Status(IStatus.ERROR, ID_PLUGIN, ex.getMessage(), ex);
// 		plugin.getLog().log(s);
// 	}
// 
// 	public static void log(IStatus status) {
// 		plugin.getLog().log(status);
// 	}
// 
// 	private FormToolkit fDialogsFormToolkit;
// 
// 	public FormToolkit getDialogsFormToolkit() {
// 		if (fDialogsFormToolkit == null) {
// 			FormColors colors = new FormColors(Display.getCurrent());
// 			colors.setBackground(null);
// 			colors.setForeground(null);
// 			fDialogsFormToolkit = new FormToolkit(colors);
// 		}
// 		return fDialogsFormToolkit;
// 	}
// 
// 	public static IWorkspace getWorkspace() {
// 		return ResourcesPlugin.getWorkspace();
// 	}
// 
// }


// Path: src/eclipse/spellchecker/etc/JavaPluginImages.java
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import org.osgi.framework.Bundle;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import eclipse.spellchecker.Activator;

	//---- Helper methods to access icons on the file system --------------------------------------

	private static void setImageDescriptors(IAction action, String type, String relPath) {
		ImageDescriptor id= create("d" + type, relPath, false); //$NON-NLS-1$
		if (id != null)
			action.setDisabledImageDescriptor(id);

		/*
		 * id= create("c" + type, relPath, false); //$NON-NLS-1$
		 * if (id != null)
		 * 		action.setHoverImageDescriptor(id);
		 */

		ImageDescriptor descriptor= create("e" + type, relPath, true); //$NON-NLS-1$
		action.setHoverImageDescriptor(descriptor);
		action.setImageDescriptor(descriptor);
	}

	private static ImageDescriptor createManagedFromKey(String prefix, String key) {
		return createManaged(prefix, key.substring(NAME_PREFIX_LENGTH), key);
	}

	private static ImageDescriptor createManaged(String prefix, String name, String key) {
		ImageDescriptor result= create(prefix, name, true);

		if (fgAvoidSWTErrorMap == null) {
			fgAvoidSWTErrorMap= new HashMap<String, ImageDescriptor>();
		}
		fgAvoidSWTErrorMap.put(key, result);
		if (fgImageRegistry != null) {
			Activator.logErrorMessage("Image registry already defined"); //$NON-NLS-1$