Package org.apache.cayenne.project

Examples of org.apache.cayenne.project.Project


        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


        super(getActionName(), application);
    }

    public void performAction(ActionEvent e) {

        Project project = getCurrentProject();
        if (project == null) {
            return;
        }

        boolean isNew = project.isLocationUndefined();

        CayenneModelerController controller = getApplication().getFrameController();

        // close ... don't use OpenProjectAction close method as it will ask for save, we
        // don't want that here
        controller.projectClosedAction();

        // reopen existing
        if (!isNew && project.getMainFile().isFile()) {
            OpenProjectAction openAction = (OpenProjectAction) controller
                    .getApplication()
                    .getAction(OpenProjectAction.getActionName());
            openAction.openProject(project.getMainFile());
        }
        // create new
        else if (!(project instanceof ApplicationProject)) {
            throw new CayenneRuntimeException("Only ApplicationProjects are supported.");
        }
View Full Code Here

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

    Project project = (Project)path.firstInstanceOf(Project.class);
    return project != null;
  }
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

                }
            }

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

                ProjectController projectController = getApplication()
                        .getFrameController()
                        .getProjectController();
                projectController.setDirty(true);
View Full Code Here

        super(getActionName(), application);
    }

    public void performAction(ActionEvent e) {

        Project project = getCurrentProject();
        if (project == null) {
            return;
        }

        boolean isNew = project.isLocationUndefined();

        CayenneModelerController controller = getApplication().getFrameController();

        // close ... don't use OpenProjectAction close method as it will ask for save, we
        // don't want that here
        controller.projectClosedAction();

        // reopen existing
        if (!isNew && project.getMainFile().isFile()) {
            OpenProjectAction openAction = (OpenProjectAction) controller
                    .getApplication()
                    .getAction(OpenProjectAction.getActionName());
            openAction.openProject(project.getMainFile());
        }
        // create new
        else if (!(project instanceof ApplicationProject)) {
            throw new CayenneRuntimeException("Only ApplicationProjects are supported.");
        }
View Full Code Here

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

    Project project = path.firstInstanceOf(Project.class);
    return project != null;
  }
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

*
*/
public class ValidatorTest extends CayenneCase {
   
  public void testProject() throws Exception {
    Project project = new TstProject(new File(System.getProperty("user.dir")));
    Validator validator = new Validator(project);
    assertSame(project, validator.getProject());
  }
View Full Code Here

    public void reconfigure() {
        pauseWatching();

        removeAllFiles();

        Project project = mediator.getProject();
        if (project != null // project opened
                && project.getProjectDirectory() != null) // not new project
        {
            String projectPath = project.getProjectDirectory().getPath() + File.separator;

            List<ProjectFile> files = project.buildFileList();
            for (ProjectFile pr : files)
                addFile(projectPath + pr.getLocation());
        }

        resumeWatching();
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.