Package org.apache.cayenne.project

Examples of org.apache.cayenne.project.Project


            // no more name assertions
            return;
        }

        Project project = (Project) path.getObjectParent();
        if (project == null) {
            return;
        }

        // check for duplicate names in the parent context
        Iterator it = project.getChildren().iterator();
        while (it.hasNext()) {
            DataDomain dom = (DataDomain) it.next();
            if (dom == domain) {
                continue;
            }
View Full Code Here


            // no more name assertions
            return;
        }

        Project project = (Project) path.getObjectParent();
        if (project == null) {
            return;
        }

        // check for duplicate names in the parent context
        Iterator it = project.getChildren().iterator();
        while (it.hasNext()) {
            DataDomain dom = (DataDomain) it.next();
            if (dom == domain) {
                continue;
            }
View Full Code Here

                }
            }
           
            if (modelChanged) {
                // mark the model as unsaved
                Project project = Application.getProject();
                project.setModified(true);

                ProjectController projectController = Application
                        .getInstance()
                        .getFrameController()
                        .getProjectController();
View Full Code Here

            // no more name assertions
            return;
        }

        Project project = (Project) path.getObjectParent();
        if (project == null) {
            return;
        }

        // check for duplicate names in the parent context
        Iterator it = project.getChildren().iterator();
        while (it.hasNext()) {
            DataDomain dom = (DataDomain) it.next();
            if (dom == domain) {
                continue;
            }
View Full Code Here

            // no more name assertions
            return;
        }

        Project project = (Project) path.getObjectParent();
        if (project == null) {
            return;
        }

        // check for duplicate names in the parent context
        Iterator it = project.getChildren().iterator();
        while (it.hasNext()) {
            DataDomain dom = (DataDomain) it.next();
            if (dom == domain) {
                continue;
            }
View Full Code Here

    }

    void saveLoaded(DataMap dataMap, File dataMapFile) throws FileNotFoundException {

        ConfigurationTree<DataMap> projectRoot = new ConfigurationTree<DataMap>(dataMap);
        Project project = new Project(projectRoot);
        projectSaver.save(project);
    }
View Full Code Here

        nodes[0].getDataMapNames().add("B");
        nodes[0].getDataMapNames().add("A");

        rootNode.getNodeDescriptors().addAll(Arrays.asList(nodes));

        Project project = new Project(new ConfigurationTree<DataChannelDescriptor>(
                rootNode));

        saver.saveAs(project, new URLResource(testFolder.toURL()));

        File target = new File(testFolder, "cayenne-test.xml");
View Full Code Here

        String mapFilePath = testFolder.toURI() + "../test.map.xml";
        String mapFileName = "test";
        DataMap testDataMap = new DataMap(mapFileName);
        testDataMap.setConfigurationSource(new URLResource(new URL(mapFilePath)));
        Project project = new Project(new ConfigurationTree<DataMap>(testDataMap));

        saver.save(project);

        File target = new File(testFolder.getParentFile(), mapFileName + ".map.xml");
        assertTrue(target.isFile());
View Full Code Here

    /**
     * Saves project and related files. Saving is done to temporary files, and only on
     * successful save, master files are replaced with new versions.
     */
    protected boolean saveAll() throws Exception {
        Project p = getCurrentProject();

        // obtain preference object before save, when the project path may change.....
        Domain preference = getProjectController().getPreferenceDomainForProject();

        if (!chooseDestination(p)) {
            return false;
        }

        p.save();

        // update preferences domain key
        preference.rename(p.getMainFile().getAbsolutePath());

        getApplication().getFrameController().addToLastProjListAction(
                p.getMainFile().getAbsolutePath());
        return true;
    }
View Full Code Here

    public boolean enableForPath(ProjectPath path) {
        if (path == null) {
            return false;
        }

        Project project = (Project) path.firstInstanceOf(Project.class);
        return project != null && project.isModified();
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.project.Project

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.