package org.freeplane.plugin.latex; import java.util.Hashtable; import org.freeplane.features.mode.ModeController; import org.freeplane.features.mode.browsemode.BModeController; import org.freeplane.features.mode.mindmapmode.MModeController; import org.freeplane.main.osgi.IModeControllerExtensionProvider; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; public class Activator implements BundleActivator { /* * (non-Javadoc) * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) */ public void start(final BundleContext context) throws Exception { registerMindMapModeExtension(context); registerBrowseModeExtension(context); } private void registerMindMapModeExtension(final BundleContext context) { final Hashtable<String, String[]> props = new Hashtable<String, String[]>(); props.put("mode", new String[] { MModeController.MODENAME }); context.registerService(IModeControllerExtensionProvider.class.getName(), new IModeControllerExtensionProvider() { public void installExtension(final ModeController modeController) { new LatexRegistration(); } }, props); } private void registerBrowseModeExtension(final BundleContext context) { final Hashtable<String, String[]> props = new Hashtable<String, String[]>(); props.put("mode", new String[] { BModeController.MODENAME }); context.registerService(IModeControllerExtensionProvider.class.getName(), new IModeControllerExtensionProvider() { public void installExtension(final ModeController modeController) { new LatexRegistration(); } }, props); } /* * (non-Javadoc) * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) */ public void stop(final BundleContext context) throws Exception { } }