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.");
}