@Override
        public Object getValue(String key) {
            JTextComponent tc = getTextComponent();
            if (key.equals(NAME)) {
                UndoManager um = (UndoManager) tc.getClientProperty("undoManager");
                switch (type) {
                    case undo:
                        return um == null
                                ? UIManager.getString("AbstractUndoableEdit.undoText")
                                : um.getUndoPresentationName();
                    case redo:
                        return um == null
                                ? UIManager.getString("AbstractUndoableEdit.redoText")
                                : um.getRedoPresentationName();
                    default:
                        return super.getValue(NAME);
                }
            } else {
                return super.getValue(key);
            }
        }