void (@Nullable RemoteServer<?> newSelection) { String nameToSelect = newSelection != null ? newSelection.getName() : null; myServerListModel.removeAll(); ServerItem itemToSelect = null; List<RemoteServer<S>> servers = getSortedServers(); if (servers.isEmpty()) { ServerItem noServersItem = getNoServersItem(); if (nameToSelect == null) { itemToSelect = noServersItem; } myServerListModel.add(noServersItem); } for (RemoteServer<S> nextServer : getSortedServers()) { ServerItem nextServerItem = new ServerItemImpl(nextServer.getName()); if (itemToSelect == null && nextServer.getName().equals(nameToSelect)) { itemToSelect = nextServerItem; } myServerListModel.add(nextServerItem); } for (TransientItem nextAction : getActionItems()) { myServerListModel.add(nextAction); } setSelectedServerItem(newSelection, itemToSelect); }