Bladeren bron

Tidy how CommandParsers are created.

Instead of passing them in to the FrameContainer ctor, create
them afterwards.

This means the reference in FrameContainer can't be final but
removes the horrible setOwner() kludge that was previously in
CommandParser, and cuts down the deps needed to pass in to the
FrameContainer ctor.
pull/548/head
Chris Smith 9 jaren geleden
bovenliggende
commit
deaf4b232f

+ 0
- 7
src/com/dmdirc/Channel.java Bestand weergeven

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc;
24 24
 
25 25
 import com.dmdirc.commandparser.CommandType;
26
-import com.dmdirc.commandparser.parsers.ChannelCommandParser;
27 26
 import com.dmdirc.config.ConfigBinding;
28 27
 import com.dmdirc.events.ChannelClosedEvent;
29 28
 import com.dmdirc.events.ChannelSelfActionEvent;
@@ -35,7 +34,6 @@ import com.dmdirc.events.NickListClientAddedEvent;
35 34
 import com.dmdirc.events.NickListClientRemovedEvent;
36 35
 import com.dmdirc.events.NickListClientsChangedEvent;
37 36
 import com.dmdirc.events.NickListUpdatedEvent;
38
-import com.dmdirc.interfaces.CommandController;
39 37
 import com.dmdirc.interfaces.Connection;
40 38
 import com.dmdirc.interfaces.GroupChat;
41 39
 import com.dmdirc.interfaces.GroupChatUser;
@@ -103,18 +101,14 @@ public class Channel extends FrameContainer implements GroupChat {
103 101
      * @param newChannelInfo      The parser's channel object that corresponds to this channel
104 102
      * @param configMigrator      The config migrator which provides the config for this channel.
105 103
      * @param tabCompleterFactory The factory to use to create tab completers.
106
-     * @param commandController   The controller to load commands from.
107 104
      * @param messageSinkManager  The sink manager to use to despatch messages.
108
-     * @param eventBus            The bus to despatch events onto.
109 105
      */
110 106
     public Channel(
111 107
             final Connection connection,
112 108
             final ChannelInfo newChannelInfo,
113 109
             final ConfigProviderMigrator configMigrator,
114 110
             final TabCompleterFactory tabCompleterFactory,
115
-            final CommandController commandController,
116 111
             final MessageSinkManager messageSinkManager,
117
-            final DMDircMBassador eventBus,
118 112
             final BackBufferFactory backBufferFactory,
119 113
             final GroupChatUserManager groupChatUserManager) {
120 114
         super(connection.getWindowModel(), "channel-inactive",
@@ -122,7 +116,6 @@ public class Channel extends FrameContainer implements GroupChat {
122 116
                 Styliser.stipControlCodes(newChannelInfo.getName()),
123 117
                 configMigrator.getConfigProvider(),
124 118
                 backBufferFactory,
125
-                new ChannelCommandParser(connection.getWindowModel(), commandController,  eventBus),
126 119
                 tabCompleterFactory.getTabCompleter(connection.getWindowModel().getTabCompleter(),
127 120
                         configMigrator.getConfigProvider(), CommandType.TYPE_CHANNEL,
128 121
                         CommandType.TYPE_CHAT),

+ 4
- 2
src/com/dmdirc/ChannelFactory.java Bestand weergeven

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc;
24 24
 
25
+import com.dmdirc.commandparser.parsers.ChannelCommandParser;
25 26
 import com.dmdirc.events.ChannelOpenedEvent;
26 27
 import com.dmdirc.interfaces.CommandController;
27 28
 import com.dmdirc.interfaces.Connection;
@@ -67,8 +68,9 @@ public class ChannelFactory {
67 68
             final ChannelInfo channelInfo,
68 69
             final ConfigProviderMigrator configMigrator) {
69 70
         final Channel channel = new Channel(connection, channelInfo, configMigrator,
70
-                tabCompleterFactory, commandController, messageSinkManager, eventBus,
71
-                backBufferFactory, groupChatUserManager);
71
+                tabCompleterFactory, messageSinkManager, backBufferFactory, groupChatUserManager);
72
+        channel.setCommandParser(new ChannelCommandParser(connection.getWindowModel(),
73
+                commandController, eventBus, channel));
72 74
         windowManager.addWindow(connection.getWindowModel(), channel);
73 75
         connection.getWindowModel().getEventBus().publish(new ChannelOpenedEvent(channel));
74 76
         return channel;

+ 11
- 10
src/com/dmdirc/FrameContainer.java Bestand weergeven

@@ -95,12 +95,6 @@ public abstract class FrameContainer implements WindowModel {
95 95
     /** The back buffer for this container. */
96 96
     private BackBuffer backBuffer;
97 97
 
98
-    /**
99
-     * The command parser used for commands in this container.
100
-     * <p>
101
-     * Only defined if this container is {@link #writable}.
102
-     */
103
-    private final Optional<CommandParser> commandParser;
104 98
     /**
105 99
      * The manager to use to dispatch messages to sinks.
106 100
      * <p>
@@ -114,6 +108,13 @@ public abstract class FrameContainer implements WindowModel {
114 108
      */
115 109
     private final Optional<TabCompleter> tabCompleter;
116 110
 
111
+    /**
112
+     * The command parser used for commands in this container.
113
+     * <p>
114
+     * Only defined if this container is {@link #writable}.
115
+     */
116
+    private Optional<CommandParser> commandParser = Optional.empty();
117
+
117 118
     /**
118 119
      * Instantiate new frame container.
119 120
      */
@@ -132,7 +133,6 @@ public abstract class FrameContainer implements WindowModel {
132 133
         this.title = title;
133 134
         this.components = new HashSet<>(components);
134 135
         this.writable = false;
135
-        this.commandParser = Optional.empty();
136 136
         this.tabCompleter = Optional.empty();
137 137
         this.messageSinkManager = Optional.empty();
138 138
         this.backBufferFactory = backBufferFactory;
@@ -157,7 +157,6 @@ public abstract class FrameContainer implements WindowModel {
157 157
             final String title,
158 158
             final AggregateConfigProvider config,
159 159
             final BackBufferFactory backBufferFactory,
160
-            final CommandParser commandParser,
161 160
             final TabCompleter tabCompleter,
162 161
             final MessageSinkManager messageSinkManager,
163 162
             final DMDircMBassador eventBus,
@@ -168,11 +167,9 @@ public abstract class FrameContainer implements WindowModel {
168 167
         this.title = title;
169 168
         this.components = new HashSet<>(components);
170 169
         this.writable = true;
171
-        this.commandParser = Optional.of(commandParser);
172 170
         this.tabCompleter = Optional.of(tabCompleter);
173 171
         this.messageSinkManager = Optional.of(messageSinkManager);
174 172
         this.backBufferFactory = backBufferFactory;
175
-        commandParser.setOwner(this);
176 173
 
177 174
         eventBusManager = new ChildEventBusManager(eventBus);
178 175
         eventBusManager.connect();
@@ -189,6 +186,10 @@ public abstract class FrameContainer implements WindowModel {
189 186
         backBuffer.startAddingEvents();
190 187
     }
191 188
 
189
+    public void setCommandParser(final CommandParser commandParser) {
190
+        this.commandParser = Optional.ofNullable(commandParser);
191
+    }
192
+
192 193
     @Override
193 194
     public Optional<WindowModel> getParent() {
194 195
         return parent;

+ 2
- 1
src/com/dmdirc/GlobalWindow.java Bestand weergeven

@@ -56,12 +56,13 @@ public class GlobalWindow extends FrameContainer {
56 56
             final GlobalCommandParser parser, final TabCompleterFactory tabCompleterFactory,
57 57
             final MessageSinkManager messageSinkManager,
58 58
             final DMDircMBassador eventBus, final BackBufferFactory backBufferFactory) {
59
-        super(null, "icon", "Global", "(Global)", config, backBufferFactory, parser,
59
+        super(null, "icon", "Global", "(Global)", config, backBufferFactory,
60 60
                 tabCompleterFactory.getTabCompleter(config, CommandType.TYPE_GLOBAL),
61 61
                 messageSinkManager, eventBus,
62 62
                 Arrays.asList(WindowComponent.TEXTAREA.getIdentifier(),
63 63
                         WindowComponent.INPUTFIELD.getIdentifier()));
64 64
         initBackBuffer();
65
+        setCommandParser(parser);
65 66
     }
66 67
 
67 68
     @Override

+ 0
- 5
src/com/dmdirc/Query.java Bestand weergeven

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc;
24 24
 
25 25
 import com.dmdirc.commandparser.CommandType;
26
-import com.dmdirc.commandparser.parsers.QueryCommandParser;
27 26
 import com.dmdirc.events.AppErrorEvent;
28 27
 import com.dmdirc.events.CommandErrorEvent;
29 28
 import com.dmdirc.events.QueryActionEvent;
@@ -33,7 +32,6 @@ import com.dmdirc.events.QueryNickChangeEvent;
33 32
 import com.dmdirc.events.QueryQuitEvent;
34 33
 import com.dmdirc.events.QuerySelfActionEvent;
35 34
 import com.dmdirc.events.QuerySelfMessageEvent;
36
-import com.dmdirc.interfaces.CommandController;
37 35
 import com.dmdirc.interfaces.Connection;
38 36
 import com.dmdirc.interfaces.PrivateChat;
39 37
 import com.dmdirc.interfaces.User;
@@ -78,7 +76,6 @@ public class Query extends FrameContainer implements PrivateActionListener,
78 76
             final Connection connection,
79 77
             final User user,
80 78
             final TabCompleterFactory tabCompleterFactory,
81
-            final CommandController commandController,
82 79
             final MessageSinkManager messageSinkManager,
83 80
             final BackBufferFactory backBufferFactory) {
84 81
         super(connection.getWindowModel(), "query",
@@ -86,8 +83,6 @@ public class Query extends FrameContainer implements PrivateActionListener,
86 83
                 user.getNickname(),
87 84
                 connection.getWindowModel().getConfigManager(),
88 85
                 backBufferFactory,
89
-                new QueryCommandParser(connection.getWindowModel(),
90
-                        commandController, connection.getWindowModel().getEventBus()),
91 86
                 tabCompleterFactory.getTabCompleter(connection.getWindowModel().getTabCompleter(),
92 87
                         connection.getWindowModel().getConfigManager(),
93 88
                         CommandType.TYPE_QUERY, CommandType.TYPE_CHAT),

+ 4
- 1
src/com/dmdirc/QueryFactory.java Bestand weergeven

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc;
24 24
 
25
+import com.dmdirc.commandparser.parsers.QueryCommandParser;
25 26
 import com.dmdirc.events.QueryOpenedEvent;
26 27
 import com.dmdirc.interfaces.CommandController;
27 28
 import com.dmdirc.interfaces.Connection;
@@ -58,8 +59,10 @@ public class QueryFactory {
58 59
     }
59 60
 
60 61
     public Query getQuery(final Connection connection, final User user) {
61
-        final Query query = new Query(connection, user, tabCompleterFactory, commandController,
62
+        final Query query = new Query(connection, user, tabCompleterFactory,
62 63
                 messageSinkManager, backBufferFactory);
64
+        query.setCommandParser(new QueryCommandParser(connection.getWindowModel(),
65
+                commandController, connection.getWindowModel().getEventBus(), query));
63 66
         windowManager.addWindow(connection.getWindowModel(), query);
64 67
         connection.getWindowModel().getEventBus().publish(new QueryOpenedEvent(query));
65 68
         return query;

+ 0
- 3
src/com/dmdirc/Server.java Bestand weergeven

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc;
24 24
 
25 25
 import com.dmdirc.commandparser.CommandType;
26
-import com.dmdirc.commandparser.parsers.CommandParser;
27 26
 import com.dmdirc.config.profiles.Profile;
28 27
 import com.dmdirc.events.AppErrorEvent;
29 28
 import com.dmdirc.events.ServerConnectErrorEvent;
@@ -177,7 +176,6 @@ public class Server extends FrameContainer implements Connection {
177 176
      */
178 177
     public Server(
179 178
             final ConfigProviderMigrator configMigrator,
180
-            final CommandParser commandParser,
181 179
             final ParserFactory parserFactory,
182 180
             final TabCompleterFactory tabCompleterFactory,
183 181
             final IdentityFactory identityFactory,
@@ -197,7 +195,6 @@ public class Server extends FrameContainer implements Connection {
197 195
                 getHost(uri),
198 196
                 configMigrator.getConfigProvider(),
199 197
                 backBufferFactory,
200
-                commandParser,
201 198
                 tabCompleterFactory.getTabCompleter(configMigrator.getConfigProvider(),
202 199
                         CommandType.TYPE_SERVER, CommandType.TYPE_GLOBAL),
203 200
                 messageSinkManager,

+ 9
- 3
src/com/dmdirc/ServerFactoryImpl.java Bestand weergeven

@@ -22,8 +22,9 @@
22 22
 
23 23
 package com.dmdirc;
24 24
 
25
-import com.dmdirc.commandparser.parsers.CommandParser;
25
+import com.dmdirc.commandparser.parsers.ServerCommandParser;
26 26
 import com.dmdirc.config.profiles.Profile;
27
+import com.dmdirc.interfaces.CommandController;
27 28
 import com.dmdirc.interfaces.config.ConfigProvider;
28 29
 import com.dmdirc.interfaces.config.ConfigProviderMigrator;
29 30
 import com.dmdirc.interfaces.config.IdentityFactory;
@@ -49,6 +50,7 @@ public class ServerFactoryImpl {
49 50
     private final IdentityFactory identityFactory;
50 51
     private final MessageSinkManager messageSinkManager;
51 52
     private final Provider<QueryFactory> queryFactory;
53
+    private final Provider<CommandController> commandController;
52 54
     private final DMDircMBassador eventBus;
53 55
     private final MessageEncoderFactory messageEncoderFactory;
54 56
     private final ConfigProvider userSettings;
@@ -63,6 +65,7 @@ public class ServerFactoryImpl {
63 65
             final IdentityFactory identityFactory,
64 66
             final MessageSinkManager messageSinkManager,
65 67
             final Provider<QueryFactory> queryFactory,
68
+            final Provider<CommandController> commandController,
66 69
             final DMDircMBassador eventBus,
67 70
             final MessageEncoderFactory messageEncoderFactory,
68 71
             @ClientModule.UserConfig final ConfigProvider userSettings,
@@ -74,6 +77,7 @@ public class ServerFactoryImpl {
74 77
         this.identityFactory = identityFactory;
75 78
         this.messageSinkManager = messageSinkManager;
76 79
         this.queryFactory = queryFactory;
80
+        this.commandController = commandController;
77 81
         this.eventBus = eventBus;
78 82
         this.messageEncoderFactory = messageEncoderFactory;
79 83
         this.userSettings = userSettings;
@@ -84,14 +88,16 @@ public class ServerFactoryImpl {
84 88
 
85 89
     public Server getServer(
86 90
             final ConfigProviderMigrator configMigrator,
87
-            final CommandParser commandParser,
88 91
             final ScheduledExecutorService executorService,
89 92
             final URI uri,
90 93
             final Profile profile) {
91
-        return new Server(configMigrator, commandParser, parserFactory,
94
+        final Server server = new Server(configMigrator, parserFactory,
92 95
                 tabCompleterFactory, identityFactory, messageSinkManager,
93 96
                 queryFactory.get(), eventBus, messageEncoderFactory, userSettings,
94 97
                 groupChatManagerFactory, executorService, uri, profile, backBufferFactory,
95 98
                 userManager);
99
+        server.setCommandParser(new ServerCommandParser(server.getConfigManager(),
100
+                commandController.get(), eventBus, server));
101
+        return server;
96 102
     }
97 103
 }

+ 0
- 2
src/com/dmdirc/ServerManager.java Bestand weergeven

@@ -110,8 +110,6 @@ public class ServerManager implements ConnectionManager {
110 110
 
111 111
         final Server server = serverFactoryImpl.getServer(
112 112
                 configProvider,
113
-                new ServerCommandParser(configProvider.getConfigProvider(), commandController.get(),
114
-                        eventBus),
115 113
                 Executors.newScheduledThreadPool(1,
116 114
                         new ThreadFactoryBuilder().setNameFormat("server-timer-%d").build()),
117 115
                 uri,

+ 7
- 13
src/com/dmdirc/commandparser/parsers/ChannelCommandParser.java Bestand weergeven

@@ -43,7 +43,7 @@ public class ChannelCommandParser extends ChatCommandParser {
43 43
     /** A version number for this class. */
44 44
     private static final long serialVersionUID = 1;
45 45
     /** The group chat instance that this parser is attached to. */
46
-    private GroupChat groupChat;
46
+    private final GroupChat groupChat;
47 47
 
48 48
     /**
49 49
      * Creates a new instance of ChannelCommandParser.
@@ -52,20 +52,14 @@ public class ChannelCommandParser extends ChatCommandParser {
52 52
      * @param commandController The controller to load commands from.
53 53
      * @param eventBus          Event bus to post events on
54 54
      */
55
-    public ChannelCommandParser(final WindowModel owner,
55
+    public ChannelCommandParser(
56
+            final WindowModel owner,
56 57
             final CommandController commandController,
57
-            final DMDircMBassador eventBus) {
58
-        super(owner, commandController, eventBus);
59
-    }
60
-
61
-    @Override
62
-    public void setOwner(final WindowModel owner) {
63
-        if (groupChat == null) {
64
-            // TODO: Can't assume that framecontainers may be group chats.
65
-            groupChat = (GroupChat) owner;
66
-        }
58
+            final DMDircMBassador eventBus,
59
+            final GroupChat groupChat) {
60
+        super(owner, commandController, eventBus, groupChat);
67 61
 
68
-        super.setOwner(owner);
62
+        this.groupChat = groupChat;
69 63
     }
70 64
 
71 65
     @Override

+ 8
- 12
src/com/dmdirc/commandparser/parsers/ChatCommandParser.java Bestand weergeven

@@ -45,7 +45,7 @@ public class ChatCommandParser extends ServerCommandParser {
45 45
     /** A version number for this class. */
46 46
     private static final long serialVersionUID = 1;
47 47
     /** The container that owns this parser. */
48
-    private Chat owner;
48
+    private final Chat owner;
49 49
 
50 50
     /**
51 51
      * Creates a new chat command parser that belongs to a child of the specified server.
@@ -54,17 +54,13 @@ public class ChatCommandParser extends ServerCommandParser {
54 54
      * @param commandController The controller to load commands from.
55 55
      * @param eventBus          Event but to post events on
56 56
      */
57
-    public ChatCommandParser(final WindowModel owner, final CommandController commandController,
58
-            final DMDircMBassador eventBus) {
59
-        super(owner.getConfigManager(), commandController, eventBus);
60
-        super.setOwner(owner);
61
-    }
62
-
63
-    @Override
64
-    public void setOwner(final WindowModel owner) {
65
-        if (this.owner == null && owner instanceof Chat) {
66
-            this.owner = (Chat) owner;
67
-        }
57
+    public ChatCommandParser(
58
+            final WindowModel owner,
59
+            final CommandController commandController,
60
+            final DMDircMBassador eventBus,
61
+            final Chat chat) {
62
+        super(owner.getConfigManager(), commandController, eventBus, chat.getConnection().get());
63
+        this.owner = chat;
68 64
     }
69 65
 
70 66
     @Override

+ 0
- 9
src/com/dmdirc/commandparser/parsers/CommandParser.java Bestand weergeven

@@ -87,15 +87,6 @@ public abstract class CommandParser implements Serializable {
87 87
         loadCommands();
88 88
     }
89 89
 
90
-    /**
91
-     * Sets the owner of this command parser.
92
-     *
93
-     * @param owner The container which owns this parser
94
-     *
95
-     * @since 0.6.4
96
-     */
97
-    public abstract void setOwner(final WindowModel owner);
98
-
99 90
     /** Loads the relevant commands into the parser. */
100 91
     protected abstract void loadCommands();
101 92
 

+ 0
- 5
src/com/dmdirc/commandparser/parsers/GlobalCommandParser.java Bestand weergeven

@@ -66,11 +66,6 @@ public class GlobalCommandParser extends CommandParser {
66 66
         this.eventBus = eventBus;
67 67
     }
68 68
 
69
-    @Override
70
-    public void setOwner(final WindowModel owner) {
71
-        // Don't care
72
-    }
73
-
74 69
     /** Loads the relevant commands into the parser. */
75 70
     @Override
76 71
     protected void loadCommands() {

+ 4
- 12
src/com/dmdirc/commandparser/parsers/QueryCommandParser.java Bestand weergeven

@@ -46,7 +46,7 @@ public class QueryCommandParser extends ChatCommandParser {
46 46
     /**
47 47
      * The query instance that this parser is attached to.
48 48
      */
49
-    private Query query;
49
+    private final Query query;
50 50
 
51 51
     /**
52 52
      * Creates a new instance of QueryCommandParser.
@@ -56,17 +56,9 @@ public class QueryCommandParser extends ChatCommandParser {
56 56
      * @param eventBus          Event bus to post events on
57 57
      */
58 58
     public QueryCommandParser(final WindowModel owner, final CommandController commandController,
59
-            final DMDircMBassador eventBus) {
60
-        super(owner, commandController, eventBus);
61
-    }
62
-
63
-    @Override
64
-    public void setOwner(final WindowModel owner) {
65
-        if (query == null) {
66
-            query = (Query) owner;
67
-        }
68
-
69
-        super.setOwner(query);
59
+            final DMDircMBassador eventBus, final Query query) {
60
+        super(owner, commandController, eventBus, query);
61
+        this.query = query;
70 62
     }
71 63
 
72 64
     /** Loads the relevant commands into the parser. */

+ 8
- 14
src/com/dmdirc/commandparser/parsers/ServerCommandParser.java Bestand weergeven

@@ -46,6 +46,11 @@ public class ServerCommandParser extends GlobalCommandParser {
46 46
     /** A version number for this class. */
47 47
     private static final long serialVersionUID = 1;
48 48
 
49
+    /**
50
+     * The server instance that this parser is attached to.
51
+     */
52
+    private final Connection server;
53
+
49 54
     /**
50 55
      * Creates a new command parser for server commands.
51 56
      *
@@ -56,21 +61,10 @@ public class ServerCommandParser extends GlobalCommandParser {
56 61
     public ServerCommandParser(
57 62
             final AggregateConfigProvider configManager,
58 63
             final CommandController commandController,
59
-            final DMDircMBassador eventBus) {
64
+            final DMDircMBassador eventBus,
65
+            final Connection connection) {
60 66
         super(configManager, commandController, eventBus);
61
-    }
62
-    /**
63
-     * The server instance that this parser is attached to.
64
-     */
65
-    private Connection server;
66
-
67
-    @Override
68
-    public void setOwner(final WindowModel owner) {
69
-        if (server == null && owner instanceof Connection) {
70
-            server = (Connection) owner;
71
-        }
72
-
73
-        super.setOwner(owner);
67
+        this.server = connection;
74 68
     }
75 69
 
76 70
     /** Loads the relevant commands into the parser. */

+ 1
- 2
test/com/dmdirc/ServerManagerTest.java Bestand weergeven

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc;
24 24
 
25
-import com.dmdirc.commandparser.parsers.CommandParser;
26 25
 import com.dmdirc.config.profiles.Profile;
27 26
 import com.dmdirc.config.profiles.ProfileManager;
28 27
 import com.dmdirc.interfaces.CommandController;
@@ -92,7 +91,7 @@ public class ServerManagerTest {
92 91
                 anyString())).thenReturn(configProviderMigrator);
93 92
         when(configProviderMigrator.getConfigProvider()).thenReturn(configProvider);
94 93
 
95
-        when(serverFactoryImpl.getServer(eq(configProviderMigrator), any(CommandParser.class),
94
+        when(serverFactoryImpl.getServer(eq(configProviderMigrator),
96 95
                 any(ScheduledExecutorService.class), uriCaptor.capture(), eq(profile)))
97 96
                 .thenReturn(server);
98 97
     }

+ 0
- 5
test/com/dmdirc/harness/TestCommandParser.java Bestand weergeven

@@ -83,9 +83,4 @@ public class TestCommandParser extends CommandParser {
83 83
         invalidCommand = args.getCommandName();
84 84
     }
85 85
 
86
-    @Override
87
-    public void setOwner(final WindowModel owner) {
88
-        // Don't care
89
-    }
90
-
91 86
 }

+ 1
- 1
test/com/dmdirc/harness/TestWritableFrameContainer.java Bestand weergeven

@@ -48,12 +48,12 @@ public class TestWritableFrameContainer extends FrameContainer {
48 48
             final DMDircMBassador eventBus,
49 49
             final BackBufferFactory backBufferFactory) {
50 50
         super(null, "raw", "Raw", "(Raw)", cm, backBufferFactory,
51
-                new GlobalCommandParser(cm, commandManager, eventBus),
52 51
                 new TabCompleter(mock(CommandController.class), cm),
53 52
                 messageSinkManager,
54 53
                 eventBus,
55 54
                 Collections.<String>emptySet());
56 55
 
56
+        setCommandParser(new GlobalCommandParser(cm, commandManager, eventBus));
57 57
         this.lineLength = lineLength;
58 58
     }
59 59
 

Laden…
Annuleren
Opslaan