Search in sources :

Example 1 with PyProjectSynchronizer

use of com.jetbrains.python.remote.PyProjectSynchronizer in project intellij-community by JetBrains.

the class ProjectSpecificSettingsStep method configureMappingField.

/**
   * Enables or disables "remote path" based on interpreter.
   */
private void configureMappingField(@NotNull final PythonRemoteInterpreterManager remoteInterpreterManager) {
    if (myRemotePathField == null) {
        return;
    }
    final JPanel mainPanel = myRemotePathField.getMainPanel();
    final PyProjectSynchronizer synchronizer = getSynchronizer(remoteInterpreterManager);
    if (synchronizer != null) {
        final String defaultRemotePath = synchronizer.getDefaultRemotePath();
        final boolean mappingRequired = defaultRemotePath != null;
        mainPanel.setVisible(mappingRequired);
        final TextAccessor textField = myRemotePathField.getTextField();
        if (mappingRequired && StringUtil.isEmpty(textField.getText())) {
            textField.setText(defaultRemotePath);
        }
        myRemotePathRequired = mappingRequired;
    } else {
        mainPanel.setVisible(false);
        myRemotePathRequired = false;
    }
}
Also used : PyProjectSynchronizer(com.jetbrains.python.remote.PyProjectSynchronizer) TextAccessor(com.intellij.ui.TextAccessor)

Aggregations

TextAccessor (com.intellij.ui.TextAccessor)1 PyProjectSynchronizer (com.jetbrains.python.remote.PyProjectSynchronizer)1