()
| 60 | } |
| 61 | |
| 62 | private void init() { |
| 63 | setHgap(4 * GuiConstants.padding); |
| 64 | setVgap(4 * GuiConstants.padding); |
| 65 | |
| 66 | ColumnConstraints colConstraint = new ColumnConstraints(); |
| 67 | colConstraint.setPercentWidth(50); |
| 68 | getColumnConstraints().addAll(colConstraint, colConstraint); |
| 69 | |
| 70 | RowConstraints rowConstraintInput = new RowConstraints(); |
| 71 | RowConstraints rowConstraintClassPath = new RowConstraints(); |
| 72 | rowConstraintClassPath.setVgrow(Priority.SOMETIMES); |
| 73 | RowConstraints rowConstraintButtons = new RowConstraints(); |
| 74 | RowConstraints rowConstraintShared = new RowConstraints(); |
| 75 | rowConstraintShared.setVgrow(Priority.SOMETIMES); |
| 76 | getRowConstraints().addAll(rowConstraintInput, rowConstraintClassPath, rowConstraintButtons, rowConstraintShared); |
| 77 | |
| 78 | add(createFilesSelectionPane("Inputs A", pathsA, window, false, false), 0, 0); |
| 79 | add(createFilesSelectionPane("Inputs B", pathsB, window, false, false), 1, 0); |
| 80 | add(createFilesSelectionPane("Class path A", classPathA, window, true, false), 0, 1); |
| 81 | add(createFilesSelectionPane("Class path B", classPathB, window, true, false), 1, 1); |
| 82 | |
| 83 | HBox hbox = new HBox(GuiConstants.padding); |
| 84 | Button swapButton = new Button("swap A ⇄ B"); |
| 85 | hbox.getChildren().add(swapButton); |
| 86 | swapButton.setOnAction(event -> { |
| 87 | List<Path> paths = new ArrayList<>(pathsA); |
| 88 | pathsA.clear(); |
| 89 | pathsA.addAll(pathsB); |
| 90 | pathsB.setAll(paths); |
| 91 | |
| 92 | paths.clear(); |
| 93 | paths.addAll(classPathA); |
| 94 | classPathA.clear(); |
| 95 | classPathA.addAll(classPathB); |
| 96 | classPathB.setAll(paths); |
| 97 | |
| 98 | String tmp = nonObfuscatedClassPatternA.getText(); |
| 99 | nonObfuscatedClassPatternA.setText(nonObfuscatedClassPatternB.getText()); |
| 100 | nonObfuscatedClassPatternB.setText(tmp); |
| 101 | |
| 102 | tmp = nonObfuscatedMemberPatternA.getText(); |
| 103 | nonObfuscatedMemberPatternA.setText(nonObfuscatedMemberPatternB.getText()); |
| 104 | nonObfuscatedMemberPatternB.setText(tmp); |
| 105 | }); |
| 106 | add(hbox, 0, 2, 2, 1); |
| 107 | |
| 108 | add(createFilesSelectionPane("Shared class path", sharedClassPath, window, true, true), 0, 3, 2, 1); |
| 109 | // TODO: config.inputsBeforeClassPath |
| 110 | |
| 111 | add(createMiscPane(), 0, 4, 2, 1); |
| 112 | |
| 113 | ListChangeListener<Path> listChangeListener = change -> okButton.setDisable(!createConfig().isValid()); |
| 114 | InvalidationListener invalidationListener = change -> okButton.setDisable(!createConfig().isValid()); |
| 115 | |
| 116 | pathsA.addListener(listChangeListener); |
| 117 | pathsB.addListener(listChangeListener); |
| 118 | classPathA.addListener(listChangeListener); |
| 119 | classPathB.addListener(listChangeListener); |
no test coverage detected