소스 검색

Tidy up.

Remove deprecated methods, make all methods on TCUtils non-static.
pull/123/head
Chris Smith 9 년 전
부모
커밋
6cc6ceab91
3개의 변경된 파일11개의 추가작업 그리고 31개의 파일을 삭제
  1. 1
    11
      src/com/dmdirc/commandparser/parsers/CommandParser.java
  2. 0
    13
      src/com/dmdirc/ui/input/InputHandler.java
  3. 10
    7
      src/com/dmdirc/ui/input/TabCompleterUtils.java

+ 1
- 11
src/com/dmdirc/commandparser/parsers/CommandParser.java 파일 보기

@@ -84,16 +84,6 @@ public abstract class CommandParser implements Serializable {
84 84
         loadCommands();
85 85
     }
86 86
 
87
-    /**
88
-     * @deprecated Callers should obtain their own instance of command controller.
89
-     *
90
-     * @return The command manager for this parser.
91
-     */
92
-    @Deprecated
93
-    public CommandController getCommandManager() {
94
-        return commandManager;
95
-    }
96
-
97 87
     /**
98 88
      * Sets the owner of this command parser.
99 89
      *
@@ -212,7 +202,7 @@ public abstract class CommandParser implements Serializable {
212 202
                 final String newCommandString = commandManager.getCommandChar()
213 203
                         + (silent ? String.valueOf(commandManager.getSilenceChar()) : "")
214 204
                         + args.getCommandName()
215
-                        + (cargs.length > 1 ? " " + args.getArgumentsAsString(1) : "");
205
+                        + (cargs.length > 1 ? ' ' + args.getArgumentsAsString(1) : "");
216 206
 
217 207
                 if (server.hasChannel(channel)) {
218 208
                     server.getChannel(channel).getCommandParser().parseCommand(origin,

+ 0
- 13
src/com/dmdirc/ui/input/InputHandler.java 파일 보기

@@ -115,19 +115,6 @@ public abstract class InputHandler implements ConfigChangeListener {
115 115
     /** The event bus to use to dispatch input events. */
116 116
     private final DMDircMBassador eventBus;
117 117
 
118
-    /** Temporary ctor to allow plugins to specify a new one. */
119
-    @Deprecated
120
-    public InputHandler(
121
-            final ServiceManager serviceManager,
122
-            final InputField target,
123
-            final CommandController commandController,
124
-            final CommandParser commandParser,
125
-            final FrameContainer parentWindow,
126
-            final DMDircMBassador eventBus) {
127
-        this(serviceManager, target, commandController, commandParser, parentWindow,
128
-                new TabCompleterUtils(), eventBus);
129
-    }
130
-
131 118
     /**
132 119
      * Creates a new instance of InputHandler. Adds listeners to the target that we need to operate.
133 120
      *

+ 10
- 7
src/com/dmdirc/ui/input/TabCompleterUtils.java 파일 보기

@@ -43,8 +43,11 @@ import javax.inject.Singleton;
43 43
 @Singleton
44 44
 public class TabCompleterUtils {
45 45
 
46
+    private final CommandController commandController;
47
+
46 48
     @Inject
47
-    public TabCompleterUtils() {
49
+    public TabCompleterUtils(final CommandController commandController) {
50
+        this.commandController = commandController;
48 51
     }
49 52
 
50 53
     /**
@@ -57,7 +60,7 @@ public class TabCompleterUtils {
57 60
      * @return Additional tab targets for the text, or null if none are available
58 61
      */
59 62
     @Nullable
60
-    public static AdditionalTabTargets getIntelligentResults(final int arg,
63
+    public AdditionalTabTargets getIntelligentResults(final int arg,
61 64
             final IntelligentCommand.IntelligentCommandContext context, final int offset) {
62 65
         if (arg == offset) {
63 66
             final AdditionalTabTargets targets = new AdditionalTabTargets().excludeAll();
@@ -65,7 +68,7 @@ public class TabCompleterUtils {
65 68
             return targets;
66 69
         } else {
67 70
             return getIntelligentResults(context.getWindow(),
68
-                    new CommandArguments(context.getWindow().getCommandParser().getCommandManager(),
71
+                    new CommandArguments(commandController,
69 72
                             context.getPreviousArgs().subList(offset,
70 73
                                     context.getPreviousArgs().size())), context.getPartial());
71 74
         }
@@ -83,15 +86,15 @@ public class TabCompleterUtils {
83 86
      * @since 0.6.4
84 87
      */
85 88
     @Nullable
86
-    private static AdditionalTabTargets getIntelligentResults(
89
+    private AdditionalTabTargets getIntelligentResults(
87 90
             final FrameContainer window,
88 91
             final CommandArguments args, final String partial) {
89 92
         if (!args.isCommand()) {
90 93
             return null;
91 94
         }
92 95
 
93
-        final Map.Entry<CommandInfo, Command> command = window.getCommandParser().
94
-                getCommandManager().getCommand(args.getCommandName());
96
+        final Map.Entry<CommandInfo, Command> command =
97
+                commandController.getCommand(args.getCommandName());
95 98
 
96 99
         AdditionalTabTargets targets = null;
97 100
 
@@ -127,7 +130,7 @@ public class TabCompleterUtils {
127 130
      * @since 0.6.4
128 131
      */
129 132
     @Nullable
130
-    public static AdditionalTabTargets getIntelligentResults(
133
+    public AdditionalTabTargets getIntelligentResults(
131 134
             final FrameContainer window, final CommandController commandController,
132 135
             final String text, final String partial) {
133 136
         return getIntelligentResults(window,

Loading…
취소
저장