Browse Source

Stop using deprecated Command constructor

Change-Id: I65539646852b5e1542f23a069a1fe2d68cbf4fa6
Reviewed-on: http://gerrit.dmdirc.com/2591
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.7
Greg Holmes 11 years ago
parent
commit
561acbc78c
55 changed files with 395 additions and 136 deletions
  1. 5
    2
      src/com/dmdirc/addons/activewindow/ActiveCommand.java
  2. 5
    2
      src/com/dmdirc/addons/activewindow/ActiveWindowPlugin.java
  3. 10
    0
      src/com/dmdirc/addons/audio/AudioCommand.java
  4. 9
    4
      src/com/dmdirc/addons/audio/AudioPlugin.java
  5. 10
    0
      src/com/dmdirc/addons/audio/BeepCommand.java
  6. 11
    1
      src/com/dmdirc/addons/calc/CalcCommand.java
  7. 8
    3
      src/com/dmdirc/addons/calc/CalcPlugin.java
  8. 11
    1
      src/com/dmdirc/addons/contactlist/ContactListCommand.java
  9. 8
    3
      src/com/dmdirc/addons/contactlist/ContactListPlugin.java
  10. 5
    2
      src/com/dmdirc/addons/dcc/DCCCommand.java
  11. 6
    4
      src/com/dmdirc/addons/dcc/DCCPlugin.java
  12. 10
    0
      src/com/dmdirc/addons/dcop/DcopCommand.java
  13. 8
    3
      src/com/dmdirc/addons/dcop/DcopPlugin.java
  14. 6
    4
      src/com/dmdirc/addons/debug/Debug.java
  15. 5
    2
      src/com/dmdirc/addons/debug/DebugPlugin.java
  16. 10
    0
      src/com/dmdirc/addons/dns/DNSCommand.java
  17. 8
    3
      src/com/dmdirc/addons/dns/DNSPlugin.java
  18. 10
    0
      src/com/dmdirc/addons/exec/ExecCommand.java
  19. 8
    3
      src/com/dmdirc/addons/exec/ExecPlugin.java
  20. 5
    2
      src/com/dmdirc/addons/freedesktop_notifications/FDNotifyCommand.java
  21. 7
    11
      src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java
  22. 13
    3
      src/com/dmdirc/addons/logging/LoggingCommand.java
  23. 6
    2
      src/com/dmdirc/addons/logging/LoggingPlugin.java
  24. 10
    0
      src/com/dmdirc/addons/nma/NotifyMyAndroidCommand.java
  25. 6
    2
      src/com/dmdirc/addons/nma/NotifyMyAndroidPlugin.java
  26. 5
    2
      src/com/dmdirc/addons/notifications/NotificationCommand.java
  27. 5
    2
      src/com/dmdirc/addons/notifications/NotificationsPlugin.java
  28. 5
    2
      src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java
  29. 6
    2
      src/com/dmdirc/addons/nowplaying/NowPlayingPlugin.java
  30. 5
    2
      src/com/dmdirc/addons/osd/OsdCommand.java
  31. 6
    2
      src/com/dmdirc/addons/osd/OsdPlugin.java
  32. 5
    1
      src/com/dmdirc/addons/osx_integration/DockBounceCommand.java
  33. 6
    3
      src/com/dmdirc/addons/osx_integration/OsxIntegrationPlugin.java
  34. 6
    2
      src/com/dmdirc/addons/parserdebug/DebugPlugin.java
  35. 5
    2
      src/com/dmdirc/addons/parserdebug/ParserDebugCommand.java
  36. 10
    0
      src/com/dmdirc/addons/redirect/RedirectCommand.java
  37. 9
    3
      src/com/dmdirc/addons/redirect/RedirectPlugin.java
  38. 5
    2
      src/com/dmdirc/addons/scriptplugin/ScriptCommand.java
  39. 7
    2
      src/com/dmdirc/addons/scriptplugin/ScriptPlugin.java
  40. 6
    2
      src/com/dmdirc/addons/systray/PopupCommand.java
  41. 6
    2
      src/com/dmdirc/addons/systray/SystrayPlugin.java
  42. 6
    2
      src/com/dmdirc/addons/time/TimePlugin.java
  43. 5
    2
      src/com/dmdirc/addons/time/TimerCommand.java
  44. 18
    7
      src/com/dmdirc/addons/ui_swing/SwingController.java
  45. 10
    0
      src/com/dmdirc/addons/ui_swing/commands/ChannelSettings.java
  46. 5
    3
      src/com/dmdirc/addons/ui_swing/commands/Input.java
  47. 5
    2
      src/com/dmdirc/addons/ui_swing/commands/PopInCommand.java
  48. 5
    2
      src/com/dmdirc/addons/ui_swing/commands/PopOutCommand.java
  49. 10
    0
      src/com/dmdirc/addons/ui_swing/commands/ServerSettings.java
  50. 8
    3
      src/com/dmdirc/addons/urlcatcher/UrlCatcherPlugin.java
  51. 5
    1
      src/com/dmdirc/addons/urlcatcher/UrlListCommand.java
  52. 4
    2
      src/com/dmdirc/addons/windowflashing/FlashWindow.java
  53. 5
    2
      src/com/dmdirc/addons/windowflashing/WindowFlashing.java
  54. 9
    14
      test/com/dmdirc/addons/debug/DebugTest.java
  55. 3
    8
      test/com/dmdirc/addons/urlcatcher/UrlCatcherPluginTest.java

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

@@ -32,6 +32,7 @@ import com.dmdirc.commandparser.CommandType;
32 32
 import com.dmdirc.commandparser.commands.Command;
33 33
 import com.dmdirc.commandparser.commands.IntelligentCommand;
34 34
 import com.dmdirc.commandparser.commands.context.CommandContext;
35
+import com.dmdirc.interfaces.CommandController;
35 36
 import com.dmdirc.ui.input.AdditionalTabTargets;
36 37
 import com.dmdirc.ui.input.TabCompleter;
37 38
 
@@ -51,10 +52,12 @@ public class ActiveCommand extends Command implements IntelligentCommand {
51 52
     /**
52 53
      * Creates a new active command.
53 54
      *
55
+     * @param commandController Command controller
54 56
      * @param mainFrame Parent MainFrame
55 57
      */
56
-    public ActiveCommand(final MainFrame mainFrame) {
57
-        super();
58
+    public ActiveCommand(final CommandController commandController,
59
+            final MainFrame mainFrame) {
60
+        super(commandController);
58 61
         this.mainFrame = mainFrame;
59 62
     }
60 63
 

+ 5
- 2
src/com/dmdirc/addons/activewindow/ActiveWindowPlugin.java View File

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.activewindow;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.SwingController;
26
+import com.dmdirc.interfaces.CommandController;
26 27
 import com.dmdirc.messages.MessageSinkManager;
27 28
 import com.dmdirc.plugins.BasePlugin;
28 29
 
@@ -35,14 +36,16 @@ public final class ActiveWindowPlugin extends BasePlugin {
35 36
     /**
36 37
      * Creates a new instance of this plugin.
37 38
      *
39
+     * @param commandController Command controller
38 40
      * @param controller The controller to use to find active windows
39 41
      */
40
-    public ActiveWindowPlugin(final SwingController controller) {
42
+    public ActiveWindowPlugin(final CommandController commandController,
43
+            final SwingController controller) {
41 44
         super();
42 45
 
43 46
         sink = new ActiveWindowMessageSink(controller.getMainFrame());
44 47
 
45
-        registerCommand(new ActiveCommand(controller.getMainFrame()),
48
+        registerCommand(new ActiveCommand(commandController, controller.getMainFrame()),
46 49
                 ActiveCommand.INFO);
47 50
     }
48 51
 

+ 10
- 0
src/com/dmdirc/addons/audio/AudioCommand.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.commandparser.CommandInfo;
29 29
 import com.dmdirc.commandparser.CommandType;
30 30
 import com.dmdirc.commandparser.commands.Command;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 
33 34
 import java.io.File;
34 35
 
@@ -41,6 +42,15 @@ public class AudioCommand extends Command {
41 42
     public static final CommandInfo INFO = new BaseCommandInfo("audio",
42 43
             "audio <file> - plays the specified file", CommandType.TYPE_GLOBAL);
43 44
 
45
+    /**
46
+     * Creates a new instance of the AudioCommand command
47
+     *
48
+     * @param controller Command controller for the command
49
+     */
50
+    public AudioCommand(final CommandController controller) {
51
+        super(controller);
52
+    }
53
+
44 54
     /** {@inheritDoc} */
45 55
     @Override
46 56
     public void execute(final FrameContainer origin,

+ 9
- 4
src/com/dmdirc/addons/audio/AudioPlugin.java View File

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.audio;
24 24
 
25
+import com.dmdirc.interfaces.CommandController;
25 26
 import com.dmdirc.plugins.BasePlugin;
26 27
 
27 28
 /**
@@ -29,10 +30,14 @@ import com.dmdirc.plugins.BasePlugin;
29 30
  */
30 31
 public final class AudioPlugin extends BasePlugin {
31 32
 
32
-    /** Creates a new instance of this plugin. */
33
-    public AudioPlugin() {
33
+    /**
34
+     * Creates a new instance of this plugin.
35
+     *
36
+     * @param commandController Command controller
37
+     */
38
+    public AudioPlugin(final CommandController commandController) {
34 39
         super();
35
-        registerCommand(new AudioCommand(), AudioCommand.INFO);
36
-        registerCommand(new BeepCommand(), BeepCommand.INFO);
40
+        registerCommand(new AudioCommand(commandController), AudioCommand.INFO);
41
+        registerCommand(new BeepCommand(commandController), BeepCommand.INFO);
37 42
     }
38 43
 }

+ 10
- 0
src/com/dmdirc/addons/audio/BeepCommand.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.commandparser.CommandInfo;
29 29
 import com.dmdirc.commandparser.CommandType;
30 30
 import com.dmdirc.commandparser.commands.Command;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 
33 34
 import java.awt.Toolkit;
34 35
 
@@ -41,6 +42,15 @@ public class BeepCommand extends Command {
41 42
     public static final CommandInfo INFO = new BaseCommandInfo("beep",
42 43
             "beep - emits a beep", CommandType.TYPE_GLOBAL);
43 44
 
45
+    /**
46
+     * Creates a new instance of the BeepCommand command
47
+     *
48
+     * @param controller Command controller for the command
49
+     */
50
+    public BeepCommand(final CommandController controller) {
51
+        super(controller);
52
+    }
53
+
44 54
     /** {@inheritDoc} */
45 55
     @Override
46 56
     public void execute(final FrameContainer origin,

+ 11
- 1
src/com/dmdirc/addons/calc/CalcCommand.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.commandparser.CommandInfo;
29 29
 import com.dmdirc.commandparser.CommandType;
30 30
 import com.dmdirc.commandparser.commands.Command;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 
33 34
 import java.text.ParseException;
34 35
 
@@ -41,7 +42,16 @@ public class CalcCommand extends Command {
41 42
     /** A command info object for this command. */
42 43
     public static final CommandInfo INFO = new BaseCommandInfo("calc",
43 44
             "calc [--showexpr] <expr> - evaluate mathematical expression",
44
-            CommandType.TYPE_GLOBAL) ;
45
+            CommandType.TYPE_GLOBAL);
46
+
47
+    /**
48
+     * Creates a new instance of the CalcCommand command
49
+     *
50
+     * @param controller Command controller for the command
51
+     */
52
+    public CalcCommand(final CommandController controller) {
53
+        super(controller);
54
+    }
45 55
 
46 56
     /** {@inheritDoc} */
47 57
     @Override

+ 8
- 3
src/com/dmdirc/addons/calc/CalcPlugin.java View File

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.calc;
24 24
 
25
+import com.dmdirc.interfaces.CommandController;
25 26
 import com.dmdirc.plugins.BasePlugin;
26 27
 
27 28
 /**
@@ -29,9 +30,13 @@ import com.dmdirc.plugins.BasePlugin;
29 30
  */
30 31
 public class CalcPlugin extends BasePlugin {
31 32
 
32
-    /** Creates a new instance of this plugin. */
33
-    public CalcPlugin() {
33
+    /**
34
+     * Creates a new instance of this plugin.
35
+     *
36
+     * @param controller Command controller
37
+     */
38
+    public CalcPlugin(final CommandController controller) {
34 39
         super();
35
-        registerCommand(new CalcCommand(), CalcCommand.INFO);
40
+        registerCommand(new CalcCommand(controller), CalcCommand.INFO);
36 41
     }
37 42
 }

+ 11
- 1
src/com/dmdirc/addons/contactlist/ContactListCommand.java View File

@@ -31,6 +31,7 @@ import com.dmdirc.commandparser.commands.Command;
31 31
 import com.dmdirc.commandparser.commands.IntelligentCommand;
32 32
 import com.dmdirc.commandparser.commands.context.ChannelCommandContext;
33 33
 import com.dmdirc.commandparser.commands.context.CommandContext;
34
+import com.dmdirc.interfaces.CommandController;
34 35
 import com.dmdirc.ui.input.AdditionalTabTargets;
35 36
 
36 37
 /**
@@ -41,7 +42,16 @@ public class ContactListCommand extends Command implements IntelligentCommand {
41 42
     /** A command info object for this command. */
42 43
     public static final CommandInfo INFO = new BaseCommandInfo("contactlist",
43 44
             "contactlist - show a contact list for the current channel",
44
-            CommandType.TYPE_CHANNEL) ;
45
+            CommandType.TYPE_CHANNEL);
46
+
47
+    /**
48
+     * Creates a new instance of the ContactListCommand command
49
+     *
50
+     * @param controller Command controller for the command
51
+     */
52
+    public ContactListCommand(final CommandController controller) {
53
+        super(controller);
54
+    }
45 55
 
46 56
     /** {@inheritDoc} */
47 57
     @Override

+ 8
- 3
src/com/dmdirc/addons/contactlist/ContactListPlugin.java View File

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.contactlist;
24 24
 
25
+import com.dmdirc.interfaces.CommandController;
25 26
 import com.dmdirc.plugins.BasePlugin;
26 27
 
27 28
 /**
@@ -29,9 +30,13 @@ import com.dmdirc.plugins.BasePlugin;
29 30
  */
30 31
 public final class ContactListPlugin extends BasePlugin {
31 32
 
32
-    /** Creates a new instance of this plugin. */
33
-    public ContactListPlugin() {
33
+    /**
34
+     * Creates a new instance of this plugin.
35
+     *
36
+     * @param commandController Command controller
37
+     */
38
+    public ContactListPlugin(final CommandController commandController) {
34 39
         super();
35
-        registerCommand(new ContactListCommand(), ContactListCommand.INFO);
40
+        registerCommand(new ContactListCommand(commandController), ContactListCommand.INFO);
36 41
     }
37 42
 }

+ 5
- 2
src/com/dmdirc/addons/dcc/DCCCommand.java View File

@@ -40,6 +40,7 @@ import com.dmdirc.commandparser.commands.Command;
40 40
 import com.dmdirc.commandparser.commands.IntelligentCommand;
41 41
 import com.dmdirc.commandparser.commands.context.CommandContext;
42 42
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
43
+import com.dmdirc.interfaces.CommandController;
43 44
 import com.dmdirc.parser.interfaces.Parser;
44 45
 import com.dmdirc.ui.input.AdditionalTabTargets;
45 46
 import com.dmdirc.ui.input.TabCompletionType;
@@ -68,11 +69,13 @@ public class DCCCommand extends Command implements IntelligentCommand {
68 69
     /**
69 70
      * Creates a new instance of DCCCommand.
70 71
      *
72
+     * @param commandController Command controller
71 73
      * @param mainFrame mainFrame instance to use
72 74
      * @param plugin The DCC Plugin that this command belongs to
73 75
      */
74
-    public DCCCommand(final MainFrame mainFrame, final DCCPlugin plugin) {
75
-        super();
76
+    public DCCCommand(final CommandController commandController,
77
+            final MainFrame mainFrame, final DCCPlugin plugin) {
78
+        super(commandController);
76 79
         this.mainFrame = mainFrame;
77 80
         myPlugin = plugin;
78 81
     }

+ 6
- 4
src/com/dmdirc/addons/dcc/DCCPlugin.java View File

@@ -42,6 +42,7 @@ import com.dmdirc.config.prefs.PreferencesDialogModel;
42 42
 import com.dmdirc.config.prefs.PreferencesSetting;
43 43
 import com.dmdirc.config.prefs.PreferencesType;
44 44
 import com.dmdirc.interfaces.ActionListener;
45
+import com.dmdirc.interfaces.CommandController;
45 46
 import com.dmdirc.interfaces.actions.ActionType;
46 47
 import com.dmdirc.logger.ErrorLevel;
47 48
 import com.dmdirc.logger.Logger;
@@ -83,18 +84,19 @@ public final class DCCPlugin extends BasePlugin implements ActionListener {
83 84
      * @param controller The controller to register UI implementations with
84 85
      * @param pluginInfo This plugin's plugin info
85 86
      * @param identityManager The Identity Manager that controls the current config
87
+     * @param commandController Command controller
86 88
      */
87 89
     public DCCPlugin(final SwingController controller,
88 90
             final PluginInfo pluginInfo,
89
-            final IdentityManager identityManager
90
-            ) {
91
+            final IdentityManager identityManager,
92
+            final CommandController commandController) {
91 93
         super();
92 94
         this.identityManager = identityManager;
93 95
         this.controller = controller;
94 96
         config = controller.getGlobalConfig();
95 97
         this.pluginInfo = pluginInfo;
96
-        registerCommand(new DCCCommand(controller.getMainFrame(), this),
97
-                DCCCommand.INFO);
98
+        registerCommand(new DCCCommand(commandController,
99
+                controller.getMainFrame(), this), DCCCommand.INFO);
98 100
         final SwingWindowFactory factory = controller.getWindowFactory();
99 101
         factory.registerImplementation(new HashSet<String>(Arrays.asList(
100 102
                 "com.dmdirc.addons.dcc.ui.PlaceholderPanel")),

+ 10
- 0
src/com/dmdirc/addons/dcop/DcopCommand.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.commandparser.CommandInfo;
29 29
 import com.dmdirc.commandparser.CommandType;
30 30
 import com.dmdirc.commandparser.commands.Command;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 
33 34
 import java.util.List;
34 35
 
@@ -42,6 +43,15 @@ public final class DcopCommand extends Command {
42 43
             "dcop <app> <object> <function> - retrieves information from a DCOP aplication",
43 44
             CommandType.TYPE_SERVER);
44 45
 
46
+    /**
47
+     * Creates a new instance of the DcopCommand command
48
+     *
49
+     * @param controller Command controller for the command
50
+     */
51
+    public DcopCommand(final CommandController controller) {
52
+        super(controller);
53
+    }
54
+
45 55
     /** {@inheritDoc} */
46 56
     @Override
47 57
     public void execute(final FrameContainer origin,

+ 8
- 3
src/com/dmdirc/addons/dcop/DcopPlugin.java View File

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.dcop;
24 24
 
25
+import com.dmdirc.interfaces.CommandController;
25 26
 import com.dmdirc.plugins.BasePlugin;
26 27
 
27 28
 import java.io.BufferedReader;
@@ -35,10 +36,14 @@ import java.util.List;
35 36
  */
36 37
 public final class DcopPlugin extends BasePlugin {
37 38
 
38
-    /** Creates a new instance of this plugin. */
39
-    public DcopPlugin() {
39
+    /**
40
+     * Creates a new instance of this plugin.
41
+     *
42
+     * @param commandController Command controller
43
+     */
44
+    public DcopPlugin(final CommandController commandController) {
40 45
         super();
41
-        registerCommand(new DcopCommand(), DcopCommand.INFO);
46
+        registerCommand(new DcopCommand(commandController), DcopCommand.INFO);
42 47
     }
43 48
 
44 49
     /**

+ 6
- 4
src/com/dmdirc/addons/debug/Debug.java View File

@@ -26,11 +26,11 @@ import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.commandparser.BaseCommandInfo;
27 27
 import com.dmdirc.commandparser.CommandArguments;
28 28
 import com.dmdirc.commandparser.CommandInfo;
29
-import com.dmdirc.commandparser.CommandManager;
30 29
 import com.dmdirc.commandparser.CommandType;
31 30
 import com.dmdirc.commandparser.commands.Command;
32 31
 import com.dmdirc.commandparser.commands.IntelligentCommand;
33 32
 import com.dmdirc.commandparser.commands.context.CommandContext;
33
+import com.dmdirc.interfaces.CommandController;
34 34
 import com.dmdirc.ui.input.AdditionalTabTargets;
35 35
 
36 36
 import java.util.Arrays;
@@ -51,10 +51,12 @@ public class Debug extends Command implements IntelligentCommand {
51 51
     /**
52 52
      * Creates a new debug command with the specified parent plugin.
53 53
      *
54
+     * @param commandController Command controller
54 55
      * @param plugin Parent debug plugin
55 56
      */
56
-    public Debug(final DebugPlugin plugin) {
57
-        super();
57
+    public Debug(final CommandController commandController,
58
+            final DebugPlugin plugin) {
59
+        super(commandController);
58 60
 
59 61
         this.plugin = plugin;
60 62
     }
@@ -74,7 +76,7 @@ public class Debug extends Command implements IntelligentCommand {
74 76
                         "Unknown debug action.");
75 77
             } else {
76 78
                 final CommandArguments newArgs = new CommandArguments(
77
-                        Arrays.asList((CommandManager.getCommandManager().getCommandChar()
79
+                        Arrays.asList((getController().getCommandChar()
78 80
                         + command.getName() + " "
79 81
                         + args.getArgumentsAsString(1)).split(" ")));
80 82
                 command.execute(origin, newArgs, context);

+ 5
- 2
src/com/dmdirc/addons/debug/DebugPlugin.java View File

@@ -24,6 +24,7 @@ package com.dmdirc.addons.debug;
24 24
 
25 25
 import com.dmdirc.addons.debug.commands.*; //NOPMD
26 26
 import com.dmdirc.config.IdentityManager;
27
+import com.dmdirc.interfaces.CommandController;
27 28
 import com.dmdirc.logger.ErrorLevel;
28 29
 import com.dmdirc.logger.Logger;
29 30
 import com.dmdirc.plugins.BasePlugin;
@@ -66,16 +67,18 @@ public class DebugPlugin extends BasePlugin {
66 67
     /**
67 68
      * Creates a new debug plugin.
68 69
      *
70
+     * @param commandController Command controller
69 71
      * @param identityManager Identity manager instance
70 72
      * @param pluginManager Plugin manager instance.
71 73
      */
72
-    public DebugPlugin(final IdentityManager identityManager,
74
+    public DebugPlugin(final CommandController commandController,
75
+            final IdentityManager identityManager,
73 76
             final PluginManager pluginManager) {
74 77
         super();
75 78
         this.identityManager = identityManager;
76 79
         this.pluginManager = pluginManager;
77 80
         commands = new HashMap<String, DebugCommand>();
78
-        debugCommand = new Debug(this);
81
+        debugCommand = new Debug(commandController, this);
79 82
         registerCommand(debugCommand, Debug.INFO);
80 83
     }
81 84
 

+ 10
- 0
src/com/dmdirc/addons/dns/DNSCommand.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.commandparser.CommandInfo;
29 29
 import com.dmdirc.commandparser.CommandType;
30 30
 import com.dmdirc.commandparser.commands.Command;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 
33 34
 import java.util.Timer;
34 35
 import java.util.TimerTask;
@@ -43,6 +44,15 @@ public class DNSCommand extends Command {
43 44
             "dns <IP|hostname> - Performs DNS lookup of the specified ip/hostname/nickname",
44 45
             CommandType.TYPE_GLOBAL);
45 46
 
47
+    /**
48
+     * Creates a new instance of the DNSCommand command
49
+     *
50
+     * @param controller Command controller for the command
51
+     */
52
+    public DNSCommand(final CommandController controller) {
53
+        super(controller);
54
+    }
55
+
46 56
     /** {@inheritDoc} */
47 57
     @Override
48 58
     public void execute(final FrameContainer origin,

+ 8
- 3
src/com/dmdirc/addons/dns/DNSPlugin.java View File

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.dns;
24 24
 
25
+import com.dmdirc.interfaces.CommandController;
25 26
 import com.dmdirc.plugins.BasePlugin;
26 27
 
27 28
 import java.net.InetAddress;
@@ -35,10 +36,14 @@ import java.util.List;
35 36
  */
36 37
 public final class DNSPlugin extends BasePlugin {
37 38
 
38
-    /** Creates a new instance of this plugin. */
39
-    public DNSPlugin() {
39
+    /**
40
+     * Creates a new instance of this plugin.
41
+     *
42
+     * @param commandController Command controller
43
+     */
44
+    public DNSPlugin(final CommandController commandController) {
40 45
         super();
41
-        registerCommand(new DNSCommand(), DNSCommand.INFO);
46
+        registerCommand(new DNSCommand(commandController), DNSCommand.INFO);
42 47
     }
43 48
 
44 49
     /**

+ 10
- 0
src/com/dmdirc/addons/exec/ExecCommand.java View File

@@ -28,6 +28,7 @@ import com.dmdirc.commandparser.CommandArguments;
28 28
 import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.context.CommandContext;
31
+import com.dmdirc.interfaces.CommandController;
31 32
 import com.dmdirc.logger.ErrorLevel;
32 33
 import com.dmdirc.logger.Logger;
33 34
 import com.dmdirc.util.CommandUtils;
@@ -48,6 +49,15 @@ public class ExecCommand extends Command {
48 49
             "exec <command> [<parameters>] - executes an external program "
49 50
             + "and displays the output", CommandType.TYPE_GLOBAL);
50 51
 
52
+    /**
53
+     * Creates a new instance of the ExecCommand command
54
+     *
55
+     * @param controller Command controller for the command
56
+     */
57
+    public ExecCommand(final CommandController controller) {
58
+        super(controller);
59
+    }
60
+
51 61
     /** {@inheritDoc} */
52 62
     @Override
53 63
     public void execute(final FrameContainer origin,

+ 8
- 3
src/com/dmdirc/addons/exec/ExecPlugin.java View File

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.exec;
24 24
 
25
+import com.dmdirc.interfaces.CommandController;
25 26
 import com.dmdirc.plugins.BasePlugin;
26 27
 
27 28
 /**
@@ -29,9 +30,13 @@ import com.dmdirc.plugins.BasePlugin;
29 30
  */
30 31
 public class ExecPlugin extends BasePlugin {
31 32
 
32
-    /** Creates a new instance of this plugin. */
33
-    public ExecPlugin() {
33
+    /**
34
+     * Creates a new instance of this plugin.
35
+     *
36
+     * @param commandController Command controller
37
+     */
38
+    public ExecPlugin(final CommandController commandController) {
34 39
         super();
35
-        registerCommand(new ExecCommand(), ExecCommand.INFO);
40
+        registerCommand(new ExecCommand(commandController), ExecCommand.INFO);
36 41
     }
37 42
 }

+ 5
- 2
src/com/dmdirc/addons/freedesktop_notifications/FDNotifyCommand.java View File

@@ -28,6 +28,7 @@ import com.dmdirc.commandparser.CommandArguments;
28 28
 import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.context.CommandContext;
31
+import com.dmdirc.interfaces.CommandController;
31 32
 
32 33
 /**
33 34
  * The FDNotify Command shows a nice popup on using the FreeDesktop
@@ -45,10 +46,12 @@ public final class FDNotifyCommand extends Command {
45 46
     /**
46 47
      * Creates a new instance of FDNotifyCommand.
47 48
      *
49
+     * @param commandController Command controller
48 50
      * @param myPlugin the plugin creating this command.
49 51
      */
50
-    public FDNotifyCommand(final FreeDesktopNotificationsPlugin myPlugin) {
51
-        super();
52
+    public FDNotifyCommand(final CommandController commandController,
53
+            final FreeDesktopNotificationsPlugin myPlugin) {
54
+        super(commandController);
52 55
         this.myPlugin = myPlugin;
53 56
     }
54 57
 

+ 7
- 11
src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java View File

@@ -30,12 +30,12 @@ import com.dmdirc.config.prefs.PreferencesCategory;
30 30
 import com.dmdirc.config.prefs.PreferencesDialogModel;
31 31
 import com.dmdirc.config.prefs.PreferencesSetting;
32 32
 import com.dmdirc.config.prefs.PreferencesType;
33
+import com.dmdirc.interfaces.CommandController;
33 34
 import com.dmdirc.interfaces.ConfigChangeListener;
34 35
 import com.dmdirc.logger.ErrorLevel;
35 36
 import com.dmdirc.logger.Logger;
36 37
 import com.dmdirc.plugins.BaseFileDependantPlugin;
37 38
 import com.dmdirc.plugins.PluginInfo;
38
-import com.dmdirc.plugins.PluginManager;
39 39
 import com.dmdirc.ui.messages.Styliser;
40 40
 import com.dmdirc.util.io.StreamReader;
41 41
 import com.dmdirc.util.resourcemanager.ResourceManager;
@@ -67,24 +67,23 @@ public final class FreeDesktopNotificationsPlugin
67 67
     private final ConfigManager config;
68 68
     /** Addon identity. */
69 69
     private final Identity identity;
70
-    /** Plugin manager instance. */
71
-    private final PluginManager pluginManager;
72 70
 
73 71
     /**
74 72
      * Creates a new instance of this plugin.
75 73
      *
76 74
      * @param pluginInfo This plugin's plugin info
77 75
      * @param identityManager Identity Manager instance
76
+     * @param commandController Command controller
78 77
      */
79 78
     public FreeDesktopNotificationsPlugin(final PluginInfo pluginInfo,
80 79
             final IdentityManager identityManager,
81
-            final PluginManager pluginManager) {
80
+            final CommandController commandController) {
82 81
         super(pluginInfo.getMetaData());
83 82
         this.pluginInfo = pluginInfo;
84
-        this.pluginManager = pluginManager;
85 83
         config = identityManager.getGlobalConfiguration();
86 84
         identity = identityManager.getGlobalAddonIdentity();
87
-        registerCommand(new FDNotifyCommand(this), FDNotifyCommand.INFO);
85
+        registerCommand(new FDNotifyCommand(commandController, this),
86
+                FDNotifyCommand.INFO);
88 87
     }
89 88
 
90 89
     /**
@@ -161,14 +160,11 @@ public final class FreeDesktopNotificationsPlugin
161 160
         config.addChangeListener(getDomain(), this);
162 161
         setCachedSettings();
163 162
 
164
-        // Extract required Files
165
-        final PluginInfo pi = pluginManager.getPluginInfoByName("freedesktop_notifications");
166
-
167 163
         // This shouldn't actually happen, but check to make sure.
168
-        if (pi != null) {
164
+        if (pluginInfo != null) {
169 165
             // Now get the RM
170 166
             try {
171
-                final ResourceManager res = pi.getResourceManager();
167
+                final ResourceManager res = pluginInfo.getResourceManager();
172 168
 
173 169
                 // Extract the files needed
174 170
                 try {

+ 13
- 3
src/com/dmdirc/addons/logging/LoggingCommand.java View File

@@ -29,14 +29,12 @@ import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 import com.dmdirc.ui.input.AdditionalTabTargets;
33 34
 
34
-import lombok.AllArgsConstructor;
35
-
36 35
 /**
37 36
  * The dcop command retrieves information from a dcop application.
38 37
  */
39
-@AllArgsConstructor
40 38
 public final class LoggingCommand extends Command implements
41 39
         IntelligentCommand {
42 40
 
@@ -49,6 +47,18 @@ public final class LoggingCommand extends Command implements
49 47
     /** Logging plugin. */
50 48
     private final LoggingPlugin plugin;
51 49
 
50
+    /**
51
+     * Creates a new instance of the LoggingCommand command
52
+     *
53
+     * @param controller Command controller for the command
54
+     * @param plugin Parent plugin
55
+     */
56
+    public LoggingCommand(final CommandController controller,
57
+            final LoggingPlugin plugin) {
58
+        super(controller);
59
+        this.plugin = plugin;
60
+    }
61
+
52 62
     /** {@inheritDoc} */
53 63
     @Override
54 64
     public void execute(final FrameContainer origin,

+ 6
- 2
src/com/dmdirc/addons/logging/LoggingPlugin.java View File

@@ -39,6 +39,7 @@ import com.dmdirc.config.prefs.PreferencesSetting;
39 39
 import com.dmdirc.config.prefs.PreferencesType;
40 40
 import com.dmdirc.interfaces.ActionController;
41 41
 import com.dmdirc.interfaces.ActionListener;
42
+import com.dmdirc.interfaces.CommandController;
42 43
 import com.dmdirc.interfaces.ConfigChangeListener;
43 44
 import com.dmdirc.logger.ErrorLevel;
44 45
 import com.dmdirc.logger.Logger;
@@ -112,10 +113,12 @@ public class LoggingPlugin extends BasePlugin implements ActionListener,
112 113
      * @param pluginInfo This plugin's plugin info
113 114
      * @param actionController The action controller to register listeners with
114 115
      * @param identityManager The Identity Manager that controls the current config
116
+     * @param commandController Command controller
115 117
      */
116 118
     public LoggingPlugin(final PluginInfo pluginInfo,
117 119
             final ActionController actionController,
118
-            final IdentityManager identityManager) {
120
+            final IdentityManager identityManager,
121
+            final CommandController commandController) {
119 122
         super();
120 123
         this.identityManager = identityManager;
121 124
 
@@ -124,7 +127,8 @@ public class LoggingPlugin extends BasePlugin implements ActionListener,
124 127
         config = identityManager.getGlobalConfiguration();
125 128
         identity = identityManager.getGlobalAddonIdentity();
126 129
 
127
-        registerCommand(new LoggingCommand(this), LoggingCommand.INFO);
130
+        registerCommand(new LoggingCommand(commandController, this),
131
+                LoggingCommand.INFO);
128 132
     }
129 133
 
130 134
     /** {@inheritDoc} */

+ 10
- 0
src/com/dmdirc/addons/nma/NotifyMyAndroidCommand.java View File

@@ -28,6 +28,7 @@ import com.dmdirc.commandparser.CommandArguments;
28 28
 import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.context.CommandContext;
31
+import com.dmdirc.interfaces.CommandController;
31 32
 
32 33
 import java.io.IOException;
33 34
 
@@ -51,6 +52,15 @@ public class NotifyMyAndroidCommand extends Command {
51 52
     @Setter
52 53
     private String configDomain;
53 54
 
55
+    /**
56
+     * Creates a new instance of the NotifyMyAndroidCommand command
57
+     *
58
+     * @param controller Command controller for the command
59
+     */
60
+    public NotifyMyAndroidCommand(final CommandController controller) {
61
+        super(controller);
62
+    }
63
+
54 64
     /** {@inheritDoc} */
55 65
     @Override
56 66
     public void execute(final FrameContainer origin,

+ 6
- 2
src/com/dmdirc/addons/nma/NotifyMyAndroidPlugin.java View File

@@ -27,6 +27,7 @@ import com.dmdirc.config.prefs.PreferencesCategory;
27 27
 import com.dmdirc.config.prefs.PreferencesDialogModel;
28 28
 import com.dmdirc.config.prefs.PreferencesSetting;
29 29
 import com.dmdirc.config.prefs.PreferencesType;
30
+import com.dmdirc.interfaces.CommandController;
30 31
 import com.dmdirc.plugins.BasePlugin;
31 32
 import com.dmdirc.plugins.PluginInfo;
32 33
 
@@ -36,7 +37,7 @@ import com.dmdirc.plugins.PluginInfo;
36 37
 public class NotifyMyAndroidPlugin extends BasePlugin {
37 38
 
38 39
     /** The command to register. */
39
-    private final NotifyMyAndroidCommand command = new NotifyMyAndroidCommand();
40
+    private final NotifyMyAndroidCommand command;
40 41
 
41 42
     /** Our info object. */
42 43
     private final PluginInfo pluginInfo;
@@ -44,9 +45,12 @@ public class NotifyMyAndroidPlugin extends BasePlugin {
44 45
     /**
45 46
      * Creates a new instance of the {@link NotifyMyAndroidPlugin}.
46 47
      *
48
+     * @param commandController Command controller
47 49
      * @param pluginInfo The plugin info object for this plugin.
48 50
      */
49
-    public NotifyMyAndroidPlugin(final PluginInfo pluginInfo) {
51
+    public NotifyMyAndroidPlugin(final CommandController commandController,
52
+            final PluginInfo pluginInfo) {
53
+        command = new NotifyMyAndroidCommand(commandController);
50 54
         registerCommand(command, NotifyMyAndroidCommand.INFO);
51 55
 
52 56
         this.pluginInfo = pluginInfo;

+ 5
- 2
src/com/dmdirc/addons/notifications/NotificationCommand.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 import com.dmdirc.plugins.ExportedService;
33 34
 import com.dmdirc.plugins.PluginInfo;
34 35
 import com.dmdirc.ui.input.AdditionalTabTargets;
@@ -54,10 +55,12 @@ public class NotificationCommand extends Command implements
54 55
     /**
55 56
      * Creates a new instance of this notification command.
56 57
      *
58
+     * @param commandController Command controller
57 59
      * @param parent The plugin that's instantiating this command
58 60
      */
59
-    public NotificationCommand(final NotificationsPlugin parent) {
60
-        super();
61
+    public NotificationCommand(final CommandController commandController,
62
+            final NotificationsPlugin parent) {
63
+        super(commandController);
61 64
 
62 65
         this.parent = parent;
63 66
     }

+ 5
- 2
src/com/dmdirc/addons/notifications/NotificationsPlugin.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.config.prefs.PluginPreferencesCategory;
29 29
 import com.dmdirc.config.prefs.PreferencesCategory;
30 30
 import com.dmdirc.config.prefs.PreferencesDialogModel;
31 31
 import com.dmdirc.interfaces.ActionListener;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 import com.dmdirc.interfaces.actions.ActionType;
33 34
 import com.dmdirc.plugins.BasePlugin;
34 35
 import com.dmdirc.plugins.PluginInfo;
@@ -53,12 +54,14 @@ public class NotificationsPlugin extends BasePlugin implements ActionListener {
53 54
     /**
54 55
      * Creates a new instance of this plugin.
55 56
      *
57
+     * @param commandController Command controller
56 58
      * @param pluginInfo This plugin's plugin info
57 59
      */
58
-    public NotificationsPlugin(final PluginInfo pluginInfo) {
60
+    public NotificationsPlugin(final CommandController commandController,
61
+            final PluginInfo pluginInfo) {
59 62
         super();
60 63
         this.pluginInfo = pluginInfo;
61
-        registerCommand(new NotificationCommand(this),
64
+        registerCommand(new NotificationCommand(commandController, this),
62 65
                 NotificationCommand.INFO);
63 66
     }
64 67
 

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

@@ -32,6 +32,7 @@ import com.dmdirc.commandparser.commands.IntelligentCommand;
32 32
 import com.dmdirc.commandparser.commands.context.ChatCommandContext;
33 33
 import com.dmdirc.commandparser.commands.context.CommandContext;
34 34
 import com.dmdirc.config.IdentityManager;
35
+import com.dmdirc.interfaces.CommandController;
35 36
 import com.dmdirc.ui.input.AdditionalTabTargets;
36 37
 import com.dmdirc.ui.input.TabCompleter;
37 38
 
@@ -56,10 +57,12 @@ public final class NowPlayingCommand extends Command implements
56 57
     /**
57 58
      * Creates a new instance of NowPlayingCommand.
58 59
      *
60
+     * @param commandController Command controller
59 61
      * @param parent The plugin that's instantiating this command
60 62
      */
61
-    public NowPlayingCommand(final NowPlayingPlugin parent) {
62
-        super();
63
+    public NowPlayingCommand(final CommandController commandController,
64
+            final NowPlayingPlugin parent) {
65
+        super(commandController);
63 66
 
64 67
         this.parent = parent;
65 68
     }

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

@@ -30,6 +30,7 @@ import com.dmdirc.config.prefs.PreferencesCategory;
30 30
 import com.dmdirc.config.prefs.PreferencesDialogModel;
31 31
 import com.dmdirc.interfaces.ActionController;
32 32
 import com.dmdirc.interfaces.ActionListener;
33
+import com.dmdirc.interfaces.CommandController;
33 34
 import com.dmdirc.interfaces.actions.ActionType;
34 35
 import com.dmdirc.plugins.BasePlugin;
35 36
 import com.dmdirc.plugins.Plugin;
@@ -60,17 +61,20 @@ public class NowPlayingPlugin extends BasePlugin implements ActionListener  {
60 61
     /**
61 62
      * Creates a new instance of this plugin.
62 63
      *
64
+     * @param commandController Command controller
63 65
      * @param pluginInfo This plugin's plugin info
64 66
      * @param actionController The action controller to register listeners with
65 67
      */
66
-    public NowPlayingPlugin(final PluginInfo pluginInfo,
68
+    public NowPlayingPlugin(final CommandController commandController,
69
+            final PluginInfo pluginInfo,
67 70
             final ActionController actionController) {
68 71
         super();
69 72
 
70 73
         this.pluginInfo = pluginInfo;
71 74
         this.actionController = actionController;
72 75
 
73
-        registerCommand(new NowPlayingCommand(this), NowPlayingCommand.INFO);
76
+        registerCommand(new NowPlayingCommand(commandController, this),
77
+                NowPlayingCommand.INFO);
74 78
     }
75 79
 
76 80
     /** {@inheritDoc} */

+ 5
- 2
src/com/dmdirc/addons/osd/OsdCommand.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 import com.dmdirc.ui.input.AdditionalTabTargets;
33 34
 import com.dmdirc.ui.messages.Styliser;
34 35
 
@@ -49,10 +50,12 @@ public final class OsdCommand extends Command implements IntelligentCommand {
49 50
     /**
50 51
      * Creates a new instance of OsdCommand.
51 52
      *
53
+     * @param commandController Command controller
52 54
      * @param osdManager OSD Manager used to control OSD windows
53 55
      */
54
-    public OsdCommand(final OsdManager osdManager) {
55
-        super();
56
+    public OsdCommand(final CommandController commandController,
57
+            final OsdManager osdManager) {
58
+        super(commandController);
56 59
 
57 60
         this.osdManager = osdManager;
58 61
     }

+ 6
- 2
src/com/dmdirc/addons/osd/OsdPlugin.java View File

@@ -31,6 +31,7 @@ import com.dmdirc.config.prefs.PreferencesDialogModel;
31 31
 import com.dmdirc.config.prefs.PreferencesSetting;
32 32
 import com.dmdirc.config.prefs.PreferencesType;
33 33
 import com.dmdirc.config.prefs.SettingChangeListener;
34
+import com.dmdirc.interfaces.CommandController;
34 35
 import com.dmdirc.plugins.BasePlugin;
35 36
 import com.dmdirc.plugins.PluginInfo;
36 37
 import com.dmdirc.util.validators.NumericalValidator;
@@ -62,13 +63,16 @@ public final class OsdPlugin extends BasePlugin implements
62 63
     /**
63 64
      * Creates a new instance of this plugin.
64 65
      *
66
+     * @param commandController Command controller
65 67
      * @param pluginInfo This plugin's plugin info
66 68
      */
67
-    public OsdPlugin(final PluginInfo pluginInfo) {
69
+    public OsdPlugin(final CommandController commandController,
70
+            final PluginInfo pluginInfo) {
68 71
         super();
69 72
         this.pluginInfo = pluginInfo;
70 73
         osdManager = new OsdManager(this);
71
-        registerCommand(new OsdCommand(osdManager), OsdCommand.INFO);
74
+        registerCommand(new OsdCommand(commandController, osdManager),
75
+                OsdCommand.INFO);
72 76
     }
73 77
 
74 78
     /**

+ 5
- 1
src/com/dmdirc/addons/osx_integration/DockBounceCommand.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.commandparser.CommandArguments;
29 29
 import com.dmdirc.commandparser.CommandType;
30 30
 import com.dmdirc.commandparser.commands.Command;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 
33 34
 /**
34 35
  * A command to bounce the icon in the OSX dock.
@@ -52,9 +53,12 @@ public class DockBounceCommand extends Command {
52 53
     /**
53 54
      * Creates an instance of {@link DockBounceCommand}.
54 55
      *
56
+     * @param commandController Command controller
55 57
      * @param apple The UI wrapper for Apple-specific things
56 58
      */
57
-    public DockBounceCommand(final Apple apple) {
59
+    public DockBounceCommand(final CommandController commandController,
60
+            final Apple apple) {
61
+        super(commandController);
58 62
         this.apple = apple;
59 63
     }
60 64
 

+ 6
- 3
src/com/dmdirc/addons/osx_integration/OsxIntegrationPlugin.java View File

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.osx_integration;
24 24
 
25 25
 import com.dmdirc.addons.ui_swing.SwingController;
26
+import com.dmdirc.interfaces.CommandController;
26 27
 import com.dmdirc.plugins.BasePlugin;
27 28
 
28 29
 /**
@@ -34,10 +35,12 @@ public class OsxIntegrationPlugin extends BasePlugin {
34 35
     /**
35 36
      * Creates an instance of {@link OsxIntegrationPlugin}.
36 37
      *
38
+     * @param commandController Command controller
37 39
      * @param controller The Swing UI which runs on the OS X environment
38 40
      */
39
-    public OsxIntegrationPlugin(final SwingController controller) {
40
-        registerCommand(new DockBounceCommand(controller.getApple()),
41
-                DockBounceCommand.INFO);
41
+    public OsxIntegrationPlugin(final CommandController commandController,
42
+            final SwingController controller) {
43
+        registerCommand(new DockBounceCommand(commandController,
44
+                controller.getApple()), DockBounceCommand.INFO);
42 45
     }
43 46
 }

+ 6
- 2
src/com/dmdirc/addons/parserdebug/DebugPlugin.java View File

@@ -26,6 +26,7 @@ import com.dmdirc.Server;
26 26
 import com.dmdirc.actions.CoreActionType;
27 27
 import com.dmdirc.interfaces.ActionController;
28 28
 import com.dmdirc.interfaces.ActionListener;
29
+import com.dmdirc.interfaces.CommandController;
29 30
 import com.dmdirc.interfaces.actions.ActionType;
30 31
 import com.dmdirc.parser.interfaces.Parser;
31 32
 import com.dmdirc.parser.interfaces.callbacks.DebugInfoListener;
@@ -50,14 +51,17 @@ public final class DebugPlugin extends BasePlugin implements DebugInfoListener,
50 51
     /**
51 52
      * Creates a new instance of this plugin.
52 53
      *
54
+     * @param commandController Command controller
53 55
      * @param actionController The action controller to register listeners with
54 56
      */
55
-    public DebugPlugin(final ActionController actionController) {
57
+    public DebugPlugin(final CommandController commandController,
58
+            final ActionController actionController) {
56 59
         super();
57 60
 
58 61
         this.actionController = actionController;
59 62
 
60
-        registerCommand(new ParserDebugCommand(this), ParserDebugCommand.INFO);
63
+        registerCommand(new ParserDebugCommand(commandController, this),
64
+                ParserDebugCommand.INFO);
61 65
     }
62 66
 
63 67
     /** {@inheritDoc} */

+ 5
- 2
src/com/dmdirc/addons/parserdebug/ParserDebugCommand.java View File

@@ -30,6 +30,7 @@ import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.CommandOptions;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32 32
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
33
+import com.dmdirc.interfaces.CommandController;
33 34
 import com.dmdirc.parser.interfaces.Parser;
34 35
 import com.dmdirc.parser.interfaces.callbacks.DebugInfoListener;
35 36
 
@@ -50,10 +51,12 @@ public final class ParserDebugCommand extends Command {
50 51
     /**
51 52
      * Creates a new instance of ParserDebugCommand.
52 53
      *
54
+     * @param commandController Command controller
53 55
      * @param plugin Plugin that owns this command
54 56
      */
55
-    public ParserDebugCommand(final DebugPlugin plugin) {
56
-        super();
57
+    public ParserDebugCommand(final CommandController commandController,
58
+            final DebugPlugin plugin) {
59
+        super(commandController);
57 60
         myPlugin = plugin;
58 61
     }
59 62
 

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

@@ -31,6 +31,7 @@ import com.dmdirc.commandparser.commands.Command;
31 31
 import com.dmdirc.commandparser.commands.IntelligentCommand;
32 32
 import com.dmdirc.commandparser.commands.context.ChatCommandContext;
33 33
 import com.dmdirc.commandparser.commands.context.CommandContext;
34
+import com.dmdirc.interfaces.CommandController;
34 35
 import com.dmdirc.ui.input.AdditionalTabTargets;
35 36
 import com.dmdirc.ui.input.TabCompleter;
36 37
 
@@ -47,6 +48,15 @@ public class RedirectCommand extends Command implements IntelligentCommand {
47 48
                 + "channel or query window",
48 49
             CommandType.TYPE_CHAT);
49 50
 
51
+    /**
52
+     * Creates a new instance of the RedirectCommand command
53
+     *
54
+     * @param controller Command controller for the command
55
+     */
56
+    public RedirectCommand(final CommandController controller) {
57
+        super(controller);
58
+    }
59
+
50 60
     /** {@inheritDoc} */
51 61
     @Override
52 62
     public void execute(final FrameContainer origin,

+ 9
- 3
src/com/dmdirc/addons/redirect/RedirectPlugin.java View File

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.redirect;
24 24
 
25
+import com.dmdirc.interfaces.CommandController;
25 26
 import com.dmdirc.plugins.BasePlugin;
26 27
 
27 28
 /**
@@ -30,9 +31,14 @@ import com.dmdirc.plugins.BasePlugin;
30 31
  */
31 32
 public final class RedirectPlugin extends BasePlugin {
32 33
 
33
-    /** Creates a new instance of this plugin. */
34
-    public RedirectPlugin() {
34
+    /**
35
+     * Creates a new instance of this plugin.
36
+     *
37
+     * @param commandController Command controller
38
+     */
39
+    public RedirectPlugin(final CommandController commandController) {
35 40
         super();
36
-        registerCommand(new RedirectCommand(), RedirectCommand.INFO);
41
+        registerCommand(new RedirectCommand(commandController),
42
+                RedirectCommand.INFO);
37 43
     }
38 44
 }

+ 5
- 2
src/com/dmdirc/addons/scriptplugin/ScriptCommand.java View File

@@ -31,6 +31,7 @@ import com.dmdirc.commandparser.commands.Command;
31 31
 import com.dmdirc.commandparser.commands.IntelligentCommand;
32 32
 import com.dmdirc.commandparser.commands.context.CommandContext;
33 33
 import com.dmdirc.config.IdentityManager;
34
+import com.dmdirc.interfaces.CommandController;
34 35
 import com.dmdirc.ui.input.AdditionalTabTargets;
35 36
 
36 37
 import java.io.File;
@@ -57,10 +58,12 @@ public final class ScriptCommand extends Command implements IntelligentCommand {
57 58
     /**
58 59
      * Creates a new instance of ScriptCommand.
59 60
      *
61
+     * @param commandController Command controller
60 62
      * @param plugin Parent plugin
61 63
      */
62
-    public ScriptCommand(final ScriptPlugin plugin) {
63
-        super();
64
+    public ScriptCommand(final CommandController commandController,
65
+            final ScriptPlugin plugin) {
66
+        super(commandController);
64 67
         myPlugin = plugin;
65 68
     }
66 69
 

+ 7
- 2
src/com/dmdirc/addons/scriptplugin/ScriptPlugin.java View File

@@ -26,6 +26,7 @@ import com.dmdirc.actions.CoreActionType;
26 26
 import com.dmdirc.config.IdentityManager;
27 27
 import com.dmdirc.interfaces.ActionController;
28 28
 import com.dmdirc.interfaces.ActionListener;
29
+import com.dmdirc.interfaces.CommandController;
29 30
 import com.dmdirc.interfaces.actions.ActionType;
30 31
 import com.dmdirc.logger.ErrorLevel;
31 32
 import com.dmdirc.logger.Logger;
@@ -64,10 +65,13 @@ public final class ScriptPlugin extends BasePlugin implements ActionListener {
64 65
     /**
65 66
      * Creates a new instance of the Script Plugin.
66 67
      *
68
+     * @param commandController Command controller
67 69
      * @param actionController The action controller to register listeners with
68 70
      * @param identityManager The Identity Manager that controls the current config
69 71
      */
70
-    public ScriptPlugin(final ActionController actionController, final IdentityManager identityManager) {
72
+    public ScriptPlugin(final CommandController commandController,
73
+            final ActionController actionController,
74
+            final IdentityManager identityManager) {
71 75
         super();
72 76
         scriptDir = identityManager.getConfigDir() + "scripts/";
73 77
         this.actionController = actionController;
@@ -75,7 +79,8 @@ public final class ScriptPlugin extends BasePlugin implements ActionListener {
75 79
         // Add the JS Helper to the scriptFactory
76 80
         getScriptFactory().put("globalHelper", getJavaScriptHelper());
77 81
         getScriptFactory().put("globalVariables", getGlobalVariables());
78
-        registerCommand(new ScriptCommand(this), ScriptCommand.INFO);
82
+        registerCommand(new ScriptCommand(commandController, this),
83
+                ScriptCommand.INFO);
79 84
     }
80 85
 
81 86
     /** {@inheritDoc} */

+ 6
- 2
src/com/dmdirc/addons/systray/PopupCommand.java View File

@@ -28,6 +28,7 @@ import com.dmdirc.commandparser.CommandArguments;
28 28
 import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.context.CommandContext;
31
+import com.dmdirc.interfaces.CommandController;
31 32
 
32 33
 /**
33 34
  * The /popup command allows the user to show a popup message from the system
@@ -44,10 +45,13 @@ public final class PopupCommand extends Command {
44 45
 
45 46
     /**
46 47
      * Creates a new instance of PopupCommand.
48
+     *
49
+     * @param commandController Command controller
47 50
      * @param newParent The plugin that this command belongs to
48 51
      */
49
-    public PopupCommand(final SystrayPlugin newParent) {
50
-        super();
52
+    public PopupCommand(final CommandController commandController,
53
+            final SystrayPlugin newParent) {
54
+        super(commandController);
51 55
 
52 56
         this.parent = newParent;
53 57
     }

+ 6
- 2
src/com/dmdirc/addons/systray/SystrayPlugin.java View File

@@ -33,6 +33,7 @@ import com.dmdirc.config.prefs.PreferencesDialogModel;
33 33
 import com.dmdirc.config.prefs.PreferencesSetting;
34 34
 import com.dmdirc.config.prefs.PreferencesType;
35 35
 import com.dmdirc.interfaces.ActionController;
36
+import com.dmdirc.interfaces.CommandController;
36 37
 import com.dmdirc.plugins.BasePlugin;
37 38
 import com.dmdirc.plugins.PluginInfo;
38 39
 import com.dmdirc.ui.IconManager;
@@ -69,10 +70,12 @@ public final class SystrayPlugin extends BasePlugin implements ActionListener,
69 70
     /**
70 71
      * Creates a new system tray plugin.
71 72
      *
73
+     * @param commandController Command controller
72 74
      * @param pluginInfo This plugin's plugin info
73 75
      * @param actionController The action controller to use
74 76
      */
75
-    public SystrayPlugin(final PluginInfo pluginInfo,
77
+    public SystrayPlugin(final CommandController commandController,
78
+            final PluginInfo pluginInfo,
76 79
             final ActionController actionController) {
77 80
         super();
78 81
 
@@ -93,7 +96,8 @@ public final class SystrayPlugin extends BasePlugin implements ActionListener,
93 96
                 .getImage("logo"), "DMDirc", menu);
94 97
         icon.setImageAutoSize(true);
95 98
         icon.addMouseListener(this);
96
-        registerCommand(new PopupCommand(this), PopupCommand.INFO);
99
+        registerCommand(new PopupCommand(commandController, this),
100
+                PopupCommand.INFO);
97 101
     }
98 102
 
99 103
     /**

+ 6
- 2
src/com/dmdirc/addons/time/TimePlugin.java View File

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.addons.time;
24 24
 
25 25
 import com.dmdirc.interfaces.ActionController;
26
+import com.dmdirc.interfaces.CommandController;
26 27
 import com.dmdirc.plugins.BasePlugin;
27 28
 
28 29
 import java.util.Calendar;
@@ -46,14 +47,17 @@ public final class TimePlugin extends BasePlugin {
46 47
     /**
47 48
      * Creates a new instance of this plugin.
48 49
      *
50
+     * @param commandController Command controller
49 51
      * @param actionController The action controller to register listeners with
50 52
      */
51
-    public TimePlugin(final ActionController actionController) {
53
+    public TimePlugin(final CommandController commandController,
54
+            final ActionController actionController) {
52 55
         super();
53 56
 
54 57
         this.actionController = actionController;
55 58
         manager = new TimerManager();
56
-        registerCommand(new TimerCommand(manager), TimerCommand.INFO);
59
+        registerCommand(new TimerCommand(commandController, manager),
60
+                TimerCommand.INFO);
57 61
     }
58 62
 
59 63
     /** {@inheritDoc} */

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

@@ -29,6 +29,7 @@ import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 import com.dmdirc.ui.input.AdditionalTabTargets;
33 34
 
34 35
 import java.util.Map.Entry;
@@ -53,10 +54,12 @@ public final class TimerCommand extends Command implements IntelligentCommand {
53 54
     /**
54 55
      * Creates a new instance of TimerCommand.
55 56
      *
57
+     * @param commandController Command controller
56 58
      * @param manager The instance of TimerManager associated with this command
57 59
      */
58
-    public TimerCommand(final TimerManager manager) {
59
-        super();
60
+    public TimerCommand(final CommandController commandController,
61
+            final TimerManager manager) {
62
+        super(commandController);
60 63
 
61 64
         this.manager = manager;
62 65
     }

+ 18
- 7
src/com/dmdirc/addons/ui_swing/SwingController.java View File

@@ -55,6 +55,7 @@ import com.dmdirc.config.prefs.PreferencesCategory;
55 55
 import com.dmdirc.config.prefs.PreferencesDialogModel;
56 56
 import com.dmdirc.config.prefs.PreferencesSetting;
57 57
 import com.dmdirc.config.prefs.PreferencesType;
58
+import com.dmdirc.interfaces.CommandController;
58 59
 import com.dmdirc.interfaces.ui.UIController;
59 60
 import com.dmdirc.interfaces.ui.Window;
60 61
 import com.dmdirc.logger.ErrorLevel;
@@ -163,11 +164,16 @@ public class SwingController extends BasePlugin implements UIController {
163 164
     /**
164 165
      * Instantiates a new SwingController.
165 166
      *
167
+     * @param commandController Command controller
166 168
      * @param pluginInfo Plugin info
167 169
      * @param identityManager Identity Manager
168
-     * @param main Main
170
+     * @param pluginManager Plugin manager
171
+     * @param serverManager Server manager
172
+     * @param main Main instance (used to quit the client)
173
+     * @param actionManager Action manager
169 174
      */
170
-    public SwingController(final PluginInfo pluginInfo,
175
+    public SwingController(final CommandController commandController,
176
+            final PluginInfo pluginInfo,
171 177
             final IdentityManager identityManager,
172 178
             final PluginManager pluginManager,
173 179
             final ActionManager actionManager,
@@ -190,11 +196,16 @@ public class SwingController extends BasePlugin implements UIController {
190 196
         dialogManager = new DialogManager(this);
191 197
         setAntiAlias();
192 198
         windows = new ArrayList<java.awt.Window>();
193
-        registerCommand(new ServerSettings(), ServerSettings.INFO);
194
-        registerCommand(new ChannelSettings(), ChannelSettings.INFO);
195
-        registerCommand(new Input(windowFactory), Input.INFO);
196
-        registerCommand(new PopOutCommand(this), PopOutCommand.INFO);
197
-        registerCommand(new PopInCommand(this), PopInCommand.INFO);
199
+        registerCommand(new ServerSettings(commandController),
200
+                ServerSettings.INFO);
201
+        registerCommand(new ChannelSettings(commandController),
202
+                ChannelSettings.INFO);
203
+        registerCommand(new Input(commandController, windowFactory),
204
+                Input.INFO);
205
+        registerCommand(new PopOutCommand(commandController, this),
206
+                PopOutCommand.INFO);
207
+        registerCommand(new PopInCommand(commandController, this),
208
+                PopInCommand.INFO);
198 209
     }
199 210
 
200 211
     /**

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

@@ -33,6 +33,7 @@ import com.dmdirc.commandparser.commands.CommandOptions;
33 33
 import com.dmdirc.commandparser.commands.IntelligentCommand;
34 34
 import com.dmdirc.commandparser.commands.context.ChannelCommandContext;
35 35
 import com.dmdirc.commandparser.commands.context.CommandContext;
36
+import com.dmdirc.interfaces.CommandController;
36 37
 import com.dmdirc.ui.input.AdditionalTabTargets;
37 38
 
38 39
 /**
@@ -47,6 +48,15 @@ public class ChannelSettings extends Command implements
47 48
             "channelsettings - opens the channel settings window",
48 49
             CommandType.TYPE_CHANNEL);
49 50
 
51
+    /**
52
+     * Creates a new instance of the ChannelSettings command
53
+     *
54
+     * @param controller Command controller for the command
55
+     */
56
+    public ChannelSettings(final CommandController controller) {
57
+        super(controller);
58
+    }
59
+
50 60
     /** {@inheritDoc} */
51 61
     @Override
52 62
     public void execute(final FrameContainer origin,

+ 5
- 3
src/com/dmdirc/addons/ui_swing/commands/Input.java View File

@@ -31,6 +31,7 @@ import com.dmdirc.commandparser.CommandType;
31 31
 import com.dmdirc.commandparser.commands.Command;
32 32
 import com.dmdirc.commandparser.commands.IntelligentCommand;
33 33
 import com.dmdirc.commandparser.commands.context.CommandContext;
34
+import com.dmdirc.interfaces.CommandController;
34 35
 import com.dmdirc.ui.input.AdditionalTabTargets;
35 36
 import com.dmdirc.interfaces.ui.InputWindow;
36 37
 
@@ -52,10 +53,12 @@ public class Input extends Command implements IntelligentCommand {
52 53
     /**
53 54
      * Creates a new input command.
54 55
      *
56
+     * @param commandController Command controller
55 57
      * @param windowFactory Window factory to get windows from
56 58
      */
57
-    public Input(final SwingWindowFactory windowFactory) {
58
-        super();
59
+    public Input(final CommandController commandController,
60
+            final SwingWindowFactory windowFactory) {
61
+        super(commandController);
59 62
         this.windowFactory = windowFactory;
60 63
     }
61 64
 
@@ -66,7 +69,6 @@ public class Input extends Command implements IntelligentCommand {
66 69
         if (args.getArguments().length == 0) {
67 70
             showUsage(origin, args.isSilent(), "input",
68 71
                     "[--clear] <text to insert into inputfield");
69
-            return;
70 72
         } else if (args.getArguments().length == 1
71 73
                 && "--clear".equals(args.getArgumentsAsString(0))) {
72 74
             ((InputWindow) windowFactory.getSwingWindow(origin))

+ 5
- 2
src/com/dmdirc/addons/ui_swing/commands/PopInCommand.java View File

@@ -32,6 +32,7 @@ import com.dmdirc.commandparser.CommandInfo;
32 32
 import com.dmdirc.commandparser.CommandType;
33 33
 import com.dmdirc.commandparser.commands.Command;
34 34
 import com.dmdirc.commandparser.commands.context.CommandContext;
35
+import com.dmdirc.interfaces.CommandController;
35 36
 
36 37
 /**
37 38
  * Command to pop in windows.
@@ -49,10 +50,12 @@ public class PopInCommand extends Command {
49 50
     /**
50 51
      * Create a new instance of PopInCommand.
51 52
      *
53
+     * @param commandController Command controller
52 54
      * @param controller SwingWindowController associated with this command
53 55
      */
54
-    public PopInCommand(final SwingController controller) {
55
-        super();
56
+    public PopInCommand(final CommandController commandController,
57
+            final SwingController controller) {
58
+        super(commandController);
56 59
         this.controller = controller;
57 60
     }
58 61
 

+ 5
- 2
src/com/dmdirc/addons/ui_swing/commands/PopOutCommand.java View File

@@ -32,6 +32,7 @@ import com.dmdirc.commandparser.CommandInfo;
32 32
 import com.dmdirc.commandparser.CommandType;
33 33
 import com.dmdirc.commandparser.commands.Command;
34 34
 import com.dmdirc.commandparser.commands.context.CommandContext;
35
+import com.dmdirc.interfaces.CommandController;
35 36
 
36 37
 /**
37 38
  * Command to pop out windows.
@@ -49,10 +50,12 @@ public class PopOutCommand extends Command {
49 50
     /**
50 51
      * Create a new instance of PopOutCommand.
51 52
      *
53
+     * @param commandController Command controller
52 54
      * @param controller SwingWindowController associated with this command
53 55
      */
54
-    public PopOutCommand(final SwingController controller) {
55
-        super();
56
+    public PopOutCommand(final CommandController commandController,
57
+            final SwingController controller) {
58
+        super(commandController);
56 59
         this.controller = controller;
57 60
     }
58 61
 

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

@@ -32,6 +32,7 @@ import com.dmdirc.commandparser.commands.Command;
32 32
 import com.dmdirc.commandparser.commands.CommandOptions;
33 33
 import com.dmdirc.commandparser.commands.IntelligentCommand;
34 34
 import com.dmdirc.commandparser.commands.context.CommandContext;
35
+import com.dmdirc.interfaces.CommandController;
35 36
 import com.dmdirc.ui.input.AdditionalTabTargets;
36 37
 
37 38
 /**
@@ -47,6 +48,15 @@ public class ServerSettings extends Command implements IntelligentCommand {
47 48
             "serversettings - opens the server settings window",
48 49
             CommandType.TYPE_SERVER);
49 50
 
51
+    /**
52
+     * Creates a new instance of the ServerSettings command
53
+     *
54
+     * @param controller Command controller for the command
55
+     */
56
+    public ServerSettings(final CommandController controller) {
57
+        super(controller);
58
+    }
59
+
50 60
     /** {@inheritDoc} */
51 61
     @Override
52 62
     public void execute(final FrameContainer origin,

+ 8
- 3
src/com/dmdirc/addons/urlcatcher/UrlCatcherPlugin.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.actions.CoreActionType;
29 29
 import com.dmdirc.interfaces.actions.ActionType;
30 30
 import com.dmdirc.config.IdentityManager;
31 31
 import com.dmdirc.interfaces.ActionListener;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 import com.dmdirc.interfaces.ConfigChangeListener;
33 34
 import com.dmdirc.plugins.BasePlugin;
34 35
 import com.dmdirc.ui.messages.Styliser;
@@ -48,10 +49,14 @@ public class UrlCatcherPlugin extends BasePlugin implements ActionListener,
48 49
     /** Whether to capture URLs from the raw window. */
49 50
     private boolean captureRaw = false;
50 51
 
51
-    /** Creates a new instance of this plugin. */
52
-    public UrlCatcherPlugin() {
52
+    /**
53
+     * Creates a new instance of this plugin.
54
+     *
55
+     * @param commandController Command controller
56
+     */
57
+    public UrlCatcherPlugin(final CommandController commandController) {
53 58
         super();
54
-        registerCommand(new UrlListCommand(this), UrlListCommand.INFO);
59
+        registerCommand(new UrlListCommand(commandController, this), UrlListCommand.INFO);
55 60
     }
56 61
 
57 62
     /** {@inheritDoc} */

+ 5
- 1
src/com/dmdirc/addons/urlcatcher/UrlListCommand.java View File

@@ -29,6 +29,7 @@ import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.IntelligentCommand;
31 31
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
+import com.dmdirc.interfaces.CommandController;
32 33
 import com.dmdirc.ui.input.AdditionalTabTargets;
33 34
 
34 35
 import java.util.Map;
@@ -49,9 +50,12 @@ public class UrlListCommand extends Command implements IntelligentCommand {
49 50
      * Creates a new URL List command, outputting all known URLs seen by the URL
50 51
      * catcher plugin to the active window.
51 52
      *
53
+     * @param commandController Command controller
52 54
      * @param plugin Parent plugin
53 55
      */
54
-    public UrlListCommand(final UrlCatcherPlugin plugin) {
56
+    public UrlListCommand(final CommandController commandController,
57
+            final UrlCatcherPlugin plugin) {
58
+        super(commandController);
55 59
         this.plugin = plugin;
56 60
     }
57 61
 

+ 4
- 2
src/com/dmdirc/addons/windowflashing/FlashWindow.java View File

@@ -28,6 +28,7 @@ import com.dmdirc.commandparser.CommandArguments;
28 28
 import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.commandparser.commands.Command;
30 30
 import com.dmdirc.commandparser.commands.context.CommandContext;
31
+import com.dmdirc.interfaces.CommandController;
31 32
 
32 33
 /**
33 34
  * Command to flash an inactive window under Windows.
@@ -44,10 +45,11 @@ public class FlashWindow extends Command {
44 45
     /**
45 46
      * Creates a new flash window command.
46 47
      *
48
+     * @param controller Command controller
47 49
      * @param plugin Parent plugin to trigger window flashing
48 50
      */
49
-    public FlashWindow(final WindowFlashing plugin) {
50
-        super();
51
+    public FlashWindow(final CommandController controller, final WindowFlashing plugin) {
52
+        super(controller);
51 53
         this.plugin = plugin;
52 54
     }
53 55
 

+ 5
- 2
src/com/dmdirc/addons/windowflashing/WindowFlashing.java View File

@@ -35,6 +35,7 @@ import com.dmdirc.config.prefs.PreferencesDialogModel;
35 35
 import com.dmdirc.config.prefs.PreferencesSetting;
36 36
 import com.dmdirc.config.prefs.PreferencesType;
37 37
 import com.dmdirc.interfaces.ActionListener;
38
+import com.dmdirc.interfaces.CommandController;
38 39
 import com.dmdirc.interfaces.actions.ActionType;
39 40
 import com.dmdirc.plugins.BasePlugin;
40 41
 import com.dmdirc.plugins.PluginInfo;
@@ -86,17 +87,19 @@ public class WindowFlashing extends BasePlugin implements ActionListener {
86 87
      * @param identityManager Identity Manager
87 88
      * @param controller Parent swing controller
88 89
      * @param actionManager Action manager
90
+     * @param commandController Command controller
89 91
      */
90 92
     public WindowFlashing(final PluginInfo pluginInfo,
91 93
             final IdentityManager identityManager,
92 94
             final SwingController controller,
93
-            final ActionManager actionManager) {
95
+            final ActionManager actionManager,
96
+            final CommandController commandController) {
94 97
         super();
95 98
         this.pluginInfo = pluginInfo;
96 99
         this.controller = controller;
97 100
         this.actionManager = actionManager;
98 101
         binder = identityManager.getGlobalConfiguration().getBinder();
99
-        registerCommand(new FlashWindow(this), FlashWindow.INFO);
102
+        registerCommand(new FlashWindow(commandController, this), FlashWindow.INFO);
100 103
     }
101 104
 
102 105
     /**

+ 9
- 14
test/com/dmdirc/addons/debug/DebugTest.java View File

@@ -22,13 +22,11 @@
22 22
 
23 23
 package com.dmdirc.addons.debug;
24 24
 
25
-import com.dmdirc.TestMain;
26 25
 import com.dmdirc.FrameContainer;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.commands.context.CommandContext;
29
-import com.dmdirc.config.InvalidIdentityFileException;
28
+import com.dmdirc.interfaces.CommandController;
30 29
 
31
-import org.junit.BeforeClass;
32 30
 import org.junit.Test;
33 31
 
34 32
 import static com.dmdirc.harness.CommandArgsMatcher.*;
@@ -36,13 +34,6 @@ import static org.mockito.Mockito.*;
36 34
 
37 35
 public class DebugTest {
38 36
 
39
-    @BeforeClass
40
-    public static void setUp() throws InvalidIdentityFileException {
41
-        // Command has a dependency on CommandManager (to get the command char)
42
-        // And CommandManager has a dependency on IdentityManager for the same
43
-        TestMain.getTestMain();
44
-    }
45
-
46 37
     /** Checks the debug command with no arguments shows usage. */
47 38
     @Test
48 39
     public void testNoArgs() {
@@ -52,7 +43,7 @@ public class DebugTest {
52 43
         when(arguments.isCommand()).thenReturn(true);
53 44
         when(arguments.getArguments()).thenReturn(new String[0]);
54 45
 
55
-        final Debug debug = new Debug(null);
46
+        final Debug debug = new Debug(mock(CommandController.class), null);
56 47
 
57 48
         debug.execute(container, arguments, null);
58 49
         verify(container).addLine(eq("commandUsage"), anyObject(),
@@ -70,7 +61,7 @@ public class DebugTest {
70 61
         when(arguments.isCommand()).thenReturn(true);
71 62
         when(arguments.getArguments()).thenReturn(new String[]{"test"});
72 63
 
73
-        final Debug debug = new Debug(plugin);
64
+        final Debug debug = new Debug(mock(CommandController.class), plugin);
74 65
 
75 66
         debug.execute(container, arguments, null);
76 67
         verify(container).addLine(eq("commandError"), anyObject());
@@ -84,14 +75,16 @@ public class DebugTest {
84 75
         final FrameContainer container = mock(FrameContainer.class);
85 76
         final DebugCommand command = mock(DebugCommand.class);
86 77
         final CommandContext context = mock(CommandContext.class);
78
+        final CommandController commandController = mock(CommandController.class);
87 79
 
88 80
         when(plugin.getCommand("test")).thenReturn(command);
89 81
         when(arguments.isCommand()).thenReturn(true);
90 82
         when(arguments.getArguments()).thenReturn(new String[]{"test"});
91 83
         when(arguments.getArgumentsAsString(1)).thenReturn("");
92 84
         when(command.getName()).thenReturn("test");
85
+        when(commandController.getCommandChar()).thenReturn('/');
93 86
 
94
-        final Debug debug = new Debug(plugin);
87
+        final Debug debug = new Debug(commandController, plugin);
95 88
 
96 89
         debug.execute(container, arguments, context);
97 90
 
@@ -107,14 +100,16 @@ public class DebugTest {
107 100
         final FrameContainer container = mock(FrameContainer.class);
108 101
         final DebugCommand command = mock(DebugCommand.class);
109 102
         final CommandContext context = mock(CommandContext.class);
103
+        final CommandController commandController = mock(CommandController.class);
110 104
 
111 105
         when(plugin.getCommand("test")).thenReturn(command);
112 106
         when(arguments.isCommand()).thenReturn(true);
113 107
         when(arguments.getArguments()).thenReturn(new String[]{"test", "1", "2", "3"});
114 108
         when(arguments.getArgumentsAsString(1)).thenReturn("1 2 3");
115 109
         when(command.getName()).thenReturn("test");
110
+        when(commandController.getCommandChar()).thenReturn('/');
116 111
 
117
-        final Debug debug = new Debug(plugin);
112
+        final Debug debug = new Debug(commandController, plugin);
118 113
 
119 114
         debug.execute(container, arguments, context);
120 115
 

+ 3
- 8
test/com/dmdirc/addons/urlcatcher/UrlCatcherPluginTest.java View File

@@ -22,12 +22,11 @@
22 22
 
23 23
 package com.dmdirc.addons.urlcatcher;
24 24
 
25
-import com.dmdirc.TestMain;
26 25
 import com.dmdirc.FrameContainer;
27 26
 import com.dmdirc.actions.CoreActionType;
28 27
 import com.dmdirc.config.ConfigManager;
29
-import com.dmdirc.config.IdentityManager;
30 28
 import com.dmdirc.config.InvalidIdentityFileException;
29
+import com.dmdirc.interfaces.CommandController;
31 30
 import com.dmdirc.ui.messages.Styliser;
32 31
 import org.junit.BeforeClass;
33 32
 import org.junit.Test;
@@ -53,9 +52,7 @@ public class UrlCatcherPluginTest {
53 52
 
54 53
     @Test
55 54
     public void testURLCounting() throws InvalidIdentityFileException {
56
-        TestMain.getTestMain();
57
-
58
-        final UrlCatcherPlugin plugin = new UrlCatcherPlugin();
55
+        final UrlCatcherPlugin plugin = new UrlCatcherPlugin(mock(CommandController.class));
59 56
 
60 57
         plugin.processEvent(CoreActionType.CHANNEL_MESSAGE, null,
61 58
                 container, "This is a message - http://www.google.com/ foo");
@@ -70,9 +67,7 @@ public class UrlCatcherPluginTest {
70 67
 
71 68
     @Test
72 69
     public void testURLCatching() throws InvalidIdentityFileException {
73
-        TestMain.getTestMain();
74
-
75
-        final UrlCatcherPlugin plugin = new UrlCatcherPlugin();
70
+        final UrlCatcherPlugin plugin = new UrlCatcherPlugin(mock(CommandController.class));
76 71
 
77 72
         plugin.processEvent(CoreActionType.CHANNEL_MESSAGE, null,
78 73
                 container, "http://www.google.com/ www.example.com foo://bar.baz");

Loading…
Cancel
Save