use of org.freeplane.main.osgi.IModeControllerExtensionProvider in project freeplane by freeplane.
the class Activator method registerMindMapModeExtension.
private void registerMindMapModeExtension(final BundleContext context) {
final Hashtable<String, String[]> props = new Hashtable<String, String[]>();
props.put("mode", new String[] { MModeController.MODENAME, SModeController.MODENAME });
context.registerService(IModeControllerExtensionProvider.class.getName(), new IModeControllerExtensionProvider() {
public void installExtension(final ModeController modeController) {
// LattexNodeHook -> Menu insert
final LatexNodeHook nodeHook = new LatexNodeHook();
//
modeController.getExtension(TextController.class).addTextTransformer(new ConditionalContentTransformer(new LatexRenderer(), Activator.TOGGLE_PARSE_LATEX));
modeController.getController().getExtension(FormatController.class).addPatternFormat(new LatexFormat());
modeController.getController().getExtension(FormatController.class).addPatternFormat(new UnparsedLatexFormat());
if (modeController.getModeName().equals("MindMap")) {
modeController.addAction(new InsertLatexAction(nodeHook));
modeController.addAction(new EditLatexAction(nodeHook));
modeController.addAction(new DeleteLatexAction(nodeHook));
addPreferencesToOptionPanel();
}
}
private void addPreferencesToOptionPanel() {
final URL preferences = this.getClass().getResource(PREFERENCES_RESOURCE);
if (preferences == null)
throw new RuntimeException("cannot open preferences");
final Controller controller = Controller.getCurrentController();
MModeController modeController = (MModeController) controller.getModeController();
modeController.getOptionPanelBuilder().load(preferences);
}
}, props);
}
use of org.freeplane.main.osgi.IModeControllerExtensionProvider in project freeplane by freeplane.
the class Activator method start.
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(final BundleContext context) throws Exception {
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(ModeController modeController) {
new ScriptingRegistration(modeController);
}
}, props);
}
use of org.freeplane.main.osgi.IModeControllerExtensionProvider in project freeplane by freeplane.
the class Activator method registerMindMapModeExtension.
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(ModeController modeController) {
final ExportController exportController = ExportController.getController(modeController);
exportController.addExportEngine(new ExampleFileFilter("pdf", TextUtils.getText("export_pdf_text")), new ExportPdf());
exportController.addExportEngine(new ExampleFileFilter("svg", TextUtils.getText("export_svg_text")), new ExportSvg());
final ViewerController extension = (ViewerController) modeController.getExtension(ViewerController.class);
extension.addFactory(new SvgViewerFactory());
}
}, props);
}
use of org.freeplane.main.osgi.IModeControllerExtensionProvider in project freeplane by freeplane.
the class Activator method start.
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(final BundleContext context) throws Exception {
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(ModeController modeController) {
if (!modeController.getController().getViewController().isHeadless())
initJSyntaxPane(context);
// new ScriptingRegistration(modeController);
}
}, props);
}
Aggregations