Browse Source

Merge pull request #443 from csmith/core-updates

Plugin support for core changes.
pull/444/head
Greg Holmes 8 years ago
parent
commit
d6f0f4e0fc

+ 0
- 3
activewindow/build.gradle View File

1
-dependencies {
2
-  compile plugin('ui_swing')
3
-}

+ 0
- 32
activewindow/plugin.config View File

1
-# This is a DMDirc configuration file.
2
-
3
-# This section indicates which sections below take key/value
4
-# pairs, rather than a simple list. It should be placed above
5
-# any sections that take key/values.
6
-keysections:
7
-  metadata
8
-  updates
9
-  version
10
-  requires
11
-
12
-metadata:
13
-  author=Greboid <greg@dmdirc.com>
14
-  mainclass=com.dmdirc.addons.activewindow.ActiveWindowPlugin
15
-  description=Provides an active window command to the swing UI
16
-  name=activewindow
17
-  nicename=Active Window
18
-
19
-updates:
20
-  id=66
21
-
22
-requires:
23
-  parent=ui_swing
24
-
25
-version:
26
-  friendly=1.0
27
-
28
-provides:
29
-  active command
30
-
31
-required-services:
32
-  swing ui

+ 0
- 85
activewindow/src/com/dmdirc/addons/activewindow/ActiveCommand.java View File

1
-/*
2
- * Copyright (c) 2006-2015 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.addons.activewindow;
24
-
25
-import com.dmdirc.addons.ui_swing.interfaces.ActiveFrameManager;
26
-import com.dmdirc.commandparser.BaseCommandInfo;
27
-import com.dmdirc.commandparser.CommandArguments;
28
-import com.dmdirc.commandparser.CommandInfo;
29
-import com.dmdirc.commandparser.CommandType;
30
-import com.dmdirc.commandparser.commands.Command;
31
-import com.dmdirc.commandparser.commands.IntelligentCommand;
32
-import com.dmdirc.commandparser.commands.context.CommandContext;
33
-import com.dmdirc.interfaces.CommandController;
34
-import com.dmdirc.interfaces.WindowModel;
35
-import com.dmdirc.ui.input.AdditionalTabTargets;
36
-import com.dmdirc.ui.input.TabCompleterUtils;
37
-
38
-import javax.annotation.Nonnull;
39
-import javax.inject.Inject;
40
-
41
-/**
42
- * Executes another command as if it were executed in the active window.
43
- */
44
-public class ActiveCommand extends Command implements IntelligentCommand {
45
-
46
-    /** A command info object for this command. */
47
-    public static final CommandInfo INFO = new BaseCommandInfo("active",
48
-            "active <command> - executes the command as though it had been "
49
-            + "executed in the active window", CommandType.TYPE_GLOBAL);
50
-    /** Active frame manager. */
51
-    private final ActiveFrameManager activeFrameManager;
52
-    /** Tab-completer utilities. */
53
-    private final TabCompleterUtils tabUtils;
54
-
55
-    /**
56
-     * Creates a new active command.
57
-     *
58
-     * @param controller          The controller to use for command information.
59
-     * @param activeFrameManager The active window manager
60
-     */
61
-    @Inject
62
-    public ActiveCommand(
63
-            final CommandController controller,
64
-            final ActiveFrameManager activeFrameManager,
65
-            final TabCompleterUtils tabUtils) {
66
-        super(controller);
67
-
68
-        this.activeFrameManager = activeFrameManager;
69
-        this.tabUtils = tabUtils;
70
-    }
71
-
72
-    @Override
73
-    public void execute(@Nonnull final WindowModel origin,
74
-            final CommandArguments args, final CommandContext context) {
75
-        activeFrameManager.getActiveFrame().ifPresent(f -> f.getContainer().getCommandParser()
76
-                .parseCommand(f.getContainer(), args.getArgumentsAsString()));
77
-    }
78
-
79
-    @Override
80
-    public AdditionalTabTargets getSuggestions(final int arg,
81
-            final IntelligentCommandContext context) {
82
-        return tabUtils.getIntelligentResults(arg, context, 0);
83
-    }
84
-
85
-}

+ 0
- 67
activewindow/src/com/dmdirc/addons/activewindow/ActiveWindowManager.java View File

1
-/*
2
- * Copyright (c) 2006-2015 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.addons.activewindow;
24
-
25
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
26
-
27
-import javax.inject.Inject;
28
-
29
-/**
30
- * Manages the active window sink.
31
- */
32
-public class ActiveWindowManager {
33
-
34
-    /** The message sink to register and unregister. */
35
-    private final ActiveWindowMessageSink sink;
36
-    /** The manager to add and remove the sink from. */
37
-    private final MessageSinkManager sinkManager;
38
-
39
-    /**
40
-     * Creates a new instance of {@link ActiveWindowManager}.
41
-     *
42
-     * @param sinkManager The manager to add and remove sinks from.
43
-     * @param sink        The sink to be added and removed.
44
-     */
45
-    @Inject
46
-    public ActiveWindowManager(
47
-            final MessageSinkManager sinkManager,
48
-            final ActiveWindowMessageSink sink) {
49
-        this.sink = sink;
50
-        this.sinkManager = sinkManager;
51
-    }
52
-
53
-    /**
54
-     * Registers the sink with the manager.
55
-     */
56
-    public void register() {
57
-        sinkManager.addSink(sink);
58
-    }
59
-
60
-    /**
61
-     * Unregisters the sink from the manager.
62
-     */
63
-    public void unregister() {
64
-        sinkManager.removeSink(sink);
65
-    }
66
-
67
-}

+ 0
- 68
activewindow/src/com/dmdirc/addons/activewindow/ActiveWindowMessageSink.java View File

1
-/*
2
- * Copyright (c) 2006-2015 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.addons.activewindow;
24
-
25
-import com.dmdirc.addons.ui_swing.interfaces.ActiveFrameManager;
26
-import com.dmdirc.interfaces.WindowModel;
27
-import com.dmdirc.ui.messages.sink.MessageSink;
28
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
29
-
30
-import java.util.Date;
31
-import java.util.regex.Pattern;
32
-
33
-import javax.inject.Inject;
34
-
35
-/**
36
- * A message sink which passes messages onto the active swing window.
37
- */
38
-public class ActiveWindowMessageSink implements MessageSink {
39
-
40
-    /** The pattern to use to match this sink. */
41
-    private static final Pattern PATTERN = Pattern.compile("active");
42
-    /** Active frame manager. */
43
-    private final ActiveFrameManager activeFrameManager;
44
-
45
-    /**
46
-     * Creates a new ActiveWindowMessageSink for the specified mainframe.
47
-     *
48
-     * @param activeFrameManager Active frame manager.
49
-     */
50
-    @Inject
51
-    public ActiveWindowMessageSink(final ActiveFrameManager activeFrameManager) {
52
-        this.activeFrameManager = activeFrameManager;
53
-    }
54
-
55
-    @Override
56
-    public Pattern getPattern() {
57
-        return PATTERN;
58
-    }
59
-
60
-    @Override
61
-    public void handleMessage(final MessageSinkManager dispatcher,
62
-            final WindowModel source, final String[] patternMatches,
63
-            final Date date, final String messageType, final Object... args) {
64
-        activeFrameManager.getActiveFrame()
65
-                .ifPresent(f -> f.getContainer().addLine(messageType, date, args));
66
-    }
67
-
68
-}

+ 0
- 34
activewindow/src/com/dmdirc/addons/activewindow/ActiveWindowModule.java View File

1
-/*
2
- * Copyright (c) 2006-2015 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.addons.activewindow;
24
-
25
-import com.dmdirc.addons.ui_swing.injection.SwingModule;
26
-
27
-import dagger.Module;
28
-
29
-/**
30
- * DI module for the active window plugin.
31
- */
32
-@Module(injects = {ActiveWindowManager.class, ActiveCommand.class}, addsTo = SwingModule.class)
33
-public class ActiveWindowModule {
34
-}

+ 0
- 58
activewindow/src/com/dmdirc/addons/activewindow/ActiveWindowPlugin.java View File

1
-/*
2
- * Copyright (c) 2006-2015 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.addons.activewindow;
24
-
25
-import com.dmdirc.plugins.PluginInfo;
26
-import com.dmdirc.plugins.implementations.BaseCommandPlugin;
27
-
28
-import dagger.ObjectGraph;
29
-
30
-/** Plugin to provide an active window command to the Swing UI. */
31
-public class ActiveWindowPlugin extends BaseCommandPlugin {
32
-
33
-    /** Manager to use for the active window sink. */
34
-    private ActiveWindowManager activeWindowManager;
35
-
36
-    @Override
37
-    public void load(final PluginInfo pluginInfo, final ObjectGraph graph) {
38
-        super.load(pluginInfo, graph);
39
-
40
-        setObjectGraph(graph.plus(new ActiveWindowModule()));
41
-        registerCommand(ActiveCommand.class, ActiveCommand.INFO);
42
-
43
-        activeWindowManager = getObjectGraph().get(ActiveWindowManager.class);
44
-    }
45
-
46
-    @Override
47
-    public void onLoad() {
48
-        super.onLoad();
49
-        activeWindowManager.register();
50
-    }
51
-
52
-    @Override
53
-    public void onUnload() {
54
-        super.onUnload();
55
-        activeWindowManager.unregister();
56
-    }
57
-
58
-}

+ 0
- 26
activewindow/src/com/dmdirc/addons/activewindow/package-info.java View File

1
-/*
2
- * Copyright (c) 2006-2015 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-/**
24
- * Provides an active window command to the swing UI.
25
- */
26
-package com.dmdirc.addons.activewindow;

+ 0
- 89
activewindow/test/com/dmdirc/addons/activewindow/ActiveCommandTest.java View File

1
-/*
2
- * Copyright (c) 2006-2015 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.addons.activewindow;
24
-
25
-import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
26
-import com.dmdirc.addons.ui_swing.interfaces.ActiveFrameManager;
27
-import com.dmdirc.commandparser.CommandArguments;
28
-import com.dmdirc.commandparser.commands.IntelligentCommand.IntelligentCommandContext;
29
-import com.dmdirc.commandparser.commands.context.CommandContext;
30
-import com.dmdirc.commandparser.parsers.CommandParser;
31
-import com.dmdirc.interfaces.CommandController;
32
-import com.dmdirc.interfaces.WindowModel;
33
-import com.dmdirc.ui.input.TabCompleterUtils;
34
-
35
-import java.util.Optional;
36
-
37
-import org.junit.Before;
38
-import org.junit.Test;
39
-import org.junit.runner.RunWith;
40
-import org.mockito.Mock;
41
-import org.mockito.runners.MockitoJUnitRunner;
42
-
43
-import static org.mockito.Mockito.never;
44
-import static org.mockito.Mockito.verify;
45
-import static org.mockito.Mockito.when;
46
-
47
-@RunWith(MockitoJUnitRunner.class)
48
-public class ActiveCommandTest {
49
-
50
-    @Mock private IntelligentCommandContext intelligentCommandContext;
51
-    @Mock private CommandParser commandParser;
52
-    @Mock private CommandController commandController;
53
-    @Mock private ActiveFrameManager activeFrameManager;
54
-    @Mock private TabCompleterUtils tabCompleterUtils;
55
-    @Mock private WindowModel frameContainer;
56
-    @Mock private TextFrame textFrame;
57
-    @Mock private CommandArguments commandArguments;
58
-    @Mock private CommandContext commandContext;
59
-    private ActiveCommand activeCommand;
60
-
61
-    @Before
62
-    public void setUp() throws Exception {
63
-        when(textFrame.getContainer()).thenReturn(frameContainer);
64
-        when(frameContainer.getCommandParser()).thenReturn(commandParser);
65
-        when(commandArguments.getArgumentsAsString()).thenReturn("some arguments");
66
-        activeCommand = new ActiveCommand(commandController, activeFrameManager, tabCompleterUtils);
67
-    }
68
-
69
-    @Test
70
-    public void testExecute_NoActive() throws Exception {
71
-        when(activeFrameManager.getActiveFrame()).thenReturn(Optional.empty());
72
-        activeCommand.execute(frameContainer, commandArguments, commandContext);
73
-        verify(commandParser, never())
74
-                .parseCommand(frameContainer, commandArguments.getArgumentsAsString());
75
-    }
76
-
77
-    @Test
78
-    public void testExecute_Active() throws Exception {
79
-        when(activeFrameManager.getActiveFrame()).thenReturn(Optional.of(textFrame));
80
-        activeCommand.execute(frameContainer, commandArguments, commandContext);
81
-        verify(commandParser).parseCommand(frameContainer, commandArguments.getArgumentsAsString());
82
-    }
83
-
84
-    @Test
85
-    public void testGetSuggestions() throws Exception {
86
-        activeCommand.getSuggestions(1, intelligentCommandContext);
87
-        verify(tabCompleterUtils).getIntelligentResults(1, intelligentCommandContext, 0);
88
-    }
89
-}

+ 0
- 58
activewindow/test/com/dmdirc/addons/activewindow/ActiveWindowManagerTest.java View File

1
-/*
2
- * Copyright (c) 2006-2015 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.addons.activewindow;
24
-
25
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
26
-
27
-import org.junit.Before;
28
-import org.junit.Test;
29
-import org.junit.runner.RunWith;
30
-import org.mockito.Mock;
31
-import org.mockito.runners.MockitoJUnitRunner;
32
-
33
-import static org.mockito.Mockito.verify;
34
-
35
-@RunWith(MockitoJUnitRunner.class)
36
-public class ActiveWindowManagerTest {
37
-
38
-    @Mock private MessageSinkManager messageSinkManager;
39
-    @Mock private ActiveWindowMessageSink activeWindowMessageSink;
40
-    private ActiveWindowManager activeWindowManager;
41
-
42
-    @Before
43
-    public void setUp() throws Exception {
44
-        activeWindowManager = new ActiveWindowManager(messageSinkManager, activeWindowMessageSink);
45
-    }
46
-
47
-    @Test
48
-    public void testRegister() throws Exception {
49
-        activeWindowManager.register();
50
-        verify(messageSinkManager).addSink(activeWindowMessageSink);
51
-    }
52
-
53
-    @Test
54
-    public void testUnregister() throws Exception {
55
-        activeWindowManager.unregister();
56
-        verify(messageSinkManager).removeSink(activeWindowMessageSink);
57
-    }
58
-}

+ 0
- 80
activewindow/test/com/dmdirc/addons/activewindow/ActiveWindowMessageSinkTest.java View File

1
-/*
2
- * Copyright (c) 2006-2015 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.addons.activewindow;
24
-
25
-import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
26
-import com.dmdirc.addons.ui_swing.interfaces.ActiveFrameManager;
27
-import com.dmdirc.interfaces.WindowModel;
28
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
29
-
30
-import java.util.Date;
31
-import java.util.Optional;
32
-import java.util.regex.Pattern;
33
-
34
-import org.junit.Before;
35
-import org.junit.Test;
36
-import org.junit.runner.RunWith;
37
-import org.mockito.Mock;
38
-import org.mockito.runners.MockitoJUnitRunner;
39
-
40
-import static junit.framework.TestCase.assertEquals;
41
-import static org.mockito.Mockito.never;
42
-import static org.mockito.Mockito.verify;
43
-import static org.mockito.Mockito.when;
44
-
45
-@RunWith(MockitoJUnitRunner.class)
46
-public class ActiveWindowMessageSinkTest {
47
-
48
-    private static final Pattern PATTERN = Pattern.compile("active");
49
-    @Mock private ActiveFrameManager activeFrameManager;
50
-    @Mock private MessageSinkManager messageSinkManager;
51
-    @Mock private WindowModel frameContainer;
52
-    @Mock private TextFrame textFrame;
53
-    @Mock private Date date;
54
-    private ActiveWindowMessageSink sink;
55
-
56
-    @Before
57
-    public void setUp() throws Exception {
58
-        sink = new ActiveWindowMessageSink(activeFrameManager);
59
-        when(textFrame.getContainer()).thenReturn(frameContainer);
60
-    }
61
-
62
-    @Test
63
-    public void testGetPattern() throws Exception {
64
-        assertEquals(PATTERN.toString(), sink.getPattern().toString());
65
-    }
66
-
67
-    @Test
68
-    public void testHandleMessage_NoActive() throws Exception {
69
-        when(activeFrameManager.getActiveFrame()).thenReturn(Optional.empty());
70
-        sink.handleMessage(messageSinkManager, frameContainer, null, date, "type", "message");
71
-        verify(frameContainer, never()).addLine("type", date, "message");
72
-    }
73
-
74
-    @Test
75
-    public void testHandleMessage_Active() throws Exception {
76
-        when(activeFrameManager.getActiveFrame()).thenReturn(Optional.of(textFrame));
77
-        sink.handleMessage(messageSinkManager, frameContainer, null, date, "type", "message");
78
-        verify(frameContainer).addLine("type", date, "message");
79
-    }
80
-}

+ 0
- 4
dcc/src/com/dmdirc/addons/dcc/ChatContainer.java View File

34
 import com.dmdirc.ui.core.components.WindowComponent;
34
 import com.dmdirc.ui.core.components.WindowComponent;
35
 import com.dmdirc.ui.input.TabCompleterFactory;
35
 import com.dmdirc.ui.input.TabCompleterFactory;
36
 import com.dmdirc.ui.messages.BackBufferFactory;
36
 import com.dmdirc.ui.messages.BackBufferFactory;
37
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
38
 import com.dmdirc.util.EventUtils;
37
 import com.dmdirc.util.EventUtils;
39
 
38
 
40
 import java.util.Arrays;
39
 import java.util.Arrays;
66
      * @param nick                My Current Nickname
65
      * @param nick                My Current Nickname
67
      * @param targetNick          Nickname of target
66
      * @param targetNick          Nickname of target
68
      * @param tabCompleterFactory The factory to use to create tab completers.
67
      * @param tabCompleterFactory The factory to use to create tab completers.
69
-     * @param messageSinkManager  The sink manager to use to dispatch messages.
70
      * @param eventBus            The bus to dispatch events on.
68
      * @param eventBus            The bus to dispatch events on.
71
      */
69
      */
72
     public ChatContainer(
70
     public ChatContainer(
79
             final String nick,
77
             final String nick,
80
             final String targetNick,
78
             final String targetNick,
81
             final TabCompleterFactory tabCompleterFactory,
79
             final TabCompleterFactory tabCompleterFactory,
82
-            final MessageSinkManager messageSinkManager,
83
             final DMDircMBassador eventBus) {
80
             final DMDircMBassador eventBus) {
84
         super(parent, title, "dcc-chat-inactive", configManager, backBufferFactory,
81
         super(parent, title, "dcc-chat-inactive", configManager, backBufferFactory,
85
                 new DCCCommandParser(configManager, commandController, eventBus),
82
                 new DCCCommandParser(configManager, commandController, eventBus),
86
-                messageSinkManager,
87
                 tabCompleterFactory,
83
                 tabCompleterFactory,
88
                 eventBus,
84
                 eventBus,
89
                 Arrays.asList(
85
                 Arrays.asList(

+ 1
- 7
dcc/src/com/dmdirc/addons/dcc/DCCCommand.java View File

49
 import com.dmdirc.ui.input.TabCompleterFactory;
49
 import com.dmdirc.ui.input.TabCompleterFactory;
50
 import com.dmdirc.ui.input.TabCompletionType;
50
 import com.dmdirc.ui.input.TabCompletionType;
51
 import com.dmdirc.ui.messages.BackBufferFactory;
51
 import com.dmdirc.ui.messages.BackBufferFactory;
52
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
53
 
52
 
54
 import java.awt.Window;
53
 import java.awt.Window;
55
 import java.io.File;
54
 import java.io.File;
74
     private final Window mainWindow;
73
     private final Window mainWindow;
75
     /** Window management. */
74
     /** Window management. */
76
     private final WindowManager windowManager;
75
     private final WindowManager windowManager;
77
-    /** The sink manager to use to dispatch messages. */
78
-    private final MessageSinkManager messageSinkManager;
79
     /** The factory to use for tab completers. */
76
     /** The factory to use for tab completers. */
80
     private final TabCompleterFactory tabCompleterFactory;
77
     private final TabCompleterFactory tabCompleterFactory;
81
     /** The bus to dispatch events on. */
78
     /** The bus to dispatch events on. */
90
             final CommandController controller,
87
             final CommandController controller,
91
             @MainWindow final Window mainWindow,
88
             @MainWindow final Window mainWindow,
92
             final DCCManager plugin,
89
             final DCCManager plugin,
93
-            final MessageSinkManager messageSinkManager,
94
             final WindowManager windowManager,
90
             final WindowManager windowManager,
95
             final TabCompleterFactory tabCompleterFactory,
91
             final TabCompleterFactory tabCompleterFactory,
96
             final DMDircMBassador eventBus,
92
             final DMDircMBassador eventBus,
98
         super(controller);
94
         super(controller);
99
         this.mainWindow = mainWindow;
95
         this.mainWindow = mainWindow;
100
         myPlugin = plugin;
96
         myPlugin = plugin;
101
-        this.messageSinkManager = messageSinkManager;
102
         this.windowManager = windowManager;
97
         this.windowManager = windowManager;
103
         this.tabCompleterFactory = tabCompleterFactory;
98
         this.tabCompleterFactory = tabCompleterFactory;
104
         this.eventBus = eventBus;
99
         this.eventBus = eventBus;
170
                     myNickname,
165
                     myNickname,
171
                     target,
166
                     target,
172
                     tabCompleterFactory,
167
                     tabCompleterFactory,
173
-                    messageSinkManager,
174
                     eventBus);
168
                     eventBus);
175
             windowManager.addWindow(myPlugin.getContainer(), window);
169
             windowManager.addWindow(myPlugin.getContainer(), window);
176
             parser.sendCTCP(target, "DCC", "CHAT chat " + DCC.ipToLong(
170
             parser.sendCTCP(target, "DCC", "CHAT chat " + DCC.ipToLong(
177
-                    myPlugin.getListenIP(parser)) + " " + chat.getPort());
171
+                    myPlugin.getListenIP(parser)) + ' ' + chat.getPort());
178
             eventBus.publish(new DccChatRequestSentEvent(connection, target));
172
             eventBus.publish(new DccChatRequestSentEvent(connection, target));
179
             sendLine(origin, isSilent, "DCCChatStarting", target, chat.getHost(), chat.getPort());
173
             sendLine(origin, isSilent, "DCCChatStarting", target, chat.getHost(), chat.getPort());
180
             window.addLine("DCCChatStarting", target, chat.getHost(), chat.getPort());
174
             window.addLine("DCCChatStarting", target, chat.getHost(), chat.getPort());

+ 0
- 4
dcc/src/com/dmdirc/addons/dcc/DCCFrameContainer.java View File

30
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
30
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
31
 import com.dmdirc.ui.input.TabCompleterFactory;
31
 import com.dmdirc.ui.input.TabCompleterFactory;
32
 import com.dmdirc.ui.messages.BackBufferFactory;
32
 import com.dmdirc.ui.messages.BackBufferFactory;
33
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
34
 
33
 
35
 import java.util.Collection;
34
 import java.util.Collection;
36
 import java.util.Optional;
35
 import java.util.Optional;
53
      * @param icon                The icon to use
52
      * @param icon                The icon to use
54
      * @param configManager       Config manager
53
      * @param configManager       Config manager
55
      * @param parser              Command parser to use for this window
54
      * @param parser              Command parser to use for this window
56
-     * @param messageSinkManager  The sink manager to use to dispatch messages.
57
      * @param tabCompleterFactory The factory to use to create tab completers.
55
      * @param tabCompleterFactory The factory to use to create tab completers.
58
      * @param eventBus            The bus to dispatch events on.
56
      * @param eventBus            The bus to dispatch events on.
59
      * @param components          The UI components that this frame requires
57
      * @param components          The UI components that this frame requires
65
             final AggregateConfigProvider configManager,
63
             final AggregateConfigProvider configManager,
66
             final BackBufferFactory backBufferFactory,
64
             final BackBufferFactory backBufferFactory,
67
             final CommandParser parser,
65
             final CommandParser parser,
68
-            final MessageSinkManager messageSinkManager,
69
             final TabCompleterFactory tabCompleterFactory,
66
             final TabCompleterFactory tabCompleterFactory,
70
             final DMDircMBassador eventBus,
67
             final DMDircMBassador eventBus,
71
             final Collection<String> components) {
68
             final Collection<String> components) {
72
         super(parent, icon, title, title, configManager, backBufferFactory,
69
         super(parent, icon, title, title, configManager, backBufferFactory,
73
                 tabCompleterFactory.getTabCompleter(configManager),
70
                 tabCompleterFactory.getTabCompleter(configManager),
74
-                messageSinkManager,
75
                 eventBus,
71
                 eventBus,
76
                 components);
72
                 components);
77
         initBackBuffer();
73
         initBackBuffer();

+ 0
- 6
dcc/src/com/dmdirc/addons/dcc/DCCManager.java View File

61
 import com.dmdirc.ui.WindowManager;
61
 import com.dmdirc.ui.WindowManager;
62
 import com.dmdirc.ui.input.TabCompleterFactory;
62
 import com.dmdirc.ui.input.TabCompleterFactory;
63
 import com.dmdirc.ui.messages.BackBufferFactory;
63
 import com.dmdirc.ui.messages.BackBufferFactory;
64
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
65
 
64
 
66
 import com.google.common.collect.Sets;
65
 import com.google.common.collect.Sets;
67
 
66
 
100
     private PlaceholderContainer container;
99
     private PlaceholderContainer container;
101
     /** Config manager to read settings from. */
100
     /** Config manager to read settings from. */
102
     private final AggregateConfigProvider config;
101
     private final AggregateConfigProvider config;
103
-    /** The sink manager to use to dispatch messages. */
104
-    private final MessageSinkManager messageSinkManager;
105
     /** Window Management. */
102
     /** Window Management. */
106
     private final WindowManager windowManager;
103
     private final WindowManager windowManager;
107
     /** The command controller to use. */
104
     /** The command controller to use. */
127
             final IdentityController identityController,
124
             final IdentityController identityController,
128
             @GlobalConfig final AggregateConfigProvider globalConfig,
125
             @GlobalConfig final AggregateConfigProvider globalConfig,
129
             final CommandController commandController,
126
             final CommandController commandController,
130
-            final MessageSinkManager messageSinkManager,
131
             final WindowManager windowManager,
127
             final WindowManager windowManager,
132
             final TabCompleterFactory tabCompleterFactory,
128
             final TabCompleterFactory tabCompleterFactory,
133
             final SwingWindowFactory windowFactory,
129
             final SwingWindowFactory windowFactory,
137
             @Directory(DirectoryType.BASE) final String baseDirectory,
133
             @Directory(DirectoryType.BASE) final String baseDirectory,
138
             final BackBufferFactory backBufferFactory) {
134
             final BackBufferFactory backBufferFactory) {
139
         this.mainWindow = mainWindow;
135
         this.mainWindow = mainWindow;
140
-        this.messageSinkManager = messageSinkManager;
141
         this.windowManager = windowManager;
136
         this.windowManager = windowManager;
142
         this.commandController = commandController;
137
         this.commandController = commandController;
143
         this.tabCompleterFactory = tabCompleterFactory;
138
         this.tabCompleterFactory = tabCompleterFactory;
476
                 myNickname,
471
                 myNickname,
477
                 nickname,
472
                 nickname,
478
                 tabCompleterFactory,
473
                 tabCompleterFactory,
479
-                messageSinkManager,
480
                 eventBus);
474
                 eventBus);
481
         windowManager.addWindow(getContainer(), f);
475
         windowManager.addWindow(getContainer(), f);
482
         f.addLine("DCCChatStarting", nickname, chat.getHost(), chat.getPort());
476
         f.addLine("DCCChatStarting", nickname, chat.getHost(), chat.getPort());

+ 0
- 3
debug/src/com/dmdirc/addons/debug/RawWindow.java View File

32
 import com.dmdirc.ui.core.components.WindowComponent;
32
 import com.dmdirc.ui.core.components.WindowComponent;
33
 import com.dmdirc.ui.input.TabCompleterFactory;
33
 import com.dmdirc.ui.input.TabCompleterFactory;
34
 import com.dmdirc.ui.messages.BackBufferFactory;
34
 import com.dmdirc.ui.messages.BackBufferFactory;
35
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
36
 
35
 
37
 import java.util.Arrays;
36
 import java.util.Arrays;
38
 import java.util.Optional;
37
 import java.util.Optional;
48
 
47
 
49
     public RawWindow(
48
     public RawWindow(
50
             final Connection connection,
49
             final Connection connection,
51
-            final MessageSinkManager messageSinkManager,
52
             final TabCompleterFactory tabCompleterFactory,
50
             final TabCompleterFactory tabCompleterFactory,
53
             final BackBufferFactory backBufferFactory) {
51
             final BackBufferFactory backBufferFactory) {
54
         super(connection.getWindowModel(), "raw", "Raw", "(Raw log)",
52
         super(connection.getWindowModel(), "raw", "Raw", "(Raw log)",
57
                 tabCompleterFactory.getTabCompleter(connection.getWindowModel().getTabCompleter(),
55
                 tabCompleterFactory.getTabCompleter(connection.getWindowModel().getTabCompleter(),
58
                         connection.getWindowModel().getConfigManager(),
56
                         connection.getWindowModel().getConfigManager(),
59
                         CommandType.TYPE_QUERY, CommandType.TYPE_CHAT),
57
                         CommandType.TYPE_QUERY, CommandType.TYPE_CHAT),
60
-                messageSinkManager,
61
                 connection.getWindowModel().getEventBus(),
58
                 connection.getWindowModel().getEventBus(),
62
                 Arrays.asList(WindowComponent.TEXTAREA.getIdentifier(),
59
                 Arrays.asList(WindowComponent.TEXTAREA.getIdentifier(),
63
                         WindowComponent.INPUTFIELD.getIdentifier()));
60
                         WindowComponent.INPUTFIELD.getIdentifier()));

+ 6
- 7
debug/src/com/dmdirc/addons/debug/RawWindowFactory.java View File

28
 import com.dmdirc.ui.WindowManager;
28
 import com.dmdirc.ui.WindowManager;
29
 import com.dmdirc.ui.input.TabCompleterFactory;
29
 import com.dmdirc.ui.input.TabCompleterFactory;
30
 import com.dmdirc.ui.messages.BackBufferFactory;
30
 import com.dmdirc.ui.messages.BackBufferFactory;
31
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
32
 
31
 
33
 import javax.inject.Inject;
32
 import javax.inject.Inject;
34
 import javax.inject.Singleton;
33
 import javax.inject.Singleton;
41
 
40
 
42
     private final TabCompleterFactory tabCompleterFactory;
41
     private final TabCompleterFactory tabCompleterFactory;
43
     private final CommandController commandController;
42
     private final CommandController commandController;
44
-    private final MessageSinkManager messageSinkManager;
45
     private final BackBufferFactory backBufferFactory;
43
     private final BackBufferFactory backBufferFactory;
46
     private final WindowManager windowManager;
44
     private final WindowManager windowManager;
47
 
45
 
48
     @Inject
46
     @Inject
49
-    public RawWindowFactory(final TabCompleterFactory tabCompleterFactory,
50
-            final CommandController commandController, final MessageSinkManager messageSinkManager,
51
-            final BackBufferFactory backBufferFactory, final WindowManager windowManager) {
47
+    public RawWindowFactory(
48
+            final TabCompleterFactory tabCompleterFactory,
49
+            final CommandController commandController,
50
+            final BackBufferFactory backBufferFactory,
51
+            final WindowManager windowManager) {
52
         this.tabCompleterFactory = tabCompleterFactory;
52
         this.tabCompleterFactory = tabCompleterFactory;
53
         this.commandController = commandController;
53
         this.commandController = commandController;
54
-        this.messageSinkManager = messageSinkManager;
55
         this.backBufferFactory = backBufferFactory;
54
         this.backBufferFactory = backBufferFactory;
56
         this.windowManager = windowManager;
55
         this.windowManager = windowManager;
57
     }
56
     }
58
 
57
 
59
     public RawWindow getRawWindow(final Connection connection) {
58
     public RawWindow getRawWindow(final Connection connection) {
60
         final RawWindow rawWindow = new RawWindow(connection,
59
         final RawWindow rawWindow = new RawWindow(connection,
61
-                messageSinkManager, tabCompleterFactory,  backBufferFactory);
60
+                tabCompleterFactory,  backBufferFactory);
62
         rawWindow.setCommandParser(new ServerCommandParser(
61
         rawWindow.setCommandParser(new ServerCommandParser(
63
                 connection.getWindowModel().getConfigManager(),
62
                 connection.getWindowModel().getConfigManager(),
64
                 commandController,
63
                 commandController,

+ 1
- 4
redirect/src/com/dmdirc/addons/redirect/FakeWriteableFrameContainer.java View File

28
 import com.dmdirc.interfaces.WindowModel;
28
 import com.dmdirc.interfaces.WindowModel;
29
 import com.dmdirc.ui.messages.BackBufferFactory;
29
 import com.dmdirc.ui.messages.BackBufferFactory;
30
 import com.dmdirc.ui.messages.Formatter;
30
 import com.dmdirc.ui.messages.Formatter;
31
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
32
 
31
 
33
 import java.util.Collections;
32
 import java.util.Collections;
34
 import java.util.Date;
33
 import java.util.Date;
47
      */
46
      */
48
     public FakeWriteableFrameContainer(
47
     public FakeWriteableFrameContainer(
49
             final WindowModel target,
48
             final WindowModel target,
50
-            final MessageSinkManager messageSinkManager,
51
             final DMDircMBassador eventBus,
49
             final DMDircMBassador eventBus,
52
             final BackBufferFactory backBufferFactory) {
50
             final BackBufferFactory backBufferFactory) {
53
         super(target, target.getIcon(), target.getName(), target.getTitle(),
51
         super(target, target.getIcon(), target.getName(), target.getTitle(),
54
                 target.getConfigManager(), backBufferFactory,
52
                 target.getConfigManager(), backBufferFactory,
55
-                target.getTabCompleter(), messageSinkManager, eventBus,
56
-                Collections.<String>emptyList());
53
+                target.getTabCompleter(), eventBus, Collections.<String>emptyList());
57
         this.target = target;
54
         this.target = target;
58
         initBackBuffer();
55
         initBackBuffer();
59
         setCommandParser(target.getCommandParser());
56
         setCommandParser(target.getCommandParser());

+ 1
- 6
redirect/src/com/dmdirc/addons/redirect/RedirectCommand.java View File

36
 import com.dmdirc.ui.input.AdditionalTabTargets;
36
 import com.dmdirc.ui.input.AdditionalTabTargets;
37
 import com.dmdirc.ui.input.TabCompleterUtils;
37
 import com.dmdirc.ui.input.TabCompleterUtils;
38
 import com.dmdirc.ui.messages.BackBufferFactory;
38
 import com.dmdirc.ui.messages.BackBufferFactory;
39
-import com.dmdirc.ui.messages.sink.MessageSinkManager;
40
 
39
 
41
 import javax.annotation.Nonnull;
40
 import javax.annotation.Nonnull;
42
 import javax.inject.Inject;
41
 import javax.inject.Inject;
52
             "redirect <command> - sends the output of the command to a "
51
             "redirect <command> - sends the output of the command to a "
53
             + "channel or query window",
52
             + "channel or query window",
54
             CommandType.TYPE_CHAT);
53
             CommandType.TYPE_CHAT);
55
-    /** The sink manager to use to dispatch messages. */
56
-    private final MessageSinkManager messageSinkManager;
57
     /** The bus to dispatch events on. */
54
     /** The bus to dispatch events on. */
58
     private final DMDircMBassador eventBus;
55
     private final DMDircMBassador eventBus;
59
     private final BackBufferFactory backBufferFactory;
56
     private final BackBufferFactory backBufferFactory;
66
     @Inject
63
     @Inject
67
     public RedirectCommand(
64
     public RedirectCommand(
68
             final CommandController controller,
65
             final CommandController controller,
69
-            final MessageSinkManager messageSinkManager,
70
             final DMDircMBassador eventBus,
66
             final DMDircMBassador eventBus,
71
             final BackBufferFactory backBufferFactory,
67
             final BackBufferFactory backBufferFactory,
72
             final TabCompleterUtils tabCompleterUtils) {
68
             final TabCompleterUtils tabCompleterUtils) {
73
         super(controller);
69
         super(controller);
74
-        this.messageSinkManager = messageSinkManager;
75
         this.eventBus = eventBus;
70
         this.eventBus = eventBus;
76
         this.backBufferFactory = backBufferFactory;
71
         this.backBufferFactory = backBufferFactory;
77
         this.tabCompleterUtils = tabCompleterUtils;
72
         this.tabCompleterUtils = tabCompleterUtils;
83
         final Chat target = ((ChatCommandContext) context).getChat();
78
         final Chat target = ((ChatCommandContext) context).getChat();
84
         target.getWindowModel().getCommandParser().parseCommand(
79
         target.getWindowModel().getCommandParser().parseCommand(
85
                 new FakeWriteableFrameContainer(target.getWindowModel(),
80
                 new FakeWriteableFrameContainer(target.getWindowModel(),
86
-                        messageSinkManager, eventBus, backBufferFactory),
81
+                        eventBus, backBufferFactory),
87
                 args.getArgumentsAsString());
82
                 args.getArgumentsAsString());
88
     }
83
     }
89
 
84
 

Loading…
Cancel
Save