Examples of FSPath


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

        return editor;
    }

    public void addTemplateAction() {

        FSPath path = new TemplateCreator(this).startupAction();

        if (path != null) {
            int len = templateEntries.size();
            templateEntries.add(path);
            ((AbstractTableModel) view.getTable().getModel()).fireTableRowsInserted(
View Full Code Here

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

    }

    FSPath getLastTemplateDirectory() {
        // find start directory in preferences

        FSPath path = new FSPath(application.getPreferencesNode(
                CodeTemplateManager.class,
                "lastTemplate"));

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

        return path;
    }
View Full Code Here

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

                this);

        builder.bindToAction(view.getCancelButton(), "cancelAction()");
        builder.bindToAction(view.getOkButton(), "okAction()");

        final FSPath path = getLastTemplateDirectory();
        view.getTemplateChooser().setCurrentDirectory(path.getExistingDirectory(false));
        view.getTemplateChooser().addPropertyChangeListener(
                FileChooser.CURRENT_DIRECTORY_PROPERTY,
                new PropertyChangeListener() {

                    public void propertyChange(PropertyChangeEvent evt) {
                        File directory = view.getTemplateChooser().getCurrentDirectory();
                        path.setDirectory(directory);
                    }
                });
    }
View Full Code Here

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

        }

        String key = view.getTemplateName().getText();
        File file = view.getTemplateChooser().getFile();
        Preferences newNode = preferences.node(key);
        FSPath path = (FSPath) application
                .getCayenneProjectPreferences()
                .getProjectDetailObject(FSPath.class, newNode);
        editor.getAddedNode().add(newNode);
        path.setPath(file != null ? file.getAbsolutePath() : null);
        return path;
    }
View Full Code Here

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

     * 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) application
                .getCayenneProjectPreferences()
                .getProjectDetailObject(
                        FSPath.class,
                        getViewPreferences().node("lastDir"));

        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

    }
   
    @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);
           
            String path = chooser.getSelectedFile().getPath();
            if (!path.endsWith("." + ext)) {
                path += "." + ext;
            }
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
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.