Browse Source

added documentation

[ci skip]
Sebastian Stenzel 3 years ago
parent
commit
c1504e29c1
1 changed files with 13 additions and 2 deletions
  1. 13 2
      src/main/java/org/cryptomator/ui/fxapp/FxApplicationTerminator.java

+ 13 - 2
src/main/java/org/cryptomator/ui/fxapp/FxApplicationTerminator.java

@@ -35,7 +35,7 @@ public class FxApplicationTerminator {
 	private final AtomicBoolean allowQuitWithoutPrompt = new AtomicBoolean();
 
 	@Inject
-	public FxApplicationTerminator(ObservableList<Vault> vaults, ShutdownHook shutdownHook, FxApplicationWindows appWindows){
+	public FxApplicationTerminator(ObservableList<Vault> vaults, ShutdownHook shutdownHook, FxApplicationWindows appWindows) {
 		this.vaults = vaults;
 		this.shutdownHook = shutdownHook;
 		this.appWindows = appWindows;
@@ -84,6 +84,12 @@ public class FxApplicationTerminator {
 		}
 	}
 
+	/**
+	 * Asks the app to quit. If confirmed, the JavaFX application will exit before giving a {@code response}.
+	 *
+	 * @param e ignored
+	 * @param response a quit response that will be {@link ExitingQuitResponse decorated in order to exit the JavaFX application}.
+	 */
 	private void handleQuitRequest(@SuppressWarnings("unused") @Nullable EventObject e, QuitResponse response) {
 		var exitingResponse = new ExitingQuitResponse(response);
 		if (allowQuitWithoutPrompt.get()) {
@@ -107,7 +113,12 @@ public class FxApplicationTerminator {
 		}
 	}
 
-	private class NoopQuitResponse implements QuitResponse {
+	/**
+	 * A dummy QuitResponse that ignores the response.
+	 *
+	 * To be used with {@link #handleQuitRequest(EventObject, QuitResponse)} if the invoking method is not interested in the response.
+	 */
+	private static class NoopQuitResponse implements QuitResponse {
 
 		@Override
 		public void performQuit() {