Package org.apache.cayenne.gen

Examples of org.apache.cayenne.gen.DefaultClassGenerator


    /**
     * @deprecated since 3.0. Use {@link #createGeneratorAction()}.
     */
    protected DefaultClassGenerator createGenerator() {
        DefaultClassGenerator gen = new DefaultClassGenerator();

        gen.setClient(client);
        gen.setDestDir(destDir);
        gen.setEncoding(encoding);
        gen.setMakePairs(makepairs);
        gen.setMode(mode);
        gen.setOutputPattern(outputPattern);
        gen.setOverwrite(overwrite);
        gen.setSuperPkg(superpkg);
        gen.setSuperTemplate(supertemplate);
        gen.setTemplate(template);
        gen.setUsePkgPath(usepkgpath);
        gen.setVersionString(version);

        return gen;
    }
View Full Code Here


    /**
     * @deprecated since 3.0. Use {@link #createGeneratorAction()}.
     */
    protected DefaultClassGenerator createGenerator() {
        DefaultClassGenerator gen = new DefaultClassGenerator();

        gen.setClient(client);
        gen.setDestDir(destDir);
        gen.setEncoding(encoding);
        gen.setMakePairs(makepairs);
        gen.setMode(mode);
        gen.setOutputPattern(outputPattern);
        gen.setOverwrite(overwrite);
        gen.setSuperPkg(superpkg);
        gen.setSuperTemplate(supertemplate);
        gen.setTemplate(template);
        gen.setUsePkgPath(usepkgpath);
        gen.setVersionString(version);

        return gen;
    }
View Full Code Here

        this.preferences = prefs;
        return prefs;
    }

    public DefaultClassGenerator createGenerator() {
        DefaultClassGenerator generator = super.createGenerator();

        if (generator != null) {
            generator.setClient(true);
        }

        return generator;
    }
View Full Code Here

    public void cancelAction() {
        view.dispose();
    }

    public void generateAction() {
        DefaultClassGenerator generator = generatorSelector.getGenerator();

        if (generator != null) {
            try {
                generator.execute();
                JOptionPane.showMessageDialog(
                        (Component) this.getView(),
                        "Class generation finished");
            }
            catch (Exception e) {
View Full Code Here

        return view;
    }

    public DefaultClassGenerator createGenerator() {

        DefaultClassGenerator generator = super.createGenerator();

        String mode = modesByLabel
                .get(view.getGenerationMode().getSelectedItem())
                .toString();
        generator.setMode(mode);

        String superKey = view.getSuperclassTemplate().getSelectedItem().toString();
        String superTemplate = templateManager.getTemplatePath(superKey);
        generator.setSuperTemplate(superTemplate);

        String subKey = view.getSubclassTemplate().getSelectedItem().toString();
        String subTemplate = templateManager.getTemplatePath(subKey);
        generator.setTemplate(subTemplate);

        if (view.getGeneratorVersion().getSelectedItem() != null) {
            generator.setVersionString(view
                    .getGeneratorVersion()
                    .getSelectedItem()
                    .toString());
        }

        generator.setOverwrite(view.getOverwrite().isSelected());
        generator.setUsePkgPath(view.getUsePackagePath().isSelected());
        generator.setMakePairs(view.getPairs().isSelected());

        if (!Util.isEmptyString(view.getOutputPattern().getText())) {
            generator.setOutputPattern(view.getOutputPattern().getText());
        }

        return generator;
    }
View Full Code Here

            JOptionPane.showMessageDialog((Component) this.getView(), outputDir
                    + " is not a valid directory.");
            return null;
        }

        DefaultClassGenerator generator = new DefaultClassGenerator(getParentController()
                .getDataMap(), getParentController().getSelectedEntities());

        // configure encoding from preferences
        Domain generatorPrefs = Application
                .getInstance()
                .getPreferenceDomain()
                .getSubdomain(DefaultClassGenerator.class);

        PreferenceDetail detail = generatorPrefs.getDetail(
                GeneralPreferences.ENCODING_PREFERENCE,
                false);
        if (detail != null) {
            generator.setEncoding(detail
                    .getProperty(GeneralPreferences.ENCODING_PREFERENCE));
        }

        generator.setDestDir(outputDir);
        generator.setMakePairs(true);

        String superPackage = ((GeneratorControllerPanel) getView())
                .getSuperclassPackage()
                .getText();
        if (!Util.isEmptyString(superPackage)) {
            generator.setSuperPkg(superPackage);
        }

        return generator;
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.gen.DefaultClassGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.