use of org.freeplane.plugin.script.filter.ScriptConditionController in project freeplane by freeplane.
the class ScriptingRegistration method register.
private void register(ModeController modeController) {
modeController.addExtension(IScriptEditorStarter.class, new IScriptEditorStarter() {
@Override
public String startEditor(final String pScriptInput) {
final ScriptModel scriptModel = new ScriptModel(pScriptInput);
final ScriptEditorPanel scriptEditorPanel = new ScriptEditorPanel(scriptModel, false);
scriptEditorPanel.setVisible(true);
return scriptModel.getScript();
}
@Override
public ComboBoxEditor createComboBoxEditor(Dimension minimumSize) {
final ScriptComboBoxEditor scriptComboBoxEditor = new ScriptComboBoxEditor();
if (minimumSize != null)
scriptComboBoxEditor.setMinimumSize(minimumSize);
return scriptComboBoxEditor;
}
});
modeController.addExtension(IScriptStarter.class, new IScriptStarter() {
@Override
public void executeScript(NodeModel node, String script) {
ScriptingEngine.executeScript(node, script);
}
});
registerScriptAddOns();
if (!modeController.getController().getViewController().isHeadless()) {
registerGuiStuff(modeController);
ScriptCompiler.compileScriptsOnPath(ScriptResources.getClasspath());
createUserScriptsDirectory();
createInitScriptsDirectory();
createUserLibDirectory();
}
FilterController.getCurrentFilterController().getConditionFactory().addConditionController(100, new ScriptConditionController());
ScriptingPolicy.installRestrictingPolicy();
System.setSecurityManager(new InternationalizedSecurityManager());
}
Aggregations