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;
}
}
Aggregations