Browse Source

Add some javadoc, fix errors.

pull/381/head
Greg Holmes 9 years ago
parent
commit
d50a65d6b2

+ 21
- 0
ui_swing/src/com/dmdirc/addons/ui_swing/UIUtilities.java View File

@@ -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();

+ 1
- 1
ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/prefs/SwingPreferencesDialog.java View File

@@ -231,7 +231,7 @@ public final class SwingPreferencesDialog extends StandardDialog implements
231 231
             saveOptions();
232 232
         }
233 233
 
234
-        UIUtilities.invokeOffEDT(() -> {
234
+        UIUtilities.invokeOffEDT(eventBus, () -> {
235 235
             if (manager != null) {
236 236
                 manager.dismiss();
237 237
             }

+ 2
- 1
ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/updater/SwingUpdaterDialog.java View File

@@ -181,7 +181,8 @@ public class SwingUpdaterDialog extends StandardDialog implements
181 181
 
182 182
             header.setText("DMDirc is updating the following components:");
183 183
 
184
-            UIUtilities.invokeOffEDT(() -> ((UpdateTableModel) table.getModel()).getUpdates().stream()
184
+            UIUtilities.invokeOffEDT(eventBus,
185
+                    () -> ((UpdateTableModel) table.getModel()).getUpdates().stream()
185 186
                     .filter(((UpdateTableModel) table.getModel())::isEnabled)
186 187
                     .forEach(updateManager::install));
187 188
 

Loading…
Cancel
Save