|
@@ -28,7 +28,6 @@ import com.dmdirc.addons.ui_swing.components.DMDircUndoableEditListener;
|
28
|
28
|
import com.dmdirc.logger.ErrorLevel;
|
29
|
29
|
import com.dmdirc.logger.Logger;
|
30
|
30
|
import com.dmdirc.ui.Colour;
|
31
|
|
-import com.dmdirc.util.ReturnableThread;
|
32
|
31
|
|
33
|
32
|
import java.awt.Color;
|
34
|
33
|
import java.awt.Font;
|
|
@@ -250,7 +249,7 @@ public final class UIUtilities {
|
250
|
249
|
if (SwingUtilities.isEventDispatchThread()) {
|
251
|
250
|
return returnable.call();
|
252
|
251
|
} else {
|
253
|
|
- final FutureTask<T> task = new FutureTask<T>(returnable);
|
|
252
|
+ final FutureTask<T> task = new FutureTask<>(returnable);
|
254
|
253
|
SwingUtilities.invokeAndWait(task);
|
255
|
254
|
return task.get();
|
256
|
255
|
}
|
|
@@ -259,32 +258,6 @@ public final class UIUtilities {
|
259
|
258
|
}
|
260
|
259
|
}
|
261
|
260
|
|
262
|
|
- /**
|
263
|
|
- * Invokes and waits for the specified runnable, executed on the EDT.
|
264
|
|
- *
|
265
|
|
- * @param <T> The return type of the returnable thread
|
266
|
|
- * @param returnable Thread to be executed
|
267
|
|
- * @return Result from the compelted thread
|
268
|
|
- *
|
269
|
|
- * @deprecated In favour of {@link #invokeAndWait(java.util.concurrent.Callable) }
|
270
|
|
- */
|
271
|
|
- @Deprecated
|
272
|
|
- public static <T> T invokeAndWait(final ReturnableThread<T> returnable) {
|
273
|
|
- if (SwingUtilities.isEventDispatchThread()) {
|
274
|
|
- returnable.run();
|
275
|
|
- } else {
|
276
|
|
- try {
|
277
|
|
- SwingUtilities.invokeAndWait(returnable);
|
278
|
|
- } catch (InterruptedException ex) {
|
279
|
|
- //Ignore
|
280
|
|
- } catch (InvocationTargetException ex) {
|
281
|
|
- Logger.appError(ErrorLevel.HIGH, "Unable to execute thread.", ex);
|
282
|
|
- }
|
283
|
|
- }
|
284
|
|
-
|
285
|
|
- return returnable.getObject();
|
286
|
|
- }
|
287
|
|
-
|
288
|
261
|
/**
|
289
|
262
|
* Queues the runnable to be executed on the EDT.
|
290
|
263
|
*
|