(Gui gui)
| 9 | |
| 10 | class Shortcuts { |
| 11 | public static void init(Gui gui) { |
| 12 | Map<KeyCombination, Runnable> accelerators = gui.getScene().getAccelerators(); |
| 13 | |
| 14 | // M - match |
| 15 | accelerators.put(new KeyCodeCombination(KeyCode.M), () -> gui.getBottomPane().getMatchButton().fireEvent(new ActionEvent())); |
| 16 | // U - unmatch |
| 17 | accelerators.put(new KeyCodeCombination(KeyCode.U), () -> { |
| 18 | if (!gui.getBottomPane().getUnmatchVarButton().isDisable()) { |
| 19 | gui.getBottomPane().getUnmatchVarButton().fireEvent(new ActionEvent()); |
| 20 | } else if (!gui.getBottomPane().getUnmatchMemberButton().isDisable()) { |
| 21 | gui.getBottomPane().getUnmatchMemberButton().fireEvent(new ActionEvent()); |
| 22 | } else if (!gui.getBottomPane().getUnmatchClassButton().isDisable()) { |
| 23 | gui.getBottomPane().getUnmatchClassButton().fireEvent(new ActionEvent()); |
| 24 | } |
| 25 | }); |
| 26 | // I - ignore (toggle matchable) |
| 27 | accelerators.put(new KeyCodeCombination(KeyCode.I), () -> gui.getBottomPane().getMatchableButton().fireEvent(new ActionEvent())); |
| 28 | } |
| 29 | } |
no test coverage detected