private void configureProject(IProject newProject) {
    try {
      final IProjectDescription desc = newProject.getDescription();
      desc.setNatureIds(new String[0]);
      newProject.setDescription(desc, null);

      desc.setNatureIds(MODEL_NATURES);
      if (ProductCustomizerMgr.getInstance() != null) {
        String productName = ProductCustomizerMgr.getInstance().getProductName();
        if (!CoreStringUtil.isEmpty(productName)) {
          desc.setComment(productName + ", version " + ModelerCore.ILicense.VERSION); // $NON-NLS-1$
        }
      }
      newProject.setDescription(desc, null);

      if (!ProductCustomizerMgr.getInstance()
          .getProductCharacteristics()
          .isHiddenProjectCentric()) {
        // Defect 11480 - closing and opening the project sets the overlay icon properly
        newProject.close(null);
      }

      newProject.open(null);
    } catch (final CoreException err) {
      UiConstants.Util.log(IStatus.ERROR, err, err.getMessage());
    }
  }
Пример #2
0
  private void createProject(DBRProgressMonitor monitor) throws DBException, CoreException {
    IWorkspace workspace = DBeaverCore.getInstance().getWorkspace();
    IProject project = workspace.getRoot().getProject(data.getName());
    if (project.exists()) {
      throw new DBException(
          NLS.bind(CoreMessages.dialog_project_create_wizard_error_already_exists, data.getName()));
    }
    project.create(monitor.getNestedMonitor());

    project.open(monitor.getNestedMonitor());

    if (!CommonUtils.isEmpty(data.getDescription())) {
      final IProjectDescription description = workspace.newProjectDescription(project.getName());
      description.setComment(data.getDescription());
      project.setDescription(description, monitor.getNestedMonitor());
    }
  }