@Override
    public void actionPerformed(ActionEvent event) {
        String command = event.getActionCommand();
        if (OK.equals(command)) {
            ui.updateOption();
            getGUI().removeFromCanvas(this);
            setResponse(group);
        } else if (CANCEL.equals(command)) {
            getGUI().removeFromCanvas(this);
            setResponse(null);
        } else if (RESET.equals(command)) {
            ui.reset();
            revalidate();
            repaint();
        } else if (SAVE.equals(command)) {
            File saveFile = getGUI().showSaveDialog(FreeColDirectories.getOptionsDirectory(), ".xml",
                                                       filters, getDefaultFileName());
            if (saveFile != null) {
                ui.updateOption();
                try {
                    group.save(saveFile);
                } catch(FileNotFoundException e) {
                    logger.warning(e.toString());
                    StringTemplate t = StringTemplate.template("failedToSave")
                        .addName("%name%", saveFile.getPath());
                    getGUI().showInformationMessage(t);
                }
            }
        } else if (LOAD.equals(command)) {
            File loadFile = getGUI().showLoadDialog(FreeColDirectories.getOptionsDirectory(), filters);
            if (loadFile != null) {
                load(loadFile);
            }
        } else {
            logger.warning("Invalid ActionCommand: " + command);
        }
    }