private void okButtonClick(ActionEvent evt) {
        Object[] selectedValues = templatesList.getSelectedValues();
        if (selectedValues.length==0) {
            JOptionPane.showMessageDialog(this, "请选择模板.", "提示", JOptionPane.INFORMATION_MESSAGE);
            return;
        }
        String targetProject = textTargetProject.getText();
        if (StringUtil.isEmpty(targetProject)) {
            JOptionPane.showMessageDialog(this, "请输入代码保存路径.", "提示", JOptionPane.INFORMATION_MESSAGE);
            return;
        }
        String basePackage = textBasePackage.getText();
        if (StringUtil.isEmpty(basePackage)) {
            JOptionPane.showMessageDialog(this, "请输入基准包.", "提示", JOptionPane.INFORMATION_MESSAGE);
            return;
        }
        String moduleName = textModuleName.getText();
        if (StringUtil.isEmpty(moduleName)) {
            JOptionPane.showMessageDialog(this, "请输入模块名.", "提示", JOptionPane.INFORMATION_MESSAGE);
            return;
        }
        String tableAlias = textTableAlias.getText();
        if (StringUtil.isEmpty(moduleName)) {
            JOptionPane.showMessageDialog(this, "请输入表别名.", "提示", JOptionPane.INFORMATION_MESSAGE);
            return;
        }

        configuration.setTagertProject(targetProject);
        configuration.setBasePackage(basePackage);
        configuration.setModuleName(moduleName);

        tableModel.setTableAlias(tableAlias);

        Map<String, Object> model = new HashMap<String, Object>();
        model.put("tagertProject", configuration.getTagertProject());
        model.put("basePackage", configuration.getBasePackage());
        model.put("moduleName", configuration.getModuleName());
        model.put("table", tableModel);

        for (TemplateElement templateElement : configuration.getTemplates()) {
            templateElement.setSelected(false);
        }


        int count = selectedValues.length;
        for (int i=0;i<count; i++) {
            try {
                Object selectedObject = selectedValues[i];
                TemplateElement templateElement = (TemplateElement) selectedObject;
                templateElement.setSelected(true);

                TemplateEngine templateEngine = engineBuilder.getTemplateEngine(templateElement.getEngine());
                if(templateEngine==null){
                    JOptionPane.showMessageDialog(this, "没有对应的模板引擎: "+templateElement.getEngine(), "错误", JOptionPane.ERROR_MESSAGE);
                } else {
                    templateEngine.processToFile(model, templateElement);
                }
            } catch (Exception e) {
                JOptionPane.showMessageDialog(this, e.getMessage(), "错误", JOptionPane.ERROR_MESSAGE);
            }
        }
        configuration.save();
        JOptionPane.showMessageDialog(this, "生成完毕.", "提示", JOptionPane.INFORMATION_MESSAGE);
    }