use of org.freeplane.features.script.IScriptEditorStarter in project freeplane by freeplane.
the class ScriptEditorProperty method actionPerformed.
public void actionPerformed(final ActionEvent arg0) {
final IScriptEditorStarter plugin = (IScriptEditorStarter) Controller.getCurrentModeController().getExtension(IScriptEditorStarter.class);
if (plugin != null) {
final IScriptEditorStarter starter = plugin;
final String resultScript = starter.startEditor(script);
if (resultScript != null) {
script = resultScript;
firePropertyChangeEvent();
}
}
}
use of org.freeplane.features.script.IScriptEditorStarter 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();
createUserLibDirectory();
}
FilterController.getCurrentFilterController().getConditionFactory().addConditionController(100, new ScriptConditionController());
}
Aggregations