use of org.freeplane.plugin.workspace.features.AWorkspaceModeExtension in project freeplane by freeplane.
the class WorkspaceController method startModeExtension.
public void startModeExtension(ModeController modeController) {
AWorkspaceModeExtension modeCtrl = modeController.getExtension(AWorkspaceModeExtension.class);
if (modeCtrl == null) {
return;
}
modeCtrl.start(modeController);
}
use of org.freeplane.plugin.workspace.features.AWorkspaceModeExtension in project freeplane by freeplane.
the class WorkspaceController method shutdown.
public void shutdown() {
for (String modeName : Controller.getCurrentController().getModes()) {
ModeController modeController = Controller.getCurrentController().getModeController(modeName);
AWorkspaceModeExtension modeExt = modeController.getExtension(AWorkspaceModeExtension.class);
if (modeExt == null) {
continue;
}
modeExt.shutdown();
}
}
use of org.freeplane.plugin.workspace.features.AWorkspaceModeExtension in project freeplane by freeplane.
the class WorkspaceController method installMode.
public boolean installMode(ModeController modeController) {
AWorkspaceModeExtension modeCtrl = modeController.getExtension(AWorkspaceModeExtension.class);
if (modeCtrl == null) {
Class<? extends AWorkspaceModeExtension> clazz = modeWorkspaceCtrlMap.get(modeController.getClass());
if (clazz == null) {
return false;
}
try {
modeCtrl = clazz.getConstructor(ModeController.class).newInstance(modeController);
modeController.addExtension(AWorkspaceModeExtension.class, modeCtrl);
WorkspaceModelExtensionWriterReader.register(modeController);
return true;
} catch (Exception e) {
e.printStackTrace();
}
} else {
return true;
}
return false;
}
Aggregations