Explorar el Código

No need for the invoke later

pull/94/head
Greg Holmes hace 9 años
padre
commit
3418968ba4
Se han modificado 1 ficheros con 18 adiciones y 21 borrados
  1. 18
    21
      ui_swing/src/com/dmdirc/addons/ui_swing/MainFrame.java

+ 18
- 21
ui_swing/src/com/dmdirc/addons/ui_swing/MainFrame.java Ver fichero

492
 
492
 
493
     @Handler(invocation = EdtHandlerInvocation.class)
493
     @Handler(invocation = EdtHandlerInvocation.class)
494
     public void setActiveFrame(final SwingActiveWindowChangeRequestEvent event) {
494
     public void setActiveFrame(final SwingActiveWindowChangeRequestEvent event) {
495
-        UIUtilities.invokeLater(() -> {
496
-            focusOrder.offerAndMove(activeFrame);
497
-            framePanel.setVisible(false);
498
-            framePanel.removeAll();
495
+        focusOrder.offerAndMove(activeFrame);
496
+        framePanel.setVisible(false);
497
+        framePanel.removeAll();
499
 
498
 
500
-            activeFrame = (TextFrame) event.getWindow().get();
499
+        activeFrame = (TextFrame) event.getWindow().get();
501
 
500
 
502
-            if (activeFrame == null) {
503
-                framePanel.add(new JPanel(), "grow");
504
-                setTitle(null);
505
-            } else {
506
-                framePanel.add(activeFrame.getDisplayFrame(), "grow");
507
-                setTitle(activeFrame.getContainer().getTitle());
508
-            }
501
+        if (activeFrame == null) {
502
+            framePanel.add(new JPanel(), "grow");
503
+            setTitle(null);
504
+        } else {
505
+            framePanel.add(activeFrame.getDisplayFrame(), "grow");
506
+            setTitle(activeFrame.getContainer().getTitle());
507
+        }
509
 
508
 
510
-            framePanel.setVisible(true);
509
+        framePanel.setVisible(true);
511
 
510
 
512
-            if (activeFrame != null) {
513
-                activeFrame.requestFocus();
514
-                activeFrame.requestFocusInWindow();
515
-                activeFrame.activateFrame();
516
-            }
511
+        if (activeFrame != null) {
512
+            activeFrame.requestFocus();
513
+            activeFrame.requestFocusInWindow();
514
+            activeFrame.activateFrame();
515
+        }
517
 
516
 
518
-            swingEventBus.publish(
519
-                    new SwingWindowSelectedEvent(Optional.ofNullable((Window) activeFrame)));
520
-        });
517
+        swingEventBus.publish(new SwingWindowSelectedEvent(Optional.ofNullable((Window) activeFrame)));
521
     }
518
     }
522
 
519
 
523
     @Handler
520
     @Handler

Loading…
Cancelar
Guardar