Browse Source

Remove windows from commands

Change-Id: I895be099fa526e4e4b566e7178120b5d1ad0912c
Depends-On: I5b6e7e2ca81d114028fef6cac0d88498def62ea0
Reviewed-on: http://gerrit.dmdirc.com/2012
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.7rc1
Greg Holmes 13 years ago
parent
commit
5f76f5b75c
30 changed files with 223 additions and 62 deletions
  1. 1
    1
      src/com/dmdirc/addons/activewindow/ActiveCommand.java
  2. 5
    1
      src/com/dmdirc/addons/debug/commands/FirstRun.java
  3. 3
    4
      src/com/dmdirc/addons/debug/commands/Time.java
  4. 2
    2
      src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java
  5. 1
    1
      src/com/dmdirc/addons/redirect/RedirectCommand.java
  6. 4
    4
      src/com/dmdirc/addons/tabcompletion_bash/BashStyle.java
  7. 2
    2
      src/com/dmdirc/addons/tabcompletion_bash/BashStylePlugin.java
  8. 6
    6
      src/com/dmdirc/addons/tabcompletion_mirc/MircStyle.java
  9. 2
    2
      src/com/dmdirc/addons/tabcompletion_mirc/MircStylePlugin.java
  10. 2
    7
      src/com/dmdirc/addons/time/TimedCommand.java
  11. 1
    1
      src/com/dmdirc/addons/time/TimerCommand.java
  12. 2
    5
      src/com/dmdirc/addons/time/TimerManager.java
  13. 4
    2
      src/com/dmdirc/addons/ui_dummy/DummyInputHandler.java
  14. 2
    1
      src/com/dmdirc/addons/ui_dummy/DummyInputWindow.java
  15. 25
    0
      src/com/dmdirc/addons/ui_swing/SwingController.java
  16. 1
    1
      src/com/dmdirc/addons/ui_swing/actions/CommandAction.java
  17. 67
    0
      src/com/dmdirc/addons/ui_swing/commands/ChannelSettings.java
  18. 67
    0
      src/com/dmdirc/addons/ui_swing/commands/ServerSettings.java
  19. 3
    2
      src/com/dmdirc/addons/ui_swing/components/TopicBar.java
  20. 1
    1
      src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java
  21. 1
    1
      src/com/dmdirc/addons/ui_swing/components/frames/CustomInputFrame.java
  22. 1
    1
      src/com/dmdirc/addons/ui_swing/components/frames/ServerFrame.java
  23. 4
    4
      src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java
  24. 3
    2
      src/com/dmdirc/addons/ui_swing/components/inputfields/SwingInputHandler.java
  25. 1
    1
      src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicDisplayPane.java
  26. 1
    1
      src/com/dmdirc/addons/ui_swing/dialogs/paste/PasteDialog.java
  27. 5
    4
      src/com/dmdirc/addons/ui_swing/textpane/TextPane.java
  28. 2
    1
      src/com/dmdirc/addons/ui_web/uicomponents/WebInputHandler.java
  29. 2
    2
      src/com/dmdirc/addons/ui_web/uicomponents/WebInputWindow.java
  30. 2
    2
      test/com/dmdirc/addons/redirect/RedirectCommandTest.java

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

66
         final TextFrame frame = mainFrame.getActiveFrame();
66
         final TextFrame frame = mainFrame.getActiveFrame();
67
         if (frame.getContainer() instanceof WritableFrameContainer) {
67
         if (frame.getContainer() instanceof WritableFrameContainer) {
68
             ((WritableFrameContainer) frame.getContainer()).getCommandParser()
68
             ((WritableFrameContainer) frame.getContainer()).getCommandParser()
69
-                    .parseCommand(frame.getContainer(), context.getSource(),
69
+                    .parseCommand(frame.getContainer(),
70
                     args.getArgumentsAsString());
70
                     args.getArgumentsAsString());
71
         }
71
         }
72
     }
72
     }

+ 5
- 1
src/com/dmdirc/addons/debug/commands/FirstRun.java View File

25
 import com.dmdirc.FrameContainer;
25
 import com.dmdirc.FrameContainer;
26
 import com.dmdirc.addons.debug.Debug;
26
 import com.dmdirc.addons.debug.Debug;
27
 import com.dmdirc.addons.debug.DebugCommand;
27
 import com.dmdirc.addons.debug.DebugCommand;
28
+import com.dmdirc.addons.ui_swing.SwingController;
28
 import com.dmdirc.commandparser.CommandArguments;
29
 import com.dmdirc.commandparser.CommandArguments;
29
 import com.dmdirc.commandparser.commands.context.CommandContext;
30
 import com.dmdirc.commandparser.commands.context.CommandContext;
31
+import com.dmdirc.plugins.PluginManager;
30
 
32
 
31
 /**
33
 /**
32
  * Opens the DMDirc first run wizard.
34
  * Opens the DMDirc first run wizard.
58
     @Override
60
     @Override
59
     public void execute(final FrameContainer origin,
61
     public void execute(final FrameContainer origin,
60
             final CommandArguments args, final CommandContext context) {
62
             final CommandArguments args, final CommandContext context) {
61
-        context.getSource().getController().showFirstRunWizard();
63
+        ((SwingController) PluginManager.getPluginManager()
64
+                .getPluginInfoByName("ui_swing").getPlugin())
65
+                .showFirstRunWizard();
62
     }
66
     }
63
 
67
 
64
 }
68
 }

+ 3
- 4
src/com/dmdirc/addons/debug/commands/Time.java View File

31
 import com.dmdirc.commandparser.commands.context.CommandContext;
31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
 import com.dmdirc.ui.input.AdditionalTabTargets;
32
 import com.dmdirc.ui.input.AdditionalTabTargets;
33
 import com.dmdirc.ui.input.TabCompletionType;
33
 import com.dmdirc.ui.input.TabCompletionType;
34
-import com.dmdirc.ui.interfaces.Window;
35
 
34
 
36
 /**
35
 /**
37
  * Times how long it takes to execute commands.
36
  * Times how long it takes to execute commands.
63
     @Override
62
     @Override
64
     public void execute(final FrameContainer origin,
63
     public void execute(final FrameContainer origin,
65
             final CommandArguments args, final CommandContext context) {
64
             final CommandArguments args, final CommandContext context) {
66
-        doTime(origin, context.getSource(), args);
65
+        doTime(origin, args);
67
     }
66
     }
68
 
67
 
69
     /**
68
     /**
73
      * @param window The window to be passed on to the timed command, if any
72
      * @param window The window to be passed on to the timed command, if any
74
      * @param args The arguments that were passed to the command
73
      * @param args The arguments that were passed to the command
75
      */
74
      */
76
-    private void doTime(final FrameContainer origin, final Window window,
75
+    private void doTime(final FrameContainer origin,
77
             final CommandArguments args) {
76
             final CommandArguments args) {
78
         if (args.getArguments().length == 0) {
77
         if (args.getArguments().length == 0) {
79
             showUsage(origin, args.isSilent(), getName(), getUsage());
78
             showUsage(origin, args.isSilent(), getName(), getUsage());
84
             final WritableFrameContainer container
83
             final WritableFrameContainer container
85
                     = (WritableFrameContainer) origin;
84
                     = (WritableFrameContainer) origin;
86
             final long start = System.currentTimeMillis();
85
             final long start = System.currentTimeMillis();
87
-            container.getCommandParser().parseCommand(origin, window,
86
+            container.getCommandParser().parseCommand(origin,
88
                     args.getArgumentsAsString(0));
87
                     args.getArgumentsAsString(0));
89
             final long end = System.currentTimeMillis();
88
             final long end = System.currentTimeMillis();
90
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
89
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT,

+ 2
- 2
src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java View File

80
                     if (source.getState() == MediaSourceState.CLOSED) {
80
                     if (source.getState() == MediaSourceState.CLOSED) {
81
                         sendLine(origin, args.isSilent(), FORMAT_ERROR, "Source is not running.");
81
                         sendLine(origin, args.isSilent(), FORMAT_ERROR, "Source is not running.");
82
                     } else {
82
                     } else {
83
-                        target.getCommandParser().parseCommand(origin, context.getSource(),
83
+                        target.getCommandParser().parseCommand(origin,
84
                                 getInformation(source, args.getArgumentsAsString(2)));
84
                                 getInformation(source, args.getArgumentsAsString(2)));
85
                     }
85
                     }
86
                 }
86
                 }
90
             }
90
             }
91
         } else {
91
         } else {
92
             if (parent.hasRunningSource()) {
92
             if (parent.hasRunningSource()) {
93
-                target.getCommandParser().parseCommand(origin, context.getSource(),
93
+                target.getCommandParser().parseCommand(origin,
94
                         getInformation(parent.getBestSource(), args.
94
                         getInformation(parent.getBestSource(), args.
95
                         getArgumentsAsString(0)));
95
                         getArgumentsAsString(0)));
96
             } else {
96
             } else {

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

49
         final MessageTarget target = ((ChatCommandContext) context)
49
         final MessageTarget target = ((ChatCommandContext) context)
50
                 .getChat();
50
                 .getChat();
51
         target.getCommandParser().parseCommand(new FakeWriteableFrameContainer(
51
         target.getCommandParser().parseCommand(new FakeWriteableFrameContainer(
52
-                target), context.getSource(), args.getArgumentsAsString());
52
+                target), args.getArgumentsAsString());
53
     }
53
     }
54
 
54
 
55
     /** {@inheritDoc} */
55
     /** {@inheritDoc} */

+ 4
- 4
src/com/dmdirc/addons/tabcompletion_bash/BashStyle.java View File

22
 
22
 
23
 package com.dmdirc.addons.tabcompletion_bash;
23
 package com.dmdirc.addons.tabcompletion_bash;
24
 
24
 
25
+import com.dmdirc.WritableFrameContainer;
25
 import com.dmdirc.ui.input.AdditionalTabTargets;
26
 import com.dmdirc.ui.input.AdditionalTabTargets;
26
 import com.dmdirc.ui.input.TabCompleter;
27
 import com.dmdirc.ui.input.TabCompleter;
27
 import com.dmdirc.ui.input.TabCompleterResult;
28
 import com.dmdirc.ui.input.TabCompleterResult;
28
 import com.dmdirc.ui.input.tabstyles.TabCompletionResult;
29
 import com.dmdirc.ui.input.tabstyles.TabCompletionResult;
29
 import com.dmdirc.ui.input.tabstyles.TabCompletionStyle;
30
 import com.dmdirc.ui.input.tabstyles.TabCompletionStyle;
30
-import com.dmdirc.ui.interfaces.InputWindow;
31
 
31
 
32
 import java.awt.Toolkit;
32
 import java.awt.Toolkit;
33
 
33
 
46
     protected final TabCompleter tabCompleter;
46
     protected final TabCompleter tabCompleter;
47
 
47
 
48
     /** The input window that we use. */
48
     /** The input window that we use. */
49
-    protected final InputWindow window;
49
+    protected final WritableFrameContainer window;
50
 
50
 
51
     /**
51
     /**
52
      * Creates a new Bash-style tab completer.
52
      * Creates a new Bash-style tab completer.
54
      * @param completer The tab completer this style is for
54
      * @param completer The tab completer this style is for
55
      * @param window The window this tab style is for
55
      * @param window The window this tab style is for
56
      */
56
      */
57
-    public BashStyle(final TabCompleter completer, final InputWindow window) {
57
+    public BashStyle(final TabCompleter completer, final WritableFrameContainer window) {
58
         this.tabCompleter = completer;
58
         this.tabCompleter = completer;
59
         this.window = window;
59
         this.window = window;
60
     }
60
     }
92
 
92
 
93
             final String sub = res.getBestSubstring();
93
             final String sub = res.getBestSubstring();
94
             if (sub.equalsIgnoreCase(word) && tabCount >= 2) {
94
             if (sub.equalsIgnoreCase(word) && tabCount >= 2) {
95
-                window.getContainer().addLine("tabCompletion", res.toString());
95
+                window.addLine("tabCompletion", res.toString());
96
 
96
 
97
                 return null;
97
                 return null;
98
             } else {
98
             } else {

+ 2
- 2
src/com/dmdirc/addons/tabcompletion_bash/BashStylePlugin.java View File

22
 
22
 
23
 package com.dmdirc.addons.tabcompletion_bash;
23
 package com.dmdirc.addons.tabcompletion_bash;
24
 
24
 
25
+import com.dmdirc.WritableFrameContainer;
25
 import com.dmdirc.plugins.BasePlugin;
26
 import com.dmdirc.plugins.BasePlugin;
26
 import com.dmdirc.ui.input.TabCompleter;
27
 import com.dmdirc.ui.input.TabCompleter;
27
 import com.dmdirc.ui.input.tabstyles.TabCompletionStyle;
28
 import com.dmdirc.ui.input.tabstyles.TabCompletionStyle;
28
-import com.dmdirc.ui.interfaces.InputWindow;
29
 
29
 
30
 public class BashStylePlugin extends BasePlugin {
30
 public class BashStylePlugin extends BasePlugin {
31
 
31
 
49
      * @return A relevant TabCompletionStyle
49
      * @return A relevant TabCompletionStyle
50
      */
50
      */
51
     public TabCompletionStyle getCompletionStyle(final TabCompleter completer,
51
     public TabCompletionStyle getCompletionStyle(final TabCompleter completer,
52
-            final InputWindow window) {
52
+            final WritableFrameContainer window) {
53
         return new BashStyle(completer, window);
53
         return new BashStyle(completer, window);
54
     }
54
     }
55
 
55
 

+ 6
- 6
src/com/dmdirc/addons/tabcompletion_mirc/MircStyle.java View File

23
 package com.dmdirc.addons.tabcompletion_mirc;
23
 package com.dmdirc.addons.tabcompletion_mirc;
24
 
24
 
25
 import com.dmdirc.Channel;
25
 import com.dmdirc.Channel;
26
+import com.dmdirc.WritableFrameContainer;
26
 import com.dmdirc.ui.input.AdditionalTabTargets;
27
 import com.dmdirc.ui.input.AdditionalTabTargets;
27
 import com.dmdirc.ui.input.TabCompleter;
28
 import com.dmdirc.ui.input.TabCompleter;
28
 import com.dmdirc.ui.input.TabCompleterResult;
29
 import com.dmdirc.ui.input.TabCompleterResult;
29
 import com.dmdirc.ui.input.tabstyles.TabCompletionResult;
30
 import com.dmdirc.ui.input.tabstyles.TabCompletionResult;
30
 import com.dmdirc.ui.input.tabstyles.TabCompletionStyle;
31
 import com.dmdirc.ui.input.tabstyles.TabCompletionStyle;
31
-import com.dmdirc.ui.interfaces.InputWindow;
32
 
32
 
33
 import java.awt.Toolkit;
33
 import java.awt.Toolkit;
34
 import java.util.Collections;
34
 import java.util.Collections;
45
     protected final TabCompleter tabCompleter;
45
     protected final TabCompleter tabCompleter;
46
 
46
 
47
     /** The input window that we use. */
47
     /** The input window that we use. */
48
-    protected final InputWindow window;
48
+    protected final WritableFrameContainer window;
49
 
49
 
50
     /**
50
     /**
51
      * Creates a new mIRC-style tab completer.
51
      * Creates a new mIRC-style tab completer.
53
      * @param completer The tab completer this style is for
53
      * @param completer The tab completer this style is for
54
      * @param window The window this tab style is for
54
      * @param window The window this tab style is for
55
      */
55
      */
56
-    public MircStyle(final TabCompleter completer, final InputWindow window) {
56
+    public MircStyle(final TabCompleter completer, final WritableFrameContainer window) {
57
         this.tabCompleter = completer;
57
         this.tabCompleter = completer;
58
         this.window = window;
58
         this.window = window;
59
     }
59
     }
83
             } else {
83
             } else {
84
                 Collections.sort(res.getResults(), String.CASE_INSENSITIVE_ORDER);
84
                 Collections.sort(res.getResults(), String.CASE_INSENSITIVE_ORDER);
85
 
85
 
86
-                if (word.length() > 0 && window.getContainer() instanceof Channel
87
-                        && ((Channel) window.getContainer())
86
+                if (word.length() > 0 && window instanceof Channel
87
+                        && ((Channel) window)
88
                         .getChannelInfo().getName().startsWith(word)) {
88
                         .getChannelInfo().getName().startsWith(word)) {
89
-                    target = ((Channel) window.getContainer()).getChannelInfo().getName();
89
+                    target = ((Channel) window).getChannelInfo().getName();
90
                 } else {
90
                 } else {
91
                     target = res.getResults().get(0);
91
                     target = res.getResults().get(0);
92
                 }
92
                 }

+ 2
- 2
src/com/dmdirc/addons/tabcompletion_mirc/MircStylePlugin.java View File

22
 
22
 
23
 package com.dmdirc.addons.tabcompletion_mirc;
23
 package com.dmdirc.addons.tabcompletion_mirc;
24
 
24
 
25
+import com.dmdirc.WritableFrameContainer;
25
 import com.dmdirc.plugins.BasePlugin;
26
 import com.dmdirc.plugins.BasePlugin;
26
 import com.dmdirc.ui.input.TabCompleter;
27
 import com.dmdirc.ui.input.TabCompleter;
27
 import com.dmdirc.ui.input.tabstyles.TabCompletionStyle;
28
 import com.dmdirc.ui.input.tabstyles.TabCompletionStyle;
28
-import com.dmdirc.ui.interfaces.InputWindow;
29
 
29
 
30
 public class MircStylePlugin extends BasePlugin {
30
 public class MircStylePlugin extends BasePlugin {
31
 
31
 
49
      * @return A relevant TabCompletionStyle
49
      * @return A relevant TabCompletionStyle
50
      */
50
      */
51
     public TabCompletionStyle getCompletionStyle(final TabCompleter completer,
51
     public TabCompletionStyle getCompletionStyle(final TabCompleter completer,
52
-            final InputWindow window) {
52
+            final WritableFrameContainer window) {
53
         return new MircStyle(completer, window);
53
         return new MircStyle(completer, window);
54
     }
54
     }
55
 
55
 

+ 2
- 7
src/com/dmdirc/addons/time/TimedCommand.java View File

27
 import com.dmdirc.WritableFrameContainer;
27
 import com.dmdirc.WritableFrameContainer;
28
 import com.dmdirc.commandparser.parsers.CommandParser;
28
 import com.dmdirc.commandparser.parsers.CommandParser;
29
 import com.dmdirc.commandparser.parsers.GlobalCommandParser;
29
 import com.dmdirc.commandparser.parsers.GlobalCommandParser;
30
-import com.dmdirc.ui.interfaces.Window;
31
 
30
 
32
 import java.util.Timer;
31
 import java.util.Timer;
33
 import java.util.TimerTask;
32
 import java.util.TimerTask;
46
     /** The container to use for executing commands. */
45
     /** The container to use for executing commands. */
47
     private final FrameContainer origin;
46
     private final FrameContainer origin;
48
 
47
 
49
-    /** The window the command came from. */
50
-    private final Window window;
51
-
52
     /** The timer we're using for scheduling this command. */
48
     /** The timer we're using for scheduling this command. */
53
     private final Timer timer;
49
     private final Timer timer;
54
 
50
 
69
      */
65
      */
70
     public TimedCommand(final TimerManager manager, final int timerKey,
66
     public TimedCommand(final TimerManager manager, final int timerKey,
71
             final int repetitions, final int delay, final String command,
67
             final int repetitions, final int delay, final String command,
72
-            final FrameContainer origin, final Window window) {
68
+            final FrameContainer origin) {
73
         super();
69
         super();
74
 
70
 
75
         this.timerKey = timerKey;
71
         this.timerKey = timerKey;
76
         this.repetitions = repetitions;
72
         this.repetitions = repetitions;
77
         this.command = command;
73
         this.command = command;
78
         this.origin = origin;
74
         this.origin = origin;
79
-        this.window = window;
80
         this.manager = manager;
75
         this.manager = manager;
81
 
76
 
82
         timer = new Timer("Timed Command Timer");
77
         timer = new Timer("Timed Command Timer");
113
             parser = ((WritableFrameContainer) origin).getCommandParser();
108
             parser = ((WritableFrameContainer) origin).getCommandParser();
114
         }
109
         }
115
 
110
 
116
-        parser.parseCommand(origin, window, command);
111
+        parser.parseCommand(origin, command);
117
 
112
 
118
         if (--repetitions <= 0) {
113
         if (--repetitions <= 0) {
119
             manager.removeTimer(timerKey);
114
             manager.removeTimer(timerKey);

+ 1
- 1
src/com/dmdirc/addons/time/TimerCommand.java View File

119
                     }
119
                     }
120
 
120
 
121
                     manager.addTimer(repetitions, interval, command,
121
                     manager.addTimer(repetitions, interval, command,
122
-                            origin, context.getSource());
122
+                            origin);
123
 
123
 
124
                     sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Command scheduled.");
124
                     sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Command scheduled.");
125
                 }
125
                 }

+ 2
- 5
src/com/dmdirc/addons/time/TimerManager.java View File

23
 package com.dmdirc.addons.time;
23
 package com.dmdirc.addons.time;
24
 
24
 
25
 import com.dmdirc.FrameContainer;
25
 import com.dmdirc.FrameContainer;
26
-import com.dmdirc.ui.interfaces.Window;
27
 
26
 
28
 import java.util.HashMap;
27
 import java.util.HashMap;
29
 import java.util.Map;
28
 import java.util.Map;
52
      * @param interval Interval between repetitions
51
      * @param interval Interval between repetitions
53
      * @param command Command to be run when the timer fires
52
      * @param command Command to be run when the timer fires
54
      * @param origin The frame container to use for the execution
53
      * @param origin The frame container to use for the execution
55
-     * @param commandContext The window the command came from
56
      */
54
      */
57
     public void addTimer(final int repetitions, final int interval,
55
     public void addTimer(final int repetitions, final int interval,
58
-            final String command, final FrameContainer origin,
59
-            final Window commandContext) {
56
+            final String command, final FrameContainer origin) {
60
 
57
 
61
         synchronized (this) {
58
         synchronized (this) {
62
             final int timerKey = findFreeKey();
59
             final int timerKey = findFreeKey();
63
             timerList.put(timerKey, new TimedCommand(this, timerKey,
60
             timerList.put(timerKey, new TimedCommand(this, timerKey,
64
-                    repetitions, interval, command, origin, commandContext));
61
+                    repetitions, interval, command, origin));
65
         }
62
         }
66
     }
63
     }
67
 
64
 

+ 4
- 2
src/com/dmdirc/addons/ui_dummy/DummyInputHandler.java View File

22
 
22
 
23
 package com.dmdirc.addons.ui_dummy;
23
 package com.dmdirc.addons.ui_dummy;
24
 
24
 
25
+import com.dmdirc.WritableFrameContainer;
25
 import com.dmdirc.commandparser.parsers.CommandParser;
26
 import com.dmdirc.commandparser.parsers.CommandParser;
26
 import com.dmdirc.ui.input.InputHandler;
27
 import com.dmdirc.ui.input.InputHandler;
27
 import com.dmdirc.ui.interfaces.InputField;
28
 import com.dmdirc.ui.interfaces.InputField;
28
-import com.dmdirc.ui.interfaces.InputWindow;
29
 
29
 
30
 /**
30
 /**
31
  * Dummy input handler.
31
  * Dummy input handler.
40
      * @param commandParser The command parser to use for this text field.
40
      * @param commandParser The command parser to use for this text field.
41
      * @param parentWindow The window that owns this input handler
41
      * @param parentWindow The window that owns this input handler
42
      */
42
      */
43
-    public DummyInputHandler(final InputField target, final CommandParser commandParser, final InputWindow parentWindow) {
43
+    public DummyInputHandler(final InputField target,
44
+            final CommandParser commandParser,
45
+            final WritableFrameContainer parentWindow) {
44
         super(target, commandParser, parentWindow);
46
         super(target, commandParser, parentWindow);
45
     }
47
     }
46
 
48
 

+ 2
- 1
src/com/dmdirc/addons/ui_dummy/DummyInputWindow.java View File

50
     /** {@inheritDoc} */
50
     /** {@inheritDoc} */
51
     @Override
51
     @Override
52
     public InputHandler getInputHandler() {
52
     public InputHandler getInputHandler() {
53
-        return new DummyInputHandler(new DummyInputField(), null, this);
53
+        return new DummyInputHandler(new DummyInputField(), null,
54
+                getContainer());
54
     }
55
     }
55
 
56
 
56
     /** {@inheritDoc} */
57
     /** {@inheritDoc} */

+ 25
- 0
src/com/dmdirc/addons/ui_swing/SwingController.java View File

25
 import com.dmdirc.Channel;
25
 import com.dmdirc.Channel;
26
 import com.dmdirc.FrameContainer;
26
 import com.dmdirc.FrameContainer;
27
 import com.dmdirc.Server;
27
 import com.dmdirc.Server;
28
+import com.dmdirc.addons.ui_swing.commands.*; //NOPMD
28
 import com.dmdirc.addons.ui_swing.components.addonpanel.AddonPanel;
29
 import com.dmdirc.addons.ui_swing.components.addonpanel.AddonPanel;
29
 import com.dmdirc.addons.ui_swing.components.addonpanel.PluginPanel;
30
 import com.dmdirc.addons.ui_swing.components.addonpanel.PluginPanel;
30
 import com.dmdirc.addons.ui_swing.components.addonpanel.ThemePanel;
31
 import com.dmdirc.addons.ui_swing.components.addonpanel.ThemePanel;
42
 import com.dmdirc.addons.ui_swing.dialogs.url.URLDialog;
43
 import com.dmdirc.addons.ui_swing.dialogs.url.URLDialog;
43
 import com.dmdirc.addons.ui_swing.wizard.WizardListener;
44
 import com.dmdirc.addons.ui_swing.wizard.WizardListener;
44
 import com.dmdirc.addons.ui_swing.wizard.firstrun.SwingFirstRunWizard;
45
 import com.dmdirc.addons.ui_swing.wizard.firstrun.SwingFirstRunWizard;
46
+import com.dmdirc.commandparser.CommandInfo;
47
+import com.dmdirc.commandparser.CommandManager;
45
 import com.dmdirc.config.Identity;
48
 import com.dmdirc.config.Identity;
46
 import com.dmdirc.config.IdentityManager;
49
 import com.dmdirc.config.IdentityManager;
47
 import com.dmdirc.config.prefs.PluginPreferencesCategory;
50
 import com.dmdirc.config.prefs.PluginPreferencesCategory;
114
     private DMDircEventQueue eventQueue;
117
     private DMDircEventQueue eventQueue;
115
     /** Key listener to handle dialog key events. */
118
     /** Key listener to handle dialog key events. */
116
     private DialogKeyListener keyListener;
119
     private DialogKeyListener keyListener;
120
+    /** List of commands to load and unload. */
121
+    private final List<CommandInfo> commands = new ArrayList<CommandInfo>();
117
 
122
 
118
     /** Instantiates a new SwingController. */
123
     /** Instantiates a new SwingController. */
119
     public SwingController() {
124
     public SwingController() {
491
                     "Main frame not created. Unable to continue.");
496
                     "Main frame not created. Unable to continue.");
492
         }
497
         }
493
 
498
 
499
+        loadCommands();
500
+
494
         WindowManager.getWindowManager().addListenerAndSync(windowFactory);
501
         WindowManager.getWindowManager().addListenerAndSync(windowFactory);
495
     }
502
     }
496
 
503
 
504
+    /** Loads the commands provided by this plugin. */
505
+    private void loadCommands() {
506
+        commands.add(ServerSettings.INFO);
507
+        commands.add(ChannelSettings.INFO);
508
+        CommandManager.getCommandManager().registerCommand(
509
+                new ServerSettings(), ServerSettings.INFO);
510
+        CommandManager.getCommandManager().registerCommand(
511
+                new ChannelSettings(), ChannelSettings.INFO);
512
+    }
513
+
497
     /** {@inheritDoc} */
514
     /** {@inheritDoc} */
498
     @Override
515
     @Override
499
     public void onUnload() {
516
     public void onUnload() {
509
         for (java.awt.Window window : getTopLevelWindows()) {
526
         for (java.awt.Window window : getTopLevelWindows()) {
510
             window.dispose();
527
             window.dispose();
511
         }
528
         }
529
+        unloadCommands();
530
+    }
531
+
532
+    /** Unloads the commands loaded by this plugin. */
533
+    private void unloadCommands() {
534
+        for (CommandInfo command : commands) {
535
+            CommandManager.getCommandManager().unregisterCommand(command);
536
+        }
512
     }
537
     }
513
 
538
 
514
     /** {@inheritDoc} */
539
     /** {@inheritDoc} */

+ 1
- 1
src/com/dmdirc/addons/ui_swing/actions/CommandAction.java View File

75
     @Override
75
     @Override
76
     public void actionPerformed(final ActionEvent e) {
76
     public void actionPerformed(final ActionEvent e) {
77
         for (String line : command.split("\n")) {
77
         for (String line : command.split("\n")) {
78
-            parser.parseCommand(window.getContainer(), window, line);
78
+            parser.parseCommand(window.getContainer(), line);
79
         }
79
         }
80
     }
80
     }
81
 
81
 

+ 67
- 0
src/com/dmdirc/addons/ui_swing/commands/ChannelSettings.java View File

1
+/*
2
+ * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
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.ui_swing.commands;
24
+
25
+import com.dmdirc.FrameContainer;
26
+import com.dmdirc.addons.ui_swing.SwingController;
27
+import com.dmdirc.commandparser.BaseCommandInfo;
28
+import com.dmdirc.commandparser.CommandArguments;
29
+import com.dmdirc.commandparser.CommandInfo;
30
+import com.dmdirc.commandparser.CommandType;
31
+import com.dmdirc.commandparser.commands.Command;
32
+import com.dmdirc.commandparser.commands.CommandOptions;
33
+import com.dmdirc.commandparser.commands.IntelligentCommand;
34
+import com.dmdirc.commandparser.commands.context.ChannelCommandContext;
35
+import com.dmdirc.commandparser.commands.context.CommandContext;
36
+import com.dmdirc.plugins.PluginManager;
37
+import com.dmdirc.ui.input.AdditionalTabTargets;
38
+
39
+/**
40
+ * Opens the channel settings window for the channel.
41
+ */
42
+@CommandOptions(allowOffline = false)
43
+public class ChannelSettings extends Command implements
44
+        IntelligentCommand {
45
+
46
+    /** A command info object for this command. */
47
+    public static final CommandInfo INFO = new BaseCommandInfo("channelsettings",
48
+            "channelsettings - opens the channel settings window",
49
+            CommandType.TYPE_CHANNEL);
50
+
51
+    /** {@inheritDoc} */
52
+    @Override
53
+    public void execute(final FrameContainer origin,
54
+            final CommandArguments args, final CommandContext context) {
55
+        ((SwingController) PluginManager.getPluginManager()
56
+                .getPluginInfoByName("ui_swing").getPlugin())
57
+                .showChannelSettingsDialog(((ChannelCommandContext) context)
58
+                .getChannel());
59
+    }
60
+
61
+    /** {@inheritDoc} */
62
+    @Override
63
+    public AdditionalTabTargets getSuggestions(final int arg,
64
+            final IntelligentCommandContext context) {
65
+        return new AdditionalTabTargets().excludeAll();
66
+    }
67
+}

+ 67
- 0
src/com/dmdirc/addons/ui_swing/commands/ServerSettings.java View File

1
+/*
2
+ * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes,
3
+ * Simon Mott
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in
13
+ * all copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+
24
+package com.dmdirc.addons.ui_swing.commands;
25
+
26
+import com.dmdirc.FrameContainer;
27
+import com.dmdirc.addons.ui_swing.SwingController;
28
+import com.dmdirc.commandparser.BaseCommandInfo;
29
+import com.dmdirc.commandparser.CommandArguments;
30
+import com.dmdirc.commandparser.CommandInfo;
31
+import com.dmdirc.commandparser.CommandType;
32
+import com.dmdirc.commandparser.commands.Command;
33
+import com.dmdirc.commandparser.commands.CommandOptions;
34
+import com.dmdirc.commandparser.commands.IntelligentCommand;
35
+import com.dmdirc.commandparser.commands.context.CommandContext;
36
+import com.dmdirc.plugins.PluginManager;
37
+import com.dmdirc.ui.input.AdditionalTabTargets;
38
+
39
+/**
40
+ * Opens the server settings window for the server.
41
+ *
42
+ * @since 0.6.4
43
+ */
44
+@CommandOptions(allowOffline=false)
45
+public class ServerSettings extends Command implements IntelligentCommand {
46
+
47
+    /** A command info object for this command. */
48
+    public static final CommandInfo INFO = new BaseCommandInfo("serversettings",
49
+            "serversettings - opens the server settings window",
50
+            CommandType.TYPE_SERVER);
51
+
52
+    /** {@inheritDoc} */
53
+    @Override
54
+    public void execute(final FrameContainer origin,
55
+            final CommandArguments args, final CommandContext context) {
56
+        ((SwingController) PluginManager.getPluginManager()
57
+                .getPluginInfoByName("ui_swing").getPlugin())
58
+                .showServerSettingsDialog(context.getSource().getServer());
59
+    }
60
+
61
+    /** {@inheritDoc} */
62
+    @Override
63
+    public AdditionalTabTargets getSuggestions(final int arg,
64
+            final IntelligentCommandContext context) {
65
+        return new AdditionalTabTargets().excludeAll();
66
+    }
67
+}

+ 3
- 2
src/com/dmdirc/addons/ui_swing/components/TopicBar.java View File

101
     /**
101
     /**
102
      * Instantiates a new topic bar.
102
      * Instantiates a new topic bar.
103
      *
103
      *
104
-     * @param window Parent window
104
+     * @param parentWindow Parent window
105
      * @param channelFrame Parent channel frame
105
      * @param channelFrame Parent channel frame
106
      */
106
      */
107
     public TopicBar(final Window parentWindow,
107
     public TopicBar(final Window parentWindow,
129
                 getIcon("close-active"));
129
                 getIcon("close-active"));
130
 
130
 
131
         final SwingInputHandler handler = new SwingInputHandler(topicText,
131
         final SwingInputHandler handler = new SwingInputHandler(topicText,
132
-                channelFrame.getContainer().getCommandParser(), channelFrame);
132
+                channelFrame.getContainer().getCommandParser(),
133
+                channelFrame.getContainer());
133
         handler.setTypes(true, false, true, false);
134
         handler.setTypes(true, false, true, false);
134
         handler.setTabCompleter(channel.getTabCompleter());
135
         handler.setTabCompleter(channel.getTabCompleter());
135
 
136
 

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java View File

98
                 CoreActionType.CLIENT_CLOSING);
98
                 CoreActionType.CLIENT_CLOSING);
99
 
99
 
100
         setInputHandler(new SwingInputHandler(getInputField(),
100
         setInputHandler(new SwingInputHandler(getInputField(),
101
-                owner.getCommandParser(), this));
101
+                owner.getCommandParser(), getContainer()));
102
 
102
 
103
         identity = IdentityManager.getChannelConfig(owner.getServer().
103
         identity = IdentityManager.getChannelConfig(owner.getServer().
104
                 getNetwork(), owner.getChannelInfo().getName());
104
                 getNetwork(), owner.getChannelInfo().getName());

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/frames/CustomInputFrame.java View File

55
         super(controller, owner);
55
         super(controller, owner);
56
 
56
 
57
         setInputHandler(new SwingInputHandler(getInputField(),
57
         setInputHandler(new SwingInputHandler(getInputField(),
58
-                owner.getCommandParser(), this));
58
+                owner.getCommandParser(), getContainer()));
59
 
59
 
60
         initComponents();
60
         initComponents();
61
     }
61
     }

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/frames/ServerFrame.java View File

74
         initComponents();
74
         initComponents();
75
 
75
 
76
         setInputHandler(new SwingInputHandler(getInputField(),
76
         setInputHandler(new SwingInputHandler(getInputField(),
77
-                owner.getCommandParser(), this));
77
+                owner.getCommandParser(), getContainer()));
78
 
78
 
79
         owner.addCertificateProblemListener(this);
79
         owner.addCertificateProblemListener(this);
80
     }
80
     }

+ 4
- 4
src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java View File

169
      * Initialises the components for this frame.
169
      * Initialises the components for this frame.
170
      */
170
      */
171
     private void initComponents() {
171
     private void initComponents() {
172
-        setTextPane(new TextPane(this));
172
+        setTextPane(new TextPane(getController(), this));
173
 
173
 
174
         searchBar = new SwingSearchBar(this);
174
         searchBar = new SwingSearchBar(this);
175
         searchBar.setVisible(false);
175
         searchBar.setVisible(false);
251
 
251
 
252
     /** {@inheritDoc} */
252
     /** {@inheritDoc} */
253
     @Override
253
     @Override
254
-    public void mouseClicked(final ClickTypeValue clickType,
254
+    public void mouseClicked(final ClickTypeValue clicktype,
255
             final MouseEventType eventType, final MouseEvent event) {
255
             final MouseEventType eventType, final MouseEvent event) {
256
         if (event.isPopupTrigger()) {
256
         if (event.isPopupTrigger()) {
257
-            showPopupMenuInternal(clickType, event.getPoint());
257
+            showPopupMenuInternal(clicktype, event.getPoint());
258
         }
258
         }
259
         if (eventType == MouseEventType.CLICK
259
         if (eventType == MouseEventType.CLICK
260
                 && event.getButton() == MouseEvent.BUTTON1) {
260
                 && event.getButton() == MouseEvent.BUTTON1) {
261
-            handleLinkClick(clickType);
261
+            handleLinkClick(clicktype);
262
         }
262
         }
263
     }
263
     }
264
 
264
 

+ 3
- 2
src/com/dmdirc/addons/ui_swing/components/inputfields/SwingInputHandler.java View File

22
 
22
 
23
 package com.dmdirc.addons.ui_swing.components.inputfields;
23
 package com.dmdirc.addons.ui_swing.components.inputfields;
24
 
24
 
25
+import com.dmdirc.WritableFrameContainer;
25
 import com.dmdirc.addons.ui_swing.Apple;
26
 import com.dmdirc.addons.ui_swing.Apple;
26
 import com.dmdirc.addons.ui_swing.UIUtilities;
27
 import com.dmdirc.addons.ui_swing.UIUtilities;
27
 import com.dmdirc.addons.ui_swing.components.LoggingSwingWorker;
28
 import com.dmdirc.addons.ui_swing.components.LoggingSwingWorker;
30
 import com.dmdirc.logger.Logger;
31
 import com.dmdirc.logger.Logger;
31
 import com.dmdirc.ui.input.InputHandler;
32
 import com.dmdirc.ui.input.InputHandler;
32
 import com.dmdirc.ui.interfaces.InputField;
33
 import com.dmdirc.ui.interfaces.InputField;
33
-import com.dmdirc.ui.interfaces.InputWindow;
34
 
34
 
35
 import java.awt.event.ActionEvent;
35
 import java.awt.event.ActionEvent;
36
 import java.awt.event.KeyEvent;
36
 import java.awt.event.KeyEvent;
57
      * @param parentWindow The window that owns this input handler
57
      * @param parentWindow The window that owns this input handler
58
      */
58
      */
59
     public SwingInputHandler(final InputField target,
59
     public SwingInputHandler(final InputField target,
60
-            final CommandParser commandParser, final InputWindow parentWindow) {
60
+            final CommandParser commandParser,
61
+            final WritableFrameContainer parentWindow) {
61
         super(target, commandParser, parentWindow);
62
         super(target, commandParser, parentWindow);
62
     }
63
     }
63
 
64
 

+ 1
- 1
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicDisplayPane.java View File

110
         topicText.setRows(5);
110
         topicText.setRows(5);
111
         topicText.setColumns(30);
111
         topicText.setColumns(30);
112
         final SwingInputHandler handler = new SwingInputHandler(topicText,
112
         final SwingInputHandler handler = new SwingInputHandler(topicText,
113
-                channel.getCommandParser(), channelWindow);
113
+                channel.getCommandParser(), channelWindow.getContainer());
114
         handler.setTypes(true, false, true, false);
114
         handler.setTypes(true, false, true, false);
115
         handler.setTabCompleter(channel.getTabCompleter());
115
         handler.setTabCompleter(channel.getTabCompleter());
116
 
116
 

+ 1
- 1
src/com/dmdirc/addons/ui_swing/dialogs/paste/PasteDialog.java View File

125
         textField.setRows(10);
125
         textField.setRows(10);
126
 
126
 
127
         new SwingInputHandler(textField, parent.getContainer()
127
         new SwingInputHandler(textField, parent.getContainer()
128
-                .getCommandParser(), parent)
128
+                .getCommandParser(), parent.getContainer())
129
                 .setTypes(false, false, true,false);
129
                 .setTypes(false, false, true,false);
130
 
130
 
131
         scrollPane.setViewportView(textField);
131
         scrollPane.setViewportView(textField);

+ 5
- 4
src/com/dmdirc/addons/ui_swing/textpane/TextPane.java View File

24
 
24
 
25
 import com.dmdirc.addons.ui_swing.SwingController;
25
 import com.dmdirc.addons.ui_swing.SwingController;
26
 import com.dmdirc.addons.ui_swing.UIUtilities;
26
 import com.dmdirc.addons.ui_swing.UIUtilities;
27
+import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
27
 import com.dmdirc.interfaces.ConfigChangeListener;
28
 import com.dmdirc.interfaces.ConfigChangeListener;
28
 import com.dmdirc.ui.interfaces.Window;
29
 import com.dmdirc.ui.interfaces.Window;
29
 import com.dmdirc.ui.messages.IRCDocument;
30
 import com.dmdirc.ui.messages.IRCDocument;
81
     /**
82
     /**
82
      * Creates a new instance of TextPane.
83
      * Creates a new instance of TextPane.
83
      *
84
      *
85
+     * @param controller Parent swing controller
84
      * @param frame Parent Frame
86
      * @param frame Parent Frame
85
      */
87
      */
86
-    public TextPane(final Window frame) {
88
+    public TextPane(final SwingController controller, final TextFrame frame) {
87
         super();
89
         super();
88
         this.frame = frame;
90
         this.frame = frame;
89
 
91
 
106
         add(scrollBar, "dock east");
108
         add(scrollBar, "dock east");
107
         scrollBar.addAdjustmentListener(this);
109
         scrollBar.addAdjustmentListener(this);
108
         scrollBar.addAdjustmentListener(canvas);
110
         scrollBar.addAdjustmentListener(canvas);
109
-        frame.getContainer().getConfigManager().addChangeListener(
110
-                ((SwingController) frame.getController()).getDomain(),
111
-                "textpanelinenotification", this);
111
+        frame.getContainer().getConfigManager().addChangeListener(controller
112
+                .getDomain(), "textpanelinenotification", this);
112
         configChanged("", "textpanelinenotification");
113
         configChanged("", "textpanelinenotification");
113
 
114
 
114
         addMouseWheelListener(this);
115
         addMouseWheelListener(this);

+ 2
- 1
src/com/dmdirc/addons/ui_web/uicomponents/WebInputHandler.java View File

22
 
22
 
23
 package com.dmdirc.addons.ui_web.uicomponents;
23
 package com.dmdirc.addons.ui_web.uicomponents;
24
 
24
 
25
+import com.dmdirc.WritableFrameContainer;
25
 import com.dmdirc.commandparser.parsers.CommandParser;
26
 import com.dmdirc.commandparser.parsers.CommandParser;
26
 import com.dmdirc.ui.input.InputHandler;
27
 import com.dmdirc.ui.input.InputHandler;
27
 import com.dmdirc.ui.input.TabCompleter;
28
 import com.dmdirc.ui.input.TabCompleter;
35
 
36
 
36
     public WebInputHandler(final InputField thisTarget,
37
     public WebInputHandler(final InputField thisTarget,
37
                            final CommandParser thisCommandParser,
38
                            final CommandParser thisCommandParser,
38
-                           final WebInputWindow thisParentWindow) {
39
+                           final WritableFrameContainer thisParentWindow) {
39
         super(thisTarget, thisCommandParser, thisParentWindow);
40
         super(thisTarget, thisCommandParser, thisParentWindow);
40
     }
41
     }
41
 
42
 

+ 2
- 2
src/com/dmdirc/addons/ui_web/uicomponents/WebInputWindow.java View File

52
         this.parent = parent;
52
         this.parent = parent;
53
         this.commandparser = parent.getCommandParser();
53
         this.commandparser = parent.getCommandParser();
54
         this.inputhandler = new WebInputHandler(new WebInputField(),
54
         this.inputhandler = new WebInputHandler(new WebInputField(),
55
-                commandparser, this);
55
+                commandparser, getContainer());
56
     }
56
     }
57
 
57
 
58
     /** {@inheritDoc} */
58
     /** {@inheritDoc} */
64
     public InputHandler getInputHandler(final String clientID) {
64
     public InputHandler getInputHandler(final String clientID) {
65
         if (!inputHandlers.containsKey(clientID)) {
65
         if (!inputHandlers.containsKey(clientID)) {
66
             final WebInputHandler ih = new WebInputHandler(
66
             final WebInputHandler ih = new WebInputHandler(
67
-                    new WebInputField(clientID), commandparser, this);
67
+                    new WebInputField(clientID), commandparser, getContainer());
68
             ih.setTabCompleter(inputhandler.getTabCompleter());
68
             ih.setTabCompleter(inputhandler.getTabCompleter());
69
             inputHandlers.put(clientID, ih);
69
             inputHandlers.put(clientID, ih);
70
         }
70
         }

+ 2
- 2
test/com/dmdirc/addons/redirect/RedirectCommandTest.java View File

52
         when(window.getContainer().getConfigManager()).thenReturn(IdentityManager.getGlobalConfig());
52
         when(window.getContainer().getConfigManager()).thenReturn(IdentityManager.getGlobalConfig());
53
 
53
 
54
         command.execute(target, new CommandArguments("/redirect /echo test"),
54
         command.execute(target, new CommandArguments("/redirect /echo test"),
55
-                new ChatCommandContext(window, command, target));
56
-        
55
+                new ChatCommandContext(window.getContainer(), command, target));
56
+
57
         verify(target).sendLine("test");
57
         verify(target).sendLine("test");
58
     }
58
     }
59
 
59
 

Loading…
Cancel
Save