Search in sources :

Example 1 with LocationNameFieldsBinding

use of com.intellij.platform.LocationNameFieldsBinding in project intellij-community by JetBrains.

the class AbstractCreateVirtualEnvDialog method setupDialog.

void setupDialog(Project project, final List<Sdk> allSdks) {
    myProject = project;
    final GridBagLayout layout = new GridBagLayout();
    myMainPanel = new JPanel(layout);
    myName = new JTextField();
    myDestination = new TextFieldWithBrowseButton();
    myMakeAvailableToAllProjectsCheckbox = new JBCheckBox(PyBundle.message("sdk.create.venv.dialog.make.available.to.all.projects"));
    if (project == null || project.isDefault() || !PlatformUtils.isPyCharm()) {
        myMakeAvailableToAllProjectsCheckbox.setSelected(true);
        myMakeAvailableToAllProjectsCheckbox.setVisible(false);
    }
    layoutPanel(allSdks);
    init();
    setOKActionEnabled(false);
    registerValidators(new FacetValidatorsManager() {

        public void registerValidator(FacetEditorValidator validator, JComponent... componentsToWatch) {
        }

        public void validate() {
            checkValid();
        }
    });
    myMainPanel.setPreferredSize(new Dimension(300, 50));
    checkValid();
    setInitialDestination();
    addUpdater(myName);
    new LocationNameFieldsBinding(project, myDestination, myName, myInitialPath, PyBundle.message("sdk.create.venv.dialog.select.venv.location"));
}
Also used : TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) FacetValidatorsManager(com.intellij.facet.ui.FacetValidatorsManager) LocationNameFieldsBinding(com.intellij.platform.LocationNameFieldsBinding) FacetEditorValidator(com.intellij.facet.ui.FacetEditorValidator) JBCheckBox(com.intellij.ui.components.JBCheckBox)

Aggregations

FacetEditorValidator (com.intellij.facet.ui.FacetEditorValidator)1 FacetValidatorsManager (com.intellij.facet.ui.FacetValidatorsManager)1 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)1 LocationNameFieldsBinding (com.intellij.platform.LocationNameFieldsBinding)1 JBCheckBox (com.intellij.ui.components.JBCheckBox)1