Search in sources :

Example 6 with EncryptionModel

use of org.freeplane.features.map.EncryptionModel in project freeplane by freeplane.

the class MEncryptionController method removeEncryption.

public void removeEncryption(final NodeModel node, final PasswordStrategy passwordStrategy) {
    final EncryptionModel encryptedMindMapNode = EncryptionModel.getModel(node);
    if (encryptedMindMapNode == null) {
        return;
    }
    if (!encryptedMindMapNode.isAccessible())
        toggleCryptState(node, passwordStrategy);
    if (!encryptedMindMapNode.isAccessible())
        return;
    final IActor actor = new IActor() {

        public void act() {
            node.removeExtension(encryptedMindMapNode);
            Controller.getCurrentModeController().getMapController().nodeChanged(node);
        }

        public String getDescription() {
            return "removeEncryption";
        }

        public void undo() {
            node.addExtension(encryptedMindMapNode);
            Controller.getCurrentModeController().getMapController().nodeChanged(node);
        }
    };
    Controller.getCurrentModeController().execute(actor, node.getMap());
}
Also used : IActor(org.freeplane.core.undo.IActor) EncryptionModel(org.freeplane.features.map.EncryptionModel)

Aggregations

EncryptionModel (org.freeplane.features.map.EncryptionModel)6 IActor (org.freeplane.core.undo.IActor)3 NodeModel (org.freeplane.features.map.NodeModel)3 ModeController (org.freeplane.features.mode.ModeController)3 MapController (org.freeplane.features.map.MapController)2 SingleDesEncrypter (org.freeplane.features.encrypt.SingleDesEncrypter)1