* Updates the actions undo and redo.
* Set the actions active or not.
*/
public void updateActions()
{
JaspiraAction undo = ActionMgr.getInstance().getAction("undo.undo");
if (undo != null)
{
if (canUndo())
{
String cmdName = ((Transaction) undoStack.getFirst()).getDisplayName();
if (cmdName != null)
{
String text = undoText + ": " + cmdName;
undo.setDisplayName(text);
undo.setDescription(text);
}
else
{
undo.setDisplayName(undoText);
undo.setDescription(undoDescription);
}
undo.setEnabled(true);
}
else
{
undo.setDisplayName(undoText);
undo.setEnabled(false);
}
}
JaspiraAction redo = ActionMgr.getInstance().getAction("undo.redo");
if (redo != null)
{
if (canRedo())
{
String cmdName = ((Transaction) redoStack.getFirst()).getDisplayName();
if (cmdName != null)
{
String text = redoText + ": " + cmdName;
redo.setDisplayName(text);
redo.setDescription(text);
}
else
{
redo.setDisplayName(redoText);
redo.setDescription(redoDescription);
}
redo.setEnabled(true);
}
else
{
redo.setDisplayName(redoText);
redo.setEnabled(false);
}
}
}