Search in sources :

Example 1 with CCNewProjectPanel

use of com.jetbrains.edu.coursecreator.ui.CCNewProjectPanel in project intellij-community by JetBrains.

the class CCChangeCourseInfo method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
    Project project = e.getProject();
    if (project == null) {
        return;
    }
    Course course = StudyTaskManager.getInstance(project).getCourse();
    if (course == null) {
        return;
    }
    CCNewProjectPanel panel = new CCNewProjectPanel(course.getName(), Course.getAuthorsString(course.getAuthors()), course.getDescription());
    setupLanguageLevels(course, panel);
    DialogBuilder builder = createChangeInfoDialog(project, panel);
    if (builder.showAndGet()) {
        course.setAuthorsAsString(panel.getAuthors());
        course.setName(panel.getName());
        course.setDescription(panel.getDescription());
        setVersion(course, panel);
        ProjectView.getInstance(project).refresh();
        ProjectInspectionProfileManager.getInstance(project).fireProfileChanged();
    }
}
Also used : Project(com.intellij.openapi.project.Project) Course(com.jetbrains.edu.learning.courseFormat.Course) DialogBuilder(com.intellij.openapi.ui.DialogBuilder) CCNewProjectPanel(com.jetbrains.edu.coursecreator.ui.CCNewProjectPanel)

Example 2 with CCNewProjectPanel

use of com.jetbrains.edu.coursecreator.ui.CCNewProjectPanel in project intellij-community by JetBrains.

the class PyCCProjectGenerator method extendBasePanel.

@Nullable
@Override
public JPanel extendBasePanel() throws ProcessCanceledException {
    mySettingsPanel = new CCNewProjectPanel();
    mySettingsPanel.registerValidators(new FacetValidatorsManager() {

        public void registerValidator(FacetEditorValidator validator, JComponent... componentsToWatch) {
            throw new UnsupportedOperationException();
        }

        public void validate() {
            fireStateChanged();
        }
    });
    return mySettingsPanel.getMainPanel();
}
Also used : FacetValidatorsManager(com.intellij.facet.ui.FacetValidatorsManager) FacetEditorValidator(com.intellij.facet.ui.FacetEditorValidator) CCNewProjectPanel(com.jetbrains.edu.coursecreator.ui.CCNewProjectPanel) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

CCNewProjectPanel (com.jetbrains.edu.coursecreator.ui.CCNewProjectPanel)2 FacetEditorValidator (com.intellij.facet.ui.FacetEditorValidator)1 FacetValidatorsManager (com.intellij.facet.ui.FacetValidatorsManager)1 Project (com.intellij.openapi.project.Project)1 DialogBuilder (com.intellij.openapi.ui.DialogBuilder)1 Course (com.jetbrains.edu.learning.courseFormat.Course)1 Nullable (org.jetbrains.annotations.Nullable)1