Browse Source

Unbreak and break some more stuff

Change-Id: Ifea87add9b2280433071363e850b4c37ce14d12e
Reviewed-on: http://gerrit.dmdirc.com/1135
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
Automatic-Compile: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4
Chris Smith 14 years ago
parent
commit
347ddc730b

+ 3
- 2
src/com/dmdirc/addons/dcc/DCCChatWindow.java View File

@@ -53,13 +53,14 @@ public class DCCChatWindow extends DCCFrame implements DCCChatHandler {
53 53
      */
54 54
     public DCCChatWindow(final DCCPlugin plugin, final DCCChat dcc,
55 55
             final String title, final String nick, final String targetNick) {
56
-        super(plugin, title, "dcc-chat-inactive", false);
56
+        super(plugin, title, "dcc-chat-inactive", false,
57
+                DCCCommandParser.getDCCCommandParser());
57 58
         this.dcc = dcc;
58 59
         dcc.setHandler(this);
59 60
         nickname = nick;
60 61
         otherNickname = targetNick;
61 62
 
62
-        myWindow = Main.getUI().getInputWindow(this, DCCCommandParser.getDCCCommandParser());
63
+        myWindow = Main.getUI().getInputWindow(this);
63 64
         plugin.addWindow(this);
64 65
 
65 66
         setTitle(title);

+ 6
- 0
src/com/dmdirc/addons/dcc/DCCCommandParser.java View File

@@ -95,4 +95,10 @@ public class DCCCommandParser extends CommandParser {
95 95
         ((WritableFrameContainer) origin).sendLine(line);
96 96
     }
97 97
 
98
+    /** {@inheritDoc} */
99
+    @Override
100
+    public void setOwner(final FrameContainer owner) {
101
+        // Don't care
102
+    }
103
+
98 104
 }

+ 8
- 4
src/com/dmdirc/addons/dcc/DCCFrame.java View File

@@ -124,9 +124,11 @@ public abstract class DCCFrame extends WritableFrameContainer {
124 124
      * @param plugin The DCCPlugin that owns this frame
125 125
      * @param title The title of this window
126 126
      * @param icon The icon to use
127
+     * @param parser Command parser to use for this window
127 128
      */
128
-    public DCCFrame(final DCCPlugin plugin, final String title, final String icon) {
129
-        this(plugin, title, icon, true);
129
+    public DCCFrame(final DCCPlugin plugin, final String title,
130
+            final String icon, final CommandParser parser) {
131
+        this(plugin, title, icon, true, parser);
130 132
     }
131 133
 
132 134
     /**
@@ -136,9 +138,11 @@ public abstract class DCCFrame extends WritableFrameContainer {
136 138
      * @param title The title of this window
137 139
      * @param defaultWindow Create default (empty) window. (non-default = chat frame)
138 140
      * @param icon The icon to use
141
+     * @param parser Command parser to use for this window
139 142
      */
140
-    public DCCFrame(final DCCPlugin plugin, final String title, final String icon, final boolean defaultWindow) {
141
-        super(icon, title, title, IdentityManager.getGlobalConfig());
143
+    public DCCFrame(final DCCPlugin plugin, final String title, final String icon,
144
+            final boolean defaultWindow, final CommandParser parser) {
145
+        super(icon, title, title, IdentityManager.getGlobalConfig(), parser);
142 146
         this.plugin = plugin;
143 147
 
144 148
         if (defaultWindow) {

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

@@ -633,7 +633,7 @@ class PlaceholderDCCFrame extends DCCFrame {
633 633
      * @param plugin Parent plugin
634 634
      */
635 635
     public PlaceholderDCCFrame(final DCCPlugin plugin) {
636
-        super(plugin, "DCCs", "dcc");
636
+        super(plugin, "DCCs", "dcc", DCCCommandParser.getDCCCommandParser());
637 637
     }
638 638
 
639 639
     @Override

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

@@ -111,7 +111,8 @@ public class DCCTransferWindow extends DCCFrame implements DCCTransferHandler,
111 111
     public DCCTransferWindow(final DCCPlugin plugin, final DCCTransfer dcc,
112 112
             final String title, final String targetNick, final Server server) {
113 113
         super(plugin, title, dcc.getType() == DCCTransfer.TransferType.SEND
114
-                ? "dcc-send-inactive" : "dcc-receive-inactive");
114
+                ? "dcc-send-inactive" : "dcc-receive-inactive",
115
+                DCCCommandParser.getDCCCommandParser());
115 116
         this.dcc = dcc;
116 117
         this.server = server;
117 118
         this.parser = server == null ? null : server.getParser();

+ 1
- 1
src/com/dmdirc/addons/ui_dummy/DummyChannelWindow.java View File

@@ -43,7 +43,7 @@ public final class DummyChannelWindow extends DummyInputWindow implements Channe
43 43
      * @param parent Parent channel
44 44
      */
45 45
     public DummyChannelWindow(final Channel parent) {
46
-        super(parent, new ChannelCommandParser(parent.getServer(), parent));
46
+        super(parent, parent.getCommandParser());
47 47
         this.parent = parent;
48 48
     }
49 49
 

+ 2
- 3
src/com/dmdirc/addons/ui_dummy/DummyController.java View File

@@ -99,9 +99,8 @@ public final class DummyController extends Plugin implements UIController {
99 99
     
100 100
     /** {@inheritDoc} */
101 101
     @Override
102
-    public InputWindow getInputWindow(final WritableFrameContainer owner, 
103
-            final CommandParser commandParser) {
104
-        return new DummyInputWindow(owner, commandParser);
102
+    public InputWindow getInputWindow(final WritableFrameContainer owner) {
103
+        return new DummyInputWindow(owner, owner.getCommandParser());
105 104
     }
106 105
     
107 106
     /** {@inheritDoc} */

+ 1
- 1
src/com/dmdirc/addons/ui_dummy/DummyServerWindow.java View File

@@ -40,7 +40,7 @@ public final class DummyServerWindow extends DummyInputWindow implements ServerW
40 40
      * @param parent Parent server
41 41
      */
42 42
     public DummyServerWindow(final Server parent) {
43
-        super(parent, new ServerCommandParser(parent));
43
+        super(parent, new ServerCommandParser());
44 44
         
45 45
         this.parent = parent;
46 46
     }

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

@@ -51,7 +51,6 @@ import com.dmdirc.addons.ui_swing.dialogs.updater.SwingUpdaterDialog;
51 51
 import com.dmdirc.addons.ui_swing.dialogs.url.URLDialog;
52 52
 import com.dmdirc.addons.ui_swing.wizard.WizardListener;
53 53
 import com.dmdirc.addons.ui_swing.wizard.firstrun.SwingFirstRunWizard;
54
-import com.dmdirc.commandparser.parsers.CommandParser;
55 54
 import com.dmdirc.config.Identity;
56 55
 import com.dmdirc.config.IdentityManager;
57 56
 import com.dmdirc.config.prefs.PluginPreferencesCategory;
@@ -236,8 +235,7 @@ public final class SwingController extends Plugin implements Serializable,
236 235
 
237 236
     /** {@inheritDoc} */
238 237
     @Override
239
-    public InputWindow getInputWindow(final WritableFrameContainer owner,
240
-            final CommandParser commandParser) {
238
+    public InputWindow getInputWindow(final WritableFrameContainer owner) {
241 239
         LOGGER.finest("getInputWindow()");
242 240
 
243 241
         return UIUtilities.invokeAndWait(new ReturnableThread<CustomInputFrame>() {
@@ -246,8 +244,7 @@ public final class SwingController extends Plugin implements Serializable,
246 244
             @Override
247 245
             public void run() {
248 246
                 LOGGER.finest("getInputWindow(): run");
249
-                setObject(new CustomInputFrame(owner, commandParser,
250
-                        SwingController.this));
247
+                setObject(new CustomInputFrame(owner, SwingController.this));
251 248
                 LOGGER.finest("getInputWindow(): object set: " + getObject());
252 249
             }
253 250
         });

+ 2
- 4
src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java View File

@@ -35,7 +35,6 @@ import com.dmdirc.addons.ui_swing.components.SwingInputHandler;
35 35
 import com.dmdirc.addons.ui_swing.components.TopicBar;
36 36
 import com.dmdirc.addons.ui_swing.dialogs.channelsetting.ChannelSettingsDialog;
37 37
 import com.dmdirc.commandparser.PopupType;
38
-import com.dmdirc.commandparser.parsers.ChannelCommandParser;
39 38
 import com.dmdirc.commandparser.parsers.CommandParser;
40 39
 import com.dmdirc.config.Identity;
41 40
 import com.dmdirc.config.IdentityManager;
@@ -66,7 +65,7 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
66 65
      */
67 66
     private static final long serialVersionUID = 10;
68 67
     /** This channel's command parser. */
69
-    private final ChannelCommandParser commandParser;
68
+    private final CommandParser commandParser;
70 69
     /** split pane. */
71 70
     private SplitPane splitPane;
72 71
     /** popup menu item. */
@@ -104,8 +103,7 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
104 103
                 "shownicklist", this);
105 104
         ActionManager.addListener(this, CoreActionType.CLIENT_CLOSING);
106 105
 
107
-        commandParser = new ChannelCommandParser(((Channel) getContainer()).
108
-                getServer(),(Channel) getContainer());
106
+        commandParser = owner.getCommandParser();
109 107
 
110 108
         setInputHandler(new SwingInputHandler(getInputField(), commandParser,
111 109
                 this));

+ 3
- 9
src/com/dmdirc/addons/ui_swing/components/frames/CustomInputFrame.java View File

@@ -45,23 +45,17 @@ public class CustomInputFrame extends InputTextFrame {
45 45
      * objects being unserialized with the new class).
46 46
      */
47 47
     private static final long serialVersionUID = 2;
48
-    /** The command parser to use. */
49
-    private final CommandParser commandParser;
50 48
 
51 49
     /**
52 50
      * Creates a new instance of CustomInputFrame.
53 51
      * 
54 52
      * @param owner The frame container that owns this frame
55
-     * @param commandParser The command parser to use for this frmae
56 53
      * @param controller Swing controller
57 54
      */
58
-    public CustomInputFrame(final WritableFrameContainer owner,
59
-            final CommandParser commandParser, final SwingController controller) {
55
+    public CustomInputFrame(final WritableFrameContainer owner, final SwingController controller) {
60 56
         super(owner, controller);
61 57
 
62
-        this.commandParser = commandParser;
63
-
64
-        setInputHandler(new SwingInputHandler(getInputField(), commandParser, this));
58
+        setInputHandler(new SwingInputHandler(getInputField(), owner.getCommandParser(), this));
65 59
 
66 60
         initComponents();
67 61
     }
@@ -69,7 +63,7 @@ public class CustomInputFrame extends InputTextFrame {
69 63
     /** {@inheritDoc} */
70 64
     @Override
71 65
     public final CommandParser getCommandParser() {
72
-        return commandParser;
66
+        return ((WritableFrameContainer) frameParent).getCommandParser();
73 67
     }
74 68
 
75 69
     /**

+ 2
- 7
src/com/dmdirc/addons/ui_swing/components/frames/QueryFrame.java View File

@@ -25,7 +25,6 @@ import com.dmdirc.Query;
25 25
 import com.dmdirc.addons.ui_swing.SwingController;
26 26
 import com.dmdirc.commandparser.PopupType;
27 27
 import com.dmdirc.commandparser.parsers.CommandParser;
28
-import com.dmdirc.commandparser.parsers.QueryCommandParser;
29 28
 import com.dmdirc.ui.interfaces.QueryWindow;
30 29
 import com.dmdirc.addons.ui_swing.components.SwingInputHandler;
31 30
 
@@ -45,9 +44,7 @@ public final class QueryFrame extends InputTextFrame implements QueryWindow {
45 44
      */
46 45
     private static final long serialVersionUID = 8;
47 46
     /** This channel's command parser. */
48
-    private final QueryCommandParser commandParser;
49
-    /** This frame's parent. */
50
-    private final Query parentQuery;
47
+    private final CommandParser commandParser;
51 48
 
52 49
     /**
53 50
      * Creates a new QueryFrame.
@@ -58,11 +55,9 @@ public final class QueryFrame extends InputTextFrame implements QueryWindow {
58 55
     public QueryFrame(final Query owner, final SwingController controller) {
59 56
         super(owner, controller);
60 57
 
61
-        parentQuery = owner;
62
-
63 58
         initComponents();
64 59
 
65
-        commandParser = new QueryCommandParser(((Query) getContainer()).getServer(), (Query) getContainer());
60
+        commandParser = owner.getCommandParser();
66 61
 
67 62
         setInputHandler(new SwingInputHandler(getInputField(), commandParser, this));
68 63
     }

+ 2
- 3
src/com/dmdirc/addons/ui_swing/components/frames/ServerFrame.java View File

@@ -27,7 +27,6 @@ import com.dmdirc.ServerState;
27 27
 import com.dmdirc.addons.ui_swing.SwingController;
28 28
 import com.dmdirc.commandparser.PopupType;
29 29
 import com.dmdirc.commandparser.parsers.CommandParser;
30
-import com.dmdirc.commandparser.parsers.ServerCommandParser;
31 30
 import com.dmdirc.ui.interfaces.ServerWindow;
32 31
 import com.dmdirc.addons.ui_swing.components.SwingInputHandler;
33 32
 import com.dmdirc.addons.ui_swing.dialogs.serversetting.ServerSettingsDialog;
@@ -53,7 +52,7 @@ public final class ServerFrame extends InputTextFrame implements ServerWindow,
53 52
      */
54 53
     private static final long serialVersionUID = 9;
55 54
     /** This channel's command parser. */
56
-    private final ServerCommandParser commandParser;
55
+    private final CommandParser commandParser;
57 56
     /** popup menu item. */
58 57
     private JMenuItem settingsMI;
59 58
 
@@ -68,7 +67,7 @@ public final class ServerFrame extends InputTextFrame implements ServerWindow,
68 67
 
69 68
         initComponents();
70 69
         
71
-        commandParser = new ServerCommandParser((Server) getContainer());
70
+        commandParser = owner.getCommandParser();
72 71
 
73 72
         setInputHandler(new SwingInputHandler(getInputField(), commandParser, this));
74 73
     }

+ 2
- 4
src/com/dmdirc/addons/ui_web/WebInterfaceUI.java View File

@@ -27,7 +27,6 @@ import com.dmdirc.FrameContainer;
27 27
 import com.dmdirc.Query;
28 28
 import com.dmdirc.Server;
29 29
 import com.dmdirc.WritableFrameContainer;
30
-import com.dmdirc.commandparser.parsers.CommandParser;
31 30
 import com.dmdirc.config.prefs.PreferencesInterface;
32 31
 import com.dmdirc.ui.core.dialogs.sslcertificate.SSLCertificateDialogModel;
33 32
 import com.dmdirc.ui.interfaces.ChannelWindow;
@@ -164,9 +163,8 @@ public class WebInterfaceUI implements UIController {
164 163
 
165 164
     /** {@inheritDoc} */
166 165
     @Override
167
-    public InputWindow getInputWindow(final WritableFrameContainer owner,
168
-            final CommandParser commandParser) {
169
-        return new WebInputWindow(owner, commandParser);
166
+    public InputWindow getInputWindow(final WritableFrameContainer owner) {
167
+        return new WebInputWindow(owner, owner.getCommandParser());
170 168
     }
171 169
 
172 170
     /** {@inheritDoc} */

+ 1
- 2
src/com/dmdirc/addons/ui_web/uicomponents/WebChannelWindow.java View File

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc.addons.ui_web.uicomponents;
24 24
 
25 25
 import com.dmdirc.Channel;
26
-import com.dmdirc.commandparser.parsers.ChannelCommandParser;
27 26
 import com.dmdirc.parser.interfaces.ChannelClientInfo;
28 27
 import com.dmdirc.ui.interfaces.ChannelWindow;
29 28
 import com.dmdirc.addons.ui_web.DynamicRequestHandler;
@@ -40,7 +39,7 @@ public class WebChannelWindow extends WebInputWindow implements ChannelWindow {
40 39
     private final Channel channel;
41 40
 
42 41
     public WebChannelWindow(Channel channel) {
43
-        super(channel, new ChannelCommandParser(channel.getServer(), channel));
42
+        super(channel, channel.getCommandParser());
44 43
         this.channel = channel;
45 44
     }
46 45
 

+ 1
- 2
src/com/dmdirc/addons/ui_web/uicomponents/WebQueryWindow.java View File

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc.addons.ui_web.uicomponents;
24 24
 
25 25
 import com.dmdirc.Query;
26
-import com.dmdirc.commandparser.parsers.QueryCommandParser;
27 26
 import com.dmdirc.ui.interfaces.QueryWindow;
28 27
 
29 28
 /**
@@ -35,7 +34,7 @@ public class WebQueryWindow extends WebInputWindow implements QueryWindow {
35 34
     private final Query query;
36 35
 
37 36
     public WebQueryWindow(final Query parent) {
38
-        super(parent, new QueryCommandParser(parent.getServer(), parent));
37
+        super(parent, parent.getCommandParser());
39 38
         this.query = parent;
40 39
     }
41 40
 

+ 1
- 2
src/com/dmdirc/addons/ui_web/uicomponents/WebServerWindow.java View File

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc.addons.ui_web.uicomponents;
24 24
 
25 25
 import com.dmdirc.Server;
26
-import com.dmdirc.commandparser.parsers.ServerCommandParser;
27 26
 import com.dmdirc.ui.interfaces.ServerWindow;
28 27
 
29 28
 /**
@@ -35,7 +34,7 @@ public class WebServerWindow extends WebInputWindow implements ServerWindow {
35 34
     private final Server server;
36 35
 
37 36
     public WebServerWindow(Server server) {
38
-        super(server, new ServerCommandParser(server));
37
+        super(server, server.getCommandParser());
39 38
         
40 39
         this.server = server;
41 40
     }

Loading…
Cancel
Save