List of usage examples for javax.swing.undo UndoManager getUndoPresentationName
public synchronized String getUndoPresentationName()
From source file:ee.ioc.cs.vsle.editor.Editor.java
/** * Updates Undo and Redo actions. When a new scheme tab is selected/opened * or an action that modifies the scheme is performed the undo and redo * action objects have to be updated to reflect the current state, this * includes presentation name and enabled/disabled status. *///from w ww .jav a 2 s. c o m public void refreshUndoRedo() { Canvas canvas = getCurrentCanvas(); if (canvas != null) { UndoManager um = canvas.undoManager; undoAction.setEnabled(!canvas.isActionInProgress() && um.canUndo()); redoAction.setEnabled(!canvas.isActionInProgress() && um.canRedo()); undoAction.putValue(Action.NAME, um.getUndoPresentationName()); redoAction.putValue(Action.NAME, um.getRedoPresentationName()); } else { undoAction.setEnabled(false); redoAction.setEnabled(false); undoAction.putValue(Action.NAME, Menu.UNDO); redoAction.putValue(Action.NAME, Menu.REDO); } }