Ejemplo n.º 1
0
  /**
   * Creates a new BlueJ project.
   *
   * @param directory where you want the project be placed, it must be writable.
   * @param projectType the type of project, such as ME or SE.
   * @return the newly created BProject if successful, null otherwise.
   */
  public BProject newProject(File directory, int projectType) {
    if (!myWrapper.isValid()) throw new ExtensionUnloadedException();

    String pathString = directory.getAbsolutePath();
    if (!pathString.endsWith(File.separator)) pathString += File.separator;

    if (!Project.createNewProject(pathString, projectType == ME_PROJECT)) return null;

    return openProject(directory);
  }