Browse Source

Remove FrameContainer parent/child fields.

pull/456/head
Chris Smith 8 years ago
parent
commit
0e3805e4ac

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

@@ -68,7 +68,6 @@ public class ChatContainer extends DCCFrameContainer implements DCCChatHandler {
68 68
      * @param eventBus            The bus to dispatch events on.
69 69
      */
70 70
     public ChatContainer(
71
-            @Nullable final WindowModel parent,
72 71
             final DCCChat dcc,
73 72
             final AggregateConfigProvider configManager,
74 73
             final BackBufferFactory backBufferFactory,
@@ -78,7 +77,7 @@ public class ChatContainer extends DCCFrameContainer implements DCCChatHandler {
78 77
             final String targetNick,
79 78
             final TabCompleterFactory tabCompleterFactory,
80 79
             final DMDircMBassador eventBus) {
81
-        super(parent, title, "dcc-chat-inactive", configManager, backBufferFactory,
80
+        super(title, "dcc-chat-inactive", configManager, backBufferFactory,
82 81
                 new DCCCommandParser(configManager, commandController, eventBus),
83 82
                 tabCompleterFactory,
84 83
                 eventBus,

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

@@ -157,7 +157,6 @@ public class DCCCommand extends Command implements IntelligentCommand {
157 157
         final DCCChat chat = new DCCChat();
158 158
         if (myPlugin.listen(chat)) {
159 159
             final ChatContainer window = new ChatContainer(
160
-                    myPlugin.getContainer(),
161 160
                     chat,
162 161
                     origin.getConfigManager(),
163 162
                     backBufferFactory,

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

@@ -26,7 +26,6 @@ import com.dmdirc.DMDircMBassador;
26 26
 import com.dmdirc.FrameContainer;
27 27
 import com.dmdirc.commandparser.parsers.CommandParser;
28 28
 import com.dmdirc.interfaces.Connection;
29
-import com.dmdirc.interfaces.WindowModel;
30 29
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
31 30
 import com.dmdirc.ui.input.TabCompleterFactory;
32 31
 import com.dmdirc.ui.messages.BackBufferFactory;
@@ -34,8 +33,6 @@ import com.dmdirc.ui.messages.BackBufferFactory;
34 33
 import java.util.Collection;
35 34
 import java.util.Optional;
36 35
 
37
-import javax.annotation.Nullable;
38
-
39 36
 /**
40 37
  * This class links DCC objects to a window.
41 38
  */
@@ -47,7 +44,6 @@ public abstract class DCCFrameContainer extends FrameContainer {
47 44
     /**
48 45
      * Creates a new instance of DCCFrame.
49 46
      *
50
-     * @param parent              The parent of this frame container, if any.
51 47
      * @param title               The title of this window
52 48
      * @param icon                The icon to use
53 49
      * @param configManager       Config manager
@@ -57,7 +53,6 @@ public abstract class DCCFrameContainer extends FrameContainer {
57 53
      * @param components          The UI components that this frame requires
58 54
      */
59 55
     public DCCFrameContainer(
60
-            @Nullable final WindowModel parent,
61 56
             final String title,
62 57
             final String icon,
63 58
             final AggregateConfigProvider configManager,
@@ -66,7 +61,7 @@ public abstract class DCCFrameContainer extends FrameContainer {
66 61
             final TabCompleterFactory tabCompleterFactory,
67 62
             final DMDircMBassador eventBus,
68 63
             final Collection<String> components) {
69
-        super(parent, icon, title, title, configManager, backBufferFactory,
64
+        super(icon, title, title, configManager, backBufferFactory,
70 65
                 tabCompleterFactory.getTabCompleter(configManager),
71 66
                 eventBus,
72 67
                 components);

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

@@ -463,7 +463,6 @@ public class DCCManager {
463 463
         chat.setAddress(ipAddress, port);
464 464
         final String myNickname = parser.getLocalClient().getNickname();
465 465
         final DCCFrameContainer container = new ChatContainer(
466
-                getContainer(),
467 466
                 chat,
468 467
                 config,
469 468
                 backBufferFactory,

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

@@ -62,7 +62,7 @@ public class PlaceholderContainer extends FrameContainer {
62 62
             final Window parentWindow,
63 63
             final WindowManager windowManager,
64 64
             final DMDircMBassador eventBus) {
65
-        super(null, "dcc", "DCCs", "DCCs", config, backBufferFactory, eventBus,
65
+        super("dcc", "DCCs", "DCCs", config, backBufferFactory, eventBus,
66 66
                 Collections.singletonList("com.dmdirc.addons.dcc.ui.PlaceholderPanel"));
67 67
         this.plugin = plugin;
68 68
         this.parentWindow = parentWindow;
@@ -99,13 +99,4 @@ public class PlaceholderContainer extends FrameContainer {
99 99
         return Optional.empty();
100 100
     }
101 101
 
102
-    @Override
103
-    public void removeChild(final WindowModel child) {
104
-        super.removeChild(child);
105
-
106
-        if (windowManager.getChildren(this).isEmpty()) {
107
-            close();
108
-        }
109
-    }
110
-
111 102
 }

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

@@ -88,7 +88,7 @@ public class TransferContainer extends FrameContainer implements
88 88
             final BackBufferFactory backBufferFactory, final String title,
89 89
             final String targetNick, @Nullable final Connection connection,
90 90
             final DMDircMBassador eventBus) {
91
-        super(plugin.getContainer(), dcc.getType() == DCCTransfer.TransferType.SEND
91
+        super(dcc.getType() == DCCTransfer.TransferType.SEND
92 92
                 ? "dcc-send-inactive" : "dcc-receive-inactive",
93 93
                 title, title, config, backBufferFactory, eventBus,
94 94
                 Arrays.asList("com.dmdirc.addons.dcc.ui.TransferPanel"));

+ 1
- 1
debug/src/com/dmdirc/addons/debug/RawWindow.java View File

@@ -49,7 +49,7 @@ public class RawWindow extends FrameContainer {
49 49
             final Connection connection,
50 50
             final TabCompleterFactory tabCompleterFactory,
51 51
             final BackBufferFactory backBufferFactory) {
52
-        super(connection.getWindowModel(), "raw", "Raw", "(Raw log)",
52
+        super("raw", "Raw", "(Raw log)",
53 53
                 connection.getWindowModel().getConfigManager(),
54 54
                 backBufferFactory,
55 55
                 tabCompleterFactory.getTabCompleter(connection.getWindowModel().getTabCompleter(),

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

@@ -63,7 +63,7 @@ public class HistoryWindow extends FrameContainer {
63 63
             final DMDircMBassador eventBus,
64 64
             final BackBufferFactory backBufferFactory,
65 65
             final int numLines) {
66
-        super(parent, "raw", title, title, parent.getConfigManager(), backBufferFactory,
66
+        super("raw", title, title, parent.getConfigManager(), backBufferFactory,
67 67
                 eventBus, Collections.singletonList(WindowComponent.TEXTAREA.getIdentifier()));
68 68
         this.logFile = logFile;
69 69
         this.numLines = numLines;

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

@@ -56,7 +56,7 @@ public class DebugWindow extends FrameContainer {
56 56
             final Connection connection,
57 57
             final DMDircMBassador eventBus,
58 58
             final BackBufferFactory backBufferFactory) {
59
-        super(connection.getWindowModel(), "raw", "Parser Debug", title,
59
+        super("raw", "Parser Debug", title,
60 60
                 connection.getWindowModel().getConfigManager(), backBufferFactory,
61 61
                 eventBus, Arrays.asList(WindowComponent.TEXTAREA.getIdentifier()));
62 62
         this.listener = listener;

+ 1
- 1
redirect/src/com/dmdirc/addons/redirect/FakeWriteableFrameContainer.java View File

@@ -46,7 +46,7 @@ public class FakeWriteableFrameContainer extends FrameContainer {
46 46
             final WindowModel target,
47 47
             final DMDircMBassador eventBus,
48 48
             final BackBufferFactory backBufferFactory) {
49
-        super(target, target.getIcon(), target.getName(), target.getTitle(),
49
+        super(target.getIcon(), target.getName(), target.getTitle(),
50 50
                 target.getConfigManager(), backBufferFactory,
51 51
                 target.getTabCompleter(), eventBus, Collections.<String>emptyList());
52 52
         this.target = target;

Loading…
Cancel
Save