channelsList.setSelectedIndex(0);
} else {
int[] selectedIndices = new int[channelIds.size()];
ListModel<WebSocketChannelDTO> model = channelsList.getModel();
for (int i = 0, j = 0; i < model.getSize(); i++) {
WebSocketChannelDTO channel = model.getElementAt(i);
if (channelIds.contains(channel.id)) {
selectedIndices[j++] = i;
}
}
channelsList.setSelectedIndices(selectedIndices);