Bug fix Shortcut CTRL + T

pull/14/head
Ronaldo Christnawan 6 years ago
parent 3fc1451ac8
commit a08b2fe770

@ -168,6 +168,7 @@ public class FormUtamaController implements Initializable {
case FormConstanta.TRANSAKSI_TUNAI:
if (notaContent.nodeTunai != null) {
node = notaContent.nodeTunai;
notaContent.controllerTunai.initShortcuts();
} else {
loader.setLocation(getClass().getResource("/fxml/FormTransaksiTunai.fxml"));
node = loader.load();

@ -145,13 +145,12 @@ public class FormTransaksiTunaiController implements Initializable {
setTanggal();
}
private void initShortcuts() {
public void initShortcuts() {
Map<KeyCombination, Runnable> listShortcuts = new HashMap<>();
KeyCombination kcTundaNota = new KeyCodeCombination(KeyCode.T, KeyCombination.CONTROL_DOWN);
Runnable rnTundaNota = () -> {
List<DNotaTunai> daftarDNotaTunai = new ArrayList<>();
if (noNota != null && !noNota.equals("")) {
for (TabelBarangTunai tbt : daftarTabelTransaksi) {
tbt.getData().setNoNota(noNota);
@ -196,7 +195,9 @@ public class FormTransaksiTunaiController implements Initializable {
};
listShortcuts.put(kcTundaNota, rnTundaNota);
Platform.runLater(() -> {
apMain.getScene().getAccelerators().putAll(listShortcuts);
});
}
public void setTanggal() {
@ -638,12 +639,14 @@ public class FormTransaksiTunaiController implements Initializable {
@Override
public void onComplete() {
Platform.runLater(() -> {
if (parent != null) {
parent.notaContent.setControllerTunai(null);
parent.notaContent.setNodeTunai(null);
parent.removeNota(parent.notaContent.getBtnTunai());
}
});
}
};
}

Loading…
Cancel
Save