Search in sources :

Example 1 with WebProjectTemplate

use of com.intellij.ide.util.projectWizard.WebProjectTemplate in project intellij-community by JetBrains.

the class ProjectSpecificSettingsStep method createAdvancedSettings.

@Override
@Nullable
protected JPanel createAdvancedSettings() {
    JComponent advancedSettings = null;
    if (myProjectGenerator instanceof PythonProjectGenerator) {
        advancedSettings = ((PythonProjectGenerator) myProjectGenerator).getSettingsPanel(myProjectDirectory);
    } else if (myProjectGenerator instanceof WebProjectTemplate) {
        advancedSettings = ((WebProjectTemplate) myProjectGenerator).getPeer().getComponent();
    }
    if (advancedSettings != null) {
        final JPanel jPanel = new JPanel(new VerticalFlowLayout());
        final HideableDecorator deco = new HideableDecorator(jPanel, "Mor&e Settings", false);
        boolean isValid = checkValid();
        deco.setOn(!isValid);
        if (myProjectGenerator instanceof PythonProjectGenerator && !deco.isExpanded()) {
            final ValidationResult result = ((PythonProjectGenerator) myProjectGenerator).warningValidation(getSdk());
            deco.setOn(!result.isOk());
        }
        deco.setContentComponent(advancedSettings);
        return jPanel;
    }
    return null;
}
Also used : PythonProjectGenerator(com.jetbrains.python.newProject.PythonProjectGenerator) WebProjectTemplate(com.intellij.ide.util.projectWizard.WebProjectTemplate) HideableDecorator(com.intellij.ui.HideableDecorator) ValidationResult(com.intellij.facet.ui.ValidationResult) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with WebProjectTemplate

use of com.intellij.ide.util.projectWizard.WebProjectTemplate in project intellij-community by JetBrains.

the class PythonGenerateProjectCallback method computeProjectSettings.

public static Object computeProjectSettings(DirectoryProjectGenerator<?> generator, final ProjectSpecificSettingsStep settings) {
    Object projectSettings = null;
    if (generator instanceof PythonProjectGenerator) {
        final PythonProjectGenerator<?> projectGenerator = (PythonProjectGenerator<?>) generator;
        projectSettings = projectGenerator.getProjectSettings();
    } else if (generator instanceof WebProjectTemplate) {
        projectSettings = ((WebProjectTemplate<?>) generator).getPeer().getSettings();
    }
    if (projectSettings instanceof PyNewProjectSettings) {
        final PyNewProjectSettings newProjectSettings = (PyNewProjectSettings) projectSettings;
        newProjectSettings.setSdk(settings.getSdk());
        newProjectSettings.setInstallFramework(settings.installFramework());
        newProjectSettings.setRemotePath(settings.getRemotePath());
    }
    return projectSettings;
}
Also used : PyNewProjectSettings(com.jetbrains.python.newProject.PyNewProjectSettings) PythonProjectGenerator(com.jetbrains.python.newProject.PythonProjectGenerator) WebProjectTemplate(com.intellij.ide.util.projectWizard.WebProjectTemplate)

Aggregations

WebProjectTemplate (com.intellij.ide.util.projectWizard.WebProjectTemplate)2 PythonProjectGenerator (com.jetbrains.python.newProject.PythonProjectGenerator)2 ValidationResult (com.intellij.facet.ui.ValidationResult)1 HideableDecorator (com.intellij.ui.HideableDecorator)1 PyNewProjectSettings (com.jetbrains.python.newProject.PyNewProjectSettings)1 Nullable (org.jetbrains.annotations.Nullable)1