Search in sources :

Example 1 with ProjectId

use of com.intellij.openapi.externalSystem.model.project.ProjectId in project intellij-community by JetBrains.

the class GradleModuleWizardStep method updateDataModel.

@Override
public void updateDataModel() {
    myContext.setProjectBuilder(myBuilder);
    ProjectData parentProject = myParentProjectForm.getParentProject();
    myBuilder.setParentProject(parentProject);
    myBuilder.setProjectId(new ProjectId(myGroupIdField.getText(), myArtifactIdField.getText(), myVersionField.getText()));
    myBuilder.setInheritGroupId(myInheritGroupIdCheckBox.isSelected());
    myBuilder.setInheritVersion(myInheritVersionCheckBox.isSelected());
    if (StringUtil.isNotEmpty(myBuilder.getProjectId().getArtifactId())) {
        myContext.setProjectName(myBuilder.getProjectId().getArtifactId());
    }
    if (parentProject != null) {
        myContext.setProjectFileDirectory(parentProject.getLinkedExternalProjectPath() + '/' + myContext.getProjectName());
    } else {
        if (myProjectOrNull != null) {
            myContext.setProjectFileDirectory(myProjectOrNull.getBaseDir().getPath() + '/' + myContext.getProjectName());
        }
    }
}
Also used : ProjectId(com.intellij.openapi.externalSystem.model.project.ProjectId) ProjectData(com.intellij.openapi.externalSystem.model.project.ProjectData)

Example 2 with ProjectId

use of com.intellij.openapi.externalSystem.model.project.ProjectId in project intellij-community by JetBrains.

the class GradleModuleWizardStep method updateStep.

@Override
public void updateStep() {
    ProjectData parentProject = myParentProjectForm.getParentProject();
    ProjectId projectId = myBuilder.getProjectId();
    if (projectId == null) {
        setTestIfEmpty(myArtifactIdField, myBuilder.getName());
        setTestIfEmpty(myGroupIdField, parentProject == null ? myBuilder.getName() : parentProject.getGroup());
        setTestIfEmpty(myVersionField, parentProject == null ? DEFAULT_VERSION : parentProject.getVersion());
    } else {
        setTestIfEmpty(myArtifactIdField, projectId.getArtifactId());
        setTestIfEmpty(myGroupIdField, projectId.getGroupId());
        setTestIfEmpty(myVersionField, projectId.getVersion());
    }
    myInheritGroupIdCheckBox.setSelected(myBuilder.isInheritGroupId());
    myInheritVersionCheckBox.setSelected(myBuilder.isInheritVersion());
    updateComponents();
}
Also used : ProjectId(com.intellij.openapi.externalSystem.model.project.ProjectId) ProjectData(com.intellij.openapi.externalSystem.model.project.ProjectData)

Aggregations

ProjectData (com.intellij.openapi.externalSystem.model.project.ProjectData)2 ProjectId (com.intellij.openapi.externalSystem.model.project.ProjectId)2