Examples of FSPath


Examples of org.apache.cayenne.modeler.pref.FSPath

        // guess start directory
        if (!Util.isEmptyString(currentDir)) {
            chooser.setCurrentDirectory(new File(currentDir));
        }
        else {
            FSPath lastDir = Application
                    .getInstance()
                    .getFrameController()
                    .getLastDirectory();
            lastDir.updateChooser(chooser);
        }

        int result = chooser.showOpenDialog(getView());
        if (result == JFileChooser.APPROVE_OPTION) {
            File selected = chooser.getSelectedFile();
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.FSPath

            if (System.getProperty("cayenne.cgen.destdir") != null) {
                setOutputPath(System.getProperty("cayenne.cgen.destdir"));
            }
            else {
                // init default directory..
                FSPath lastPath = Application
                        .getInstance()
                        .getFrameController()
                        .getLastDirectory();

                path = checkDefaultMavenResourceDir(lastPath, "test");

                if (path != null
                        || (path = checkDefaultMavenResourceDir(lastPath, "main")) != null) {
                    setOutputPath(path);
                }
                else {
                    File lastDir = (lastPath != null) ? lastPath
                            .getExistingDirectory(false) : null;
                    setOutputPath(lastDir != null ? lastDir.getAbsolutePath() : null);
                }
            }
        }
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.FSPath

    }

    protected File selectDataMap(Frame f) {

        // find start directory in preferences
        FSPath lastDir = getApplication().getFrameController().getLastDirectory();

        // configure dialog
        JFileChooser chooser = new JFileChooser();
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        lastDir.updateChooser(chooser);

        chooser.addChoosableFileFilter(FileFilters.getDataMapFilter());

        int status = chooser.showDialog(f, "Select DataMap");
        if (status == JFileChooser.APPROVE_OPTION) {
            File file = chooser.getSelectedFile();

            // save to preferences...
            lastDir.updateFromChooser(chooser);

            return file;
        }

        return null;
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.FSPath

    public void updateCustomTemplates(Domain preferenceDomain) {
        Map<String, FSPath> templates = preferenceDomain.getDetailsMap(FSPath.class);
        this.customTemplates = new HashMap<String, String>(templates.size(), 1);

        for (Map.Entry<String, FSPath> entry : templates.entrySet()) {
            FSPath path = entry.getValue();
            customTemplates.put(entry.getKey(), path.getPath());
        }
    }
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.FSPath

            logger.warn("Error reading preferences");
        }
        this.customTemplates = new HashMap<String, String>(keys.length, 1);

        for (int j = 0; j < keys.length; j++) {
            FSPath path = new FSPath(preference.node(keys[j]));
            customTemplates.put(keys[j], path.getPath());
        }
    }
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.FSPath

    }

    public FSPath getLastEOModelDirectory() {
        // find start directory in preferences

        FSPath path = (FSPath) getViewDomain()
                .getDetail("lastEOMDir", FSPath.class, true);

        if (path.getPath() == null) {
            path.setPath(getLastDirectory().getPath());
        }

        return path;
    }
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.FSPath

            logger.warn("Error reading preferences");
        }
        this.customTemplates = new HashMap<String, String>(keys.length, 1);

        for (int j = 0; j < keys.length; j++) {
            FSPath path = new FSPath(preference.node(keys[j]));
            customTemplates.put(keys[j], path.getPath());
        }
    }
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.FSPath

        int status = fileChooser.showOpenDialog(Application.getFrame());

        if (status == JFileChooser.APPROVE_OPTION) {

            // save preferences
            FSPath lastDir = getApplication()
                    .getFrameController()
                    .getLastEOModelDirectory();
            lastDir.updateFromChooser(fileChooser);

            File file = fileChooser.getSelectedFile();
            if (file.isFile()) {
                file = file.getParentFile();
            }
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.FSPath

        if (eoModelChooser == null) {
            eoModelChooser = new EOModelChooser("Select EOModel");
        }

        FSPath lastDir = getApplication().getFrameController().getLastEOModelDirectory();
        lastDir.updateChooser(eoModelChooser);

        return eoModelChooser;
    }
View Full Code Here

Examples of org.apache.cayenne.modeler.pref.FSPath

        // guess start directory
        if (!Util.isEmptyString(currentDir)) {
            chooser.setCurrentDirectory(new File(currentDir));
        }
        else {
            FSPath lastDir = Application
                    .getInstance()
                    .getFrameController()
                    .getLastDirectory();
            lastDir.updateChooser(chooser);
        }

        int result = chooser.showOpenDialog(getView());
        if (result == JFileChooser.APPROVE_OPTION) {
            File selected = chooser.getSelectedFile();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.