Bladeren bron

Make Channel/Chat/etcCommand implement CommandInfo temporarily

tags/0.6.3m1rc1
Chris Smith 15 jaren geleden
bovenliggende
commit
bc3b7f458e

+ 10
- 1
src/com/dmdirc/commandparser/commands/ChannelCommand.java Bestand weergeven

@@ -24,13 +24,15 @@ package com.dmdirc.commandparser.commands;
24 24
 
25 25
 import com.dmdirc.Channel;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.CommandInfo;
28
+import com.dmdirc.commandparser.CommandType;
27 29
 import com.dmdirc.ui.interfaces.InputWindow;
28 30
 
29 31
 /**
30 32
  * Represents a command which can be performed only in the context of a channel.
31 33
  * @author chris
32 34
  */
33
-public abstract class ChannelCommand extends Command {
35
+public abstract class ChannelCommand extends Command implements CommandInfo {
34 36
     
35 37
     /**
36 38
      * Executes this command.
@@ -42,4 +44,11 @@ public abstract class ChannelCommand extends Command {
42 44
      */
43 45
     public abstract void execute(InputWindow origin, Server server, Channel channel,
44 46
             boolean isSilent, String... args);
47
+
48
+    /** {@inheritDoc} */
49
+    @Override
50
+    public CommandType getType() {
51
+        return CommandType.TYPE_CHANNEL;
52
+    }
53
+    
45 54
 }

+ 9
- 1
src/com/dmdirc/commandparser/commands/ChatCommand.java Bestand weergeven

@@ -24,6 +24,8 @@ package com.dmdirc.commandparser.commands;
24 24
 
25 25
 import com.dmdirc.MessageTarget;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.CommandInfo;
28
+import com.dmdirc.commandparser.CommandType;
27 29
 import com.dmdirc.ui.interfaces.InputWindow;
28 30
 
29 31
 /**
@@ -32,7 +34,7 @@ import com.dmdirc.ui.interfaces.InputWindow;
32 34
  *
33 35
  * @author Chris
34 36
  */
35
-public abstract class ChatCommand extends Command {
37
+public abstract class ChatCommand extends Command implements CommandInfo {
36 38
     
37 39
     /**
38 40
      * Executes this command.
@@ -45,4 +47,10 @@ public abstract class ChatCommand extends Command {
45 47
      */
46 48
     public abstract void execute(InputWindow origin, Server server, MessageTarget target,
47 49
             boolean isSilent, String... args);
50
+
51
+    /** {@inheritDoc} */
52
+    @Override
53
+    public CommandType getType() {
54
+        return CommandType.TYPE_CHAT;
55
+    }
48 56
 }

+ 9
- 1
src/com/dmdirc/commandparser/commands/GlobalCommand.java Bestand weergeven

@@ -22,6 +22,8 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands;
24 24
 
25
+import com.dmdirc.commandparser.CommandInfo;
26
+import com.dmdirc.commandparser.CommandType;
25 27
 import com.dmdirc.ui.interfaces.InputWindow;
26 28
 
27 29
 /**
@@ -29,7 +31,7 @@ import com.dmdirc.ui.interfaces.InputWindow;
29 31
  * no servers.
30 32
  * @author chris
31 33
  */
32
-public abstract class GlobalCommand extends Command {
34
+public abstract class GlobalCommand extends Command implements CommandInfo {
33 35
         
34 36
     /**
35 37
      * Executes this command. Note that for global commands, origin may be
@@ -39,4 +41,10 @@ public abstract class GlobalCommand extends Command {
39 41
      * @param args Arguments passed to this command
40 42
      */
41 43
     public abstract void execute(InputWindow origin, boolean isSilent, String ... args);
44
+
45
+    /** {@inheritDoc} */
46
+    @Override
47
+    public CommandType getType() {
48
+        return CommandType.TYPE_GLOBAL;
49
+    }
42 50
 }

+ 9
- 1
src/com/dmdirc/commandparser/commands/QueryCommand.java Bestand weergeven

@@ -24,13 +24,15 @@ package com.dmdirc.commandparser.commands;
24 24
 
25 25
 import com.dmdirc.Query;
26 26
 import com.dmdirc.Server;
27
+import com.dmdirc.commandparser.CommandInfo;
28
+import com.dmdirc.commandparser.CommandType;
27 29
 import com.dmdirc.ui.interfaces.InputWindow;
28 30
 
29 31
 /**
30 32
  * Represents a command which can be performed only in the context of a query.
31 33
  * @author chris
32 34
  */
33
-public abstract class QueryCommand extends Command {
35
+public abstract class QueryCommand extends Command implements CommandInfo {
34 36
         
35 37
     /**
36 38
      * Executes this command.
@@ -42,4 +44,10 @@ public abstract class QueryCommand extends Command {
42 44
      */
43 45
     public abstract void execute(InputWindow origin, Server server, Query query,
44 46
             boolean isSilent, String... args);
47
+
48
+    /** {@inheritDoc} */
49
+    @Override
50
+    public CommandType getType() {
51
+        return CommandType.TYPE_QUERY;
52
+    }
45 53
 }

+ 9
- 1
src/com/dmdirc/commandparser/commands/ServerCommand.java Bestand weergeven

@@ -23,6 +23,8 @@
23 23
 package com.dmdirc.commandparser.commands;
24 24
 
25 25
 import com.dmdirc.Server;
26
+import com.dmdirc.commandparser.CommandInfo;
27
+import com.dmdirc.commandparser.CommandType;
26 28
 import com.dmdirc.ui.interfaces.InputWindow;
27 29
 
28 30
 /**
@@ -30,7 +32,7 @@ import com.dmdirc.ui.interfaces.InputWindow;
30 32
  * a server instance.
31 33
  * @author chris
32 34
  */
33
-public abstract class ServerCommand extends Command {
35
+public abstract class ServerCommand extends Command implements CommandInfo {
34 36
     
35 37
     /**
36 38
      * Executes this command.
@@ -41,4 +43,10 @@ public abstract class ServerCommand extends Command {
41 43
      */
42 44
     public abstract void execute(InputWindow origin, Server server,
43 45
             boolean isSilent, String ... args);
46
+
47
+    /** {@inheritDoc} */
48
+    @Override
49
+    public CommandType getType() {
50
+        return CommandType.TYPE_SERVER;
51
+    }
44 52
 }

+ 1
- 1
src/com/dmdirc/commandparser/commands/channel/Ban.java Bestand weergeven

@@ -95,6 +95,6 @@ public final class Ban extends ChannelCommand implements IntelligentCommand {
95 95
         }
96 96
         
97 97
         return res;
98
-    } 
98
+    }
99 99
     
100 100
 }

Laden…
Annuleren
Opslaan