use of org.freeplane.core.undo.IUndoHandler in project freeplane by freeplane.
the class MModeController method deactivateUndo.
public void deactivateUndo(final MMapModel map) {
final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
undoHandler.deactivate();
}
use of org.freeplane.core.undo.IUndoHandler in project freeplane by freeplane.
the class RedoAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
if (UITools.isEditingText())
return;
final Controller controller = Controller.getCurrentController();
final MapModel map = controller.getMap();
final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
undoHandler.getRedoAction().actionPerformed(e);
undo.setEnabled(undoHandler.canUndo());
setEnabled(undoHandler.canRedo());
}
use of org.freeplane.core.undo.IUndoHandler in project freeplane by freeplane.
the class RedoAction method reset.
public void reset() {
final MapModel map = Controller.getCurrentController().getMap();
final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
undoHandler.resetRedo();
setEnabled(false);
}
use of org.freeplane.core.undo.IUndoHandler in project freeplane by freeplane.
the class UndoAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
if (UITools.isEditingText())
return;
final Controller controller = Controller.getCurrentController();
final MapModel map = controller.getMap();
final IUndoHandler undoHandler = map.getExtension(IUndoHandler.class);
undoHandler.getUndoAction().actionPerformed(e);
}
use of org.freeplane.core.undo.IUndoHandler in project freeplane by freeplane.
the class UndoAction method afterMapChange.
public void afterMapChange(final MapModel oldMap, final MapModel newMap) {
if (oldMap instanceof MMapModel) {
final IUndoHandler undoHandler = oldMap.getExtension(IUndoHandler.class);
undoHandler.removeChangeListener(changeListener);
}
if (newMap == null) {
setEnabled(false);
redo.setEnabled(false);
return;
}
final IUndoHandler undoHandler = (newMap.getExtension(IUndoHandler.class));
if (undoHandler != null) {
setEnabled(undoHandler.canUndo());
redo.setEnabled(undoHandler.canRedo());
undoHandler.addChangeListener(changeListener);
}
}
Aggregations