(UidConfig config)
| 21 | } |
| 22 | |
| 23 | private void init(UidConfig config) { |
| 24 | setHgap(GuiConstants.padding); |
| 25 | setVgap(GuiConstants.padding); |
| 26 | |
| 27 | InetSocketAddress address = config.getAddress(); |
| 28 | |
| 29 | add(new Label("Host:"), 0, 0); |
| 30 | hostField = new TextField(address != null ? address.getHostString() : ""); |
| 31 | add(hostField, 1, 0); |
| 32 | |
| 33 | add(new Label("Port:"), 0, 1); |
| 34 | portField = new TextField(address != null ? Integer.toString(address.getPort()) : ""); |
| 35 | add(portField, 1, 1); |
| 36 | |
| 37 | add(new Label("User:"), 0, 2); |
| 38 | userField = new TextField(config.getUser()); |
| 39 | add(userField, 1, 2); |
| 40 | |
| 41 | add(new Label("Password:"), 0, 3); |
| 42 | passwordField = new TextField(config.getPassword()); |
| 43 | add(passwordField, 1, 3); |
| 44 | |
| 45 | add(new Label("Project:"), 0, 4); |
| 46 | projectField = new TextField(config.getProject() != null ? config.getProject() : ""); |
| 47 | add(projectField, 1, 4); |
| 48 | |
| 49 | add(new Label("Version A:"), 0, 5); |
| 50 | versionAField = new TextField(config.getVersionA() != null ? config.getVersionA() : ""); |
| 51 | add(versionAField, 1, 5); |
| 52 | |
| 53 | add(new Label("Version B:"), 0, 6); |
| 54 | versionBField = new TextField(config.getVersionB() != null ? config.getVersionB() : ""); |
| 55 | add(versionBField, 1, 6); |
| 56 | |
| 57 | ChangeListener<String> changeListener = (observable, oldValue, newValue) -> okButton.setDisable(!createConfig().isValid()); |
| 58 | |
| 59 | hostField.textProperty().addListener(changeListener); |
| 60 | portField.textProperty().addListener(changeListener); |
| 61 | userField.textProperty().addListener(changeListener); |
| 62 | passwordField.textProperty().addListener(changeListener); |
| 63 | projectField.textProperty().addListener(changeListener); |
| 64 | versionAField.textProperty().addListener(changeListener); |
| 65 | versionBField.textProperty().addListener(changeListener); |
| 66 | |
| 67 | changeListener.changed(null, null, null); |
| 68 | } |
| 69 | |
| 70 | UidConfig createConfig() { |
| 71 | int port; |
no test coverage detected