use of org.freeplane.core.undo.IUndoHandler in project freeplane by freeplane.
the class MModeController method delayedRollback.
public void delayedRollback() {
final MMapModel map = (MMapModel) getController().getMap();
final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
undoHandler.delayedRollback();
}
use of org.freeplane.core.undo.IUndoHandler in project freeplane by freeplane.
the class MModeController method delayedCommit.
public void delayedCommit() {
final MMapModel map = (MMapModel) getController().getMap();
final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
undoHandler.delayedCommit();
}
use of org.freeplane.core.undo.IUndoHandler in project freeplane by freeplane.
the class MModeController method forceNewTransaction.
@Override
public void forceNewTransaction() {
final MapModel map = getController().getMap();
final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
undoHandler.forceNewTransaction();
}
use of org.freeplane.core.undo.IUndoHandler in project freeplane by freeplane.
the class ModeController method undoableCopyExtensions.
public void undoableCopyExtensions(final Object key, final NodeModel from, final NodeModel to) {
final MapModel map = to.getMap();
if (map == null) {
copyExtensions(key, from, to);
return;
}
final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
if (undoHandler == null) {
copyExtensions(key, from, to);
return;
}
final NodeModel backup = new NodeModel(null);
copyExtensions(key, to, backup);
final IActor actor = new IActor() {
public void undo() {
removeExtensions(key, to);
copyExtensions(key, backup, to);
getMapController().nodeChanged(to);
}
public String getDescription() {
return "undoableCopyExtensions";
}
public void act() {
copyExtensions(key, from, to);
getMapController().nodeChanged(to);
}
};
execute(actor, map);
}
use of org.freeplane.core.undo.IUndoHandler in project freeplane by freeplane.
the class ModeController method undoableResolveParentExtensions.
public void undoableResolveParentExtensions(final Object key, final NodeModel to) {
final MapModel map = to.getMap();
if (map == null) {
resolveParentExtensions(key, to);
return;
}
final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
if (undoHandler == null) {
resolveParentExtensions(key, to);
return;
}
final NodeModel backup = new NodeModel(null);
copyExtensions(key, to, backup);
final IActor actor = new IActor() {
public void undo() {
copyExtensions(key, backup, to);
getMapController().nodeChanged(to);
}
public String getDescription() {
return "undoableCopyExtensions";
}
public void act() {
resolveParentExtensions(key, to);
getMapController().nodeChanged(to);
}
};
execute(actor, map);
}
Aggregations