String address = addressText.getText();
Integer port = Ints.tryParse(portText.getText());
if (serverInfo == null) {
// create new
serverInfo = new ServerInfo(name, address, port);
config.getNetwork().add(serverInfo);
} else {
// update existing
serverInfo.setName(name);