Search in sources :

Example 16 with IUndoHandler

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();
}
Also used : IUndoHandler(org.freeplane.core.undo.IUndoHandler)

Example 17 with IUndoHandler

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());
}
Also used : IUndoHandler(org.freeplane.core.undo.IUndoHandler) MapModel(org.freeplane.features.map.MapModel) Controller(org.freeplane.features.mode.Controller)

Example 18 with IUndoHandler

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);
}
Also used : IUndoHandler(org.freeplane.core.undo.IUndoHandler) MapModel(org.freeplane.features.map.MapModel)

Example 19 with IUndoHandler

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);
}
Also used : IUndoHandler(org.freeplane.core.undo.IUndoHandler) MapModel(org.freeplane.features.map.MapModel) MMapModel(org.freeplane.features.map.mindmapmode.MMapModel) Controller(org.freeplane.features.mode.Controller)

Example 20 with IUndoHandler

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);
    }
}
Also used : MMapModel(org.freeplane.features.map.mindmapmode.MMapModel) IUndoHandler(org.freeplane.core.undo.IUndoHandler)

Aggregations

IUndoHandler (org.freeplane.core.undo.IUndoHandler)21 MapModel (org.freeplane.features.map.MapModel)15 MMapModel (org.freeplane.features.map.mindmapmode.MMapModel)10 Controller (org.freeplane.features.mode.Controller)4 IActor (org.freeplane.core.undo.IActor)3 NodeModel (org.freeplane.features.map.NodeModel)3 IMapViewManager (org.freeplane.features.ui.IMapViewManager)3 ModeController (org.freeplane.features.mode.ModeController)2 LogicalStyleController (org.freeplane.features.styles.LogicalStyleController)2 ViewController (org.freeplane.features.ui.ViewController)2 Component (java.awt.Component)1 Window (java.awt.Window)1 ComponentAdapter (java.awt.event.ComponentAdapter)1 ComponentEvent (java.awt.event.ComponentEvent)1 WindowAdapter (java.awt.event.WindowAdapter)1 WindowEvent (java.awt.event.WindowEvent)1 JDialog (javax.swing.JDialog)1 WindowConfigurationStorage (org.freeplane.core.resources.WindowConfigurationStorage)1 MapStyleModel (org.freeplane.features.styles.MapStyleModel)1