Search in sources :

Example 6 with PythonProjectGenerator

use of com.jetbrains.python.newProject.PythonProjectGenerator 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

PythonProjectGenerator (com.jetbrains.python.newProject.PythonProjectGenerator)6 Sdk (com.intellij.openapi.projectRoots.Sdk)4 ValidationResult (com.intellij.facet.ui.ValidationResult)2 WebProjectTemplate (com.intellij.ide.util.projectWizard.WebProjectTemplate)2 PyNewProjectSettings (com.jetbrains.python.newProject.PyNewProjectSettings)2 ExecutionException (com.intellij.execution.ExecutionException)1 Project (com.intellij.openapi.project.Project)1 SdkAdditionalData (com.intellij.openapi.projectRoots.SdkAdditionalData)1 DirectoryProjectGenerator (com.intellij.platform.DirectoryProjectGenerator)1 DocumentAdapter (com.intellij.ui.DocumentAdapter)1 HideableDecorator (com.intellij.ui.HideableDecorator)1 PyFrameworkProjectGenerator (com.jetbrains.python.newProject.PyFrameworkProjectGenerator)1 PyPackage (com.jetbrains.python.packaging.PyPackage)1 PythonRemoteInterpreterManager (com.jetbrains.python.remote.PythonRemoteInterpreterManager)1 PyDetectedSdk (com.jetbrains.python.sdk.PyDetectedSdk)1 PythonSdkAdditionalData (com.jetbrains.python.sdk.PythonSdkAdditionalData)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 DocumentEvent (javax.swing.event.DocumentEvent)1 Nullable (org.jetbrains.annotations.Nullable)1