Index: LutinGeneratorEclipsePlugin/src/org/codelutin/eclipse/generator/LutinGeneratorPlugin.java diff -u /dev/null LutinGeneratorEclipsePlugin/src/org/codelutin/eclipse/generator/LutinGeneratorPlugin.java:1.1 --- /dev/null Wed Jun 20 12:40:40 2007 +++ LutinGeneratorEclipsePlugin/src/org/codelutin/eclipse/generator/LutinGeneratorPlugin.java Wed Jun 20 12:40:35 2007 @@ -0,0 +1,79 @@ +package org.codelutin.eclipse.generator; + +import org.codelutin.eclipse.generator.ui.editor.FastTemplatedJavaPartitionScanner; +import org.codelutin.eclipse.generator.ui.editor.TemplatedJavaTextAttributeProvider; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class LutinGeneratorPlugin extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.codelutin.eclipse.generator"; + + // The shared instance + private static LutinGeneratorPlugin plugin; + + /** + * Scanner unique plugin instance + */ + private FastTemplatedJavaPartitionScanner templatedJavaPartitionScanner; + + /** + * Color text attribute provider unique plugin instance + */ + private TemplatedJavaTextAttributeProvider templateTextAttributeProvider; + + /** + * The constructor + */ + public LutinGeneratorPlugin() { + plugin = this; + + templatedJavaPartitionScanner = new FastTemplatedJavaPartitionScanner(); + templateTextAttributeProvider = new TemplatedJavaTextAttributeProvider(); + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static LutinGeneratorPlugin getDefault() { + return plugin; + } + + /** + * @return + */ + public FastTemplatedJavaPartitionScanner getTemplatePartitionScanner() { + return templatedJavaPartitionScanner; + } + + /** + * @return + */ + public TemplatedJavaTextAttributeProvider getTextAttributeProvider() { + return templateTextAttributeProvider; + } + +}