IStructuredTextUndoManager undoManager = fStructuredModel.getUndoManager();
// get undo command
Command undoCommand = undoManager.getUndoCommand();
// set undo label and description
if (undoAction != null) {
undoAction.setEnabled(undoManager.undoable());
if (undoCommand != null) {
String label = undoCommand.getLabel();
if (label != null) {
String customText = MessageFormat.format(UNDO_ACTION_TEXT, new String[]{label});
updateActions = updateActions || customText == null || previousUndoText == null || !customText.equals(previousUndoText);