Преглед на файлове

Remove windows from commands

Change-Id: I5b6e7e2ca81d114028fef6cac0d88498def62ea0
Depends-On: I895be099fa526e4e4b566e7178120b5d1ad0912c
Reviewed-on: http://gerrit.dmdirc.com/2011
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.6.6b1
Greg Holmes преди 13 години
родител
ревизия
935c21ebf8
променени са 31 файла, в които са добавени 124 реда и са изтрити 254 реда
  1. 1
    7
      src/com/dmdirc/actions/ActionModel.java
  2. 0
    2
      src/com/dmdirc/commandparser/CommandManager.java
  3. 4
    4
      src/com/dmdirc/commandparser/commands/IntelligentCommand.java
  4. 3
    2
      src/com/dmdirc/commandparser/commands/ValidatingCommand.java
  5. 2
    2
      src/com/dmdirc/commandparser/commands/WrappableCommand.java
  6. 0
    63
      src/com/dmdirc/commandparser/commands/channel/ChannelSettings.java
  7. 7
    6
      src/com/dmdirc/commandparser/commands/chat/Me.java
  8. 2
    2
      src/com/dmdirc/commandparser/commands/context/ChannelCommandContext.java
  9. 3
    3
      src/com/dmdirc/commandparser/commands/context/ChatCommandContext.java
  10. 4
    4
      src/com/dmdirc/commandparser/commands/context/CommandContext.java
  11. 5
    3
      src/com/dmdirc/commandparser/commands/context/QueryCommandContext.java
  12. 2
    2
      src/com/dmdirc/commandparser/commands/context/ServerCommandContext.java
  13. 1
    1
      src/com/dmdirc/commandparser/commands/global/AllServers.java
  14. 2
    3
      src/com/dmdirc/commandparser/commands/global/Echo.java
  15. 2
    2
      src/com/dmdirc/commandparser/commands/global/Ifplugin.java
  16. 4
    4
      src/com/dmdirc/commandparser/commands/global/Set.java
  17. 1
    1
      src/com/dmdirc/commandparser/commands/server/AllChannels.java
  18. 1
    1
      src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java
  19. 4
    3
      src/com/dmdirc/commandparser/commands/server/Message.java
  20. 7
    4
      src/com/dmdirc/commandparser/commands/server/OpenQuery.java
  21. 0
    65
      src/com/dmdirc/commandparser/commands/server/ServerSettings.java
  22. 5
    5
      src/com/dmdirc/commandparser/parsers/ChannelCommandParser.java
  23. 7
    6
      src/com/dmdirc/commandparser/parsers/ChatCommandParser.java
  24. 9
    10
      src/com/dmdirc/commandparser/parsers/CommandParser.java
  25. 3
    4
      src/com/dmdirc/commandparser/parsers/GlobalCommandParser.java
  26. 5
    5
      src/com/dmdirc/commandparser/parsers/QueryCommandParser.java
  27. 4
    5
      src/com/dmdirc/commandparser/parsers/ServerCommandParser.java
  28. 13
    13
      src/com/dmdirc/ui/input/InputHandler.java
  29. 6
    4
      src/com/dmdirc/ui/input/TabCompleter.java
  30. 16
    16
      test/com/dmdirc/commandparser/parsers/CommandParserTest.java
  31. 1
    2
      test/com/dmdirc/harness/TestCommandParser.java

+ 1
- 7
src/com/dmdirc/actions/ActionModel.java Целия файл

@@ -28,7 +28,6 @@ import com.dmdirc.WritableFrameContainer;
28 28
 import com.dmdirc.actions.interfaces.ActionType;
29 29
 import com.dmdirc.commandparser.parsers.CommandParser;
30 30
 import com.dmdirc.commandparser.parsers.GlobalCommandParser;
31
-import com.dmdirc.ui.interfaces.Window;
32 31
 
33 32
 import java.util.ArrayList;
34 33
 import java.util.Arrays;
@@ -141,7 +140,6 @@ public class ActionModel {
141 140
             return false;
142 141
         }
143 142
 
144
-        Window window = null;
145 143
         WritableFrameContainer container = null;
146 144
         CommandParser cp = null;
147 145
 
@@ -152,10 +150,6 @@ public class ActionModel {
152 150
             container = ServerManager.getServerManager().getServers().get(0);
153 151
         }
154 152
 
155
-        if (arguments.length > 0 && arguments[0] instanceof Window) {
156
-            window = (Window) arguments[0];
157
-        }
158
-
159 153
         if (container == null) {
160 154
             cp = GlobalCommandParser.getGlobalCommandParser();
161 155
         } else {
@@ -163,7 +157,7 @@ public class ActionModel {
163 157
         }
164 158
 
165 159
         for (String command : response) {
166
-            cp.parseCommand(container, window, sub.doSubstitution(command, arguments));
160
+            cp.parseCommand(container, sub.doSubstitution(command, arguments));
167 161
         }
168 162
 
169 163
         if (newFormat != null && format != null) {

+ 0
- 2
src/com/dmdirc/commandparser/CommandManager.java Целия файл

@@ -229,7 +229,6 @@ public class CommandManager {
229 229
 
230 230
         // Channel commands
231 231
         registerCommand(new Ban(), Ban.INFO);
232
-        registerCommand(new ChannelSettings(), ChannelSettings.INFO);
233 232
         registerCommand(new Cycle(), Cycle.INFO);
234 233
         registerCommand(new Invite(), Invite.INFO);
235 234
         registerCommand(new KickReason(), KickReason.INFO);
@@ -254,7 +253,6 @@ public class CommandManager {
254 253
         registerCommand(new OpenQuery(), OpenQuery.INFO);
255 254
         registerCommand(new Raw(), Raw.INFO);
256 255
         registerCommand(new Reconnect(), Reconnect.INFO);
257
-        registerCommand(new ServerSettings(), ServerSettings.INFO);
258 256
         registerCommand(new Umode(), Umode.INFO);
259 257
 
260 258
         registerCommand(new RawServerCommand("lusers"));

+ 4
- 4
src/com/dmdirc/commandparser/commands/IntelligentCommand.java Целия файл

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands;
24 24
 
25
+import com.dmdirc.WritableFrameContainer;
25 26
 import com.dmdirc.ui.input.AdditionalTabTargets;
26
-import com.dmdirc.ui.interfaces.InputWindow;
27 27
 
28 28
 import java.util.List;
29 29
 
@@ -52,7 +52,7 @@ public interface IntelligentCommand {
52 52
     class IntelligentCommandContext {
53 53
 
54 54
         /** The window the command is being entered in. */
55
-        private final InputWindow window;
55
+        private final WritableFrameContainer window;
56 56
 
57 57
         /** The previously supplied arguments, if any. */
58 58
         private final List<String> previousArgs;
@@ -67,7 +67,7 @@ public interface IntelligentCommand {
67 67
          * @param previousArgs The previously supplied arguments, if any
68 68
          * @param partial The partially-typed word being completed
69 69
          */
70
-        public IntelligentCommandContext(final InputWindow window,
70
+        public IntelligentCommandContext(final WritableFrameContainer window,
71 71
                 final List<String> previousArgs, final String partial) {
72 72
             this.window = window;
73 73
             this.previousArgs = previousArgs;
@@ -79,7 +79,7 @@ public interface IntelligentCommand {
79 79
          *
80 80
          * @return The command's input window
81 81
          */
82
-        public InputWindow getWindow() {
82
+        public WritableFrameContainer getWindow() {
83 83
             return window;
84 84
         }
85 85
 

+ 3
- 2
src/com/dmdirc/commandparser/commands/ValidatingCommand.java Целия файл

@@ -21,8 +21,8 @@
21 21
  */
22 22
 package com.dmdirc.commandparser.commands;
23 23
 
24
+import com.dmdirc.WritableFrameContainer;
24 25
 import com.dmdirc.commandparser.CommandArguments;
25
-import com.dmdirc.ui.interfaces.InputWindow;
26 26
 import com.dmdirc.util.validators.ValidationResponse;
27 27
 
28 28
 /**
@@ -39,6 +39,7 @@ public interface ValidatingCommand {
39 39
      * @return A validation response indicating the validity of the arguments
40 40
      * @since 0.6.3m1
41 41
      */
42
-    ValidationResponse validateArguments(InputWindow origin, CommandArguments arguments);
42
+    ValidationResponse validateArguments(WritableFrameContainer origin,
43
+            CommandArguments arguments);
43 44
 
44 45
 }

+ 2
- 2
src/com/dmdirc/commandparser/commands/WrappableCommand.java Целия файл

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands;
24 24
 
25
+import com.dmdirc.WritableFrameContainer;
25 26
 import com.dmdirc.commandparser.CommandArguments;
26
-import com.dmdirc.ui.interfaces.InputWindow;
27 27
 
28 28
 /**
29 29
  * Wrapping commands are commands whose arguments may be wrapped into multiple
@@ -42,6 +42,6 @@ public interface WrappableCommand {
42 42
      * @return The number of lines that the arguments will result in
43 43
      * @since 0.6.3m1
44 44
      */
45
-    int getLineCount(InputWindow origin, CommandArguments arguments);
45
+    int getLineCount(WritableFrameContainer origin, CommandArguments arguments);
46 46
 
47 47
 }

+ 0
- 63
src/com/dmdirc/commandparser/commands/channel/ChannelSettings.java Целия файл

@@ -1,63 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.commandparser.commands.channel;
24
-
25
-import com.dmdirc.FrameContainer;
26
-import com.dmdirc.commandparser.BaseCommandInfo;
27
-import com.dmdirc.commandparser.CommandArguments;
28
-import com.dmdirc.commandparser.CommandInfo;
29
-import com.dmdirc.commandparser.CommandType;
30
-import com.dmdirc.commandparser.commands.Command;
31
-import com.dmdirc.commandparser.commands.CommandOptions;
32
-import com.dmdirc.commandparser.commands.IntelligentCommand;
33
-import com.dmdirc.commandparser.commands.context.ChannelCommandContext;
34
-import com.dmdirc.commandparser.commands.context.CommandContext;
35
-import com.dmdirc.ui.input.AdditionalTabTargets;
36
-
37
-/**
38
- * Opens the channel settings window for the channel.
39
- */
40
-@CommandOptions(allowOffline = false)
41
-public class ChannelSettings extends Command implements
42
-        IntelligentCommand {
43
-
44
-    /** A command info object for this command. */
45
-    public static final CommandInfo INFO = new BaseCommandInfo("channelsettings",
46
-            "channelsettings - opens the channel settings window",
47
-            CommandType.TYPE_CHANNEL);
48
-
49
-    /** {@inheritDoc} */
50
-    @Override
51
-    public void execute(final FrameContainer origin,
52
-            final CommandArguments args, final CommandContext context) {
53
-        context.getSource().getController().showChannelSettingsDialog(
54
-                ((ChannelCommandContext) context).getChannel());
55
-    }
56
-
57
-    /** {@inheritDoc} */
58
-    @Override
59
-    public AdditionalTabTargets getSuggestions(final int arg,
60
-            final IntelligentCommandContext context) {
61
-        return new AdditionalTabTargets().excludeAll();
62
-    }
63
-}

+ 7
- 6
src/com/dmdirc/commandparser/commands/chat/Me.java Целия файл

@@ -25,6 +25,7 @@ package com.dmdirc.commandparser.commands.chat;
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.MessageTarget;
27 27
 import com.dmdirc.commandparser.BaseCommandInfo;
28
+import com.dmdirc.WritableFrameContainer;
28 29
 import com.dmdirc.commandparser.CommandArguments;
29 30
 import com.dmdirc.commandparser.CommandInfo;
30 31
 import com.dmdirc.commandparser.CommandType;
@@ -32,7 +33,6 @@ import com.dmdirc.commandparser.commands.Command;
32 33
 import com.dmdirc.commandparser.commands.ValidatingCommand;
33 34
 import com.dmdirc.commandparser.commands.context.ChatCommandContext;
34 35
 import com.dmdirc.commandparser.commands.context.CommandContext;
35
-import com.dmdirc.ui.interfaces.InputWindow;
36 36
 import com.dmdirc.util.validators.ValidationResponse;
37 37
 
38 38
 /**
@@ -59,17 +59,18 @@ public class Me extends Command implements ValidatingCommand {
59 59
 
60 60
     /** {@inheritDoc} */
61 61
     @Override
62
-    public ValidationResponse validateArguments(final InputWindow origin,
62
+    public ValidationResponse validateArguments(
63
+            final WritableFrameContainer origin,
63 64
             final CommandArguments arguments) {
64
-        if (origin.getContainer().getServer() == null
65
-                || origin.getContainer().getServer().getParser() == null) {
65
+        if (origin.getServer() == null
66
+                || origin.getServer().getParser() == null) {
66 67
             return new ValidationResponse();
67 68
         }
68 69
 
69 70
         final int length = 2 + arguments.getArgumentsAsString().length();
70 71
 
71
-        if (origin.getContainer().getServer().getParser().getMaxLength("PRIVMSG",
72
-                origin.getContainer().getName()) <= length) {
72
+        if (origin.getServer().getParser().getMaxLength("PRIVMSG",
73
+                origin.getName()) <= length) {
73 74
             return new ValidationResponse("Too long");
74 75
         } else {
75 76
             return new ValidationResponse();

+ 2
- 2
src/com/dmdirc/commandparser/commands/context/ChannelCommandContext.java Целия файл

@@ -23,8 +23,8 @@
23 23
 package com.dmdirc.commandparser.commands.context;
24 24
 
25 25
 import com.dmdirc.Channel;
26
+import com.dmdirc.FrameContainer;
26 27
 import com.dmdirc.commandparser.CommandInfo;
27
-import com.dmdirc.ui.interfaces.Window;
28 28
 
29 29
 /**
30 30
  * A specialised {@link CommandContext} for commands executed in channels.
@@ -44,7 +44,7 @@ public class ChannelCommandContext extends ChatCommandContext {
44 44
      * with the input
45 45
      * @param channel The channel associated with the command
46 46
      */
47
-    public ChannelCommandContext(final Window source,
47
+    public ChannelCommandContext(final FrameContainer source,
48 48
             final CommandInfo commandInfo, final Channel channel) {
49 49
         super(source, commandInfo, channel);
50 50
         this.channel = channel;

+ 3
- 3
src/com/dmdirc/commandparser/commands/context/ChatCommandContext.java Целия файл

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.context;
24 24
 
25
+import com.dmdirc.FrameContainer;
25 26
 import com.dmdirc.MessageTarget;
26 27
 import com.dmdirc.commandparser.CommandInfo;
27
-import com.dmdirc.ui.interfaces.Window;
28 28
 
29 29
 /**
30 30
  * A command context specific to chat windows.
@@ -43,8 +43,8 @@ public class ChatCommandContext extends ServerCommandContext {
43 43
      * @param commandInfo The command info object which associated the command with the input
44 44
      * @param chat The chat container associated with the command
45 45
      */
46
-    public ChatCommandContext(final Window source, final CommandInfo commandInfo,
47
-            final MessageTarget chat) {
46
+    public ChatCommandContext(final FrameContainer source,
47
+            final CommandInfo commandInfo, final MessageTarget chat) {
48 48
         super(source, commandInfo, chat.getServer());
49 49
         this.chat = chat;
50 50
     }

+ 4
- 4
src/com/dmdirc/commandparser/commands/context/CommandContext.java Целия файл

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.context;
24 24
 
25
+import com.dmdirc.FrameContainer;
25 26
 import com.dmdirc.commandparser.CommandInfo;
26
-import com.dmdirc.ui.interfaces.Window;
27 27
 
28 28
 /**
29 29
  * Provides information relating to the context that a command was executed in.
@@ -36,7 +36,7 @@ public class CommandContext {
36 36
     protected final CommandInfo commandInfo;
37 37
 
38 38
     /** The source of this command. */
39
-    protected final Window source;
39
+    protected final FrameContainer source;
40 40
 
41 41
     /**
42 42
      * Creates a new command context.
@@ -44,7 +44,7 @@ public class CommandContext {
44 44
      * @param source The source of the command
45 45
      * @param commandInfo The command info object which associated the command with the input
46 46
      */
47
-    public CommandContext(final Window source, final CommandInfo commandInfo) {
47
+    public CommandContext(final FrameContainer source, final CommandInfo commandInfo) {
48 48
         this.source = source;
49 49
         this.commandInfo = commandInfo;
50 50
     }
@@ -64,7 +64,7 @@ public class CommandContext {
64 64
      *
65 65
      * @return The window the command came from, or null
66 66
      */
67
-    public Window getSource() {
67
+    public FrameContainer getSource() {
68 68
         return source;
69 69
     }
70 70
 

+ 5
- 3
src/com/dmdirc/commandparser/commands/context/QueryCommandContext.java Целия файл

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.context;
24 24
 
25
+import com.dmdirc.FrameContainer;
25 26
 import com.dmdirc.Query;
26 27
 import com.dmdirc.commandparser.CommandInfo;
27
-import com.dmdirc.ui.interfaces.Window;
28 28
 
29 29
 /**
30 30
  * A query-specific command context.
@@ -41,10 +41,12 @@ public class QueryCommandContext extends ChatCommandContext {
41 41
      * Creates a new query command context.
42 42
      *
43 43
      * @param source The source of the command
44
-     * @param commandInfo The command info object which associated the command with the input
44
+     * @param commandInfo The command info object which associated the command
45
+     * with the input
45 46
      * @param query The query associated with the command
46 47
      */
47
-    public QueryCommandContext(final Window source, final CommandInfo commandInfo, final Query query) {
48
+    public QueryCommandContext(final FrameContainer source,
49
+            final CommandInfo commandInfo, final Query query) {
48 50
         super(source, commandInfo, query);
49 51
         this.query = query;
50 52
     }

+ 2
- 2
src/com/dmdirc/commandparser/commands/context/ServerCommandContext.java Целия файл

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.context;
24 24
 
25
+import com.dmdirc.FrameContainer;
25 26
 import com.dmdirc.Server;
26 27
 import com.dmdirc.commandparser.CommandInfo;
27
-import com.dmdirc.ui.interfaces.Window;
28 28
 
29 29
 /**
30 30
  * A command context for server commands.
@@ -44,7 +44,7 @@ public class ServerCommandContext extends CommandContext {
44 44
      * @param commandInfo The command info object which associated the command with the input
45 45
      * @param server The server associated with the command
46 46
      */
47
-    public ServerCommandContext(final Window source, final CommandInfo commandInfo,
47
+    public ServerCommandContext(final FrameContainer source, final CommandInfo commandInfo,
48 48
             final Server server) {
49 49
         super(source, commandInfo);
50 50
         this.server = server;

+ 1
- 1
src/com/dmdirc/commandparser/commands/global/AllServers.java Целия файл

@@ -52,7 +52,7 @@ public class AllServers extends Command implements IntelligentCommand {
52 52
         final String command = args.getArgumentsAsString();
53 53
 
54 54
         for (Server target : ServerManager.getServerManager().getServers()) {
55
-            target.getCommandParser().parseCommand(target, context.getSource(), command);
55
+            target.getCommandParser().parseCommand(target, command);
56 56
         }
57 57
     }
58 58
 

+ 2
- 3
src/com/dmdirc/commandparser/commands/global/Echo.java Целия файл

@@ -128,11 +128,10 @@ public class Echo extends Command implements IntelligentCommand {
128 128
                 && context.getPreviousArgs().get(0).equals("--ts"))) {
129 129
 
130 130
             final List<FrameContainer> windowList = new ArrayList<FrameContainer>();
131
-            final Server currentServer = context.getWindow().getContainer()
132
-                    .getServer();
131
+            final Server currentServer = context.getWindow().getServer();
133 132
 
134 133
             //Active window's Children
135
-            windowList.addAll(context.getWindow().getContainer().getChildren());
134
+            windowList.addAll(context.getWindow().getChildren());
136 135
 
137 136
             //Children of Current Window's server
138 137
             if (currentServer != null) {

+ 2
- 2
src/com/dmdirc/commandparser/commands/global/Ifplugin.java Целия файл

@@ -73,10 +73,10 @@ public class Ifplugin extends Command implements IntelligentCommand {
73 73
         if (result != negative) {
74 74
             if (origin == null) {
75 75
                 GlobalCommandParser.getGlobalCommandParser().parseCommand(null,
76
-                        context.getSource(), args.getArgumentsAsString(1));
76
+                        args.getArgumentsAsString(1));
77 77
             } else {
78 78
                 ((WritableFrameContainer) origin).getCommandParser()
79
-                        .parseCommand(origin, context.getSource(), args.getArgumentsAsString(1));
79
+                        .parseCommand(origin, args.getArgumentsAsString(1));
80 80
             }
81 81
         }
82 82
     }

+ 4
- 4
src/com/dmdirc/commandparser/commands/global/Set.java Целия файл

@@ -289,7 +289,7 @@ public class Set extends Command implements IntelligentCommand {
289 289
         final AdditionalTabTargets res = new AdditionalTabTargets();
290 290
 
291 291
         if (arg == 0) {
292
-            res.addAll(context.getWindow().getContainer().getConfigManager()
292
+            res.addAll(context.getWindow().getConfigManager()
293 293
                     .getDomains());
294 294
             res.add("--unset");
295 295
             res.add("--append");
@@ -301,10 +301,10 @@ public class Set extends Command implements IntelligentCommand {
301 301
                     || previousArgs.get(0).equalsIgnoreCase("--append")
302 302
                     || previousArgs.get(0).equalsIgnoreCase("--server")
303 303
                     || previousArgs.get(0).equalsIgnoreCase("--channel")) {
304
-                res.addAll(context.getWindow().getContainer().getConfigManager()
304
+                res.addAll(context.getWindow().getConfigManager()
305 305
                         .getDomains());
306 306
             } else {
307
-                res.addAll(context.getWindow().getContainer().getConfigManager()
307
+                res.addAll(context.getWindow().getConfigManager()
308 308
                         .getOptions(previousArgs.get(0)).keySet());
309 309
             }
310 310
             res.excludeAll();
@@ -312,7 +312,7 @@ public class Set extends Command implements IntelligentCommand {
312 312
                 || previousArgs.get(0).equalsIgnoreCase("--append")
313 313
                 || previousArgs.get(0).equalsIgnoreCase("--server")
314 314
                 || previousArgs.get(0).equalsIgnoreCase("--channel"))) {
315
-            res.addAll(context.getWindow().getContainer().getConfigManager()
315
+            res.addAll(context.getWindow().getConfigManager()
316 316
                     .getOptions(previousArgs.get(1)).keySet());
317 317
             res.excludeAll();
318 318
         }

+ 1
- 1
src/com/dmdirc/commandparser/commands/server/AllChannels.java Целия файл

@@ -55,7 +55,7 @@ public class AllChannels extends Command implements IntelligentCommand {
55 55
 
56 56
         for (String channel : server.getChannels()) {
57 57
             server.getChannel(channel).getCommandParser()
58
-                    .parseCommand(server.getChannel(channel), context.getSource(), command);
58
+                    .parseCommand(server.getChannel(channel), command);
59 59
         }
60 60
     }
61 61
 

+ 1
- 1
src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java Целия файл

@@ -118,7 +118,7 @@ public class JoinChannelCommand extends Command implements
118 118
     @Override
119 119
     public AdditionalTabTargets getSuggestions(final int arg,
120 120
             final IntelligentCommandContext context) {
121
-        final FrameContainer source = context.getWindow().getContainer();
121
+        final FrameContainer source = context.getWindow();
122 122
         final Server server = source.getServer();
123 123
         final List<String> results = checkSource(source, true, true);
124 124
 

+ 4
- 3
src/com/dmdirc/commandparser/commands/server/Message.java Целия файл

@@ -25,6 +25,7 @@ package com.dmdirc.commandparser.commands.server;
25 25
 import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Server;
27 27
 import com.dmdirc.commandparser.BaseCommandInfo;
28
+import com.dmdirc.WritableFrameContainer;
28 29
 import com.dmdirc.commandparser.CommandArguments;
29 30
 import com.dmdirc.commandparser.CommandInfo;
30 31
 import com.dmdirc.commandparser.CommandType;
@@ -37,7 +38,6 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
37 38
 import com.dmdirc.parser.interfaces.Parser;
38 39
 import com.dmdirc.ui.input.AdditionalTabTargets;
39 40
 import com.dmdirc.ui.input.TabCompletionType;
40
-import com.dmdirc.ui.interfaces.InputWindow;
41 41
 
42 42
 /**
43 43
  * Allows the user to send privmsgs.
@@ -103,10 +103,11 @@ public class Message extends Command implements IntelligentCommand,
103 103
 
104 104
     /** {@inheritDoc} */
105 105
     @Override
106
-    public int getLineCount(final InputWindow origin, final CommandArguments arguments) {
106
+    public int getLineCount(final WritableFrameContainer origin,
107
+            final CommandArguments arguments) {
107 108
         if (arguments.getArguments().length >= 2) {
108 109
             final String target = arguments.getArguments()[0];
109
-            return origin.getContainer().getServer().getNumLines("PRIVMSG "
110
+            return origin.getServer().getNumLines("PRIVMSG "
110 111
                     + target + " :" + arguments.getArgumentsAsString(1));
111 112
         } else {
112 113
             return 1;

+ 7
- 4
src/com/dmdirc/commandparser/commands/server/OpenQuery.java Целия файл

@@ -26,6 +26,7 @@ import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.Query;
27 27
 import com.dmdirc.Server;
28 28
 import com.dmdirc.commandparser.BaseCommandInfo;
29
+import com.dmdirc.WritableFrameContainer;
29 30
 import com.dmdirc.commandparser.CommandArguments;
30 31
 import com.dmdirc.commandparser.CommandInfo;
31 32
 import com.dmdirc.commandparser.CommandManager;
@@ -37,7 +38,6 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
37 38
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
38 39
 import com.dmdirc.ui.input.AdditionalTabTargets;
39 40
 import com.dmdirc.ui.input.TabCompletionType;
40
-import com.dmdirc.ui.interfaces.InputWindow;
41 41
 import com.dmdirc.ui.messages.Styliser;
42 42
 
43 43
 /**
@@ -79,7 +79,9 @@ public class OpenQuery extends Command implements IntelligentCommand,
79 79
         }
80 80
 
81 81
         if (!args.isSilent()) {
82
-            context.getSource().getController().requestWindowFocus(query);
82
+            //TODO how are we going to handle focusing an existing query?
83
+            //context.getSource().getController().requestWindowFocus(query);
84
+            return; //NOPMD
83 85
         }
84 86
     }
85 87
 
@@ -99,10 +101,11 @@ public class OpenQuery extends Command implements IntelligentCommand,
99 101
 
100 102
     /** {@inheritDoc} */
101 103
     @Override
102
-    public int getLineCount(final InputWindow origin, final CommandArguments arguments) {
104
+    public int getLineCount(final WritableFrameContainer origin,
105
+            final CommandArguments arguments) {
103 106
         if (arguments.getArguments().length >= 2) {
104 107
             final String target = arguments.getArguments()[0];
105
-            return origin.getContainer().getServer().getNumLines("PRIVMSG "
108
+            return origin.getServer().getNumLines("PRIVMSG "
106 109
                     + target + " :" + arguments.getArgumentsAsString(1));
107 110
         } else {
108 111
             return 1;

+ 0
- 65
src/com/dmdirc/commandparser/commands/server/ServerSettings.java Целия файл

@@ -1,65 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes,
3
- * Simon Mott
4
- *
5
- * Permission is hereby granted, free of charge, to any person obtaining a copy
6
- * of this software and associated documentation files (the "Software"), to deal
7
- * in the Software without restriction, including without limitation the rights
8
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- * copies of the Software, and to permit persons to whom the Software is
10
- * furnished to do so, subject to the following conditions:
11
- *
12
- * The above copyright notice and this permission notice shall be included in
13
- * all copies or substantial portions of the Software.
14
- *
15
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- * SOFTWARE.
22
- */
23
-
24
-package com.dmdirc.commandparser.commands.server;
25
-
26
-import com.dmdirc.FrameContainer;
27
-import com.dmdirc.commandparser.BaseCommandInfo;
28
-import com.dmdirc.commandparser.CommandArguments;
29
-import com.dmdirc.commandparser.CommandInfo;
30
-import com.dmdirc.commandparser.CommandType;
31
-import com.dmdirc.commandparser.commands.Command;
32
-import com.dmdirc.commandparser.commands.CommandOptions;
33
-import com.dmdirc.commandparser.commands.IntelligentCommand;
34
-import com.dmdirc.commandparser.commands.context.CommandContext;
35
-import com.dmdirc.commandparser.commands.context.ServerCommandContext;
36
-import com.dmdirc.ui.input.AdditionalTabTargets;
37
-
38
-/**
39
- * Opens the server settings window for the server.
40
- *
41
- * @since 0.6.4
42
- */
43
-@CommandOptions(allowOffline=false)
44
-public class ServerSettings extends Command implements IntelligentCommand {
45
-
46
-    /** A command info object for this command. */
47
-    public static final CommandInfo INFO = new BaseCommandInfo("serversettings",
48
-            "serversettings - opens the server settings window",
49
-            CommandType.TYPE_SERVER);
50
-
51
-    /** {@inheritDoc} */
52
-    @Override
53
-    public void execute(final FrameContainer origin,
54
-            final CommandArguments args, final CommandContext context) {
55
-        context.getSource().getController().showServerSettingsDialog(
56
-                ((ServerCommandContext) context).getServer());
57
-    }
58
-
59
-    /** {@inheritDoc} */
60
-    @Override
61
-    public AdditionalTabTargets getSuggestions(final int arg,
62
-            final IntelligentCommandContext context) {
63
-        return new AdditionalTabTargets().excludeAll();
64
-    }
65
-}

+ 5
- 5
src/com/dmdirc/commandparser/parsers/ChannelCommandParser.java Целия файл

@@ -30,7 +30,6 @@ import com.dmdirc.commandparser.CommandInfo;
30 30
 import com.dmdirc.commandparser.CommandType;
31 31
 import com.dmdirc.commandparser.commands.Command;
32 32
 import com.dmdirc.commandparser.commands.context.ChannelCommandContext;
33
-import com.dmdirc.ui.interfaces.Window;
34 33
 
35 34
 /**
36 35
  * A command parser that is tailored for use in a channel environment.
@@ -78,12 +77,13 @@ public class ChannelCommandParser extends ChatCommandParser {
78 77
     /** {@inheritDoc} */
79 78
     @Override
80 79
     protected void executeCommand(final FrameContainer origin,
81
-            final Window window, final CommandInfo commandInfo,
82
-            final Command command, final CommandArguments args) {
80
+            final CommandInfo commandInfo, final Command command,
81
+            final CommandArguments args) {
83 82
         if (commandInfo.getType() == CommandType.TYPE_CHANNEL) {
84
-            command.execute(origin, args, new ChannelCommandContext(window, commandInfo, channel));
83
+            command.execute(origin, args, new ChannelCommandContext(origin,
84
+                    commandInfo, channel));
85 85
         } else {
86
-            super.executeCommand(origin, window, commandInfo, command, args);
86
+            super.executeCommand(origin, commandInfo, command, args);
87 87
         }
88 88
     }
89 89
 

+ 7
- 6
src/com/dmdirc/commandparser/parsers/ChatCommandParser.java Целия файл

@@ -30,7 +30,6 @@ import com.dmdirc.commandparser.CommandInfo;
30 30
 import com.dmdirc.commandparser.CommandType;
31 31
 import com.dmdirc.commandparser.commands.Command;
32 32
 import com.dmdirc.commandparser.commands.context.ChatCommandContext;
33
-import com.dmdirc.ui.interfaces.Window;
34 33
 
35 34
 /**
36 35
  * A command parser which implements common functionality for chat windows
@@ -71,18 +70,20 @@ public class ChatCommandParser extends ServerCommandParser {
71 70
     /** {@inheritDoc} */
72 71
     @Override
73 72
     protected void executeCommand(final FrameContainer origin,
74
-            final Window window, final CommandInfo commandInfo,
75
-            final Command command, final CommandArguments args) {
73
+            final CommandInfo commandInfo, final Command command,
74
+            final CommandArguments args) {
76 75
         if (commandInfo.getType() == CommandType.TYPE_CHAT) {
77
-            command.execute(origin, args, new ChatCommandContext(window, commandInfo, owner));
76
+            command.execute(origin, args, new ChatCommandContext(origin,
77
+                    commandInfo, owner));
78 78
         } else {
79
-            super.executeCommand(origin, window, commandInfo, command, args);
79
+            super.executeCommand(origin, commandInfo, command, args);
80 80
         }
81 81
     }
82 82
 
83 83
     /** {@inheritDoc} */
84 84
     @Override
85
-    protected void handleNonCommand(final FrameContainer origin, final String line) {
85
+    protected void handleNonCommand(final FrameContainer origin,
86
+            final String line) {
86 87
         owner.sendLine(line);
87 88
     }
88 89
 

+ 9
- 10
src/com/dmdirc/commandparser/parsers/CommandParser.java Целия файл

@@ -36,7 +36,6 @@ import com.dmdirc.commandparser.commands.CommandOptions;
36 36
 import com.dmdirc.commandparser.commands.ExternalCommand;
37 37
 import com.dmdirc.commandparser.commands.PreviousCommand;
38 38
 import com.dmdirc.config.IdentityManager;
39
-import com.dmdirc.ui.interfaces.Window;
40 39
 import com.dmdirc.util.RollingList;
41 40
 
42 41
 import java.io.Serializable;
@@ -132,18 +131,18 @@ public abstract class CommandParser implements Serializable {
132 131
      * @since 0.6.4
133 132
      */
134 133
     public final void parseCommand(final FrameContainer origin,
135
-            final Window window, final String line, final boolean parseChannel) {
134
+            final String line, final boolean parseChannel) {
136 135
         final CommandArguments args = new CommandArguments(line);
137 136
 
138 137
         if (args.isCommand()) {
139
-            if (handleChannelCommand(origin, window, args, parseChannel)) {
138
+            if (handleChannelCommand(origin, args, parseChannel)) {
140 139
                 return;
141 140
             }
142 141
 
143 142
             if (commands.containsKey(args.getCommandName().toLowerCase())) {
144 143
                 final CommandInfoPair pair = commands.get(args.getCommandName().toLowerCase());
145 144
                 addHistory(args.getStrippedLine());
146
-                executeCommand(origin, window, pair.getCommandInfo(), pair.getCommand(), args);
145
+                executeCommand(origin, pair.getCommandInfo(), pair.getCommand(), args);
147 146
             } else {
148 147
                 handleInvalidCommand(origin, args);
149 148
             }
@@ -167,7 +166,7 @@ public abstract class CommandParser implements Serializable {
167 166
      * @return True iff the command was handled, false otherwise
168 167
      */
169 168
     protected boolean handleChannelCommand(final FrameContainer origin,
170
-            final Window window, final CommandArguments args, final boolean parseChannel) {
169
+            final CommandArguments args, final boolean parseChannel) {
171 170
         final boolean silent = args.isSilent();
172 171
         final String command = args.getCommandName();
173 172
         final String[] cargs = args.getArguments();
@@ -194,7 +193,7 @@ public abstract class CommandParser implements Serializable {
194 193
 
195 194
                 if (server.hasChannel(channel)) {
196 195
                     server.getChannel(channel).getCommandParser()
197
-                            .parseCommand(origin, window, commandManager.getCommandChar()
196
+                            .parseCommand(origin, commandManager.getCommandChar()
198 197
                             + args.getCommandName() + " " + args.getWordsAsString(2), false);
199 198
                 } else {
200 199
                     final Map.Entry<CommandInfo, Command> actCommand
@@ -258,8 +257,8 @@ public abstract class CommandParser implements Serializable {
258 257
      * @since 0.6.4
259 258
      */
260 259
     public final void parseCommand(final FrameContainer origin,
261
-            final Window window, final String line) {
262
-        parseCommand(origin, window, line, true);
260
+            final String line) {
261
+        parseCommand(origin, line, true);
263 262
     }
264 263
 
265 264
     /**
@@ -283,8 +282,8 @@ public abstract class CommandParser implements Serializable {
283 282
      * @since 0.6.4
284 283
      */
285 284
     protected abstract void executeCommand(final FrameContainer origin,
286
-            final Window window, final CommandInfo commandInfo,
287
-            final Command command, final CommandArguments args);
285
+            final CommandInfo commandInfo, final Command command,
286
+            final CommandArguments args);
288 287
 
289 288
     /**
290 289
      * Called when the user attempted to issue a command (i.e., used the command

+ 3
- 4
src/com/dmdirc/commandparser/parsers/GlobalCommandParser.java Целия файл

@@ -30,7 +30,6 @@ import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.context.CommandContext;
31 31
 import com.dmdirc.logger.ErrorLevel;
32 32
 import com.dmdirc.logger.Logger;
33
-import com.dmdirc.ui.interfaces.Window;
34 33
 
35 34
 /**
36 35
  * The command parser used for global commands.
@@ -76,9 +75,9 @@ public class GlobalCommandParser extends CommandParser {
76 75
     /** {@inheritDoc} */
77 76
     @Override
78 77
     protected void executeCommand(final FrameContainer origin,
79
-            final Window window, final CommandInfo commandInfo,
80
-            final Command command, final CommandArguments args) {
81
-        command.execute(origin, args, new CommandContext(window, commandInfo));
78
+            final CommandInfo commandInfo, final Command command,
79
+            final CommandArguments args) {
80
+        command.execute(origin, args, new CommandContext(origin, commandInfo));
82 81
     }
83 82
 
84 83
     /**

+ 5
- 5
src/com/dmdirc/commandparser/parsers/QueryCommandParser.java Целия файл

@@ -30,7 +30,6 @@ import com.dmdirc.commandparser.CommandInfo;
30 30
 import com.dmdirc.commandparser.CommandType;
31 31
 import com.dmdirc.commandparser.commands.Command;
32 32
 import com.dmdirc.commandparser.commands.context.QueryCommandContext;
33
-import com.dmdirc.ui.interfaces.Window;
34 33
 
35 34
 /**
36 35
  * A command parser that is tailored for use in a query environment. Handles
@@ -79,12 +78,13 @@ public class QueryCommandParser extends ChatCommandParser {
79 78
     /** {@inheritDoc} */
80 79
     @Override
81 80
     protected void executeCommand(final FrameContainer origin,
82
-            final Window window, final CommandInfo commandInfo,
83
-            final Command command, final CommandArguments args) {
81
+            final CommandInfo commandInfo, final Command command,
82
+            final CommandArguments args) {
84 83
         if (commandInfo.getType() == CommandType.TYPE_QUERY) {
85
-            command.execute(origin, args, new QueryCommandContext(window, commandInfo, query));
84
+            command.execute(origin, args, new QueryCommandContext(origin,
85
+                    commandInfo, query));
86 86
         } else {
87
-            super.executeCommand(origin, window, commandInfo, command, args);
87
+            super.executeCommand(origin, commandInfo, command, args);
88 88
         }
89 89
     }
90 90
 

+ 4
- 5
src/com/dmdirc/commandparser/parsers/ServerCommandParser.java Целия файл

@@ -30,7 +30,6 @@ import com.dmdirc.commandparser.CommandInfo;
30 30
 import com.dmdirc.commandparser.CommandType;
31 31
 import com.dmdirc.commandparser.commands.Command;
32 32
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
33
-import com.dmdirc.ui.interfaces.Window;
34 33
 
35 34
 /**
36 35
  * A command parser used in the context of a server.
@@ -68,8 +67,8 @@ public class ServerCommandParser extends GlobalCommandParser {
68 67
     /** {@inheritDoc} */
69 68
     @Override
70 69
     protected void executeCommand(final FrameContainer origin,
71
-            final Window window, final CommandInfo commandInfo,
72
-            final Command command, final CommandArguments args) {
70
+            final CommandInfo commandInfo, final Command command,
71
+            final CommandArguments args) {
73 72
         if (commandInfo.getType() == CommandType.TYPE_SERVER) {
74 73
             if (hasCommandOptions(command) && !getCommandOptions(command).allowOffline()
75 74
                     && (server == null || (server.getState() != ServerState.CONNECTED
@@ -79,10 +78,10 @@ public class ServerCommandParser extends GlobalCommandParser {
79 78
                     origin.addLine("commandError", "You must be connected to use this command");
80 79
                 }
81 80
             } else {
82
-                command.execute(origin, args, new ServerCommandContext(window, commandInfo, server));
81
+                command.execute(origin, args, new ServerCommandContext(origin, commandInfo, server));
83 82
             }
84 83
         } else {
85
-            super.executeCommand(origin, window, commandInfo, command, args);
84
+            super.executeCommand(origin, commandInfo, command, args);
86 85
         }
87 86
     }
88 87
 

+ 13
- 13
src/com/dmdirc/ui/input/InputHandler.java Целия файл

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.ui.input;
24 24
 
25
+import com.dmdirc.WritableFrameContainer;
25 26
 import com.dmdirc.actions.ActionManager;
26 27
 import com.dmdirc.actions.CoreActionType;
27 28
 import com.dmdirc.commandparser.CommandArguments;
@@ -37,7 +38,6 @@ import com.dmdirc.ui.input.tabstyles.TabCompletionResult;
37 38
 import com.dmdirc.ui.input.tabstyles.TabCompletionStyle;
38 39
 import com.dmdirc.ui.interfaces.InputField;
39 40
 import com.dmdirc.ui.interfaces.InputValidationListener;
40
-import com.dmdirc.ui.interfaces.InputWindow;
41 41
 import com.dmdirc.ui.messages.Styliser;
42 42
 import com.dmdirc.util.ListenerList;
43 43
 import com.dmdirc.util.RollingList;
@@ -93,7 +93,7 @@ public abstract class InputHandler implements ConfigChangeListener {
93 93
     /** The CommandParser to use for our input. */
94 94
     protected final CommandParser commandParser;
95 95
     /** The frame that we belong to. */
96
-    protected final InputWindow parentWindow;
96
+    protected final WritableFrameContainer parentWindow;
97 97
     /** The tab completion style. */
98 98
     protected TabCompletionStyle style;
99 99
     /** Our listener list. */
@@ -109,10 +109,10 @@ public abstract class InputHandler implements ConfigChangeListener {
109 109
      */
110 110
     public InputHandler(final InputField thisTarget,
111 111
             final CommandParser thisCommandParser,
112
-            final InputWindow thisParentWindow) {
112
+            final WritableFrameContainer thisParentWindow) {
113 113
 
114
-        buffer = new RollingList<String>(thisParentWindow.getContainer()
115
-                .getConfigManager().getOptionInt("ui", "inputbuffersize"), "");
114
+        buffer = new RollingList<String>(thisParentWindow.getConfigManager()
115
+                .getOptionInt("ui", "inputbuffersize"), "");
116 116
 
117 117
         this.commandParser = thisCommandParser;
118 118
         this.parentWindow = thisParentWindow;
@@ -120,7 +120,7 @@ public abstract class InputHandler implements ConfigChangeListener {
120 120
 
121 121
         setStyle();
122 122
 
123
-        parentWindow.getContainer().getConfigManager().addChangeListener(
123
+        parentWindow.getConfigManager().addChangeListener(
124 124
                 "tabcompletion", "style", this);
125 125
 
126 126
         addUpHandler();
@@ -177,9 +177,10 @@ public abstract class InputHandler implements ConfigChangeListener {
177 177
      */
178 178
     private void setStyle() {
179 179
         style = (TabCompletionStyle) PluginManager.getPluginManager()
180
-                .getServiceProvider("tabcompletion", parentWindow.getContainer()
180
+                .getServiceProvider("tabcompletion", parentWindow
181 181
                 .getConfigManager().getOption("tabcompletion", "style"))
182
-                .getExportedService("getCompletionStyle").execute(tabCompleter, parentWindow);
182
+                .getExportedService("getCompletionStyle").execute(tabCompleter,
183
+                parentWindow);
183 184
     }
184 185
 
185 186
     /**
@@ -240,7 +241,7 @@ public abstract class InputHandler implements ConfigChangeListener {
240 241
                 fireLineWrap(count);
241 242
             }
242 243
         } else {
243
-            final int lines = parentWindow.getContainer().getNumLines(text);
244
+            final int lines = parentWindow.getNumLines(text);
244 245
                 fireLineWrap(lines);
245 246
         }
246 247
     }
@@ -330,7 +331,7 @@ public abstract class InputHandler implements ConfigChangeListener {
330 331
 
331 332
             case KeyEvent.VK_ENTER:
332 333
                 if ((flags & HANDLE_RETURN) != 0 && !line.isEmpty()) {
333
-                    commandParser.parseCommandCtrl(parentWindow.getContainer(), line);
334
+                    commandParser.parseCommandCtrl(parentWindow, line);
334 335
                     addToBuffer(line);
335 336
                 }
336 337
                 break;
@@ -486,12 +487,11 @@ public abstract class InputHandler implements ConfigChangeListener {
486 487
 
487 488
             ActionManager.getActionManager().triggerEvent(
488 489
                     CoreActionType.CLIENT_USER_INPUT, null,
489
-                    parentWindow.getContainer(), thisBuffer);
490
+                    parentWindow, thisBuffer);
490 491
 
491 492
             addToBuffer(thisBuffer.toString());
492 493
 
493
-            commandParser.parseCommand(parentWindow.getContainer(),
494
-                    parentWindow, thisBuffer.toString());
494
+            commandParser.parseCommand(parentWindow, thisBuffer.toString());
495 495
         }
496 496
         fireLineWrap(0);
497 497
         fireCommandPassed();

+ 6
- 4
src/com/dmdirc/ui/input/TabCompleter.java Целия файл

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.ui.input;
24 24
 
25
+import com.dmdirc.WritableFrameContainer;
25 26
 import com.dmdirc.commandparser.CommandArguments;
26 27
 import com.dmdirc.commandparser.CommandInfo;
27 28
 import com.dmdirc.commandparser.CommandManager;
@@ -30,7 +31,6 @@ import com.dmdirc.commandparser.commands.Command;
30 31
 import com.dmdirc.commandparser.commands.IntelligentCommand;
31 32
 import com.dmdirc.commandparser.commands.IntelligentCommand.IntelligentCommandContext;
32 33
 import com.dmdirc.config.IdentityManager;
33
-import com.dmdirc.ui.interfaces.InputWindow;
34 34
 import com.dmdirc.util.MapList;
35 35
 
36 36
 import java.util.Arrays;
@@ -234,7 +234,8 @@ public class TabCompleter {
234 234
      * @return Additional tab targets for the text, or null if none are available
235 235
      * @since 0.6.4
236 236
      */
237
-    private static AdditionalTabTargets getIntelligentResults(final InputWindow window,
237
+    private static AdditionalTabTargets getIntelligentResults(
238
+            final WritableFrameContainer window,
238 239
             final CommandArguments args, final String partial) {
239 240
         if (!args.isCommand()) {
240 241
             return null;
@@ -274,8 +275,9 @@ public class TabCompleter {
274 275
      * @return Additional tab targets for the text, or null if none are available
275 276
      * @since 0.6.4
276 277
      */
277
-    public static AdditionalTabTargets getIntelligentResults(final InputWindow window,
278
-            final String text, final String partial) {
278
+    public static AdditionalTabTargets getIntelligentResults(
279
+            final WritableFrameContainer window, final String text,
280
+            final String partial) {
279 281
         return getIntelligentResults(window, new CommandArguments(text), partial);
280 282
     }
281 283
 }

+ 16
- 16
test/com/dmdirc/commandparser/parsers/CommandParserTest.java Целия файл

@@ -41,7 +41,7 @@ public class CommandParserTest {
41 41
     @Test
42 42
     public void testBasicCommand() {
43 43
         final TestCommandParser tcp = new TestCommandParser();
44
-        tcp.parseCommand(null, null, "/echo this is a test");
44
+        tcp.parseCommand(null, "/echo this is a test");
45 45
 
46 46
         assertNull(tcp.nonCommandLine);
47 47
         assertNull(tcp.invalidCommand);
@@ -53,7 +53,7 @@ public class CommandParserTest {
53 53
     @Test
54 54
     public void testBasicNoArgs() {
55 55
         final TestCommandParser tcp = new TestCommandParser();
56
-        tcp.parseCommand(null, null, "/echo");
56
+        tcp.parseCommand(null, "/echo");
57 57
 
58 58
         assertNull(tcp.nonCommandLine);
59 59
         assertNull(tcp.invalidCommand);
@@ -65,7 +65,7 @@ public class CommandParserTest {
65 65
     @Test
66 66
     public void testSilentNoArgs() {
67 67
         final TestCommandParser tcp = new TestCommandParser();
68
-        tcp.parseCommand(null, null, "/.echo");
68
+        tcp.parseCommand(null, "/.echo");
69 69
 
70 70
         assertNull(tcp.nonCommandLine);
71 71
         assertNull(tcp.invalidCommand);
@@ -77,7 +77,7 @@ public class CommandParserTest {
77 77
     @Test
78 78
     public void testSilentCommand() {
79 79
         final TestCommandParser tcp = new TestCommandParser();
80
-        tcp.parseCommand(null, null, "/.echo this is a test");
80
+        tcp.parseCommand(null, "/.echo this is a test");
81 81
 
82 82
         assertNull(tcp.nonCommandLine);
83 83
         assertNull(tcp.invalidCommand);
@@ -89,7 +89,7 @@ public class CommandParserTest {
89 89
     @Test
90 90
     public void testNonExistantCommand() {
91 91
         final TestCommandParser tcp = new TestCommandParser();
92
-        tcp.parseCommand(null, null, "/foobar moo bar");
92
+        tcp.parseCommand(null, "/foobar moo bar");
93 93
 
94 94
         assertNull(tcp.nonCommandLine);
95 95
         assertEquals("foobar", tcp.invalidCommand);
@@ -101,7 +101,7 @@ public class CommandParserTest {
101 101
     @Test
102 102
     public void testEmptyCommand() {
103 103
         final TestCommandParser tcp = new TestCommandParser();
104
-        tcp.parseCommand(null, null, "/ moo bar");
104
+        tcp.parseCommand(null, "/ moo bar");
105 105
 
106 106
         assertNull(tcp.nonCommandLine);
107 107
         assertEquals("", tcp.invalidCommand);
@@ -109,11 +109,11 @@ public class CommandParserTest {
109 109
         assertNull(tcp.executedCommand);
110 110
         assertFalse(tcp.wasSilent);
111 111
     }
112
-    
112
+
113 113
     @Test
114 114
     public void testEmptySilentCommand() {
115 115
         final TestCommandParser tcp = new TestCommandParser();
116
-        tcp.parseCommand(null, null, "/. moo bar");
116
+        tcp.parseCommand(null, "/. moo bar");
117 117
 
118 118
         assertNull(tcp.nonCommandLine);
119 119
         assertEquals("", tcp.invalidCommand);
@@ -121,11 +121,11 @@ public class CommandParserTest {
121 121
         assertNull(tcp.executedCommand);
122 122
         assertFalse(tcp.wasSilent);
123 123
     }
124
-    
124
+
125 125
     @Test
126 126
     public void testNonCommand() {
127 127
         final TestCommandParser tcp = new TestCommandParser();
128
-        tcp.parseCommand(null, null, "Foobar baz");
128
+        tcp.parseCommand(null, "Foobar baz");
129 129
 
130 130
         assertNotNull(tcp.nonCommandLine);
131 131
         assertEquals("Foobar baz", tcp.nonCommandLine);
@@ -133,21 +133,21 @@ public class CommandParserTest {
133 133
         assertNull(tcp.executedCommand);
134 134
         assertFalse(tcp.wasSilent);
135 135
     }
136
-    
136
+
137 137
     @Test
138 138
     public void testCommandHistory() {
139 139
         final TestCommandParser tcp = new TestCommandParser();
140
-        tcp.parseCommand(null, null, "/echo this is a test");
140
+        tcp.parseCommand(null, "/echo this is a test");
141 141
 
142 142
         final long time1 = tcp.getCommandTime("echo this is a test");
143 143
         assertTrue(time1 > 0);
144
-        
145
-        tcp.parseCommand(null, null, "/echo this is a test");
144
+
145
+        tcp.parseCommand( null, "/echo this is a test");
146 146
         final long time2 = tcp.getCommandTime("echo this is a test");
147 147
         assertTrue(time2 > 0);
148 148
         assertTrue(time2 >= time1);
149
-        
149
+
150 150
         assertEquals(0L, tcp.getCommandTime("echo"));
151
-    }    
151
+    }
152 152
 
153 153
 }

+ 1
- 2
test/com/dmdirc/harness/TestCommandParser.java Целия файл

@@ -29,7 +29,6 @@ import com.dmdirc.commandparser.parsers.*;
29 29
 import com.dmdirc.commandparser.CommandManager;
30 30
 import com.dmdirc.commandparser.CommandType;
31 31
 import com.dmdirc.commandparser.commands.Command;
32
-import com.dmdirc.ui.interfaces.Window;
33 32
 
34 33
 public class TestCommandParser extends CommandParser {
35 34
     private static final long serialVersionUID = 7073002401375438532L;
@@ -50,7 +49,7 @@ public class TestCommandParser extends CommandParser {
50 49
     }
51 50
 
52 51
     @Override
53
-    protected void executeCommand(FrameContainer origin, Window window,
52
+    protected void executeCommand(FrameContainer origin,
54 53
             CommandInfo commandInfo, Command command, CommandArguments args) {
55 54
         executedCommand = command;
56 55
         wasSilent = args.isSilent();

Loading…
Отказ
Запис