Search in sources :

Example 1 with AWorkspaceModeExtension

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);
}
Also used : AWorkspaceModeExtension(org.freeplane.plugin.workspace.features.AWorkspaceModeExtension)

Example 2 with AWorkspaceModeExtension

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();
    }
}
Also used : AWorkspaceModeExtension(org.freeplane.plugin.workspace.features.AWorkspaceModeExtension) ModeController(org.freeplane.features.mode.ModeController) MModeController(org.freeplane.features.mode.mindmapmode.MModeController)

Example 3 with AWorkspaceModeExtension

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;
}
Also used : AWorkspaceModeExtension(org.freeplane.plugin.workspace.features.AWorkspaceModeExtension) ModeControlAlreadyRegisteredException(org.freeplane.plugin.workspace.features.ModeControlAlreadyRegisteredException) IOException(java.io.IOException)

Aggregations

AWorkspaceModeExtension (org.freeplane.plugin.workspace.features.AWorkspaceModeExtension)3 IOException (java.io.IOException)1 ModeController (org.freeplane.features.mode.ModeController)1 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)1 ModeControlAlreadyRegisteredException (org.freeplane.plugin.workspace.features.ModeControlAlreadyRegisteredException)1