mirror of
https://gitlab.com/kauron/jstudy
synced 2024-12-22 16:33:33 +01:00
Merge branch 'app-ends'
This commit is contained in:
commit
50cefbfd53
2 changed files with 9 additions and 0 deletions
|
@ -77,6 +77,8 @@ public class Controller implements Initializable {
|
||||||
root.getScene().getWindow().setOnCloseRequest(event -> {
|
root.getScene().getWindow().setOnCloseRequest(event -> {
|
||||||
for (Tab tab : tabPane.getTabs()) {
|
for (Tab tab : tabPane.getTabs()) {
|
||||||
EventHandler<Event> handler = tab.getOnCloseRequest();
|
EventHandler<Event> handler = tab.getOnCloseRequest();
|
||||||
|
if (tabMap.containsKey(tab))
|
||||||
|
tabMap.get(tab).stopTimer();
|
||||||
if (tab.isClosable() && handler != null) {
|
if (tab.isClosable() && handler != null) {
|
||||||
tabPane.getSelectionModel().select(tab);
|
tabPane.getSelectionModel().select(tab);
|
||||||
handler.handle(event);
|
handler.handle(event);
|
||||||
|
|
|
@ -209,4 +209,11 @@ public class TableController implements Initializable {
|
||||||
timerTask = null;
|
timerTask = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void stopTimer() {
|
||||||
|
timer.cancel();
|
||||||
|
timer.purge();
|
||||||
|
if (timerTask != null)
|
||||||
|
timerTask.cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue