use of com.intellij.remoteServer.impl.configuration.SingleRemoteServerConfigurable in project intellij-community by JetBrains.
the class CloudAccountSelectionEditor method createAccount.
private void createAccount(ServerType<?> cloudType) {
RemoteServer<?> newAccount = RemoteServersManager.getInstance().createServer(cloudType, generateServerName(cloudType));
final Ref<Consumer<String>> errorConsumerRef = new Ref<>();
SingleRemoteServerConfigurable configurable = new SingleRemoteServerConfigurable(newAccount, null, true) {
@Override
protected void setConnectionStatusText(boolean error, String text) {
super.setConnectionStatusText(error, error ? "" : text);
errorConsumerRef.get().consume(error ? text : null);
}
};
if (!new SingleConfigurableEditor(myMainPanel, configurable, ShowSettingsUtilImpl.createDimensionKey(configurable), false) {
{
errorConsumerRef.set(s -> setErrorText(s, myMainPanel));
}
}.showAndGet()) {
return;
}
newAccount.setName(configurable.getDisplayName());
RemoteServersManager.getInstance().addServer(newAccount);
AccountItem newAccountItem = new AccountItem(newAccount);
myAccountComboBox.addItem(newAccountItem);
myAccountComboBox.setSelectedItem(newAccountItem);
}
Aggregations