Examples of FSPath


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

    }

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

        FSPath path = (FSPath) application
                .getCayenneProjectPreferences()
                .getProjectDetailObject(
                        FSPath.class,
                        getViewPreferences().node("lastEOMDir"));

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

        return path;
    }
View Full Code Here

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

        this.customTemplates = new HashMap(templates.size(), 1);
        Iterator it = templates.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry entry = (Map.Entry) it.next();

            FSPath path = (FSPath) entry.getValue();
            customTemplates.put(entry.getKey(), 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

        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

    }

    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

     * no such directory set up in the preferences, creates a new object, setting its path
     * to the parent last directory or to the user HOME directory.
     */
    public FSPath getLastDirectory() {
        // find start directory in preferences
        FSPath path = (FSPath) getViewDomain().getDetail("lastDir", FSPath.class, true);

        if (path.getPath() == null) {

            String pathString = (getParent() != null) ? getParent()
                    .getLastDirectory()
                    .getPath() : System.getProperty("user.home");
            path.setPath(pathString);
        }

        return path;
    }
View Full Code Here

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

    }

    protected void initBindings(BindingBuilder bindingBuilder) {
        if (preferences.getOutputPath() == null) {
            // init default directory..
            FSPath lastPath = Application
                    .getInstance()
                    .getFrameController()
                    .getLastDirectory();
            File lastDir = (lastPath != null)
                    ? lastPath.getExistingDirectory(false)
                    : null;
            preferences.setOutputPath(lastDir != null ? lastDir.getAbsolutePath() : null);
        }

        JTextField outputFolder = ((GeneratorControllerPanel) getView())
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

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

    }
   
    @Override
    public void performAction(ActionEvent e) {
        // 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.setAcceptAllFileFilterUsed(false);
       
        String ext = "png";
        chooser.addChoosableFileFilter(FileFilters.getExtensionFileFilter(ext, "PNG Images"));
       
        int status = chooser.showSaveDialog(Application.getFrame());
        if (status == JFileChooser.APPROVE_OPTION) {
            lastDir.updateFromChooser(chooser);
            try {
                String path = chooser.getSelectedFile().getPath();
                if (!path.endsWith("." + ext)) {
                    path += "." + ext;
                }
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.