From 3871840fc600fdb497de5fbd9bca0055d884a09e Mon Sep 17 00:00:00 2001 From: Michael Golubev Date: Tue, 29 Aug 2017 14:57:48 +0200 Subject: [PATCH] IDEA-177963 - Servers combo: Switch to on last removal - refillModel should not try to restore previous selection - refillModel should notify listeners to start detection routine --- .../impl/configuration/deployment/RemoteServerCombo.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/deployment/RemoteServerCombo.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/deployment/RemoteServerCombo.java index 147c7f84dfb1..4bc0114fe31c 100644 --- a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/deployment/RemoteServerCombo.java +++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/deployment/RemoteServerCombo.java @@ -171,8 +171,7 @@ public class RemoteServerCombo 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 extends ComboboxWi myServerListModel.add(nextAction); } - myServerListModel.setSelectedItem(itemToSelect); + getComboBox().setSelectedItem(itemToSelect); } @NotNull