Quellcode durchsuchen

Made a load of server commands global

git-svn-id: http://svn.dmdirc.com/trunk@1266 00569f92-eb28-0410-84fd-f71c24880f
tags/0.4
Chris Smith vor 17 Jahren
Ursprung
Commit
81af14e539

+ 9
- 9
src/uk/org/ownage/dmdirc/commandparser/CommandManager.java Datei anzeigen

@@ -265,7 +265,6 @@ public final class CommandManager {
265 265
         
266 266
         // Server commands
267 267
         new AllChannels();
268
-        new AllServers();
269 268
         new Away();
270 269
         new Back();
271 270
         new Clear();
@@ -276,8 +275,6 @@ public final class CommandManager {
276 275
         new Help();
277 276
         new Ignore();
278 277
         new Join();
279
-        new LoadFormatter();
280
-        new LoadPlugin();
281 278
         new Message();
282 279
         new Motd();
283 280
         new Nick();
@@ -285,11 +282,6 @@ public final class CommandManager {
285 282
         new Query();
286 283
         new Raw();
287 284
         new Reconnect();
288
-        new ReloadActions();
289
-        new ReloadFormatter();
290
-        new ReloadPlugin();
291
-        new SaveFormatter();
292
-        new Set();
293 285
         new Whois();
294 286
         
295 287
         // Query commands
@@ -300,6 +292,14 @@ public final class CommandManager {
300 292
         new Exit();
301 293
         new ExitDefault();
302 294
         new NewServer();
295
+        new AllServers();
296
+        new LoadFormatter();
297
+        new LoadPlugin();
298
+        new ReloadActions();
299
+        new ReloadFormatter();
300
+        new ReloadPlugin();
301
+        new SaveFormatter();
302
+        new Set();
303 303
     }
304 304
     
305 305
     /**
@@ -498,7 +498,7 @@ public final class CommandManager {
498 498
         }
499 499
         
500 500
         return getCommandNames(globalCommands);
501
-    }    
501
+    }
502 502
     
503 503
     /**
504 504
      * Returns the names (including command char) of all registered channel

src/uk/org/ownage/dmdirc/commandparser/commands/server/AllServers.java → src/uk/org/ownage/dmdirc/commandparser/commands/global/AllServers.java Datei anzeigen

@@ -20,19 +20,19 @@
20 20
  * SOFTWARE.
21 21
  */
22 22
 
23
-package uk.org.ownage.dmdirc.commandparser.commands.server;
23
+package uk.org.ownage.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import uk.org.ownage.dmdirc.Server;
26 26
 import uk.org.ownage.dmdirc.ServerManager;
27 27
 import uk.org.ownage.dmdirc.commandparser.CommandManager;
28 28
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
29
-import uk.org.ownage.dmdirc.commandparser.ServerCommand;
29
+import uk.org.ownage.dmdirc.commandparser.GlobalCommand;
30 30
 
31 31
 /**
32 32
  * The AllServers command allows users to issue commands to all servers.
33 33
  * @author chris
34 34
  */
35
-public class AllServers extends ServerCommand {
35
+public class AllServers extends GlobalCommand {
36 36
     
37 37
     /** Creates a new instance of AllServers. */
38 38
     public AllServers() {
@@ -44,11 +44,9 @@ public class AllServers extends ServerCommand {
44 44
     /**
45 45
      * Executes this command.
46 46
      * @param origin The frame in which this command was issued
47
-     * @param server The server object that this command is associated with
48 47
      * @param args The user supplied arguments
49 48
      */
50
-    public void execute(final CommandWindow origin, final Server server,
51
-            final String... args) {
49
+    public void execute(final CommandWindow origin, final String... args) {
52 50
         final String command = implodeArgs(args);
53 51
         CommandWindow window;
54 52
         

src/uk/org/ownage/dmdirc/commandparser/commands/server/LoadFormatter.java → src/uk/org/ownage/dmdirc/commandparser/commands/global/LoadFormatter.java Datei anzeigen

@@ -20,19 +20,18 @@
20 20
  * SOFTWARE.
21 21
  */
22 22
 
23
-package uk.org.ownage.dmdirc.commandparser.commands.server;
23
+package uk.org.ownage.dmdirc.commandparser.commands.global;
24 24
 
25
-import uk.org.ownage.dmdirc.Server;
26 25
 import uk.org.ownage.dmdirc.commandparser.CommandManager;
27 26
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
28
-import uk.org.ownage.dmdirc.commandparser.ServerCommand;
27
+import uk.org.ownage.dmdirc.commandparser.GlobalCommand;
29 28
 import uk.org.ownage.dmdirc.ui.messages.Formatter;
30 29
 
31 30
 /**
32 31
  * Allows the user to load a message formatter from a file.
33 32
  * @author chris
34 33
  */
35
-public final class LoadFormatter extends ServerCommand {
34
+public final class LoadFormatter extends GlobalCommand {
36 35
     
37 36
     /**
38 37
      * Creates a new instance of LoadFormatter.
@@ -46,11 +45,9 @@ public final class LoadFormatter extends ServerCommand {
46 45
     /**
47 46
      * Executes this command.
48 47
      * @param origin The frame in which this command was issued
49
-     * @param server The server object that this command is associated with
50 48
      * @param args The user supplied arguments
51 49
      */
52
-    public void execute(final CommandWindow origin, final Server server,
53
-            final String... args) {
50
+    public void execute(final CommandWindow origin, final String... args) {
54 51
         if (Formatter.loadFile(args[0])) {
55 52
             origin.addLine("commandOutput", "Formatter loaded.");
56 53
         } else {

src/uk/org/ownage/dmdirc/commandparser/commands/server/LoadPlugin.java → src/uk/org/ownage/dmdirc/commandparser/commands/global/LoadPlugin.java Datei anzeigen

@@ -20,20 +20,18 @@
20 20
  * SOFTWARE.
21 21
  */
22 22
 
23
-package uk.org.ownage.dmdirc.commandparser.commands.server;
23
+package uk.org.ownage.dmdirc.commandparser.commands.global;
24 24
 
25
-import uk.org.ownage.dmdirc.Server;
26 25
 import uk.org.ownage.dmdirc.commandparser.CommandManager;
27 26
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
28
-import uk.org.ownage.dmdirc.commandparser.ServerCommand;
27
+import uk.org.ownage.dmdirc.commandparser.GlobalCommand;
29 28
 import uk.org.ownage.dmdirc.plugins.PluginManager;
30
-import uk.org.ownage.dmdirc.ui.messages.Formatter;
31 29
 
32 30
 /**
33 31
  * Allows the user to load a plugin.
34 32
  * @author chris
35 33
  */
36
-public final class LoadPlugin extends ServerCommand {
34
+public final class LoadPlugin extends GlobalCommand {
37 35
     
38 36
     /**
39 37
      * Creates a new instance of LoadPlugin.
@@ -47,11 +45,9 @@ public final class LoadPlugin extends ServerCommand {
47 45
     /**
48 46
      * Executes this command.
49 47
      * @param origin The frame in which this command was issued
50
-     * @param server The server object that this command is associated with
51 48
      * @param args The user supplied arguments
52 49
      */
53
-    public void execute(final CommandWindow origin, final Server server,
54
-            final String... args) {
50
+    public void execute(final CommandWindow origin, final String... args) {
55 51
         if (PluginManager.getPluginManager().addPlugin(args[0])) {
56 52
             PluginManager.getPluginManager().getPlugin(args[0]).setActive(true);
57 53
             origin.addLine("commandOutput", "Plugin loaded.");

src/uk/org/ownage/dmdirc/commandparser/commands/server/ReloadActions.java → src/uk/org/ownage/dmdirc/commandparser/commands/global/ReloadActions.java Datei anzeigen

@@ -20,19 +20,18 @@
20 20
  * SOFTWARE.
21 21
  */
22 22
 
23
-package uk.org.ownage.dmdirc.commandparser.commands.server;
23
+package uk.org.ownage.dmdirc.commandparser.commands.global;
24 24
 
25
-import uk.org.ownage.dmdirc.Server;
26 25
 import uk.org.ownage.dmdirc.actions.ActionManager;
27 26
 import uk.org.ownage.dmdirc.commandparser.CommandManager;
28 27
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
29
-import uk.org.ownage.dmdirc.commandparser.ServerCommand;
28
+import uk.org.ownage.dmdirc.commandparser.GlobalCommand;
30 29
 
31 30
 /**
32 31
  * Allows the user to reload actions.
33 32
  * @author chris
34 33
  */
35
-public final class ReloadActions extends ServerCommand {
34
+public final class ReloadActions extends GlobalCommand {
36 35
     
37 36
     /**
38 37
      * Creates a new instance of ReloadActions.
@@ -46,11 +45,9 @@ public final class ReloadActions extends ServerCommand {
46 45
     /**
47 46
      * Executes this command.
48 47
      * @param origin The frame in which this command was issued
49
-     * @param server The server object that this command is associated with
50 48
      * @param args The user supplied arguments
51 49
      */
52
-    public void execute(final CommandWindow origin, final Server server,
53
-            final String... args) {
50
+    public void execute(final CommandWindow origin, final String... args) {
54 51
         ActionManager.loadActions();
55 52
         origin.addLine("commandOutput", "Actions reloaded.");
56 53
     }

src/uk/org/ownage/dmdirc/commandparser/commands/server/ReloadFormatter.java → src/uk/org/ownage/dmdirc/commandparser/commands/global/ReloadFormatter.java Datei anzeigen

@@ -20,19 +20,18 @@
20 20
  * SOFTWARE.
21 21
  */
22 22
 
23
-package uk.org.ownage.dmdirc.commandparser.commands.server;
23
+package uk.org.ownage.dmdirc.commandparser.commands.global;
24 24
 
25
-import uk.org.ownage.dmdirc.Server;
26 25
 import uk.org.ownage.dmdirc.commandparser.CommandManager;
27 26
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
28
-import uk.org.ownage.dmdirc.commandparser.ServerCommand;
27
+import uk.org.ownage.dmdirc.commandparser.GlobalCommand;
29 28
 import uk.org.ownage.dmdirc.ui.messages.Formatter;
30 29
 
31 30
 /**
32 31
  * Allows the user to reload the message formatter.
33 32
  * @author chris
34 33
  */
35
-public final class ReloadFormatter extends ServerCommand {
34
+public final class ReloadFormatter extends GlobalCommand {
36 35
     
37 36
     /**
38 37
      * Creates a new instance of ReloadFormatter.
@@ -46,11 +45,9 @@ public final class ReloadFormatter extends ServerCommand {
46 45
     /**
47 46
      * Executes this command.
48 47
      * @param origin The frame in which this command was issued
49
-     * @param server The server object that this command is associated with
50 48
      * @param args The user supplied arguments
51 49
      */
52
-    public void execute(final CommandWindow origin, final Server server,
53
-            final String... args) {
50
+    public void execute(final CommandWindow origin, final String... args) {
54 51
         Formatter.reload();
55 52
         origin.addLine("commandOutput", "Formatter reloaded.");
56 53
     }

src/uk/org/ownage/dmdirc/commandparser/commands/server/ReloadPlugin.java → src/uk/org/ownage/dmdirc/commandparser/commands/global/ReloadPlugin.java Datei anzeigen

@@ -20,21 +20,19 @@
20 20
  * SOFTWARE.
21 21
  */
22 22
 
23
-package uk.org.ownage.dmdirc.commandparser.commands.server;
23
+package uk.org.ownage.dmdirc.commandparser.commands.global;
24 24
 
25
-import uk.org.ownage.dmdirc.Server;
26 25
 import uk.org.ownage.dmdirc.commandparser.CommandManager;
27 26
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
28
-import uk.org.ownage.dmdirc.commandparser.ServerCommand;
27
+import uk.org.ownage.dmdirc.commandparser.GlobalCommand;
29 28
 import uk.org.ownage.dmdirc.plugins.PluginManager;
30 29
 import uk.org.ownage.dmdirc.plugins.Plugin;
31
-import uk.org.ownage.dmdirc.ui.messages.Formatter;
32 30
 
33 31
 /**
34 32
  * Allows the user to reload a plugin.
35 33
  * @author chris
36 34
  */
37
-public final class ReloadPlugin extends ServerCommand {
35
+public final class ReloadPlugin extends GlobalCommand {
38 36
     
39 37
     /**
40 38
      * Creates a new instance of ReloadPlugin.
@@ -48,11 +46,9 @@ public final class ReloadPlugin extends ServerCommand {
48 46
     /**
49 47
      * Executes this command.
50 48
      * @param origin The frame in which this command was issued
51
-     * @param server The server object that this command is associated with
52 49
      * @param args The user supplied arguments
53 50
      */
54
-    public void execute(final CommandWindow origin, final Server server,
55
-            final String... args) {
51
+    public void execute(final CommandWindow origin, final String... args) {
56 52
         Plugin plugin = PluginManager.getPluginManager().getPlugin(args[0]);
57 53
         if (plugin != null) {
58 54
             boolean isActive = plugin.isActive();

src/uk/org/ownage/dmdirc/commandparser/commands/server/SaveFormatter.java → src/uk/org/ownage/dmdirc/commandparser/commands/global/SaveFormatter.java Datei anzeigen

@@ -20,19 +20,18 @@
20 20
  * SOFTWARE.
21 21
  */
22 22
 
23
-package uk.org.ownage.dmdirc.commandparser.commands.server;
23
+package uk.org.ownage.dmdirc.commandparser.commands.global;
24 24
 
25
-import uk.org.ownage.dmdirc.Server;
26 25
 import uk.org.ownage.dmdirc.commandparser.CommandManager;
27 26
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
28
-import uk.org.ownage.dmdirc.commandparser.ServerCommand;
27
+import uk.org.ownage.dmdirc.commandparser.GlobalCommand;
29 28
 import uk.org.ownage.dmdirc.ui.messages.Formatter;
30 29
 
31 30
 /**
32 31
  * Allows the user to save the message formatter to a file.
33 32
  * @author chris
34 33
  */
35
-public final class SaveFormatter extends ServerCommand {
34
+public final class SaveFormatter extends GlobalCommand {
36 35
     
37 36
     /**
38 37
      * Creates a new instance of SaveFormatter.
@@ -46,11 +45,9 @@ public final class SaveFormatter extends ServerCommand {
46 45
     /**
47 46
      * Executes this command.
48 47
      * @param origin The frame in which this command was issued
49
-     * @param server The server object that this command is associated with
50 48
      * @param args The user supplied arguments
51 49
      */
52
-    public void execute(final CommandWindow origin, final Server server,
53
-            final String... args) {
50
+    public void execute(final CommandWindow origin, final String... args) {
54 51
         if (Formatter.saveAs(args[0])) {
55 52
             origin.addLine("commandOutput", "Formatter saved.");
56 53
         } else {

src/uk/org/ownage/dmdirc/commandparser/commands/server/Set.java → src/uk/org/ownage/dmdirc/commandparser/commands/global/Set.java Datei anzeigen

@@ -20,19 +20,18 @@
20 20
  * SOFTWARE.
21 21
  */
22 22
 
23
-package uk.org.ownage.dmdirc.commandparser.commands.server;
23
+package uk.org.ownage.dmdirc.commandparser.commands.global;
24 24
 
25 25
 import uk.org.ownage.dmdirc.Config;
26
-import uk.org.ownage.dmdirc.Server;
27 26
 import uk.org.ownage.dmdirc.commandparser.CommandManager;
28 27
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
29
-import uk.org.ownage.dmdirc.commandparser.ServerCommand;
28
+import uk.org.ownage.dmdirc.commandparser.GlobalCommand;
30 29
 
31 30
 /**
32 31
  * The set command allows the user to inspect and change global config settings.
33 32
  * @author chris
34 33
  */
35
-public final class Set extends ServerCommand {
34
+public final class Set extends GlobalCommand {
36 35
     
37 36
     /**
38 37
      * Creates a new instance of Set.
@@ -46,11 +45,9 @@ public final class Set extends ServerCommand {
46 45
     /**
47 46
      * Executes this command.
48 47
      * @param origin The frame in which this command was issued
49
-     * @param server The server object that this command is associated with
50 48
      * @param args The user supplied arguments
51 49
      */
52
-    public void execute(final CommandWindow origin, final Server server,
53
-            final String... args) {
50
+    public void execute(final CommandWindow origin, final String... args) {
54 51
         switch (args.length) {
55 52
             case 0:
56 53
                 doDomainList(origin);

Laden…
Abbrechen
Speichern