Skip to content

Commit

Permalink
getCleaner()
Browse files Browse the repository at this point in the history
  • Loading branch information
xzel23 committed Apr 22, 2024
1 parent 18eae8c commit e1abcfc
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions fx-util/src/main/java/com/dua3/fx/util/PlatformHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private PlatformHelper() {
}

/**
* Run task on the JavaFX application thread and wait for completion.
* Run a task on the JavaFX application thread and wait for completion.
* Consider using {@link #runLater(Runnable)} to avoid executing tasks out of order.
*
* @param action the task to run
Expand All @@ -49,7 +49,7 @@ public static void runAndWait(Runnable action) {
}

/**
* Run task on the JavaFX application thread and return result.
* Run a task on the JavaFX application thread and return result.
*
* @param <T> the result type
* @param action the task to run
Expand Down Expand Up @@ -86,7 +86,7 @@ public static <T> T runAndWait(Supplier<T> action) {
}

/**
* Run task on the JavaFX application thread.
* Run a task on the JavaFX application thread.
*
* @param action the task to run
* @throws NullPointerException if {@code action} is {@code null}
Expand All @@ -113,4 +113,14 @@ public static void checkApplicationThread() {
public static void registerForCleanup(Object obj, Runnable action) {
CLEANER.register(obj, action);
}

/**
* Get default Cleaner.
*
* @return the {@link Cleaner} instance
*/
public static Cleaner getCleaner() {
return CLEANER;
}

}

0 comments on commit e1abcfc

Please sign in to comment.