|
@@ -248,14 +248,35 @@ public final class UIUtilities {
|
248
|
248
|
}
|
249
|
249
|
}
|
250
|
250
|
|
|
251
|
+ /**
|
|
252
|
+ * Invokes something off the EDT, ignoring any exceptions that occur.
|
|
253
|
+ *
|
|
254
|
+ * @param runnable Runnable to execute off the EDT
|
|
255
|
+ */
|
251
|
256
|
public static void invokeOffEDTNoLogging(final Runnable runnable) {
|
252
|
257
|
new RunnableSwingWorker<>(runnable).execute();
|
253
|
258
|
}
|
254
|
259
|
|
|
260
|
+ /**
|
|
261
|
+ * Invokes something off the EDT, logging any exceptions that occur.
|
|
262
|
+ *
|
|
263
|
+ * @param eventBus Eventbus to post errors to
|
|
264
|
+ * @param runnable Runnable to execute off the EDT
|
|
265
|
+ */
|
255
|
266
|
public static void invokeOffEDT(final DMDircMBassador eventBus, final Runnable runnable) {
|
256
|
267
|
new RunnableLoggingSwingWorker<Void, Void>(eventBus, runnable).execute();
|
257
|
268
|
}
|
258
|
269
|
|
|
270
|
+ /**
|
|
271
|
+ * Invokes something off the EDT, handling the result when its finished on the EDT, logging
|
|
272
|
+ * any exceptions that occur.
|
|
273
|
+ *
|
|
274
|
+ * @param eventBus Eventbus to post errors to
|
|
275
|
+ * @param runnable Runnable to execute off the EDT
|
|
276
|
+ * @param consumer Consumer to finalise the runnable on the EDT
|
|
277
|
+ *
|
|
278
|
+ * @param <T> Type the consumer takes
|
|
279
|
+ */
|
259
|
280
|
public static <T> void invokeOffEDT(final DMDircMBassador eventBus, final Runnable runnable,
|
260
|
281
|
final Consumer<T> consumer) {
|
261
|
282
|
new RunnableLoggingSwingWorker<>(eventBus, runnable, consumer).execute();
|