IDEA-177963 - Servers combo: Switch to <Auto-Detected> on last removal

- refillModel should not try to restore previous selection
- refillModel should notify listeners to start detection routine
This commit is contained in:
Michael Golubev
2017-08-29 14:59:52 +02:00
parent 7ec0589c35
commit 3871840fc6
@@ -171,8 +171,7 @@ public class RemoteServerCombo<S extends ServerConfiguration> extends ComboboxWi
}
protected final void refillModel(@Nullable RemoteServer<?> newSelection) {
String nameToSelect = newSelection != null ? newSelection.getName() :
(getSelectedItem() != null ? getSelectedItem().getServerName() : null);
String nameToSelect = newSelection != null ? newSelection.getName() : null;
myServerListModel.removeAll();
ServerItem itemToSelect = null;
@@ -198,7 +197,7 @@ public class RemoteServerCombo<S extends ServerConfiguration> extends ComboboxWi
myServerListModel.add(nextAction);
}
myServerListModel.setSelectedItem(itemToSelect);
getComboBox().setSelectedItem(itemToSelect);
}
@NotNull