Package org.apache.cayenne.project

Examples of org.apache.cayenne.project.ApplicationProject


        try {
            getApplication().getFrameController().addToLastProjListAction(
                    file.getAbsolutePath());

            Configuration config = buildProjectConfiguration(file);
            Project project = new ApplicationProject(file, config);
            getProjectController().setProject(project);

            // if upgrade was canceled
            int upgradeStatus = project.getUpgradeStatus();
            if (upgradeStatus > 0) {
                JOptionPane
                        .showMessageDialog(
                                Application.getFrame(),
                                "Can't open project - it was created using a newer version of the Modeler",
View Full Code Here


        createDomain();
    }

    protected void createDomain() {
        // only ApplicationProjects can have domains, so this cast is reasonable
        ApplicationProject project = (ApplicationProject) getCurrentProject();

        ProjectController mediator = getProjectController();
        DataDomain domain = (DataDomain) NamedObjectFactory.createObject(
                DataDomain.class,
                project.getConfiguration());
        domain.getEntityResolver().setIndexedByClass(false);
        project.getConfiguration().addDomain(domain);
        mediator.fireDomainEvent(new DomainEvent(this, domain, MapEvent.ADD));
        mediator.fireDomainDisplayEvent(new DomainDisplayEvent(this, domain));
    }
View Full Code Here

        if (getCurrentProject() != null && !closeProject(true)) {
            return;
        }

        Configuration config = buildProjectConfiguration(null);
        Project project = new ApplicationProject(null, config);

        // stick a DataDomain
        DataDomain domain = (DataDomain) NamedObjectFactory.createObject(
                DataDomain.class,
                config);
View Full Code Here

            removeDomain();
        }
    }

    protected void removeDomain() {
        ApplicationProject project = (ApplicationProject) getCurrentProject();
        ProjectController mediator = getProjectController();
        DataDomain domain = mediator.getCurrentDataDomain();
        project.getConfiguration().removeDomain(domain.getName());
        mediator.fireDomainEvent(new DomainEvent(
                Application.getFrame(),
                domain,
                MapEvent.REMOVE));
    }
View Full Code Here

        if (getCurrentProject() != null && !closeProject(true)) {
            return;
        }

        Configuration config = buildProjectConfiguration(null);
        Project project = new ApplicationProject(null, config);

        // stick a DataDomain
        DataDomain domain = (DataDomain) NamedObjectFactory.createObject(
                DataDomain.class,
                config);
View Full Code Here

    protected ApplicationProject project;

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        project = new ApplicationProject(new File(System.getProperty("user.dir")));
        validator = new Validator(project);
    }
View Full Code Here

           
            getApplication().getFrameController().addToLastProjListAction(
                    file.getAbsolutePath());

            Configuration config = buildProjectConfiguration(file);
            Project project = new ApplicationProject(file, config);
            getProjectController().setProject(project);

            // if upgrade was canceled
            int upgradeStatus = project.getUpgradeStatus();
            if (upgradeStatus > 0) {
                JOptionPane
                        .showMessageDialog(
                                Application.getFrame(),
                                "Can't open project - it was created using a newer version of the Modeler",
View Full Code Here

    public String getIconName() {
        return "icon-dom.gif";
    }

    public void performAction(ActionEvent e) {
        ApplicationProject project = (ApplicationProject) getCurrentProject();
        ProjectController mediator = getProjectController();

        DataDomain domain = (DataDomain) NamedObjectFactory.createObject(
                DataDomain.class,
                project.getConfiguration());

        domain.getEntityResolver().setIndexedByClass(false);

        createDomain(domain);
View Full Code Here

        application.getUndoManager().addEdit(new CreateDomainUndoableEdit(domain));
    }

    public void createDomain(DataDomain domain) {
        ApplicationProject project = (ApplicationProject) getCurrentProject();
        ProjectController mediator = getProjectController();

        project.getConfiguration().addDomain(domain);
        mediator.fireDomainEvent(new DomainEvent(this, domain, MapEvent.ADD));
        mediator.fireDomainDisplayEvent(new DomainDisplayEvent(this, domain));
    }
View Full Code Here

        }

    }

    public void removeDomain(DataDomain domain) {
        ApplicationProject project = (ApplicationProject) getCurrentProject();
        ProjectController mediator = getProjectController();

        project.getConfiguration().removeDomain(domain.getName());
        mediator.fireDomainEvent(new DomainEvent(
                Application.getFrame(),
                domain,
                MapEvent.REMOVE));
    }
View Full Code Here

TOP

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

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.