@Action public void portInputDidEndEditing(final NSNotification sender) { try { host.setPort(portField.intValue()); } catch (NumberFormatException e) { host.setPort(-1); } this.itemChanged(); this.init(); this.reachable(); }
@Action public void hostFieldDidChange(final NSNotification sender) { String input = hostField.stringValue(); if (ProtocolFactory.isURL(input)) { final Host parsed = Host.parse(input); host.setProtocol(parsed.getProtocol()); host.setPort(parsed.getPort()); host.setHostname(parsed.getHostname()); host.setDefaultPath(parsed.getDefaultPath()); } else { host.setHostname(input); } this.itemChanged(); this.init(); this.reachable(); }