class UndoAction extends AbstractAction {

    private UndoAction() {
      super(messages.getString("guiUndo"));
      Image img;
      img = Toolkit.getDefaultToolkit().getImage(
              JLanguageTool.getDataBroker().getFromResourceDirAsUrl("sc_undo.png"));
      putValue(Action.SMALL_ICON, new ImageIcon(img));
      img = Toolkit.getDefaultToolkit().getImage(
              JLanguageTool.getDataBroker().getFromResourceDirAsUrl("lc_undo.png"));
      putValue(Action.LARGE_ICON_KEY, new ImageIcon(img));
      KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_Z,
              Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
      putValue(Action.ACCELERATOR_KEY, key);
      putValue(Action.MNEMONIC_KEY, KeyEvent.VK_U);
      setEnabled(false);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
      try {
        undoManager.undo();
      } catch (CannotUndoException ex) {
        // ignore
      }
      updateUndoState();
      redoAction.updateRedoState();
    }

    private void updateUndoState() {<FILL_FUNCTION_BODY>}
  }

      if (undoManager.canUndo()) {
        setEnabled(true);
      } else {
        setEnabled(false);
      }
    
<no_super_class>