• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

se-edu / addressbook-level4 / 4262
94%

Build:
DEFAULT BRANCH: master
Ran 02 Mar 2018 04:01PM UTC
Jobs 1
Files 92
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
4262

push

travis-ci

Zhiyuan-Amos
MainWindow.fxml: update onCloseRequest event to call handleExit()

The MainWindow does not have an event handler to handle external
requests (such as the close button or through the taskbar) to close
the MainWindow.

This may cause the app to not close properly since MainApp#stop() is
not called as the ExitAppRequestEvent is not raised. MainApp#stop() is
the method used to call Platform#exit() and System#exit(int) which
closes our app and all remaining open windows. Thus, if MainApp#stop()
is not called, the app may continue to run even after the MainWindow is
closed, causing existing HelpWindows to remain open even when the user
expects the app to stop.

According to the life-cycle section in the documentation on JavaFX
Application[1], the app will only finish and call MainApp#stop() when
the app either calls Platform#exit() or when the last window has been
closed. Thus, should there be any HelpWindows still opened, the app
will continue running, causing those HelpWindows to remain open.

Let's add an event handler for the onCloseRequest event in the root of
MainWindow.fxml. This event will call MainWindow#handleExit(), which
raises an ExitAppRequestEvent, when there is an external request to
close the app.

EmptyMainWindowHandle does not contain a close button, thus to test if
an ExitAppRequestEvent was raised, we fire a
WindowEvent#WINDOW_CLOSE_REQUEST event which will trigger the
onCloseRequest event.

[1] JavaFx documentation for Application:
https://docs.oracle.com/javafx/2/api/javafx/application/Application.html

1463 of 1587 relevant lines covered (92.19%)

0.92 hits per line

Jobs
ID Job ID Ran Files Coverage
1 4262.1 02 Mar 2018 04:01PM UTC 0
92.19
Travis Job 4262.1
Source Files on build 4262
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #4262
  • 088db25e on github
  • Prev Build on master (#4236)
  • Next Build on master (#4263)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc