Преглед изворни кода

Make Commands take a WindowModel.

pull/531/head
Chris Smith пре 9 година
родитељ
комит
344e0d38a3
44 измењених фајлова са 125 додато и 105 уклоњено
  1. 4
    2
      src/com/dmdirc/commandparser/aliases/AliasCommandHandler.java
  2. 4
    4
      src/com/dmdirc/commandparser/commands/Command.java
  3. 2
    2
      src/com/dmdirc/commandparser/commands/channel/Ban.java
  4. 2
    2
      src/com/dmdirc/commandparser/commands/channel/Cycle.java
  5. 2
    1
      src/com/dmdirc/commandparser/commands/channel/Invite.java
  6. 2
    2
      src/com/dmdirc/commandparser/commands/channel/KickReason.java
  7. 2
    1
      src/com/dmdirc/commandparser/commands/channel/Mode.java
  8. 2
    1
      src/com/dmdirc/commandparser/commands/channel/Names.java
  9. 2
    2
      src/com/dmdirc/commandparser/commands/channel/Part.java
  10. 2
    2
      src/com/dmdirc/commandparser/commands/channel/SetNickColour.java
  11. 2
    1
      src/com/dmdirc/commandparser/commands/channel/ShowTopic.java
  12. 2
    1
      src/com/dmdirc/commandparser/commands/chat/Me.java
  13. 5
    5
      src/com/dmdirc/commandparser/commands/flags/CommandFlagHandler.java
  14. 2
    2
      src/com/dmdirc/commandparser/commands/global/AliasCommand.java
  15. 2
    1
      src/com/dmdirc/commandparser/commands/global/AllServers.java
  16. 2
    2
      src/com/dmdirc/commandparser/commands/global/Clear.java
  17. 7
    6
      src/com/dmdirc/commandparser/commands/global/Echo.java
  18. 2
    2
      src/com/dmdirc/commandparser/commands/global/Exit.java
  19. 4
    4
      src/com/dmdirc/commandparser/commands/global/Help.java
  20. 4
    2
      src/com/dmdirc/commandparser/commands/global/Ifplugin.java
  21. 2
    2
      src/com/dmdirc/commandparser/commands/global/LoadPlugin.java
  22. 3
    2
      src/com/dmdirc/commandparser/commands/global/NewServer.java
  23. 10
    8
      src/com/dmdirc/commandparser/commands/global/OpenWindow.java
  24. 2
    2
      src/com/dmdirc/commandparser/commands/global/ReloadIdentities.java
  25. 2
    2
      src/com/dmdirc/commandparser/commands/global/ReloadPlugin.java
  26. 2
    2
      src/com/dmdirc/commandparser/commands/global/SaveConfig.java
  27. 8
    8
      src/com/dmdirc/commandparser/commands/global/SetCommand.java
  28. 2
    2
      src/com/dmdirc/commandparser/commands/global/UnloadPlugin.java
  29. 2
    1
      src/com/dmdirc/commandparser/commands/server/AllChannels.java
  30. 2
    2
      src/com/dmdirc/commandparser/commands/server/Away.java
  31. 2
    2
      src/com/dmdirc/commandparser/commands/server/Back.java
  32. 4
    2
      src/com/dmdirc/commandparser/commands/server/ChangeServer.java
  33. 2
    2
      src/com/dmdirc/commandparser/commands/server/Ctcp.java
  34. 2
    2
      src/com/dmdirc/commandparser/commands/server/Disconnect.java
  35. 6
    6
      src/com/dmdirc/commandparser/commands/server/Ignore.java
  36. 2
    1
      src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java
  37. 2
    1
      src/com/dmdirc/commandparser/commands/server/Message.java
  38. 2
    2
      src/com/dmdirc/commandparser/commands/server/Nick.java
  39. 2
    2
      src/com/dmdirc/commandparser/commands/server/Notice.java
  40. 2
    1
      src/com/dmdirc/commandparser/commands/server/OpenQuery.java
  41. 2
    2
      src/com/dmdirc/commandparser/commands/server/Raw.java
  42. 2
    2
      src/com/dmdirc/commandparser/commands/server/RawServerCommand.java
  43. 2
    2
      src/com/dmdirc/commandparser/commands/server/Reconnect.java
  44. 2
    2
      src/com/dmdirc/commandparser/commands/server/Umode.java

+ 4
- 2
src/com/dmdirc/commandparser/aliases/AliasCommandHandler.java Прегледај датотеку

@@ -27,6 +27,7 @@ import com.dmdirc.commandparser.CommandArguments;
27 27
 import com.dmdirc.commandparser.commands.Command;
28 28
 import com.dmdirc.commandparser.commands.context.CommandContext;
29 29
 import com.dmdirc.interfaces.CommandController;
30
+import com.dmdirc.interfaces.WindowModel;
30 31
 
31 32
 import javax.annotation.Nonnull;
32 33
 
@@ -43,11 +44,12 @@ public class AliasCommandHandler extends Command {
43 44
     }
44 45
 
45 46
     @Override
46
-    public void execute(@Nonnull final FrameContainer origin, final CommandArguments args,
47
+    public void execute(@Nonnull final WindowModel origin, final CommandArguments args,
47 48
             final CommandContext context) {
48 49
         if (args.getArguments().length >= alias.getMinArguments()) {
49 50
             for (String line : alias.getSubstitution().split("\n")) {
50
-                origin.getCommandParser().parseCommand(origin, getSubstituteCommand(line, args));
51
+                origin.getCommandParser().parseCommand((FrameContainer) origin,
52
+                        getSubstituteCommand(line, args));
51 53
             }
52 54
         } else {
53 55
             sendLine(origin, args.isSilent(), FORMAT_ERROR, alias.getName() + " requires at least "

+ 4
- 4
src/com/dmdirc/commandparser/commands/Command.java Прегледај датотеку

@@ -22,10 +22,10 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.CommandArguments;
27 26
 import com.dmdirc.commandparser.commands.context.CommandContext;
28 27
 import com.dmdirc.interfaces.CommandController;
28
+import com.dmdirc.interfaces.WindowModel;
29 29
 import com.dmdirc.ui.messages.Styliser;
30 30
 
31 31
 import javax.annotation.Nonnull;
@@ -59,7 +59,7 @@ public abstract class Command {
59 59
      * @param type     The type of message to send
60 60
      * @param args     The arguments of the message
61 61
      */
62
-    protected final void sendLine(@Nullable final FrameContainer target,
62
+    protected final void sendLine(@Nullable final WindowModel target,
63 63
             final boolean isSilent, final String type, final Object... args) {
64 64
         if (!isSilent && target != null) {
65 65
             target.addLine(type, args);
@@ -74,7 +74,7 @@ public abstract class Command {
74 74
      * @param name     The name of the command that's raising the error
75 75
      * @param args     The arguments that the command accepts or expects
76 76
      */
77
-    protected final void showUsage(@Nullable final FrameContainer target,
77
+    protected final void showUsage(@Nullable final WindowModel target,
78 78
             final boolean isSilent, final String name, final String args) {
79 79
         sendLine(target, isSilent, "commandUsage",
80 80
                 controller.getCommandChar(),
@@ -144,7 +144,7 @@ public abstract class Command {
144 144
      *
145 145
      * @since 0.6.4
146 146
      */
147
-    public abstract void execute(@Nonnull FrameContainer origin, CommandArguments args,
147
+    public abstract void execute(@Nonnull WindowModel origin, CommandArguments args,
148 148
             CommandContext context);
149 149
 
150 150
 }

+ 2
- 2
src/com/dmdirc/commandparser/commands/channel/Ban.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.channel;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -34,6 +33,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
34 33
 import com.dmdirc.interfaces.CommandController;
35 34
 import com.dmdirc.interfaces.GroupChat;
36 35
 import com.dmdirc.interfaces.GroupChatUser;
36
+import com.dmdirc.interfaces.WindowModel;
37 37
 import com.dmdirc.ui.input.AdditionalTabTargets;
38 38
 import com.dmdirc.ui.input.TabCompletionType;
39 39
 
@@ -61,7 +61,7 @@ public class Ban extends Command implements IntelligentCommand {
61 61
     }
62 62
 
63 63
     @Override
64
-    public void execute(@Nonnull final FrameContainer origin,
64
+    public void execute(@Nonnull final WindowModel origin,
65 65
             final CommandArguments args, final CommandContext context) {
66 66
         final GroupChat channel = ((ChannelCommandContext) context).getGroupChat();
67 67
 

+ 2
- 2
src/com/dmdirc/commandparser/commands/channel/Cycle.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.channel;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -33,6 +32,7 @@ import com.dmdirc.commandparser.commands.context.ChannelCommandContext;
33 32
 import com.dmdirc.commandparser.commands.context.CommandContext;
34 33
 import com.dmdirc.interfaces.CommandController;
35 34
 import com.dmdirc.interfaces.GroupChat;
35
+import com.dmdirc.interfaces.WindowModel;
36 36
 
37 37
 import javax.annotation.Nonnull;
38 38
 import javax.inject.Inject;
@@ -59,7 +59,7 @@ public class Cycle extends Command {
59 59
     }
60 60
 
61 61
     @Override
62
-    public void execute(@Nonnull final FrameContainer origin,
62
+    public void execute(@Nonnull final WindowModel origin,
63 63
             final CommandArguments args, final CommandContext context) {
64 64
         final GroupChat channel = ((ChannelCommandContext) context).getGroupChat();
65 65
         channel.part(args.getArguments().length > 0 ? args.getArgumentsAsString()

+ 2
- 1
src/com/dmdirc/commandparser/commands/channel/Invite.java Прегледај датотеку

@@ -35,6 +35,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
35 35
 import com.dmdirc.interfaces.CommandController;
36 36
 import com.dmdirc.interfaces.Connection;
37 37
 import com.dmdirc.interfaces.GroupChat;
38
+import com.dmdirc.interfaces.WindowModel;
38 39
 
39 40
 import javax.annotation.Nonnull;
40 41
 import javax.inject.Inject;
@@ -63,7 +64,7 @@ public class Invite extends Command implements ExternalCommand {
63 64
     }
64 65
 
65 66
     @Override
66
-    public void execute(@Nonnull final FrameContainer origin,
67
+    public void execute(@Nonnull final WindowModel origin,
67 68
             final CommandArguments args, final CommandContext context) {
68 69
         if (args.getArguments().length < 1) {
69 70
             sendLine(origin, args.isSilent(), FORMAT_ERROR,

+ 2
- 2
src/com/dmdirc/commandparser/commands/channel/KickReason.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.channel;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -35,6 +34,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
35 34
 import com.dmdirc.interfaces.CommandController;
36 35
 import com.dmdirc.interfaces.GroupChat;
37 36
 import com.dmdirc.interfaces.GroupChatUser;
37
+import com.dmdirc.interfaces.WindowModel;
38 38
 import com.dmdirc.ui.input.AdditionalTabTargets;
39 39
 import com.dmdirc.ui.input.TabCompletionType;
40 40
 
@@ -66,7 +66,7 @@ public class KickReason extends Command implements IntelligentCommand {
66 66
     }
67 67
 
68 68
     @Override
69
-    public void execute(@Nonnull final FrameContainer origin,
69
+    public void execute(@Nonnull final WindowModel origin,
70 70
             final CommandArguments args, final CommandContext context) {
71 71
         final GroupChat groupChat = ((ChannelCommandContext) context).getGroupChat();
72 72
         if (args.getArguments().length == 0) {

+ 2
- 1
src/com/dmdirc/commandparser/commands/channel/Mode.java Прегледај датотеку

@@ -36,6 +36,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
36 36
 import com.dmdirc.interfaces.CommandController;
37 37
 import com.dmdirc.interfaces.Connection;
38 38
 import com.dmdirc.interfaces.GroupChat;
39
+import com.dmdirc.interfaces.WindowModel;
39 40
 import com.dmdirc.ui.input.AdditionalTabTargets;
40 41
 import com.dmdirc.ui.input.TabCompletionType;
41 42
 
@@ -65,7 +66,7 @@ public class Mode extends Command implements IntelligentCommand,
65 66
     }
66 67
 
67 68
     @Override
68
-    public void execute(@Nonnull final FrameContainer origin,
69
+    public void execute(@Nonnull final WindowModel origin,
69 70
             final CommandArguments args, final CommandContext context) {
70 71
         final GroupChat channel = ((ChannelCommandContext) context).getGroupChat();
71 72
 

+ 2
- 1
src/com/dmdirc/commandparser/commands/channel/Names.java Прегледај датотеку

@@ -36,6 +36,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
36 36
 import com.dmdirc.interfaces.CommandController;
37 37
 import com.dmdirc.interfaces.Connection;
38 38
 import com.dmdirc.interfaces.GroupChat;
39
+import com.dmdirc.interfaces.WindowModel;
39 40
 import com.dmdirc.ui.input.AdditionalTabTargets;
40 41
 
41 42
 import javax.annotation.Nonnull;
@@ -64,7 +65,7 @@ public class Names extends Command implements IntelligentCommand,
64 65
     }
65 66
 
66 67
     @Override
67
-    public void execute(@Nonnull final FrameContainer origin,
68
+    public void execute(@Nonnull final WindowModel origin,
68 69
             final CommandArguments args, final CommandContext context) {
69 70
         final GroupChat channel = ((ChannelCommandContext) context).getGroupChat();
70 71
         channel.getConnection().get().getParser().get().sendRawMessage("NAMES "

+ 2
- 2
src/com/dmdirc/commandparser/commands/channel/Part.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.channel;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -33,6 +32,7 @@ import com.dmdirc.commandparser.commands.context.ChannelCommandContext;
33 32
 import com.dmdirc.commandparser.commands.context.CommandContext;
34 33
 import com.dmdirc.interfaces.CommandController;
35 34
 import com.dmdirc.interfaces.GroupChat;
35
+import com.dmdirc.interfaces.WindowModel;
36 36
 
37 37
 import javax.annotation.Nonnull;
38 38
 import javax.inject.Inject;
@@ -59,7 +59,7 @@ public class Part extends Command {
59 59
     }
60 60
 
61 61
     @Override
62
-    public void execute(@Nonnull final FrameContainer origin,
62
+    public void execute(@Nonnull final WindowModel origin,
63 63
             final CommandArguments args, final CommandContext context) {
64 64
         final GroupChat channel = ((ChannelCommandContext) context).getGroupChat();
65 65
         channel.part(args.getArguments().length > 0 ? args.getArgumentsAsString()

+ 2
- 2
src/com/dmdirc/commandparser/commands/channel/SetNickColour.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.channel;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -35,6 +34,7 @@ import com.dmdirc.events.DisplayProperty;
35 34
 import com.dmdirc.interfaces.CommandController;
36 35
 import com.dmdirc.interfaces.GroupChat;
37 36
 import com.dmdirc.interfaces.GroupChatUser;
37
+import com.dmdirc.interfaces.WindowModel;
38 38
 import com.dmdirc.ui.input.AdditionalTabTargets;
39 39
 import com.dmdirc.ui.input.TabCompletionType;
40 40
 import com.dmdirc.ui.messages.ColourManagerFactory;
@@ -71,7 +71,7 @@ public class SetNickColour extends Command implements IntelligentCommand {
71 71
     }
72 72
 
73 73
     @Override
74
-    public void execute(@Nonnull final FrameContainer origin,
74
+    public void execute(@Nonnull final WindowModel origin,
75 75
             final CommandArguments args, final CommandContext context) {
76 76
         final GroupChat channel = ((ChannelCommandContext) context).getGroupChat();
77 77
 

+ 2
- 1
src/com/dmdirc/commandparser/commands/channel/ShowTopic.java Прегледај датотеку

@@ -37,6 +37,7 @@ import com.dmdirc.interfaces.CommandController;
37 37
 import com.dmdirc.interfaces.Connection;
38 38
 import com.dmdirc.interfaces.GroupChat;
39 39
 import com.dmdirc.interfaces.GroupChatUser;
40
+import com.dmdirc.interfaces.WindowModel;
40 41
 
41 42
 import java.util.Optional;
42 43
 
@@ -65,7 +66,7 @@ public class ShowTopic extends Command implements ExternalCommand {
65 66
     }
66 67
 
67 68
     @Override
68
-    public void execute(@Nonnull final FrameContainer origin,
69
+    public void execute(@Nonnull final WindowModel origin,
69 70
             final CommandArguments args, final CommandContext context) {
70 71
         final GroupChat channel = ((ChannelCommandContext) context).getGroupChat();
71 72
         if (args.getArguments().length == 0) {

+ 2
- 1
src/com/dmdirc/commandparser/commands/chat/Me.java Прегледај датотеку

@@ -34,6 +34,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
34 34
 import com.dmdirc.interfaces.Chat;
35 35
 import com.dmdirc.interfaces.CommandController;
36 36
 import com.dmdirc.interfaces.Connection;
37
+import com.dmdirc.interfaces.WindowModel;
37 38
 import com.dmdirc.util.validators.ValidationResponse;
38 39
 
39 40
 import javax.annotation.Nonnull;
@@ -60,7 +61,7 @@ public class Me extends Command implements ValidatingCommand {
60 61
     }
61 62
 
62 63
     @Override
63
-    public void execute(@Nonnull final FrameContainer origin,
64
+    public void execute(@Nonnull final WindowModel origin,
64 65
             final CommandArguments args, final CommandContext context) {
65 66
         final Chat target = ((ChatCommandContext) context).getChat();
66 67
         if (args.getArguments().length == 0) {

+ 5
- 5
src/com/dmdirc/commandparser/commands/flags/CommandFlagHandler.java Прегледај датотеку

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.flags;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.CommandArguments;
26
+import com.dmdirc.interfaces.WindowModel;
27 27
 
28 28
 import java.util.ArrayList;
29 29
 import java.util.Collection;
@@ -75,7 +75,7 @@ public class CommandFlagHandler {
75 75
      *         encountered.
76 76
      */
77 77
     @Nullable
78
-    public CommandFlagResult process(final FrameContainer origin,
78
+    public CommandFlagResult process(final WindowModel origin,
79 79
             final CommandArguments arguments) {
80 80
         final Map<CommandFlag, Integer> results = parse(origin, arguments);
81 81
 
@@ -93,7 +93,7 @@ public class CommandFlagHandler {
93 93
      *         the <code>arguments</code> object. If an error occurs, null is returned.
94 94
      */
95 95
     @Nullable
96
-    protected Map<CommandFlag, Integer> parse(final FrameContainer origin,
96
+    protected Map<CommandFlag, Integer> parse(final WindowModel origin,
97 97
             final CommandArguments arguments) {
98 98
         enabledFlags.clear();
99 99
         disabledBy.clear();
@@ -177,7 +177,7 @@ public class CommandFlagHandler {
177 177
      */
178 178
     protected int readArguments(final CommandFlag flag,
179 179
             final CommandArguments arguments, final int offset, final int argCount,
180
-            final FrameContainer origin, final Map<CommandFlag, Integer> results) {
180
+            final WindowModel origin, final Map<CommandFlag, Integer> results) {
181 181
         final int lastArg = argCount + offset - 1;
182 182
 
183 183
         if (arguments.getArguments().length <= lastArg) {
@@ -251,7 +251,7 @@ public class CommandFlagHandler {
251 251
      * @param messageType The type of the line to be sent
252 252
      * @param args        The arguments for the specified messageType
253 253
      */
254
-    protected static void sendLine(final FrameContainer origin, final boolean isSilent,
254
+    protected static void sendLine(final WindowModel origin, final boolean isSilent,
255 255
             final String messageType, final Object... args) {
256 256
         if (origin != null && !isSilent) {
257 257
             origin.addLine(messageType, args);

+ 2
- 2
src/com/dmdirc/commandparser/commands/global/AliasCommand.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -34,6 +33,7 @@ import com.dmdirc.commandparser.commands.Command;
34 33
 import com.dmdirc.commandparser.commands.IntelligentCommand;
35 34
 import com.dmdirc.commandparser.commands.context.CommandContext;
36 35
 import com.dmdirc.interfaces.CommandController;
36
+import com.dmdirc.interfaces.WindowModel;
37 37
 import com.dmdirc.ui.input.AdditionalTabTargets;
38 38
 import com.dmdirc.ui.input.TabCompleterUtils;
39 39
 
@@ -78,7 +78,7 @@ public class AliasCommand extends Command implements IntelligentCommand {
78 78
     }
79 79
 
80 80
     @Override
81
-    public void execute(@Nonnull final FrameContainer origin,
81
+    public void execute(@Nonnull final WindowModel origin,
82 82
             final CommandArguments args, final CommandContext context) {
83 83
         if (args.getArguments().length < 2) {
84 84
             showUsage(origin, args.isSilent(), "alias", "[--remove] <name> [command]");

+ 2
- 1
src/com/dmdirc/commandparser/commands/global/AllServers.java Прегледај датотеку

@@ -33,6 +33,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
33 33
 import com.dmdirc.interfaces.CommandController;
34 34
 import com.dmdirc.interfaces.Connection;
35 35
 import com.dmdirc.interfaces.ConnectionManager;
36
+import com.dmdirc.interfaces.WindowModel;
36 37
 import com.dmdirc.ui.input.AdditionalTabTargets;
37 38
 import com.dmdirc.ui.input.TabCompleterUtils;
38 39
 
@@ -69,7 +70,7 @@ public class AllServers extends Command implements IntelligentCommand {
69 70
     }
70 71
 
71 72
     @Override
72
-    public void execute(@Nonnull final FrameContainer origin,
73
+    public void execute(@Nonnull final WindowModel origin,
73 74
             final CommandArguments args, final CommandContext context) {
74 75
         final String command = args.getArgumentsAsString();
75 76
 

+ 2
- 2
src/com/dmdirc/commandparser/commands/global/Clear.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -31,6 +30,7 @@ import com.dmdirc.commandparser.commands.Command;
31 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
32 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
33 32
 import com.dmdirc.interfaces.CommandController;
33
+import com.dmdirc.interfaces.WindowModel;
34 34
 import com.dmdirc.ui.input.AdditionalTabTargets;
35 35
 
36 36
 import javax.annotation.Nonnull;
@@ -57,7 +57,7 @@ public class Clear extends Command implements IntelligentCommand {
57 57
     }
58 58
 
59 59
     @Override
60
-    public void execute(@Nonnull final FrameContainer origin,
60
+    public void execute(@Nonnull final WindowModel origin,
61 61
             final CommandArguments args, final CommandContext context) {
62 62
         origin.getBackBuffer().getDocument().clear();
63 63
     }

+ 7
- 6
src/com/dmdirc/commandparser/commands/global/Echo.java Прегледај датотеку

@@ -85,7 +85,7 @@ public class Echo extends Command implements IntelligentCommand {
85 85
     }
86 86
 
87 87
     @Override
88
-    public void execute(@Nonnull final FrameContainer origin,
88
+    public void execute(@Nonnull final WindowModel origin,
89 89
             final CommandArguments args, final CommandContext context) {
90 90
         @Nullable final CommandFlagResult results = handler.process(origin, args);
91 91
 
@@ -105,12 +105,13 @@ public class Echo extends Command implements IntelligentCommand {
105 105
 
106 106
         if (results.hasFlag(targetFlag)) {
107 107
             FrameContainer frame = null;
108
-            Optional<FrameContainer> target = Optional.ofNullable(origin);
108
+            Optional<WindowModel> target = Optional.ofNullable(origin);
109 109
 
110 110
             while (frame == null && target.isPresent()) {
111
-                frame = windowManager.findCustomWindow(target.get(),
111
+                frame = windowManager.findCustomWindow((FrameContainer) target.get(),
112 112
                         results.getArgumentsAsString(targetFlag));
113
-                target = target.get().getParent();
113
+                // TODO: Somewhat insane...
114
+                target = Optional.ofNullable((WindowModel) target.get().getParent().orElse(null));
114 115
             }
115 116
 
116 117
             if (frame == null) {
@@ -125,8 +126,8 @@ public class Echo extends Command implements IntelligentCommand {
125 126
                         results.getArgumentsAsString()));
126 127
             }
127 128
         } else if (!args.isSilent()) {
128
-            origin.getEventBus().publishAsync(new CommandOutputEvent(origin, time.getTime(),
129
-                    results.getArgumentsAsString()));
129
+            origin.getEventBus().publishAsync(new CommandOutputEvent((FrameContainer) origin,
130
+                    time.getTime(), results.getArgumentsAsString()));
130 131
         }
131 132
     }
132 133
 

+ 2
- 2
src/com/dmdirc/commandparser/commands/global/Exit.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -31,6 +30,7 @@ import com.dmdirc.commandparser.commands.Command;
31 30
 import com.dmdirc.commandparser.commands.context.CommandContext;
32 31
 import com.dmdirc.interfaces.CommandController;
33 32
 import com.dmdirc.interfaces.LifecycleController;
33
+import com.dmdirc.interfaces.WindowModel;
34 34
 
35 35
 import javax.annotation.Nonnull;
36 36
 import javax.inject.Inject;
@@ -61,7 +61,7 @@ public class Exit extends Command {
61 61
     }
62 62
 
63 63
     @Override
64
-    public void execute(@Nonnull final FrameContainer origin,
64
+    public void execute(@Nonnull final WindowModel origin,
65 65
             final CommandArguments args, final CommandContext context) {
66 66
         controller.quit(args.getArguments().length > 0 ? args.getArgumentsAsString()
67 67
                 : origin.getConfigManager().getOption("general", "closemessage"));

+ 4
- 4
src/com/dmdirc/commandparser/commands/global/Help.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -31,6 +30,7 @@ import com.dmdirc.commandparser.commands.Command;
31 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
32 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
33 32
 import com.dmdirc.interfaces.CommandController;
33
+import com.dmdirc.interfaces.WindowModel;
34 34
 import com.dmdirc.ui.input.AdditionalTabTargets;
35 35
 import com.dmdirc.ui.input.TabCompletionType;
36 36
 import com.dmdirc.ui.messages.Styliser;
@@ -66,7 +66,7 @@ public class Help extends Command implements IntelligentCommand {
66 66
     }
67 67
 
68 68
     @Override
69
-    public void execute(@Nonnull final FrameContainer origin,
69
+    public void execute(@Nonnull final WindowModel origin,
70 70
             final CommandArguments args, final CommandContext context) {
71 71
         if (args.getArguments().length == 0) {
72 72
             showAllCommands(origin, args.isSilent());
@@ -81,7 +81,7 @@ public class Help extends Command implements IntelligentCommand {
81 81
      * @param origin   The window the command was executed in
82 82
      * @param isSilent Whether this command has been silenced or not
83 83
      */
84
-    private void showAllCommands(final FrameContainer origin, final boolean isSilent) {
84
+    private void showAllCommands(final WindowModel origin, final boolean isSilent) {
85 85
         final List<String> commands = new ArrayList<>(origin.getCommandParser()
86 86
                 .getCommands().keySet());
87 87
 
@@ -118,7 +118,7 @@ public class Help extends Command implements IntelligentCommand {
118 118
      * @param isSilent Whether this command has been silenced or not
119 119
      * @param name     The name of the command to display info for
120 120
      */
121
-    private void showCommand(final FrameContainer origin, final boolean isSilent,
121
+    private void showCommand(final WindowModel origin, final boolean isSilent,
122 122
             final String name) {
123 123
         final Map.Entry<CommandInfo, Command> command;
124 124
 

+ 4
- 2
src/com/dmdirc/commandparser/commands/global/Ifplugin.java Прегледај датотеку

@@ -33,6 +33,7 @@ import com.dmdirc.commandparser.commands.IntelligentCommand;
33 33
 import com.dmdirc.commandparser.commands.context.CommandContext;
34 34
 import com.dmdirc.commandparser.parsers.GlobalCommandParser;
35 35
 import com.dmdirc.interfaces.CommandController;
36
+import com.dmdirc.interfaces.WindowModel;
36 37
 import com.dmdirc.plugins.PluginInfo;
37 38
 import com.dmdirc.plugins.PluginManager;
38 39
 import com.dmdirc.ui.input.AdditionalTabTargets;
@@ -85,7 +86,7 @@ public class Ifplugin extends Command implements IntelligentCommand {
85 86
     }
86 87
 
87 88
     @Override
88
-    public void execute(@Nonnull final FrameContainer origin,
89
+    public void execute(@Nonnull final WindowModel origin,
89 90
             final CommandArguments args, final CommandContext context) {
90 91
         if (args.getArguments().length <= 1) {
91 92
             showUsage(origin, args.isSilent(), "ifplugin", "<[!]plugin> <command>");
@@ -106,7 +107,8 @@ public class Ifplugin extends Command implements IntelligentCommand {
106 107
 
107 108
         if (result != negative) {
108 109
             if (origin.isWritable()) {
109
-                origin.getCommandParser().parseCommand(origin, args.getArgumentsAsString(1));
110
+                origin.getCommandParser().parseCommand(
111
+                        (FrameContainer) origin, args.getArgumentsAsString(1));
110 112
             } else {
111 113
                 globalCommandParserProvider.get()
112 114
                         .parseCommand(globalWindowProvider.get(), args.getArgumentsAsString(1));

+ 2
- 2
src/com/dmdirc/commandparser/commands/global/LoadPlugin.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -31,6 +30,7 @@ import com.dmdirc.commandparser.commands.Command;
31 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
32 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
33 32
 import com.dmdirc.interfaces.CommandController;
33
+import com.dmdirc.interfaces.WindowModel;
34 34
 import com.dmdirc.plugins.PluginInfo;
35 35
 import com.dmdirc.plugins.PluginManager;
36 36
 import com.dmdirc.plugins.PluginMetaData;
@@ -66,7 +66,7 @@ public class LoadPlugin extends Command implements IntelligentCommand {
66 66
     }
67 67
 
68 68
     @Override
69
-    public void execute(@Nonnull final FrameContainer origin,
69
+    public void execute(@Nonnull final WindowModel origin,
70 70
             final CommandArguments args, final CommandContext context) {
71 71
         if (args.getArguments().length == 0) {
72 72
             showUsage(origin, args.isSilent(), "loadplugin", "<plugin>");

+ 3
- 2
src/com/dmdirc/commandparser/commands/global/NewServer.java Прегледај датотеку

@@ -35,6 +35,7 @@ import com.dmdirc.events.CommandErrorEvent;
35 35
 import com.dmdirc.interfaces.CommandController;
36 36
 import com.dmdirc.interfaces.Connection;
37 37
 import com.dmdirc.interfaces.ConnectionFactory;
38
+import com.dmdirc.interfaces.WindowModel;
38 39
 import com.dmdirc.plugins.ServiceManager;
39 40
 import com.dmdirc.ui.input.AdditionalTabTargets;
40 41
 import com.dmdirc.util.InvalidURIException;
@@ -82,7 +83,7 @@ public class NewServer extends Command implements IntelligentCommand {
82 83
     }
83 84
 
84 85
     @Override
85
-    public void execute(@Nonnull final FrameContainer origin,
86
+    public void execute(@Nonnull final WindowModel origin,
86 87
             final CommandArguments args, final CommandContext context) {
87 88
         if (args.getArguments().length == 0) {
88 89
             showUsage(origin, args.isSilent(), "newserver", "<host[:[+]port]> [password]");
@@ -95,7 +96,7 @@ public class NewServer extends Command implements IntelligentCommand {
95 96
                     profileManager.getDefault());
96 97
             server.connect();
97 98
         } catch (InvalidURIException ex) {
98
-            origin.getEventBus().publishAsync(new CommandErrorEvent(origin,
99
+            origin.getEventBus().publishAsync(new CommandErrorEvent((FrameContainer) origin,
99 100
                     "Invalid URI: " + ex.getMessage() +
100 101
                             (ex.getCause() == null ? "" : ": " + ex.getCause().getMessage())));
101 102
         }

+ 10
- 8
src/com/dmdirc/commandparser/commands/global/OpenWindow.java Прегледај датотеку

@@ -35,6 +35,7 @@ import com.dmdirc.commandparser.commands.IntelligentCommand;
35 35
 import com.dmdirc.commandparser.commands.context.CommandContext;
36 36
 import com.dmdirc.interfaces.CommandController;
37 37
 import com.dmdirc.interfaces.Connection;
38
+import com.dmdirc.interfaces.WindowModel;
38 39
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
39 40
 import com.dmdirc.ui.WindowManager;
40 41
 import com.dmdirc.ui.input.AdditionalTabTargets;
@@ -83,10 +84,10 @@ public class OpenWindow extends Command implements IntelligentCommand {
83 84
     }
84 85
 
85 86
     @Override
86
-    public void execute(@Nonnull final FrameContainer origin,
87
+    public void execute(@Nonnull final WindowModel origin,
87 88
             final CommandArguments args, final CommandContext context) {
88 89
         int start = 0;
89
-        FrameContainer parent = null;
90
+        WindowModel parent = null;
90 91
 
91 92
         if (args.getArguments().length > 0 && "--server".equals(args.getArguments()[0])) {
92 93
             final Optional<Connection> connection = origin.getConnection();
@@ -96,7 +97,7 @@ public class OpenWindow extends Command implements IntelligentCommand {
96 97
                 return;
97 98
             }
98 99
 
99
-            parent = (FrameContainer) connection.get().getWindowModel();
100
+            parent = connection.get().getWindowModel();
100 101
             start = 1;
101 102
         } else if (args.getArguments().length > 0 && "--child".equals(args.getArguments()[0])) {
102 103
             parent = origin;
@@ -107,12 +108,13 @@ public class OpenWindow extends Command implements IntelligentCommand {
107 108
             showUsage(origin, args.isSilent(), "openwindow",
108 109
                     "[--server|--child] <name> [title]");
109 110
         } else {
110
-            final FrameContainer window;
111
+            final WindowModel window;
111 112
 
112 113
             if (parent == null) {
113 114
                 window = windowManager.findCustomWindow(args.getArguments()[start]);
114 115
             } else {
115
-                window = windowManager.findCustomWindow(parent, args.getArguments()[start]);
116
+                window = windowManager.findCustomWindow(
117
+                        (FrameContainer) parent, args.getArguments()[start]);
116 118
             }
117 119
 
118 120
             final String title = args.getArguments().length > start + 1
@@ -125,9 +127,9 @@ public class OpenWindow extends Command implements IntelligentCommand {
125 127
                             configProvider, eventBus, backBufferFactory);
126 128
                     windowManager.addWindow(newWindow);
127 129
                 } else {
128
-                    newWindow = new CustomWindow(args.getArguments()[start], title, parent,
129
-                            backBufferFactory);
130
-                    windowManager.addWindow(parent, newWindow);
130
+                    newWindow = new CustomWindow(args.getArguments()[start], title,
131
+                            (FrameContainer) parent, backBufferFactory);
132
+                    windowManager.addWindow((FrameContainer) parent, newWindow);
131 133
                 }
132 134
             } else {
133 135
                 sendLine(origin, args.isSilent(), FORMAT_ERROR,

+ 2
- 2
src/com/dmdirc/commandparser/commands/global/ReloadIdentities.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -31,6 +30,7 @@ import com.dmdirc.commandparser.commands.Command;
31 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
32 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
33 32
 import com.dmdirc.interfaces.CommandController;
33
+import com.dmdirc.interfaces.WindowModel;
34 34
 import com.dmdirc.interfaces.config.IdentityController;
35 35
 import com.dmdirc.ui.input.AdditionalTabTargets;
36 36
 
@@ -63,7 +63,7 @@ public class ReloadIdentities extends Command implements IntelligentCommand {
63 63
     }
64 64
 
65 65
     @Override
66
-    public void execute(@Nonnull final FrameContainer origin,
66
+    public void execute(@Nonnull final WindowModel origin,
67 67
             final CommandArguments args, final CommandContext context) {
68 68
         identityController.loadUserIdentities();
69 69
 

+ 2
- 2
src/com/dmdirc/commandparser/commands/global/ReloadPlugin.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -31,6 +30,7 @@ import com.dmdirc.commandparser.commands.Command;
31 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
32 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
33 32
 import com.dmdirc.interfaces.CommandController;
33
+import com.dmdirc.interfaces.WindowModel;
34 34
 import com.dmdirc.plugins.PluginInfo;
35 35
 import com.dmdirc.plugins.PluginManager;
36 36
 import com.dmdirc.ui.input.AdditionalTabTargets;
@@ -65,7 +65,7 @@ public class ReloadPlugin extends Command implements IntelligentCommand {
65 65
     }
66 66
 
67 67
     @Override
68
-    public void execute(@Nonnull final FrameContainer origin,
68
+    public void execute(@Nonnull final WindowModel origin,
69 69
             final CommandArguments args, final CommandContext context) {
70 70
         if (args.getArguments().length == 0) {
71 71
             showUsage(origin, args.isSilent(), "reloadplugin", "<plugin>");

+ 2
- 2
src/com/dmdirc/commandparser/commands/global/SaveConfig.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -31,6 +30,7 @@ import com.dmdirc.commandparser.commands.Command;
31 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
32 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
33 32
 import com.dmdirc.interfaces.CommandController;
33
+import com.dmdirc.interfaces.WindowModel;
34 34
 import com.dmdirc.interfaces.config.IdentityController;
35 35
 import com.dmdirc.ui.input.AdditionalTabTargets;
36 36
 
@@ -63,7 +63,7 @@ public final class SaveConfig extends Command implements IntelligentCommand {
63 63
     }
64 64
 
65 65
     @Override
66
-    public void execute(@Nonnull final FrameContainer origin,
66
+    public void execute(@Nonnull final WindowModel origin,
67 67
             final CommandArguments args, final CommandContext context) {
68 68
         identityController.saveAll();
69 69
 

+ 8
- 8
src/com/dmdirc/commandparser/commands/global/SetCommand.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -37,6 +36,7 @@ import com.dmdirc.commandparser.commands.flags.CommandFlagResult;
37 36
 import com.dmdirc.interfaces.CommandController;
38 37
 import com.dmdirc.interfaces.Connection;
39 38
 import com.dmdirc.interfaces.GroupChat;
39
+import com.dmdirc.interfaces.WindowModel;
40 40
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
41 41
 import com.dmdirc.interfaces.config.ConfigProvider;
42 42
 import com.dmdirc.interfaces.config.IdentityController;
@@ -104,7 +104,7 @@ public class SetCommand extends Command implements IntelligentCommand {
104 104
     }
105 105
 
106 106
     @Override
107
-    public void execute(@Nonnull final FrameContainer origin,
107
+    public void execute(@Nonnull final WindowModel origin,
108 108
             final CommandArguments args, final CommandContext context) {
109 109
         @Nullable final CommandFlagResult res = handler.process(origin, args);
110 110
 
@@ -180,7 +180,7 @@ public class SetCommand extends Command implements IntelligentCommand {
180 180
      * @param isSilent Whether or not the command is being silenced or not
181 181
      * @param manager  The config manager to use to retrieve data
182 182
      */
183
-    private void doDomainList(final FrameContainer origin, final boolean isSilent,
183
+    private void doDomainList(final WindowModel origin, final boolean isSilent,
184 184
             final AggregateConfigProvider manager) {
185 185
         final StringBuilder output = new StringBuilder(67);
186 186
 
@@ -204,7 +204,7 @@ public class SetCommand extends Command implements IntelligentCommand {
204 204
      * @param manager  The config manager to use to retrieve data
205 205
      * @param domain   The domain to be inspected
206 206
      */
207
-    private void doOptionsList(final FrameContainer origin,
207
+    private void doOptionsList(final WindowModel origin,
208 208
             final boolean isSilent, final ReadOnlyConfigProvider manager, final String domain) {
209 209
         final StringBuilder output = new StringBuilder(24);
210 210
 
@@ -237,7 +237,7 @@ public class SetCommand extends Command implements IntelligentCommand {
237 237
      * @param domain   The domain of the option
238 238
      * @param option   The name of the option
239 239
      */
240
-    private void doShowOption(final FrameContainer origin,
240
+    private void doShowOption(final WindowModel origin,
241 241
             final boolean isSilent, final ReadOnlyConfigProvider manager,
242 242
             final String domain, final String option) {
243 243
         if (manager.hasOptionString(domain, option)) {
@@ -258,7 +258,7 @@ public class SetCommand extends Command implements IntelligentCommand {
258 258
      * @param option   The name of the option
259 259
      * @param newvalue The value the option should be set to
260 260
      */
261
-    private void doSetOption(final FrameContainer origin,
261
+    private void doSetOption(final WindowModel origin,
262 262
             final boolean isSilent, final ConfigProvider identity,
263 263
             final String domain, final String option, final String newvalue) {
264 264
         identity.setOption(domain, option, newvalue);
@@ -278,7 +278,7 @@ public class SetCommand extends Command implements IntelligentCommand {
278 278
      * @param option   The name of the option
279 279
      * @param data     The data to be appended
280 280
      */
281
-    private void doAppendOption(final FrameContainer origin,
281
+    private void doAppendOption(final WindowModel origin,
282 282
             final boolean isSilent, final ConfigProvider identity,
283 283
             final ReadOnlyConfigProvider manager,
284 284
             final String domain, final String option, final String data) {
@@ -296,7 +296,7 @@ public class SetCommand extends Command implements IntelligentCommand {
296 296
      * @param domain   The domain of the option
297 297
      * @param option   The name of the option
298 298
      */
299
-    private void doUnsetOption(final FrameContainer origin,
299
+    private void doUnsetOption(final WindowModel origin,
300 300
             final boolean isSilent, final ConfigProvider identity, final String domain,
301 301
             final String option) {
302 302
         identity.unsetOption(domain, option);

+ 2
- 2
src/com/dmdirc/commandparser/commands/global/UnloadPlugin.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.global;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -31,6 +30,7 @@ import com.dmdirc.commandparser.commands.Command;
31 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
32 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
33 32
 import com.dmdirc.interfaces.CommandController;
33
+import com.dmdirc.interfaces.WindowModel;
34 34
 import com.dmdirc.plugins.PluginInfo;
35 35
 import com.dmdirc.plugins.PluginManager;
36 36
 import com.dmdirc.ui.input.AdditionalTabTargets;
@@ -65,7 +65,7 @@ public class UnloadPlugin extends Command implements IntelligentCommand {
65 65
     }
66 66
 
67 67
     @Override
68
-    public void execute(@Nonnull final FrameContainer origin,
68
+    public void execute(@Nonnull final WindowModel origin,
69 69
             final CommandArguments args, final CommandContext context) {
70 70
         if (args.getArguments().length == 0) {
71 71
             showUsage(origin, args.isSilent(), "unloadplugin", "<plugin>");

+ 2
- 1
src/com/dmdirc/commandparser/commands/server/AllChannels.java Прегледај датотеку

@@ -34,6 +34,7 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
34 34
 import com.dmdirc.interfaces.CommandController;
35 35
 import com.dmdirc.interfaces.Connection;
36 36
 import com.dmdirc.interfaces.GroupChat;
37
+import com.dmdirc.interfaces.WindowModel;
37 38
 import com.dmdirc.ui.input.AdditionalTabTargets;
38 39
 import com.dmdirc.ui.input.TabCompleterUtils;
39 40
 
@@ -65,7 +66,7 @@ public class AllChannels extends Command implements IntelligentCommand {
65 66
     }
66 67
 
67 68
     @Override
68
-    public void execute(@Nonnull final FrameContainer origin,
69
+    public void execute(@Nonnull final WindowModel origin,
69 70
             final CommandArguments args, final CommandContext context) {
70 71
         final Connection server = ((ServerCommandContext) context).getConnection();
71 72
         final String command = args.getArgumentsAsString();

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/Away.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -33,6 +32,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
33 32
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
34 33
 import com.dmdirc.interfaces.CommandController;
35 34
 import com.dmdirc.interfaces.Connection;
35
+import com.dmdirc.interfaces.WindowModel;
36 36
 
37 37
 import javax.annotation.Nonnull;
38 38
 import javax.inject.Inject;
@@ -58,7 +58,7 @@ public class Away extends Command {
58 58
     }
59 59
 
60 60
     @Override
61
-    public void execute(@Nonnull final FrameContainer origin,
61
+    public void execute(@Nonnull final WindowModel origin,
62 62
             final CommandArguments args, final CommandContext context) {
63 63
         final Connection connection = ((ServerCommandContext) context).getConnection();
64 64
         final String line = args.getArgumentsAsString();

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/Back.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -34,6 +33,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
34 33
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
35 34
 import com.dmdirc.interfaces.CommandController;
36 35
 import com.dmdirc.interfaces.Connection;
36
+import com.dmdirc.interfaces.WindowModel;
37 37
 import com.dmdirc.ui.input.AdditionalTabTargets;
38 38
 
39 39
 import javax.annotation.Nonnull;
@@ -60,7 +60,7 @@ public class Back extends Command implements IntelligentCommand {
60 60
     }
61 61
 
62 62
     @Override
63
-    public void execute(@Nonnull final FrameContainer origin,
63
+    public void execute(@Nonnull final WindowModel origin,
64 64
             final CommandArguments args, final CommandContext context) {
65 65
         final Connection connection = ((ServerCommandContext) context).getConnection();
66 66
         connection.getParser().get().getLocalClient().setBack();

+ 4
- 2
src/com/dmdirc/commandparser/commands/server/ChangeServer.java Прегледај датотеку

@@ -33,6 +33,7 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
33 33
 import com.dmdirc.events.CommandErrorEvent;
34 34
 import com.dmdirc.interfaces.CommandController;
35 35
 import com.dmdirc.interfaces.Connection;
36
+import com.dmdirc.interfaces.WindowModel;
36 37
 import com.dmdirc.util.InvalidURIException;
37 38
 import com.dmdirc.util.URIParser;
38 39
 
@@ -67,7 +68,7 @@ public class ChangeServer extends Command {
67 68
     }
68 69
 
69 70
     @Override
70
-    public void execute(@Nonnull final FrameContainer origin,
71
+    public void execute(@Nonnull final WindowModel origin,
71 72
             final CommandArguments args, final CommandContext context) {
72 73
         if (args.getArguments().length == 0) {
73 74
             showUsage(origin, args.isSilent(), "server", "<host[:[+]port]> [password]");
@@ -80,7 +81,8 @@ public class ChangeServer extends Command {
80 81
             connection.connect(address, connection.getProfile());
81 82
         } catch (InvalidURIException ex) {
82 83
             origin.getEventBus().publishAsync(
83
-                    new CommandErrorEvent(origin, "Invalid URI: " + ex.getMessage() +
84
+                    new CommandErrorEvent(
85
+                            (FrameContainer) origin, "Invalid URI: " + ex.getMessage() +
84 86
                             (ex.getCause() == null ? "" : ": " + ex.getCause().getMessage())));
85 87
         }
86 88
     }

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/Ctcp.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -34,6 +33,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
34 33
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
35 34
 import com.dmdirc.interfaces.CommandController;
36 35
 import com.dmdirc.interfaces.Connection;
36
+import com.dmdirc.interfaces.WindowModel;
37 37
 import com.dmdirc.ui.input.AdditionalTabTargets;
38 38
 import com.dmdirc.ui.input.TabCompletionType;
39 39
 
@@ -62,7 +62,7 @@ public class Ctcp extends Command implements IntelligentCommand {
62 62
     }
63 63
 
64 64
     @Override
65
-    public void execute(@Nonnull final FrameContainer origin,
65
+    public void execute(@Nonnull final WindowModel origin,
66 66
             final CommandArguments args, final CommandContext context) {
67 67
         final Connection connection = ((ServerCommandContext) context).getConnection();
68 68
         if (args.getArguments().length < 2) {

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/Disconnect.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -32,6 +31,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
32 31
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
33 32
 import com.dmdirc.interfaces.CommandController;
34 33
 import com.dmdirc.interfaces.Connection;
34
+import com.dmdirc.interfaces.WindowModel;
35 35
 
36 36
 import javax.annotation.Nonnull;
37 37
 import javax.inject.Inject;
@@ -57,7 +57,7 @@ public class Disconnect extends Command {
57 57
     }
58 58
 
59 59
     @Override
60
-    public void execute(@Nonnull final FrameContainer origin,
60
+    public void execute(@Nonnull final WindowModel origin,
61 61
             final CommandArguments args, final CommandContext context) {
62 62
         final Connection connection = ((ServerCommandContext) context).getConnection();
63 63
         final String line;

+ 6
- 6
src/com/dmdirc/commandparser/commands/server/Ignore.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -33,6 +32,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
33 32
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
34 33
 import com.dmdirc.interfaces.CommandController;
35 34
 import com.dmdirc.interfaces.Connection;
35
+import com.dmdirc.interfaces.WindowModel;
36 36
 import com.dmdirc.parser.common.IgnoreList;
37 37
 import com.dmdirc.ui.input.AdditionalTabTargets;
38 38
 import com.dmdirc.ui.input.TabCompletionType;
@@ -66,7 +66,7 @@ public class Ignore extends Command implements IntelligentCommand {
66 66
     }
67 67
 
68 68
     @Override
69
-    public void execute(@Nonnull final FrameContainer origin,
69
+    public void execute(@Nonnull final WindowModel origin,
70 70
             final CommandArguments args, final CommandContext context) {
71 71
         final Connection connection = ((ServerCommandContext) context).getConnection();
72 72
 
@@ -81,7 +81,7 @@ public class Ignore extends Command implements IntelligentCommand {
81 81
         }
82 82
     }
83 83
 
84
-    protected void executeView(final FrameContainer origin, final Connection connection,
84
+    protected void executeView(final WindowModel origin, final Connection connection,
85 85
             final boolean isSilent, final CommandArguments args, final boolean forceRegex) {
86 86
         final IgnoreList ignoreList = connection.getIgnoreList();
87 87
 
@@ -109,7 +109,7 @@ public class Ignore extends Command implements IntelligentCommand {
109 109
         }
110 110
     }
111 111
 
112
-    protected void executeAdd(final FrameContainer origin, final Connection connection,
112
+    protected void executeAdd(final WindowModel origin, final Connection connection,
113 113
             final boolean isSilent, final CommandArguments args) {
114 114
         final IgnoreList ignoreList = connection.getIgnoreList();
115 115
         final String target = args.getArgumentsAsString();
@@ -119,7 +119,7 @@ public class Ignore extends Command implements IntelligentCommand {
119 119
         sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Added " + target + " to the ignore list.");
120 120
     }
121 121
 
122
-    protected void executeRegex(final FrameContainer origin, final Connection connection,
122
+    protected void executeRegex(final WindowModel origin, final Connection connection,
123 123
             final boolean isSilent, final CommandArguments args) {
124 124
         if (args.getArguments().length == 1) {
125 125
             executeView(origin, connection, args.isSilent(), args, true);
@@ -143,7 +143,7 @@ public class Ignore extends Command implements IntelligentCommand {
143 143
         sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Added " + target + " to the ignore list.");
144 144
     }
145 145
 
146
-    protected void executeRemove(final FrameContainer origin, final Connection connection,
146
+    protected void executeRemove(final WindowModel origin, final Connection connection,
147 147
             final boolean isSilent, final CommandArguments args) {
148 148
         if (args.getArguments().length == 1) {
149 149
             showUsage(origin, args.isSilent(), "ignore", "--remove <host>");

+ 2
- 1
src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java Прегледај датотеку

@@ -35,6 +35,7 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
35 35
 import com.dmdirc.events.ClientLineAddedEvent;
36 36
 import com.dmdirc.interfaces.CommandController;
37 37
 import com.dmdirc.interfaces.Connection;
38
+import com.dmdirc.interfaces.WindowModel;
38 39
 import com.dmdirc.parser.common.ChannelJoinRequest;
39 40
 import com.dmdirc.ui.input.AdditionalTabTargets;
40 41
 import com.dmdirc.ui.messages.Styliser;
@@ -85,7 +86,7 @@ public class JoinChannelCommand extends Command implements IntelligentCommand {
85 86
     }
86 87
 
87 88
     @Override
88
-    public void execute(@Nonnull final FrameContainer origin,
89
+    public void execute(@Nonnull final WindowModel origin,
89 90
             final CommandArguments args, final CommandContext context) {
90 91
         final Connection connection = ((ServerCommandContext) context).getConnection();
91 92
         if (args.getArguments().length == 0) {

+ 2
- 1
src/com/dmdirc/commandparser/commands/server/Message.java Прегледај датотеку

@@ -36,6 +36,7 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
36 36
 import com.dmdirc.interfaces.CommandController;
37 37
 import com.dmdirc.interfaces.Connection;
38 38
 import com.dmdirc.interfaces.GroupChat;
39
+import com.dmdirc.interfaces.WindowModel;
39 40
 import com.dmdirc.parser.interfaces.Parser;
40 41
 import com.dmdirc.ui.input.AdditionalTabTargets;
41 42
 import com.dmdirc.ui.input.TabCompletionType;
@@ -68,7 +69,7 @@ public class Message extends Command implements IntelligentCommand,
68 69
     }
69 70
 
70 71
     @Override
71
-    public void execute(@Nonnull final FrameContainer origin,
72
+    public void execute(@Nonnull final WindowModel origin,
72 73
             final CommandArguments args, final CommandContext context) {
73 74
         final Connection connection = ((ServerCommandContext) context).getConnection();
74 75
         if (args.getArguments().length < 2) {

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/Nick.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -34,6 +33,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
34 33
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
35 34
 import com.dmdirc.interfaces.CommandController;
36 35
 import com.dmdirc.interfaces.Connection;
36
+import com.dmdirc.interfaces.WindowModel;
37 37
 import com.dmdirc.ui.input.AdditionalTabTargets;
38 38
 import com.dmdirc.ui.input.TabCompletionType;
39 39
 
@@ -62,7 +62,7 @@ public class Nick extends Command implements IntelligentCommand {
62 62
     }
63 63
 
64 64
     @Override
65
-    public void execute(@Nonnull final FrameContainer origin,
65
+    public void execute(@Nonnull final WindowModel origin,
66 66
             final CommandArguments args, final CommandContext context) {
67 67
         final Connection connection = ((ServerCommandContext) context).getConnection();
68 68
         if (args.getArguments().length == 0) {

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/Notice.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -34,6 +33,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
34 33
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
35 34
 import com.dmdirc.interfaces.CommandController;
36 35
 import com.dmdirc.interfaces.Connection;
36
+import com.dmdirc.interfaces.WindowModel;
37 37
 import com.dmdirc.ui.input.AdditionalTabTargets;
38 38
 import com.dmdirc.ui.input.TabCompletionType;
39 39
 
@@ -62,7 +62,7 @@ public class Notice extends Command implements IntelligentCommand {
62 62
     }
63 63
 
64 64
     @Override
65
-    public void execute(@Nonnull final FrameContainer origin,
65
+    public void execute(@Nonnull final WindowModel origin,
66 66
             final CommandArguments args, final CommandContext context) {
67 67
         final Connection connection = ((ServerCommandContext) context).getConnection();
68 68
         if (args.getArguments().length < 2) {

+ 2
- 1
src/com/dmdirc/commandparser/commands/server/OpenQuery.java Прегледај датотеку

@@ -36,6 +36,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
36 36
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
37 37
 import com.dmdirc.interfaces.CommandController;
38 38
 import com.dmdirc.interfaces.Connection;
39
+import com.dmdirc.interfaces.WindowModel;
39 40
 import com.dmdirc.ui.input.AdditionalTabTargets;
40 41
 import com.dmdirc.ui.input.TabCompletionType;
41 42
 import com.dmdirc.ui.messages.Styliser;
@@ -66,7 +67,7 @@ public class OpenQuery extends Command implements IntelligentCommand,
66 67
     }
67 68
 
68 69
     @Override
69
-    public void execute(@Nonnull final FrameContainer origin,
70
+    public void execute(@Nonnull final WindowModel origin,
70 71
             final CommandArguments args, final CommandContext context) {
71 72
         if (args.getArguments().length == 0) {
72 73
             showUsage(origin, args.isSilent(), "query", "<target> <message>");

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/Raw.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -33,6 +32,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
33 32
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
34 33
 import com.dmdirc.interfaces.CommandController;
35 34
 import com.dmdirc.interfaces.Connection;
35
+import com.dmdirc.interfaces.WindowModel;
36 36
 
37 37
 import javax.annotation.Nonnull;
38 38
 import javax.inject.Inject;
@@ -59,7 +59,7 @@ public class Raw extends Command {
59 59
     }
60 60
 
61 61
     @Override
62
-    public void execute(@Nonnull final FrameContainer origin,
62
+    public void execute(@Nonnull final WindowModel origin,
63 63
             final CommandArguments args, final CommandContext context) {
64 64
         final Connection connection = ((ServerCommandContext) context).getConnection();
65 65
         final String line = args.getArgumentsAsString();

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/RawServerCommand.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.CommandArguments;
27 26
 import com.dmdirc.commandparser.CommandInfo;
28 27
 import com.dmdirc.commandparser.CommandType;
@@ -32,6 +31,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
32 31
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
33 32
 import com.dmdirc.interfaces.CommandController;
34 33
 import com.dmdirc.interfaces.Connection;
34
+import com.dmdirc.interfaces.WindowModel;
35 35
 
36 36
 import javax.annotation.Nonnull;
37 37
 
@@ -56,7 +56,7 @@ public class RawServerCommand extends Command implements CommandInfo {
56 56
     }
57 57
 
58 58
     @Override
59
-    public void execute(@Nonnull final FrameContainer origin,
59
+    public void execute(@Nonnull final WindowModel origin,
60 60
             final CommandArguments args, final CommandContext context) {
61 61
         final Connection connection = ((ServerCommandContext) context).getConnection();
62 62
         connection.getParser().get().sendRawMessage(myName.toUpperCase() + ' '

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/Reconnect.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -32,6 +31,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
32 31
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
33 32
 import com.dmdirc.interfaces.CommandController;
34 33
 import com.dmdirc.interfaces.Connection;
34
+import com.dmdirc.interfaces.WindowModel;
35 35
 
36 36
 import javax.annotation.Nonnull;
37 37
 import javax.inject.Inject;
@@ -57,7 +57,7 @@ public class Reconnect extends Command {
57 57
     }
58 58
 
59 59
     @Override
60
-    public void execute(@Nonnull final FrameContainer origin,
60
+    public void execute(@Nonnull final WindowModel origin,
61 61
             final CommandArguments args, final CommandContext context) {
62 62
         final Connection connection = ((ServerCommandContext) context).getConnection();
63 63
         final String line;

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/Umode.java Прегледај датотеку

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.ServerState;
27 26
 import com.dmdirc.commandparser.BaseCommandInfo;
28 27
 import com.dmdirc.commandparser.CommandArguments;
@@ -34,6 +33,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
34 33
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
35 34
 import com.dmdirc.interfaces.CommandController;
36 35
 import com.dmdirc.interfaces.Connection;
36
+import com.dmdirc.interfaces.WindowModel;
37 37
 
38 38
 import javax.annotation.Nonnull;
39 39
 import javax.inject.Inject;
@@ -60,7 +60,7 @@ public class Umode extends Command {
60 60
     }
61 61
 
62 62
     @Override
63
-    public void execute(@Nonnull final FrameContainer origin,
63
+    public void execute(@Nonnull final WindowModel origin,
64 64
             final CommandArguments args, final CommandContext context) {
65 65
         final Connection connection = ((ServerCommandContext) context).getConnection();
66 66
         if (connection.getState() != ServerState.CONNECTED) {

Loading…
Откажи
Сачувај