ArrayList<String> performOnConnect = new ArrayList<>();
for (String cmd : textPerform.getText().split(Message.NEW_LINE))
performOnConnect.add(cmd);
ConnectionSettings newCS = new ConnectionSettings(textServer.getText(),
textNick.getText());
if(!textConnName.getText().isEmpty())
newCS.setConnectionName(textConnName.getText());
newCS.setPort(Integer.parseInt(textPort.getText()));
newCS.setServerPassword(textServPass.getText());
newCS.setSsl(btnUseSsl.getSelection());
newCS.setConnectOnStart(btnConnectOnStartup.getSelection());
newCS.setNickPassword(textNickPass.getText());
if(!textIdent.getText().isEmpty())
newCS.setIdent(textIdent.getText());
newCS.setAutoJoin(autoJoin);
newCS.setPerformOnConnect(performOnConnect);
table.getItem(table.getSelectionIndex()).setData(newCS);
table.getItem(table.getSelectionIndex()).setText(
new String[] { newCS.getConnectionName(),
newCS.getServer(), newCS.getNickname() });
saveTable();
}