Chris Smith 9 лет назад
Родитель
Сommit
92471f0c49

+ 2
- 2
src/com/dmdirc/commandparser/commands/ValidatingCommand.java Просмотреть файл

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.commandparser.CommandArguments;
26
+import com.dmdirc.interfaces.WindowModel;
27 27
 import com.dmdirc.util.validators.ValidationResponse;
28 28
 
29 29
 /**
@@ -42,6 +42,6 @@ public interface ValidatingCommand {
42 42
      *
43 43
      * @since 0.6.3m1
44 44
      */
45
-    ValidationResponse validateArguments(FrameContainer origin, CommandArguments arguments);
45
+    ValidationResponse validateArguments(WindowModel origin, CommandArguments arguments);
46 46
 
47 47
 }

+ 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.FrameContainer;
26 25
 import com.dmdirc.commandparser.CommandArguments;
26
+import com.dmdirc.interfaces.WindowModel;
27 27
 
28 28
 /**
29 29
  * Wrapping commands are commands whose arguments may be wrapped into multiple lines when sending.
@@ -40,6 +40,6 @@ public interface WrappableCommand {
40 40
      *
41 41
      * @since 0.6.3m1
42 42
      */
43
-    int getLineCount(FrameContainer origin, CommandArguments arguments);
43
+    int getLineCount(WindowModel origin, CommandArguments arguments);
44 44
 
45 45
 }

+ 1
- 2
src/com/dmdirc/commandparser/commands/chat/Me.java Просмотреть файл

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.chat;
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;
@@ -73,7 +72,7 @@ public class Me extends Command implements ValidatingCommand {
73 72
 
74 73
     @Override
75 74
     public ValidationResponse validateArguments(
76
-            final FrameContainer origin,
75
+            final WindowModel origin,
77 76
             final CommandArguments arguments) {
78 77
         final int length = 2 + arguments.getArgumentsAsString().length();
79 78
 

+ 1
- 2
src/com/dmdirc/commandparser/commands/global/AllServers.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;
@@ -76,7 +75,7 @@ public class AllServers extends Command implements IntelligentCommand {
76 75
 
77 76
         for (Connection target : connectionManager.getConnections()) {
78 77
             target.getWindowModel().getCommandParser()
79
-                    .parseCommand((FrameContainer) target.getWindowModel(), command);
78
+                    .parseCommand(target.getWindowModel(), command);
80 79
         }
81 80
     }
82 81
 

+ 1
- 3
src/com/dmdirc/commandparser/commands/global/Ifplugin.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.GlobalWindow;
27 26
 import com.dmdirc.commandparser.BaseCommandInfo;
28 27
 import com.dmdirc.commandparser.CommandArguments;
@@ -107,8 +106,7 @@ public class Ifplugin extends Command implements IntelligentCommand {
107 106
 
108 107
         if (result != negative) {
109 108
             if (origin.isWritable()) {
110
-                origin.getCommandParser().parseCommand(
111
-                        (FrameContainer) origin, args.getArgumentsAsString(1));
109
+                origin.getCommandParser().parseCommand(origin, args.getArgumentsAsString(1));
112 110
             } else {
113 111
                 globalCommandParserProvider.get()
114 112
                         .parseCommand(globalWindowProvider.get(), args.getArgumentsAsString(1));

+ 4
- 6
src/com/dmdirc/commandparser/commands/global/OpenWindow.java Просмотреть файл

@@ -25,7 +25,6 @@ package com.dmdirc.commandparser.commands.global;
25 25
 import com.dmdirc.ClientModule.GlobalConfig;
26 26
 import com.dmdirc.CustomWindow;
27 27
 import com.dmdirc.DMDircMBassador;
28
-import com.dmdirc.FrameContainer;
29 28
 import com.dmdirc.commandparser.BaseCommandInfo;
30 29
 import com.dmdirc.commandparser.CommandArguments;
31 30
 import com.dmdirc.commandparser.CommandInfo;
@@ -113,8 +112,7 @@ public class OpenWindow extends Command implements IntelligentCommand {
113 112
             if (parent == null) {
114 113
                 window = windowManager.findCustomWindow(args.getArguments()[start]);
115 114
             } else {
116
-                window = windowManager.findCustomWindow(
117
-                        (FrameContainer) parent, args.getArguments()[start]);
115
+                window = windowManager.findCustomWindow(parent, args.getArguments()[start]);
118 116
             }
119 117
 
120 118
             final String title = args.getArguments().length > start + 1
@@ -127,9 +125,9 @@ public class OpenWindow extends Command implements IntelligentCommand {
127 125
                             configProvider, eventBus, backBufferFactory);
128 126
                     windowManager.addWindow(newWindow);
129 127
                 } else {
130
-                    newWindow = new CustomWindow(args.getArguments()[start], title,
131
-                            (FrameContainer) parent, backBufferFactory);
132
-                    windowManager.addWindow((FrameContainer) parent, newWindow);
128
+                    newWindow = new CustomWindow(args.getArguments()[start], title, parent,
129
+                            backBufferFactory);
130
+                    windowManager.addWindow(parent, newWindow);
133 131
                 }
134 132
             } else {
135 133
                 sendLine(origin, args.isSilent(), FORMAT_ERROR,

+ 1
- 3
src/com/dmdirc/commandparser/commands/server/AllChannels.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;
@@ -72,8 +71,7 @@ public class AllChannels extends Command implements IntelligentCommand {
72 71
         final String command = args.getArgumentsAsString();
73 72
 
74 73
         for (GroupChat channel : server.getGroupChatManager().getChannels()) {
75
-            channel.getWindowModel().getCommandParser().parseCommand(
76
-                    (FrameContainer) channel.getWindowModel(),
74
+            channel.getWindowModel().getCommandParser().parseCommand(channel.getWindowModel(),
77 75
                     command);
78 76
         }
79 77
     }

+ 1
- 2
src/com/dmdirc/commandparser/commands/server/Message.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;
@@ -118,7 +117,7 @@ public class Message extends Command implements IntelligentCommand,
118 117
     }
119 118
 
120 119
     @Override
121
-    public int getLineCount(final FrameContainer origin, final CommandArguments arguments) {
120
+    public int getLineCount(final WindowModel origin, final CommandArguments arguments) {
122 121
         if (arguments.getArguments().length >= 2) {
123 122
             final String target = arguments.getArguments()[0];
124 123
             return origin.getConnection().get().getWindowModel().getNumLines(

+ 1
- 2
src/com/dmdirc/commandparser/commands/server/OpenQuery.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.Query;
27 26
 import com.dmdirc.commandparser.BaseCommandInfo;
28 27
 import com.dmdirc.commandparser.CommandArguments;
@@ -109,7 +108,7 @@ public class OpenQuery extends Command implements IntelligentCommand,
109 108
     }
110 109
 
111 110
     @Override
112
-    public int getLineCount(final FrameContainer origin, final CommandArguments arguments) {
111
+    public int getLineCount(final WindowModel origin, final CommandArguments arguments) {
113 112
         if (arguments.getArguments().length >= 2) {
114 113
             final String target = arguments.getArguments()[0];
115 114
             return origin.getConnection().get().getWindowModel().getNumLines("PRIVMSG "

+ 0
- 1
src/com/dmdirc/interfaces/ui/FrameListener.java Просмотреть файл

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.interfaces.ui;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.interfaces.WindowModel;
27 26
 
28 27
 /**

+ 0
- 1
src/com/dmdirc/interfaces/ui/Window.java Просмотреть файл

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.interfaces.ui;
24 24
 
25
-import com.dmdirc.FrameContainer;
26 25
 import com.dmdirc.interfaces.WindowModel;
27 26
 
28 27
 /**

+ 5
- 6
src/com/dmdirc/ui/input/InputHandler.java Просмотреть файл

@@ -286,7 +286,7 @@ public abstract class InputHandler implements ConfigChangeListener {
286 286
 
287 287
             if (command != null && command.getValue() instanceof ValidatingCommand) {
288 288
                 final ValidationResponse vr = ((ValidatingCommand) command.getValue())
289
-                        .validateArguments((FrameContainer) parentWindow, args);
289
+                        .validateArguments(parentWindow, args);
290 290
 
291 291
                 if (vr.isFailure()) {
292 292
                     fireCommandFailure(vr.getFailureReason());
@@ -297,7 +297,7 @@ public abstract class InputHandler implements ConfigChangeListener {
297 297
 
298 298
             if (command != null && command.getValue() instanceof WrappableCommand) {
299 299
                 final int count = ((WrappableCommand) command.getValue())
300
-                        .getLineCount((FrameContainer) parentWindow, args);
300
+                        .getLineCount(parentWindow, args);
301 301
                 fireLineWrap(count);
302 302
             }
303 303
         } else {
@@ -434,7 +434,7 @@ public abstract class InputHandler implements ConfigChangeListener {
434 434
 
435 435
             case KeyEvent.VK_ENTER:
436 436
                 if ((flags & HANDLE_RETURN) != 0 && !line.isEmpty()) {
437
-                    commandParser.parseCommandCtrl((FrameContainer) parentWindow, line);
437
+                    commandParser.parseCommandCtrl(parentWindow, line);
438 438
                     addToBuffer(line);
439 439
                 }
440 440
                 break;
@@ -551,8 +551,7 @@ public abstract class InputHandler implements ConfigChangeListener {
551 551
     private void doCommandTabCompletion(final String text, final int start,
552 552
             final int end, final boolean shiftPressed) {
553 553
         doNormalTabCompletion(text, start, end, shiftPressed,
554
-                tabCompleterUtils.getIntelligentResults((FrameContainer) parentWindow,
555
-                        commandController,
554
+                tabCompleterUtils.getIntelligentResults(parentWindow, commandController,
556 555
                         text.substring(0, start), text.substring(start, end)));
557 556
     }
558 557
 
@@ -589,7 +588,7 @@ public abstract class InputHandler implements ConfigChangeListener {
589 588
             eventBus.publishAsync(new ClientUserInputEvent(
590 589
                     (FrameContainer) parentWindow, bufferedLine));
591 590
             addToBuffer(bufferedLine.toString());
592
-            commandParser.parseCommand((FrameContainer) parentWindow, bufferedLine.toString());
591
+            commandParser.parseCommand(parentWindow, bufferedLine.toString());
593 592
         }
594 593
 
595 594
         cancelTypingNotification();

+ 1
- 2
src/com/dmdirc/ui/input/TabCompleterUtils.java Просмотреть файл

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.ui.input;
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;
@@ -132,7 +131,7 @@ public class TabCompleterUtils {
132 131
      */
133 132
     @Nullable
134 133
     public AdditionalTabTargets getIntelligentResults(
135
-            final FrameContainer window, final CommandController commandController,
134
+            final WindowModel window, final CommandController commandController,
136 135
             final String text, final String partial) {
137 136
         return getIntelligentResults(window,
138 137
                 new CommandArguments(commandController, text), partial);

+ 3
- 3
src/com/dmdirc/ui/messages/BackBuffer.java Просмотреть файл

@@ -23,9 +23,9 @@
23 23
 package com.dmdirc.ui.messages;
24 24
 
25 25
 import com.dmdirc.DMDircMBassador;
26
-import com.dmdirc.FrameContainer;
27 26
 import com.dmdirc.events.DisplayProperty;
28 27
 import com.dmdirc.events.DisplayableEvent;
28
+import com.dmdirc.interfaces.WindowModel;
29 29
 import com.dmdirc.util.EventUtils;
30 30
 
31 31
 import net.engio.mbassy.listener.Handler;
@@ -39,10 +39,10 @@ public class BackBuffer {
39 39
     private final Styliser styliser;
40 40
     private final DMDircMBassador eventBus;
41 41
     private final EventFormatter formatter;
42
-    private final FrameContainer owner;
42
+    private final WindowModel owner;
43 43
 
44 44
     public BackBuffer(
45
-            final FrameContainer owner,
45
+            final WindowModel owner,
46 46
             final ColourManagerFactory colourManagerFactory,
47 47
             final EventFormatter formatter) {
48 48
         this.owner = owner;

+ 2
- 2
src/com/dmdirc/ui/messages/BackBufferFactory.java Просмотреть файл

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.dmdirc.ui.messages;
24 24
 
25
-import com.dmdirc.FrameContainer;
25
+import com.dmdirc.interfaces.WindowModel;
26 26
 
27 27
 import javax.inject.Inject;
28 28
 import javax.inject.Singleton;
@@ -44,7 +44,7 @@ public class BackBufferFactory {
44 44
         this.formatter = formatter;
45 45
     }
46 46
 
47
-    public BackBuffer getBackBuffer(final FrameContainer owner) {
47
+    public BackBuffer getBackBuffer(final WindowModel owner) {
48 48
         return new BackBuffer(owner, colourManagerFactory, formatter);
49 49
     }
50 50
 

+ 1
- 2
src/com/dmdirc/ui/messages/sink/CustomWindowMessageSink.java Просмотреть файл

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc.ui.messages.sink;
24 24
 
25 25
 import com.dmdirc.CustomWindow;
26
-import com.dmdirc.FrameContainer;
27 26
 import com.dmdirc.interfaces.WindowModel;
28 27
 import com.dmdirc.ui.WindowManager;
29 28
 import com.dmdirc.ui.messages.BackBufferFactory;
@@ -73,7 +72,7 @@ public class CustomWindowMessageSink implements MessageSink {
73 72
 
74 73
         if (targetWindow == null) {
75 74
             targetWindow = new CustomWindow(patternMatches[0], patternMatches[0],
76
-                    (FrameContainer) connectionContainer, backBufferFactory);
75
+                    connectionContainer, backBufferFactory);
77 76
             windowManager.addWindow(connectionContainer, targetWindow);
78 77
         }
79 78
 

Загрузка…
Отмена
Сохранить