Browse Source

Fix fallout from WindowManager changes

Change-Id: Ia9b45bc4ff7f17af9e1eed758c0a659f6ab47251
Depends-On: I4f8df35efbb7ce266d6e8b1239c646a0a9c92107
Reviewed-on: http://gerrit.dmdirc.com/1988
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.7rc1
Chris Smith 13 years ago
parent
commit
318f0fd32f

+ 1
- 1
src/com/dmdirc/addons/dcc/ChatContainer.java View File

@@ -62,7 +62,7 @@ public class ChatContainer extends DCCFrameContainer implements DCCChatHandler {
62 62
         nickname = nick;
63 63
         otherNickname = targetNick;
64 64
 
65
-        WindowManager.addWindow(plugin.getContainer(), this);
65
+        WindowManager.getWindowManager().addWindow(plugin.getContainer(), this);
66 66
     }
67 67
 
68 68
     /**

+ 1
- 1
src/com/dmdirc/addons/dcc/DCCPlugin.java View File

@@ -605,7 +605,7 @@ public final class DCCPlugin extends BasePlugin implements ActionListener {
605 605
      */
606 606
     protected void createContainer() {
607 607
         container = new PlaceholderContainer(this);
608
-        WindowManager.addWindow(container);
608
+        WindowManager.getWindowManager().addWindow(container);
609 609
     }
610 610
 
611 611
     /** {@inheritDoc} */

+ 1
- 1
src/com/dmdirc/addons/dcc/TransferContainer.java View File

@@ -110,7 +110,7 @@ public class TransferContainer extends FrameContainer implements
110 110
 
111 111
         otherNickname = targetNick;
112 112
 
113
-        WindowManager.addWindow(plugin.getContainer(), this);
113
+        WindowManager.getWindowManager().addWindow(plugin.getContainer(), this);
114 114
     }
115 115
 
116 116
     /** {@inheritDoc} */

+ 1
- 1
src/com/dmdirc/addons/logging/HistoryWindow.java View File

@@ -49,7 +49,7 @@ public class HistoryWindow extends FrameContainer {
49 49
         super("raw", title, title, Window.class, parent.getConfigManager(),
50 50
                 Arrays.asList(WindowComponent.TEXTAREA.getIdentifier()));
51 51
 
52
-        WindowManager.addWindow(parent, this);
52
+        WindowManager.getWindowManager().addWindow(parent, this);
53 53
 
54 54
         final int frameBufferSize = IdentityManager.getGlobalConfig().getOptionInt(
55 55
                 "ui", "frameBufferSize");

+ 1
- 1
src/com/dmdirc/addons/parserdebug/DebugWindow.java View File

@@ -60,7 +60,7 @@ public class DebugWindow extends FrameContainer {
60 60
         this.parser = parser;
61 61
         this.server = server;
62 62
 
63
-        WindowManager.addWindow(server, this);
63
+        WindowManager.getWindowManager().addWindow(server, this);
64 64
     }
65 65
 
66 66
     /**

+ 2
- 2
src/com/dmdirc/addons/ui_swing/SwingController.java View File

@@ -491,14 +491,14 @@ public class SwingController extends BasePlugin implements UIController {
491 491
                     "Main frame not created. Unable to continue.");
492 492
         }
493 493
 
494
-        WindowManager.addAndExecuteFrameListener(windowFactory);
494
+        WindowManager.getWindowManager().addListenerAndSync(windowFactory);
495 495
     }
496 496
 
497 497
     /** {@inheritDoc} */
498 498
     @Override
499 499
     public void onUnload() {
500 500
         errorDialog.dispose();
501
-        WindowManager.removeFrameListener(windowFactory);
501
+        WindowManager.getWindowManager().removeListener(windowFactory);
502 502
         mainFrameCreated.set(false);
503 503
         me.dispose();
504 504
         windowFactory.dispose();

+ 2
- 2
src/com/dmdirc/addons/ui_swing/framemanager/buttonbar/ButtonBar.java View File

@@ -175,7 +175,7 @@ public final class ButtonBar implements FrameManager, ActionListener,
175 175
                 parent.addComponentListener(ButtonBar.this);
176 176
                 ButtonBar.this.buttonWidth = position.isHorizontal()
177 177
                         ? 150 : (parent.getWidth() / NUM_CELLS);
178
-                initButtons(WindowManager.getRootWindows());
178
+                initButtons(WindowManager.getWindowManager().getRootWindows());
179 179
                 if (controller.getMainFrame().getActiveFrame() != null) {
180 180
                     selectionChanged(controller.getMainFrame()
181 181
                             .getActiveFrame());
@@ -289,7 +289,7 @@ public final class ButtonBar implements FrameManager, ActionListener,
289 289
         buttonPanel.removeAll();
290 290
 
291 291
         final ArrayList<FrameContainer> windowList = new
292
-                ArrayList<FrameContainer>(WindowManager.getRootWindows());
292
+                ArrayList<FrameContainer>(WindowManager.getWindowManager().getRootWindows());
293 293
         if (sortRootWindows) {
294 294
             Collections.sort(windowList, new FrameContainerComparator());
295 295
         }

+ 1
- 1
src/com/dmdirc/addons/ui_swing/framemanager/tree/TreeFrameManager.java View File

@@ -308,7 +308,7 @@ public final class TreeFrameManager implements FrameManager,
308 308
                 scroller = new TreeTreeScroller(controller, tree);
309 309
 
310 310
                 for (FrameContainer window
311
-                        : WindowManager.getRootWindows()) {
311
+                        : WindowManager.getWindowManager().getRootWindows()) {
312 312
                     addWindow(null, window);
313 313
                     final Collection<FrameContainer> childWindows = window
314 314
                             .getChildren();

+ 1
- 19
src/com/dmdirc/addons/ui_web/WebWindowManager.java View File

@@ -85,11 +85,7 @@ public class WebWindowManager implements FrameListener {
85 85
     public WebWindowManager(final WebInterfaceUI controller) {
86 86
         this.controller = controller;
87 87
 
88
-        WindowManager.addFrameListener(this);
89
-
90
-        for (FrameContainer container : WindowManager.getRootWindows()) {
91
-            recursiveAdd(container);
92
-        }
88
+        WindowManager.getWindowManager().addListenerAndSync(this);
93 89
     }
94 90
 
95 91
     /**
@@ -103,20 +99,6 @@ public class WebWindowManager implements FrameListener {
103 99
         return windows.get(container);
104 100
     }
105 101
 
106
-    /**
107
-     * Recursively adds a window for the specified container and all of its
108
-     * children.
109
-     *
110
-     * @param container The container to create windows for
111
-     */
112
-    private void recursiveAdd(final FrameContainer container) {
113
-        addWindow(container, false);
114
-
115
-        for (FrameContainer child : container.getChildren()) {
116
-            recursiveAdd(child);
117
-        }
118
-    }
119
-
120 102
     /** {@inheritDoc} */
121 103
     @Override
122 104
     public void addWindow(final FrameContainer window, final boolean focus) {

Loading…
Cancel
Save