ソースを参照

Style fixes

git-svn-id: http://svn.dmdirc.com/trunk@515 00569f92-eb28-0410-84fd-f71c24880f
tags/0.3
Gregory Holmes 17年前
コミット
3e897114db
29個のファイルの変更256行の追加213行の削除
  1. 4
    4
      src/uk/org/ownage/dmdirc/commandparser/ChannelCommand.java
  2. 16
    14
      src/uk/org/ownage/dmdirc/commandparser/ChannelCommandParser.java
  3. 17
    17
      src/uk/org/ownage/dmdirc/commandparser/Command.java
  4. 55
    32
      src/uk/org/ownage/dmdirc/commandparser/CommandManager.java
  5. 26
    21
      src/uk/org/ownage/dmdirc/commandparser/CommandParser.java
  6. 5
    3
      src/uk/org/ownage/dmdirc/commandparser/CommandWindow.java
  7. 4
    4
      src/uk/org/ownage/dmdirc/commandparser/QueryCommand.java
  8. 13
    11
      src/uk/org/ownage/dmdirc/commandparser/QueryCommandParser.java
  9. 3
    3
      src/uk/org/ownage/dmdirc/commandparser/ServerCommand.java
  10. 14
    12
      src/uk/org/ownage/dmdirc/commandparser/ServerCommandParser.java
  11. 4
    4
      src/uk/org/ownage/dmdirc/commandparser/commands/Test.java
  12. 5
    4
      src/uk/org/ownage/dmdirc/commandparser/commands/channel/ChannelSettings.java
  13. 6
    6
      src/uk/org/ownage/dmdirc/commandparser/commands/channel/Cycle.java
  14. 5
    4
      src/uk/org/ownage/dmdirc/commandparser/commands/channel/Me.java
  15. 5
    4
      src/uk/org/ownage/dmdirc/commandparser/commands/channel/MeEmpty.java
  16. 5
    7
      src/uk/org/ownage/dmdirc/commandparser/commands/channel/Part.java
  17. 6
    5
      src/uk/org/ownage/dmdirc/commandparser/commands/channel/PartDefault.java
  18. 5
    4
      src/uk/org/ownage/dmdirc/commandparser/commands/query/QueryMe.java
  19. 7
    6
      src/uk/org/ownage/dmdirc/commandparser/commands/query/QueryMeEmpty.java
  20. 5
    5
      src/uk/org/ownage/dmdirc/commandparser/commands/server/Help.java
  21. 6
    6
      src/uk/org/ownage/dmdirc/commandparser/commands/server/Join.java
  22. 6
    6
      src/uk/org/ownage/dmdirc/commandparser/commands/server/LoadFormatter.java
  23. 7
    7
      src/uk/org/ownage/dmdirc/commandparser/commands/server/Nick.java
  24. 4
    3
      src/uk/org/ownage/dmdirc/commandparser/commands/server/Quit.java
  25. 5
    4
      src/uk/org/ownage/dmdirc/commandparser/commands/server/QuitDefault.java
  26. 4
    3
      src/uk/org/ownage/dmdirc/commandparser/commands/server/Raw.java
  27. 7
    7
      src/uk/org/ownage/dmdirc/commandparser/commands/server/ReloadFormatter.java
  28. 6
    6
      src/uk/org/ownage/dmdirc/commandparser/commands/server/SaveFormatter.java
  29. 1
    1
      src/uk/org/ownage/dmdirc/logger/LogLevel.java

+ 4
- 4
src/uk/org/ownage/dmdirc/commandparser/ChannelCommand.java ファイルの表示

@@ -26,22 +26,22 @@ import uk.org.ownage.dmdirc.Channel;
26 26
 import uk.org.ownage.dmdirc.Server;
27 27
 
28 28
 /**
29
- * Represents a command which can be performed only in the context of a channel
29
+ * Represents a command which can be performed only in the context of a channel.
30 30
  * @author chris
31 31
  */
32 32
 public abstract class ChannelCommand extends Command {
33 33
     
34
-    /** Creates a new instance of ChannelCommand */
34
+    /** Creates a new instance of ChannelCommand. */
35 35
     public ChannelCommand() {
36 36
         super();
37 37
     }
38 38
     
39 39
     /**
40
-     * Executes this command
40
+     * Executes this command.
41 41
      * @param origin The window in which the command was typed
42 42
      * @param server The server instance that this command is being executed on
43 43
      * @param channel The channel instance that this command is being executed on
44 44
      * @param args Arguments passed to this command
45 45
      */
46 46
     public abstract void execute(CommandWindow origin, Server server, Channel channel, String... args);
47
-}
47
+}

+ 16
- 14
src/uk/org/ownage/dmdirc/commandparser/ChannelCommandParser.java ファイルの表示

@@ -30,30 +30,30 @@ import uk.org.ownage.dmdirc.Server;
30 30
  * both channel and server commands.
31 31
  * @author chris
32 32
  */
33
-public class ChannelCommandParser extends CommandParser {
33
+public final class ChannelCommandParser extends CommandParser {
34 34
     
35 35
     /**
36
-     * The server instance that this parser is attached to
36
+     * The server instance that this parser is attached to.
37 37
      */
38 38
     private Server server;
39 39
     /**
40
-     * The channel instance that this parser is attached to
40
+     * The channel instance that this parser is attached to.
41 41
      */
42 42
     private Channel channel;
43 43
     
44 44
     /**
45
-     * Creates a new instance of ChannelCommandParser
46
-     * @param server The server instance that this parser is attached to
47
-     * @param channel The channel instance that this parser is attached to
45
+     * Creates a new instance of ChannelCommandParser.
46
+     * @param newServer The server instance that this parser is attached to
47
+     * @param newChannel The channel instance that this parser is attached to
48 48
      */
49
-    public ChannelCommandParser(Server server, Channel channel) {
49
+    public ChannelCommandParser(final Server newServer, final Channel newChannel) {
50 50
         super();
51 51
         
52
-        this.server = server;
53
-        this.channel = channel;
52
+        this.server = newServer;
53
+        this.channel = newChannel;
54 54
     }
55 55
     
56
-    /** Loads the relevant commands into the parser */
56
+    /** Loads the relevant commands into the parser. */
57 57
     protected void loadCommands() {
58 58
         CommandManager.loadChannelCommands(this);
59 59
         CommandManager.loadServerCommands(this);
@@ -65,7 +65,8 @@ public class ChannelCommandParser extends CommandParser {
65 65
      * @param command The command to be executed
66 66
      * @param args The arguments to the command
67 67
      */
68
-    protected void executeCommand(CommandWindow origin, Command command, String... args) {
68
+    protected void executeCommand(final CommandWindow origin,
69
+            final Command command, final String... args) {
69 70
         if (command instanceof ChannelCommand) {
70 71
             ((ChannelCommand) command).execute(origin, server, channel, args);
71 72
         } else {
@@ -81,8 +82,9 @@ public class ChannelCommandParser extends CommandParser {
81 82
      * @param command The command the user tried to execute
82 83
      * @param args The arguments passed to the command
83 84
      */
84
-    protected void handleInvalidCommand(CommandWindow origin, String command, String... args) {
85
-        origin.addLine("Unknown command: "+command+"/"+args.length);
85
+    protected void handleInvalidCommand(final CommandWindow origin,
86
+            final String command, final String... args) {
87
+        origin.addLine("Unknown command: " + command + "/" + args.length);
86 88
     }
87 89
     
88 90
     /**
@@ -91,7 +93,7 @@ public class ChannelCommandParser extends CommandParser {
91 93
      * @param origin The window in which the command was typed
92 94
      * @param line The line input by the user
93 95
      */
94
-    protected void handleNonCommand(CommandWindow origin, String line) {
96
+    protected void handleNonCommand(final CommandWindow origin, final String line) {
95 97
         channel.sendLine(line);
96 98
     }
97 99
     

+ 17
- 17
src/uk/org/ownage/dmdirc/commandparser/Command.java ファイルの表示

@@ -23,38 +23,38 @@
23 23
 package uk.org.ownage.dmdirc.commandparser;
24 24
 
25 25
 /**
26
- * Represents a generic command
26
+ * Represents a generic command.
27 27
  * @author chris
28 28
  */
29 29
 public abstract class Command {
30 30
     
31 31
     /**
32
-     * The name of this command (i.e., the string used by the user to execute it)
32
+     * The name of this command (i.e., the string used by the user to execute it).
33 33
      */
34 34
     protected String name;
35 35
     /**
36
-     * The arity of this command
36
+     * The arity of this command.
37 37
      */
38
-    protected int arity = 0;
38
+    protected int arity;
39 39
     /**
40
-     * Whether this command is polyadic or not
40
+     * Whether this command is polyadic or not.
41 41
      */
42 42
     protected boolean polyadic;
43 43
     /**
44
-     * Whether this command should be shown in help output
44
+     * Whether this command should be shown in help output.
45 45
      */
46 46
     protected boolean show = true;
47 47
     /**
48
-     * A textual description of this command's arguments
48
+     * A textual description of this command's arguments.
49 49
      */
50 50
     protected String arguments = "<unknown>";
51 51
     /**
52
-     * A description of this command
52
+     * A description of this command.
53 53
      */
54 54
     protected String description = "unknown";
55 55
     
56 56
     /**
57
-     * Creates a new instance of Command
57
+     * Creates a new instance of Command.
58 58
      */
59 59
     public Command() {
60 60
     }
@@ -69,12 +69,12 @@ public abstract class Command {
69 69
         if (polyadic) {
70 70
             return name;
71 71
         } else {
72
-            return name+"/"+arity;
72
+            return name + "/" + arity;
73 73
         }
74 74
     }
75 75
     
76 76
     /**
77
-     * Returns whether or not this command should be shown in help messages
77
+     * Returns whether or not this command should be shown in help messages.
78 78
      * @return True iff the command should be shown, false otherwise
79 79
      */
80 80
     public boolean showInHelp() {
@@ -82,32 +82,32 @@ public abstract class Command {
82 82
     }
83 83
     
84 84
     /**
85
-     * Returns a string representing the help message for this command
85
+     * Returns a string representing the help message for this command.
86 86
      * @return the help message for this command
87 87
      */
88 88
     public String getHelp() {
89
-        return name+" "+arguments+" - "+description;
89
+        return name + " " + arguments + " - " + description;
90 90
     }
91 91
     
92 92
     /**
93
-     * Implodes the given list of arguments
93
+     * Implodes the given list of arguments.
94 94
      * @param args The arguments to implode
95 95
      * @return A string containing each argument seperated by a space
96 96
      */
97
-    protected String implodeArgs(String... args) {
97
+    protected String implodeArgs(final String... args) {
98 98
         String res = "";
99 99
         for (int i = 0; i < args.length; i++) {
100 100
             if (res.equals("")) {
101 101
                 res = args[i];
102 102
             } else {
103
-                res = res.concat(" "+args[i]);
103
+                res = res.concat(" " + args[i]);
104 104
             }
105 105
         }
106 106
         return res;
107 107
     }
108 108
     
109 109
     /**
110
-     * Returns this command's name
110
+     * Returns this command's name.
111 111
      * @return The name of this command
112 112
      */
113 113
     public String getName() {

+ 55
- 32
src/uk/org/ownage/dmdirc/commandparser/CommandManager.java ファイルの表示

@@ -24,37 +24,60 @@ package uk.org.ownage.dmdirc.commandparser;
24 24
 
25 25
 import java.util.ArrayList;
26 26
 import java.util.Vector;
27
+
27 28
 import uk.org.ownage.dmdirc.Config;
28
-import uk.org.ownage.dmdirc.commandparser.commands.*;
29
-import uk.org.ownage.dmdirc.commandparser.commands.server.*;
30
-import uk.org.ownage.dmdirc.commandparser.commands.channel.*;
31
-import uk.org.ownage.dmdirc.commandparser.commands.query.*;
29
+import uk.org.ownage.dmdirc.commandparser.commands.Test;
30
+import uk.org.ownage.dmdirc.commandparser.commands.channel.ChannelSettings;
31
+import uk.org.ownage.dmdirc.commandparser.commands.channel.Cycle;
32
+import uk.org.ownage.dmdirc.commandparser.commands.channel.Me;
33
+import uk.org.ownage.dmdirc.commandparser.commands.channel.MeEmpty;
34
+import uk.org.ownage.dmdirc.commandparser.commands.channel.Part;
35
+import uk.org.ownage.dmdirc.commandparser.commands.channel.PartDefault;
36
+import uk.org.ownage.dmdirc.commandparser.commands.query.QueryMe;
37
+import uk.org.ownage.dmdirc.commandparser.commands.query.QueryMeEmpty;
38
+import uk.org.ownage.dmdirc.commandparser.commands.server.Help;
39
+import uk.org.ownage.dmdirc.commandparser.commands.server.Join;
40
+import uk.org.ownage.dmdirc.commandparser.commands.server.LoadFormatter;
41
+import uk.org.ownage.dmdirc.commandparser.commands.server.Nick;
42
+import uk.org.ownage.dmdirc.commandparser.commands.server.Quit;
43
+import uk.org.ownage.dmdirc.commandparser.commands.server.QuitDefault;
44
+import uk.org.ownage.dmdirc.commandparser.commands.server.Raw;
45
+import uk.org.ownage.dmdirc.commandparser.commands.server.ReloadFormatter;
46
+import uk.org.ownage.dmdirc.commandparser.commands.server.SaveFormatter;
47
+
32 48
 
33 49
 /**
34 50
  * The command manager creates and manages a single instance of all commands,
35
- * and provides methods to load each group of commands into a parser instance
51
+ * and provides methods to load each group of commands into a parser instance.
36 52
  * @author chris
37 53
  */
38
-public class CommandManager {
54
+public final class CommandManager {
39 55
     
40 56
     /**
41
-     * The server commands that have been instansiated
57
+     * The server commands that have been instansiated.
42 58
      */
43 59
     private static Vector<Command> serverCommands;
44 60
     /**
45
-     * The channel commands that have been instansiated
61
+     * The channel commands that have been instansiated.
46 62
      */
47 63
     private static Vector<Command> channelCommands;
48 64
     /**
49
-     * The query commands that have been instansiated
65
+     * The query commands that have been instansiated.
50 66
      */
51 67
     private static Vector<Command> queryCommands;
52 68
     
53 69
     /**
54
-     * Initialises the command manager's various command lists
70
+     * Prevents creation of a new command manager.
71
+     */
72
+    private CommandManager() {
73
+        //do nothing
74
+    }
75
+    
76
+    /**
77
+     * Initialises the command manager's various command lists.
55 78
      */
56 79
     private static void initLists() {
57
-        channelCommands = new Vector<Command>(0,1);
80
+        channelCommands = new Vector<Command>(0, 1);
58 81
         
59 82
         channelCommands.add(new Cycle());
60 83
         channelCommands.add(new Me());
@@ -63,7 +86,7 @@ public class CommandManager {
63 86
         channelCommands.add(new PartDefault());
64 87
         channelCommands.add(new ChannelSettings());
65 88
         
66
-        serverCommands = new Vector<Command>(0,1);
89
+        serverCommands = new Vector<Command>(0, 1);
67 90
         
68 91
         serverCommands.add(new Help());
69 92
         serverCommands.add(new Join());
@@ -76,17 +99,17 @@ public class CommandManager {
76 99
         serverCommands.add(new QuitDefault());
77 100
         serverCommands.add(new Raw());
78 101
         
79
-        queryCommands = new Vector<Command>(0,1);
102
+        queryCommands = new Vector<Command>(0, 1);
80 103
         
81 104
         queryCommands.add(new QueryMe());
82 105
         queryCommands.add(new QueryMeEmpty());
83 106
     }
84 107
     
85 108
     /**
86
-     * Loads all channel commands into the specified parser
109
+     * Loads all channel commands into the specified parser.
87 110
      * @param parser The parser to load commands into
88 111
      */
89
-    public static void loadChannelCommands(CommandParser parser) {
112
+    public static void loadChannelCommands(final CommandParser parser) {
90 113
         if (channelCommands == null) {
91 114
             CommandManager.initLists();
92 115
         }
@@ -97,10 +120,10 @@ public class CommandManager {
97 120
     }
98 121
     
99 122
     /**
100
-     * Loads all server commands into the specified parser
123
+     * Loads all server commands into the specified parser.
101 124
      * @param parser The parser to load commands into
102 125
      */
103
-    public static void loadServerCommands(CommandParser parser) {
126
+    public static void loadServerCommands(final CommandParser parser) {
104 127
         if (serverCommands == null) {
105 128
             CommandManager.initLists();
106 129
         }
@@ -111,10 +134,10 @@ public class CommandManager {
111 134
     }
112 135
     
113 136
     /**
114
-     * Loads all query commands into the specified parser
137
+     * Loads all query commands into the specified parser.
115 138
      * @param parser The parser to load commands into
116 139
      */
117
-    static void loadQueryCommands(QueryCommandParser parser) {
140
+    static void loadQueryCommands(final QueryCommandParser parser) {
118 141
         if (queryCommands == null)    {
119 142
             CommandManager.initLists();
120 143
         }
@@ -125,12 +148,12 @@ public class CommandManager {
125 148
     }
126 149
     
127 150
     /**
128
-     * Retrieves the server command identified by the specified signature
151
+     * Retrieves the server command identified by the specified signature.
129 152
      * @param signature The signature to look for
130 153
      * @return A server command with a matching signature, or null if none
131 154
      * were found.
132 155
      */
133
-    public static ServerCommand getServerCommad(String signature) {
156
+    public static ServerCommand getServerCommad(final String signature) {
134 157
         if (serverCommands == null) {
135 158
             CommandManager.initLists();
136 159
         }
@@ -145,12 +168,12 @@ public class CommandManager {
145 168
     }
146 169
     
147 170
     /**
148
-     * Retrieves the channel command identified by the specified signature
171
+     * Retrieves the channel command identified by the specified signature.
149 172
      * @param signature The signature to look for
150 173
      * @return A channel command with a matching signature, or null if none
151 174
      * were found.
152 175
      */
153
-    public static ChannelCommand getChannelCommand(String signature) {
176
+    public static ChannelCommand getChannelCommand(final String signature) {
154 177
         if (channelCommands == null) {
155 178
             CommandManager.initLists();
156 179
         }
@@ -166,7 +189,7 @@ public class CommandManager {
166 189
     
167 190
     /**
168 191
      * Returns a Vector containing the server commands that have been initialised
169
-     * by this command manager
192
+     * by this command manager.
170 193
      * @return A Vector of server commands, or null if none have been loaded
171 194
      */
172 195
     public static Vector<Command> getServerCommands() {
@@ -175,7 +198,7 @@ public class CommandManager {
175 198
     
176 199
     /**
177 200
      * Returns a Vector containing the channel commands that have been initialised
178
-     * by this command manager
201
+     * by this command manager.
179 202
      * @return A Vector of channel commands, or null if none have been loaded
180 203
      */
181 204
     public static Vector<Command> getChannelCommands() {
@@ -184,7 +207,7 @@ public class CommandManager {
184 207
     
185 208
     /**
186 209
      * Returns a Vector containing the query commands that have been initialised
187
-     * by this command manager
210
+     * by this command manager.
188 211
      * @return A Vector of query commands, or null if none have been loaded
189 212
      */
190 213
     public static Vector<Command> getQueryCommands() {
@@ -193,7 +216,7 @@ public class CommandManager {
193 216
     
194 217
     /**
195 218
      * Returns the names (including command char) of all registered server
196
-     * commands
219
+     * commands.
197 220
      * @return An ArrayList<String> containing all registered server command
198 221
      * names
199 222
      */
@@ -207,7 +230,7 @@ public class CommandManager {
207 230
     
208 231
     /**
209 232
      * Returns the names (including command char) of all registered channel
210
-     * commands
233
+     * commands.
211 234
      * @return An ArrayList<String> containing all registered server command
212 235
      * names
213 236
      */
@@ -221,7 +244,7 @@ public class CommandManager {
221 244
     
222 245
     /**
223 246
      * Returns the names (including command char) of all registered channel
224
-     * commands
247
+     * commands.
225 248
      * @return An ArrayList<String> containing all registered server command
226 249
      * names
227 250
      */
@@ -239,13 +262,13 @@ public class CommandManager {
239 262
      * @param source The source vector to iterate over
240 263
      * @return A list of all commands in the source
241 264
      */
242
-    private static ArrayList<String> getCommandNames(Vector<Command> source) {
265
+    private static ArrayList<String> getCommandNames(final Vector<Command> source) {
243 266
         if (source == null) {
244 267
             return null;
245 268
         }
246 269
         
247
-        ArrayList<String> res = new ArrayList<String>();
248
-        String commandChar = Config.getOption("general","commandchar");
270
+        final ArrayList<String> res = new ArrayList<String>();
271
+        final String commandChar = Config.getOption("general", "commandchar");
249 272
         
250 273
         for (Command command : source) {
251 274
             res.add(commandChar + command.getName());

+ 26
- 21
src/uk/org/ownage/dmdirc/commandparser/CommandParser.java ファイルの表示

@@ -23,6 +23,7 @@
23 23
 package uk.org.ownage.dmdirc.commandparser;
24 24
 
25 25
 import java.util.Hashtable;
26
+
26 27
 import uk.org.ownage.dmdirc.Config;
27 28
 
28 29
 /**
@@ -31,56 +32,56 @@ import uk.org.ownage.dmdirc.Config;
31 32
  * on the character at the start of the string), and handles it appropriately.
32 33
  * @author chris
33 34
  */
34
-abstract public class CommandParser {
35
+public abstract class CommandParser {
35 36
     
36 37
     /**
37
-     * Commands that are associated with this parser
38
+     * Commands that are associated with this parser.
38 39
      */
39
-    private Hashtable<String,Command> commands;
40
+    private Hashtable<String, Command> commands;
40 41
     
41
-    /** Creates a new instance of CommandParser */
42
+    /** Creates a new instance of CommandParser. */
42 43
     public CommandParser() {
43
-        commands = new Hashtable<String,Command>();
44
+        commands = new Hashtable<String, Command>();
44 45
         loadCommands();
45 46
     }
46 47
     
47
-    /** Loads the relevant commands into the parser */
48
+    /** Loads the relevant commands into the parser. */
48 49
     protected abstract void loadCommands();
49 50
     
50 51
     /**
51
-     * Registers the specified command with this parser
52
+     * Registers the specified command with this parser.
52 53
      * @param command Command to be registered
53 54
      */
54
-    public void registerCommand(Command command) {
55
+    public void registerCommand(final Command command) {
55 56
         commands.put(command.getSignature(), command);
56 57
     }
57 58
     
58 59
     /**
59
-     * Parses the specified string as a command
60
+     * Parses the specified string as a command.
60 61
      * @param origin The window in which the command was typed
61 62
      * @param line The line to be parsed
62 63
      */
63
-    public void parseCommand(CommandWindow origin, String line) {
64
+    public void parseCommand(final CommandWindow origin, final String line) {
64 65
         if (line.equals("")) {
65 66
             return;
66 67
         }
67 68
         
68
-        if (line.charAt(0) == Config.getOption("general","commandchar").charAt(0)) {
69
-            String[] args = line.split(" ");
69
+        if (line.charAt(0) == Config.getOption("general", "commandchar").charAt(0)) {
70
+            final String[] args = line.split(" ");
70 71
             String[] comargs;
71 72
             String command;
72 73
             
73
-            assert(args.length > 0);
74
+            assert args.length > 0;
74 75
             
75 76
             command = args[0].substring(1);
76 77
             
77
-            comargs = new String[args.length-1];
78
+            comargs = new String[args.length - 1];
78 79
             
79 80
             for (int i = 1; i < args.length; i++) {
80
-                comargs[i-1] = args[i];
81
+                comargs[i - 1] = args[i];
81 82
             }
82 83
             
83
-            String signature = command+"/"+(comargs.length);
84
+            final String signature = command + "/" + (comargs.length);
84 85
             
85 86
             // Check the specific signature first, so that polyadic commands can
86 87
             // have error handlers if there are too few arguments (e.g., msg/0 and
@@ -99,12 +100,13 @@ abstract public class CommandParser {
99 100
     
100 101
     /**
101 102
      * Parses the specified string as a command, taking the indicated status
102
-     * of the control key into account
103
+     * of the control key into account.
103 104
      * @param origin The window in which the command was typed
104 105
      * @param line The line to be parsed
105 106
      * @param usedCtrl Whether the user used the control key or not
106 107
      */
107
-    public void parseCommand(CommandWindow origin, String line, boolean usedCtrl) {
108
+    public void parseCommand(final CommandWindow origin, final String line, 
109
+            final boolean usedCtrl) {
108 110
         if (usedCtrl) {
109 111
             handleNonCommand(origin, line);
110 112
         } else {
@@ -118,7 +120,8 @@ abstract public class CommandParser {
118 120
      * @param command The command to be executed
119 121
      * @param args The arguments to the command
120 122
      */
121
-    abstract protected void executeCommand(CommandWindow origin, Command command, String... args);
123
+    protected abstract void executeCommand(final CommandWindow origin, 
124
+            final Command command, final String... args);
122 125
     
123 126
     /**
124 127
      * Called when the user attempted to issue a command (i.e., used the command
@@ -128,7 +131,8 @@ abstract public class CommandParser {
128 131
      * @param command The command the user tried to execute
129 132
      * @param args The arguments passed to the command
130 133
      */
131
-    abstract protected void handleInvalidCommand(CommandWindow origin, String command, String... args);
134
+    protected abstract void handleInvalidCommand(final CommandWindow origin, 
135
+            final String command, final String... args);
132 136
     
133 137
     /**
134 138
      * Called when the input was a line of text that was not a command. This normally
@@ -136,5 +140,6 @@ abstract public class CommandParser {
136 140
      * @param origin The window in which the command was typed
137 141
      * @param line The line input by the user
138 142
      */
139
-    abstract protected void handleNonCommand(CommandWindow origin, String line);
143
+    protected abstract void handleNonCommand(final CommandWindow origin, 
144
+            final String line);
140 145
 }

+ 5
- 3
src/uk/org/ownage/dmdirc/commandparser/CommandWindow.java ファイルの表示

@@ -34,7 +34,7 @@ public interface CommandWindow {
34 34
      * Adds a line of text to the main text area of the window.
35 35
      * @param line The line to be added
36 36
      */
37
-    public void addLine(String line);
37
+    void addLine(String line);
38 38
     
39 39
     /**
40 40
      * Formats the arguments using the Formatter, then adds the result to the
@@ -42,11 +42,13 @@ public interface CommandWindow {
42 42
      * @param messageType The type of this message
43 43
      * @param args The arguments for the message
44 44
      */
45
-    public void addLine(String messageType, Object... args);
45
+    void addLine(String messageType, Object... args);
46 46
     
47 47
     /**
48 48
      * Determines if the current frame is visible.
49
+     *
50
+     * @return boolean visibility
49 51
      */
50
-    public boolean isVisible();
52
+    boolean isVisible();
51 53
     
52 54
 }

+ 4
- 4
src/uk/org/ownage/dmdirc/commandparser/QueryCommand.java ファイルの表示

@@ -26,22 +26,22 @@ import uk.org.ownage.dmdirc.Query;
26 26
 import uk.org.ownage.dmdirc.Server;
27 27
 
28 28
 /**
29
- * Represents a command which can be performed only in the context of a query
29
+ * Represents a command which can be performed only in the context of a query.
30 30
  * @author chris
31 31
  */
32 32
 public abstract class QueryCommand extends Command {
33 33
     
34
-    /** Creates a new instance of ChannelCommand */
34
+    /** Creates a new instance of ChannelCommand. */
35 35
     public QueryCommand() {
36 36
         super();
37 37
     }
38 38
     
39 39
     /**
40
-     * Executes this command
40
+     * Executes this command.
41 41
      * @param origin The window in which the command was typed
42 42
      * @param server The server instance that this command is being executed on
43 43
      * @param query The query object that the commadparser is associated with
44 44
      * @param args Arguments passed to this command
45 45
      */
46 46
     public abstract void execute(CommandWindow origin, Server server, Query query, String... args);
47
-}
47
+}

+ 13
- 11
src/uk/org/ownage/dmdirc/commandparser/QueryCommandParser.java ファイルの表示

@@ -33,27 +33,27 @@ import uk.org.ownage.dmdirc.Server;
33 33
 public class QueryCommandParser extends CommandParser {
34 34
     
35 35
     /**
36
-     * The server instance that this parser is attached to
36
+     * The server instance that this parser is attached to.
37 37
      */
38 38
     private Server server;
39 39
     /**
40
-     * The query instance that this parser is attached to
40
+     * The query instance that this parser is attached to.
41 41
      */
42 42
     private Query query;
43 43
     
44 44
     /**
45
-     * Creates a new instance of QueryCommandParser
46
-     * @param server The server instance that this parser is attached to
47
-     * @param query The query instance that this parser is attached to
45
+     * Creates a new instance of QueryCommandParser.
46
+     * @param newServer The server instance that this parser is attached to
47
+     * @param newQuery The query instance that this parser is attached to
48 48
      */
49
-    public QueryCommandParser(Server server, Query query) {
49
+    public QueryCommandParser(final Server newServer, final Query newQuery) {
50 50
         super();
51 51
         
52 52
         this.server = server;
53 53
         this.query = query;
54 54
     }
55 55
     
56
-    /** Loads the relevant commands into the parser */
56
+    /** Loads the relevant commands into the parser. */
57 57
     protected void loadCommands() {
58 58
         CommandManager.loadQueryCommands(this);
59 59
         CommandManager.loadServerCommands(this);
@@ -65,7 +65,8 @@ public class QueryCommandParser extends CommandParser {
65 65
      * @param command The command to be executed
66 66
      * @param args The arguments to the command
67 67
      */
68
-    protected void executeCommand(CommandWindow origin, Command command, String... args) {
68
+    protected void executeCommand(final CommandWindow origin, 
69
+            final Command command, final String... args) {
69 70
         if (command instanceof QueryCommand) {
70 71
             ((QueryCommand) command).execute(origin, server, query, args);
71 72
         } else {
@@ -81,8 +82,9 @@ public class QueryCommandParser extends CommandParser {
81 82
      * @param command The command the user tried to execute
82 83
      * @param args The arguments passed to the command
83 84
      */
84
-    protected void handleInvalidCommand(CommandWindow origin, String command, String... args) {
85
-        origin.addLine("Unknown command: "+command+"/"+args.length);
85
+    protected void handleInvalidCommand(final CommandWindow origin, 
86
+            final String command, final String... args) {
87
+        origin.addLine("Unknown command: " + command + "/" + args.length);
86 88
     }
87 89
     
88 90
     /**
@@ -91,7 +93,7 @@ public class QueryCommandParser extends CommandParser {
91 93
      * @param origin The window in which the command was typed
92 94
      * @param line The line input by the user
93 95
      */
94
-    protected void handleNonCommand(CommandWindow origin, String line) {
96
+    protected void handleNonCommand(final CommandWindow origin, final String line) {
95 97
         query.sendLine(line);
96 98
     }
97 99
     

+ 3
- 3
src/uk/org/ownage/dmdirc/commandparser/ServerCommand.java ファイルの表示

@@ -31,16 +31,16 @@ import uk.org.ownage.dmdirc.Server;
31 31
  */
32 32
 public abstract class ServerCommand extends Command {
33 33
     
34
-    /** Creates a new instance of ChannelCommand */
34
+    /** Creates a new instance of ChannelCommand. */
35 35
     public ServerCommand() {
36 36
         super();
37 37
     }
38 38
     
39 39
     /**
40
-     * Executes this command
40
+     * Executes this command.
41 41
      * @param origin The window in which the command was typed
42 42
      * @param server The server instance that this command is being executed on
43 43
      * @param args Arguments passed to this command
44 44
      */
45 45
     public abstract void execute(CommandWindow origin, Server server, String... args);
46
-}
46
+}

+ 14
- 12
src/uk/org/ownage/dmdirc/commandparser/ServerCommandParser.java ファイルの表示

@@ -25,27 +25,27 @@ package uk.org.ownage.dmdirc.commandparser;
25 25
 import uk.org.ownage.dmdirc.Server;
26 26
 
27 27
 /**
28
- * A command parser used in the context of a server
28
+ * A command parser used in the context of a server.
29 29
  * @author chris
30 30
  */
31 31
 public class ServerCommandParser extends CommandParser {
32 32
     
33 33
     /**
34
-     * The server instance that this parser is attached to
34
+     * The server instance that this parser is attached to.
35 35
      */
36 36
     private Server server;
37 37
     
38 38
     /**
39
-     * Creates a new instance of ServerCommandParser
40
-     * @param server The server instance that this parser is attached to
39
+     * Creates a new instance of ServerCommandParser.
40
+     * @param newServer The server instance that this parser is attached to
41 41
      */
42
-    public ServerCommandParser(Server server) {
42
+    public ServerCommandParser(final Server newServer) {
43 43
         super();
44 44
         
45
-        this.server = server;
45
+        this.server = newServer;
46 46
     }
47 47
     
48
-    /** Loads the relevant commands into the parser */
48
+    /** Loads the relevant commands into the parser. */
49 49
     protected void loadCommands() {
50 50
         CommandManager.loadServerCommands(this);
51 51
     }
@@ -56,8 +56,9 @@ public class ServerCommandParser extends CommandParser {
56 56
      * @param command The command to be executed
57 57
      * @param args The arguments to the command
58 58
      */
59
-    protected void executeCommand(CommandWindow origin, Command command, String... args) {
60
-        ((ServerCommand)command).execute(origin, server, args);
59
+    protected void executeCommand(final CommandWindow origin, 
60
+            final Command command, final String... args) {
61
+        ((ServerCommand) command).execute(origin, server, args);
61 62
     }
62 63
     
63 64
     /**
@@ -68,8 +69,9 @@ public class ServerCommandParser extends CommandParser {
68 69
      * @param command The command the user tried to execute
69 70
      * @param args The arguments passed to the command
70 71
      */
71
-    protected void handleInvalidCommand(CommandWindow origin, String command, String... args) {
72
-        origin.addLine("Unknown command: "+command+"/"+args.length);
72
+    protected void handleInvalidCommand(final CommandWindow origin, 
73
+            final String command, final String... args) {
74
+        origin.addLine("Unknown command: " + command + "/" + args.length);
73 75
     }
74 76
     
75 77
     /**
@@ -78,7 +80,7 @@ public class ServerCommandParser extends CommandParser {
78 80
      * @param origin The window in which the command was typed
79 81
      * @param line The line input by the user
80 82
      */
81
-    protected void handleNonCommand(CommandWindow origin, String line) {
83
+    protected void handleNonCommand(final CommandWindow origin, final String line) {
82 84
         server.getParser().sendLine(line);
83 85
     }
84 86
     

+ 4
- 4
src/uk/org/ownage/dmdirc/commandparser/commands/Test.java ファイルの表示

@@ -23,7 +23,6 @@
23 23
 package uk.org.ownage.dmdirc.commandparser.commands;
24 24
 
25 25
 import uk.org.ownage.dmdirc.Server;
26
-import uk.org.ownage.dmdirc.commandparser.Command;
27 26
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
28 27
 import uk.org.ownage.dmdirc.commandparser.ServerCommand;
29 28
 
@@ -34,7 +33,7 @@ import uk.org.ownage.dmdirc.commandparser.ServerCommand;
34 33
  */
35 34
 public class Test extends ServerCommand {
36 35
     
37
-    /** Creates a new instance of Test */
36
+    /** Creates a new instance of Test. */
38 37
     public Test() {
39 38
         description = "a test command";
40 39
         arguments = "";
@@ -45,12 +44,13 @@ public class Test extends ServerCommand {
45 44
     }
46 45
 
47 46
     /**
48
-     * Executes this command
47
+     * Executes this command.
49 48
      * @param origin The window in which the command was typed
50 49
      * @param server The server instance that this command is being executed on
51 50
      * @param args Arguments passed to this command
52 51
      */
53
-    public void execute(CommandWindow origin, Server server, String... args) {
52
+    public void execute(final CommandWindow origin, final Server server, 
53
+            final String... args) {
54 54
         origin.addLine(server.getParser().getSvnInfo());
55 55
     }
56 56
     

+ 5
- 4
src/uk/org/ownage/dmdirc/commandparser/commands/channel/ChannelSettings.java ファイルの表示

@@ -29,12 +29,12 @@ import uk.org.ownage.dmdirc.commandparser.CommandWindow;
29 29
 import uk.org.ownage.dmdirc.ui.ChannelSettingsDialog;
30 30
 
31 31
 /**
32
- * Opens the channel settings window for the channel
32
+ * Opens the channel settings window for the channel.
33 33
  * @author chris
34 34
  */
35 35
 public class ChannelSettings extends ChannelCommand {
36 36
     
37
-    /** Creates a new instance of ChannelSettings */
37
+    /** Creates a new instance of ChannelSettings. */
38 38
     public ChannelSettings() {
39 39
         description = "opens the channel settings window";
40 40
         arguments = "";
@@ -45,13 +45,14 @@ public class ChannelSettings extends ChannelCommand {
45 45
     }
46 46
     
47 47
     /**
48
-     * Executes this command
48
+     * Executes this command.
49 49
      * @param origin The frame in which this command was issued
50 50
      * @param server The server object that this command is associated with
51 51
      * @param channel The channel object that this command is associated with
52 52
      * @param args The user supplied arguments
53 53
      */
54
-    public void execute(CommandWindow origin, Server server, Channel channel, String... args) {
54
+    public void execute(final CommandWindow origin, final Server server, 
55
+            final Channel channel, final String... args) {
55 56
         new ChannelSettingsDialog(channel).setVisible(true);
56 57
     }
57 58
     

+ 6
- 6
src/uk/org/ownage/dmdirc/commandparser/commands/channel/Cycle.java ファイルの表示

@@ -26,7 +26,6 @@ import uk.org.ownage.dmdirc.Channel;
26 26
 import uk.org.ownage.dmdirc.Config;
27 27
 import uk.org.ownage.dmdirc.Server;
28 28
 import uk.org.ownage.dmdirc.commandparser.ChannelCommand;
29
-import uk.org.ownage.dmdirc.commandparser.CommandManager;
30 29
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
31 30
 
32 31
 /**
@@ -35,7 +34,7 @@ import uk.org.ownage.dmdirc.commandparser.CommandWindow;
35 34
  */
36 35
 public class Cycle extends ChannelCommand {
37 36
     
38
-    /** Creates a new instance of Cycle */
37
+    /** Creates a new instance of Cycle. */
39 38
     public Cycle() {
40 39
         description = "parts and rejoins the current channel";
41 40
         arguments = "";
@@ -46,15 +45,16 @@ public class Cycle extends ChannelCommand {
46 45
     }
47 46
 
48 47
     /**
49
-     * Executes this command
48
+     * Executes this command.
50 49
      * @param origin The frame in which this command was issued
51 50
      * @param server The server object that this command is associated with
52 51
      * @param channel The channel object that this command is associated with
53 52
      * @param args The user supplied arguments
54 53
      */
55
-    public void execute(CommandWindow origin, Server server, Channel channel, String... args) {
56
-        channel.part(Config.getOption("general","cyclemessage"));
54
+    public void execute(final CommandWindow origin, final Server server, 
55
+            final Channel channel, final String... args) {
56
+        channel.part(Config.getOption("general", "cyclemessage"));
57 57
         channel.join();
58 58
     }
59 59
     
60
-}
60
+}

+ 5
- 4
src/uk/org/ownage/dmdirc/commandparser/commands/channel/Me.java ファイルの表示

@@ -28,12 +28,12 @@ import uk.org.ownage.dmdirc.commandparser.ChannelCommand;
28 28
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
29 29
 
30 30
 /**
31
- * The me command sends a CTCP action to the current channel
31
+ * The me command sends a CTCP action to the current channel.
32 32
  * @author chris
33 33
  */
34 34
 public class Me extends ChannelCommand {
35 35
     
36
-    /** Creates a new instance of Me */
36
+    /** Creates a new instance of Me. */
37 37
     public Me() {
38 38
         description = "sends an action to the current channel";
39 39
         arguments = "<action>";
@@ -44,13 +44,14 @@ public class Me extends ChannelCommand {
44 44
     }
45 45
     
46 46
     /**
47
-     * Executes this command
47
+     * Executes this command.
48 48
      * @param origin The frame in which this command was issued
49 49
      * @param server The server object that this command is associated with
50 50
      * @param channel The channel object that this command is associated with
51 51
      * @param args The user supplied arguments
52 52
      */
53
-    public void execute(CommandWindow origin, Server server, Channel channel, String... args) {
53
+    public void execute(final CommandWindow origin, final Server server, 
54
+            final Channel channel, final String... args) {
54 55
         channel.sendAction(implodeArgs(args));
55 56
     }
56 57
     

+ 5
- 4
src/uk/org/ownage/dmdirc/commandparser/commands/channel/MeEmpty.java ファイルの表示

@@ -35,7 +35,7 @@ import uk.org.ownage.dmdirc.commandparser.CommandWindow;
35 35
  */
36 36
 public class MeEmpty extends ChannelCommand {
37 37
     
38
-    /** Creates a new instance of MeEmpty */
38
+    /** Creates a new instance of MeEmpty. */
39 39
     public MeEmpty() {
40 40
         description = "informs the user of the correct usage of the me command";
41 41
         arguments = "";
@@ -46,14 +46,15 @@ public class MeEmpty extends ChannelCommand {
46 46
     }
47 47
     
48 48
     /**
49
-     * Executes this command
49
+     * Executes this command.
50 50
      * @param origin The frame in which this command was issued
51 51
      * @param server The server object that this command is associated with
52 52
      * @param channel The channel object that this command is associated with
53 53
      * @param args The user supplied arguments
54 54
      */
55
-    public void execute(CommandWindow origin, Server server, Channel channel, String... args) {
56
-        origin.addLine("Usage: "+Config.getOption("general","commandchar")+"me <action>");
55
+    public void execute(final CommandWindow origin, final Server server, 
56
+            final Channel channel, final String... args) {
57
+        origin.addLine("Usage: " + Config.getOption("general", "commandchar") + "me <action>");
57 58
     }
58 59
     
59 60
 }

+ 5
- 7
src/uk/org/ownage/dmdirc/commandparser/commands/channel/Part.java ファイルの表示

@@ -23,10 +23,8 @@
23 23
 package uk.org.ownage.dmdirc.commandparser.commands.channel;
24 24
 
25 25
 import uk.org.ownage.dmdirc.Channel;
26
-import uk.org.ownage.dmdirc.Config;
27 26
 import uk.org.ownage.dmdirc.Server;
28 27
 import uk.org.ownage.dmdirc.commandparser.ChannelCommand;
29
-import uk.org.ownage.dmdirc.commandparser.CommandManager;
30 28
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
31 29
 
32 30
 /**
@@ -35,7 +33,7 @@ import uk.org.ownage.dmdirc.commandparser.CommandWindow;
35 33
  */
36 34
 public class Part extends ChannelCommand {
37 35
     
38
-    /** Creates a new instance of Part */
36
+    /** Creates a new instance of Part. */
39 37
     public Part() {
40 38
         description = "parts the channel with the specified reason";
41 39
         arguments = "<reason>";
@@ -46,15 +44,15 @@ public class Part extends ChannelCommand {
46 44
     }
47 45
     
48 46
     /**
49
-     * Executes this command
47
+     * Executes this command.
50 48
      * @param origin The frame in which this command was issued
51 49
      * @param server The server object that this command is associated with
52 50
      * @param channel The channel object that this command is associated with
53 51
      * @param args The user supplied arguments
54 52
      */
55
-    public void execute(CommandWindow origin, Server server, Channel channel, String... args) {
53
+    public void execute(final CommandWindow origin, final Server server, 
54
+            final Channel channel, final String... args) {
56 55
         channel.part(implodeArgs(args));
57 56
         channel.close();
58 57
     }
59
-    
60
-}
58
+}

+ 6
- 5
src/uk/org/ownage/dmdirc/commandparser/commands/channel/PartDefault.java ファイルの表示

@@ -37,7 +37,7 @@ import uk.org.ownage.dmdirc.commandparser.CommandWindow;
37 37
  */
38 38
 public class PartDefault extends ChannelCommand {
39 39
     
40
-    /** Creates a new instance of PartDefault */
40
+    /** Creates a new instance of PartDefault. */
41 41
     public PartDefault() {
42 42
         description = "parts the channel with the default reason";
43 43
         arguments = "";
@@ -48,15 +48,16 @@ public class PartDefault extends ChannelCommand {
48 48
     }
49 49
     
50 50
     /**
51
-     * Executes this command
51
+     * Executes this command.
52 52
      * @param origin The frame in which this command was issued
53 53
      * @param server The server object that this command is associated with
54 54
      * @param channel The channel object that this command is associated with
55 55
      * @param args The user supplied arguments
56 56
      */
57
-    public void execute(CommandWindow origin, Server server, Channel channel, String... args) {
58
-        ChannelCommand com = CommandManager.getChannelCommand("part");
59
-        com.execute(origin, server, channel, Config.getOption("general","partmessage"));
57
+    public void execute(final CommandWindow origin, final Server server, 
58
+            final Channel channel, final String... args) {
59
+        final ChannelCommand com = CommandManager.getChannelCommand("part");
60
+        com.execute(origin, server, channel, Config.getOption("general", "partmessage"));
60 61
     }
61 62
     
62 63
 }

+ 5
- 4
src/uk/org/ownage/dmdirc/commandparser/commands/query/QueryMe.java ファイルの表示

@@ -24,8 +24,8 @@ package uk.org.ownage.dmdirc.commandparser.commands.query;
24 24
 
25 25
 import uk.org.ownage.dmdirc.Query;
26 26
 import uk.org.ownage.dmdirc.Server;
27
-import uk.org.ownage.dmdirc.commandparser.QueryCommand;
28 27
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
28
+import uk.org.ownage.dmdirc.commandparser.QueryCommand;
29 29
 
30 30
 /**
31 31
  * Represents the /me command used in a query window.
@@ -33,7 +33,7 @@ import uk.org.ownage.dmdirc.commandparser.CommandWindow;
33 33
  */
34 34
 public class QueryMe extends QueryCommand {
35 35
     
36
-    /** Creates a new instance of QueryMe */
36
+    /** Creates a new instance of QueryMe. */
37 37
     public QueryMe() {
38 38
         description = "sends an action to the query receipient";
39 39
         arguments = "<action>";
@@ -44,13 +44,14 @@ public class QueryMe extends QueryCommand {
44 44
     }
45 45
 
46 46
     /**
47
-     * Executes this command
47
+     * Executes this command.
48 48
      * @param origin The frame in which this command was issued
49 49
      * @param server The server object that this command is associated with
50 50
      * @param query The query object that this command is associated with
51 51
      * @param args The user supplied arguments
52 52
      */
53
-    public void execute(CommandWindow origin, Server server, Query query, String... args) {
53
+    public void execute(final CommandWindow origin, final Server server, 
54
+            final Query query, final String... args) {
54 55
         query.sendAction(implodeArgs(args));
55 56
     }
56 57
     

+ 7
- 6
src/uk/org/ownage/dmdirc/commandparser/commands/query/QueryMeEmpty.java ファイルの表示

@@ -22,11 +22,11 @@
22 22
 
23 23
 package uk.org.ownage.dmdirc.commandparser.commands.query;
24 24
 
25
-import uk.org.ownage.dmdirc.Query;
26 25
 import uk.org.ownage.dmdirc.Config;
26
+import uk.org.ownage.dmdirc.Query;
27 27
 import uk.org.ownage.dmdirc.Server;
28
-import uk.org.ownage.dmdirc.commandparser.QueryCommand;
29 28
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
29
+import uk.org.ownage.dmdirc.commandparser.QueryCommand;
30 30
 
31 31
 /**
32 32
  * Represents the /me command used in a query window, with no parameters.
@@ -35,7 +35,7 @@ import uk.org.ownage.dmdirc.commandparser.CommandWindow;
35 35
  */
36 36
 public class QueryMeEmpty extends QueryCommand {
37 37
     
38
-    /** Creates a new instance of QueryMeEmpty */
38
+    /** Creates a new instance of QueryMeEmpty. */
39 39
     public QueryMeEmpty() {
40 40
         description = "informs the user of the correct usage of the me command";
41 41
         arguments = "";
@@ -46,14 +46,15 @@ public class QueryMeEmpty extends QueryCommand {
46 46
     }
47 47
     
48 48
     /**
49
-     * Executes this command
49
+     * Executes this command.
50 50
      * @param origin The frame in which this command was issued
51 51
      * @param server The server object that this command is associated with
52 52
      * @param query The query object that this command is associated with
53 53
      * @param args The user supplied arguments
54 54
      */
55
-    public void execute(CommandWindow origin, Server server, Query query, String... args) {
56
-        origin.addLine("Usage: "+Config.getOption("general","commandchar")+"me <action>");
55
+    public void execute(final CommandWindow origin, final Server server, 
56
+            final Query query, final String... args) {
57
+        origin.addLine("Usage: " + Config.getOption("general", "commandchar") + "me <action>");
57 58
     }
58 59
     
59 60
 }

+ 5
- 5
src/uk/org/ownage/dmdirc/commandparser/commands/server/Help.java ファイルの表示

@@ -22,7 +22,6 @@
22 22
 
23 23
 package uk.org.ownage.dmdirc.commandparser.commands.server;
24 24
 
25
-import uk.org.ownage.dmdirc.Config;
26 25
 import uk.org.ownage.dmdirc.Server;
27 26
 import uk.org.ownage.dmdirc.commandparser.Command;
28 27
 import uk.org.ownage.dmdirc.commandparser.CommandManager;
@@ -40,7 +39,7 @@ import uk.org.ownage.dmdirc.ui.QueryFrame;
40 39
 public class Help extends ServerCommand {
41 40
     
42 41
     /**
43
-     * Creates a new instance of Help
42
+     * Creates a new instance of Help.
44 43
      */
45 44
     public Help() {
46 45
         description = "Displays usage information for all implemented commands";
@@ -52,12 +51,13 @@ public class Help extends ServerCommand {
52 51
     }
53 52
     
54 53
     /**
55
-     * Executes this command
54
+     * Executes this command.
56 55
      * @param origin The frame in which this command was issued
57 56
      * @param server The server object that this command is associated with
58 57
      * @param args The user supplied arguments
59 58
      */    
60
-    public void execute(CommandWindow origin, Server server, String... args) {
59
+    public void execute(final CommandWindow origin, final Server server, 
60
+            final String... args) {
61 61
         origin.addLine("-- Server commands ----------------------------------");
62 62
         for (Command com : CommandManager.getServerCommands()) {
63 63
             if (com.showInHelp()) {
@@ -83,4 +83,4 @@ public class Help extends ServerCommand {
83 83
         origin.addLine("-----------------------------------------------------");
84 84
     }
85 85
     
86
-}
86
+}

+ 6
- 6
src/uk/org/ownage/dmdirc/commandparser/commands/server/Join.java ファイルの表示

@@ -22,7 +22,6 @@
22 22
 
23 23
 package uk.org.ownage.dmdirc.commandparser.commands.server;
24 24
 
25
-import uk.org.ownage.dmdirc.Config;
26 25
 import uk.org.ownage.dmdirc.Server;
27 26
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
28 27
 import uk.org.ownage.dmdirc.commandparser.ServerCommand;
@@ -35,9 +34,9 @@ import uk.org.ownage.dmdirc.commandparser.ServerCommand;
35 34
 public class Join extends ServerCommand {
36 35
     
37 36
     /**
38
-     * Creates a new instance of Join
37
+     * Creates a new instance of Join.
39 38
      */
40
-    public Join () {
39
+    public Join() {
41 40
         description = "Joins the specified channel. Multiple channels may be seperated by commas.";
42 41
         arguments = "<channel(s)>";
43 42
         polyadic = false;
@@ -47,13 +46,14 @@ public class Join extends ServerCommand {
47 46
     }
48 47
 
49 48
     /**
50
-     * Executes this command
49
+     * Executes this command.
51 50
      * @param origin The frame in which this command was issued
52 51
      * @param server The server object that this command is associated with
53 52
      * @param args The user supplied arguments
54 53
      */    
55
-    public void execute(CommandWindow origin, Server server, String... args) {
54
+    public void execute(final CommandWindow origin, final Server server, 
55
+            final String... args) {
56 56
         server.getParser().joinChannel(args[0]);
57 57
     }
58 58
     
59
-}
59
+}

+ 6
- 6
src/uk/org/ownage/dmdirc/commandparser/commands/server/LoadFormatter.java ファイルの表示

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

+ 7
- 7
src/uk/org/ownage/dmdirc/commandparser/commands/server/Nick.java ファイルの表示

@@ -22,21 +22,20 @@
22 22
 
23 23
 package uk.org.ownage.dmdirc.commandparser.commands.server;
24 24
 
25
-import uk.org.ownage.dmdirc.Config;
26 25
 import uk.org.ownage.dmdirc.Server;
27 26
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
28 27
 import uk.org.ownage.dmdirc.commandparser.ServerCommand;
29 28
 
30 29
 /**
31
- * Allows the user to change nickname
30
+ * Allows the user to change nickname.
32 31
  * @author chris
33 32
  */
34 33
 public class Nick extends ServerCommand {
35 34
     
36 35
     /**
37
-     * Creates a new instance of Join
36
+     * Creates a new instance of Join.
38 37
      */
39
-    public Nick () {
38
+    public Nick() {
40 39
         description = "Changes your nickname";
41 40
         arguments = "<new nickname>";
42 41
         polyadic = false;
@@ -46,13 +45,14 @@ public class Nick extends ServerCommand {
46 45
     }
47 46
 
48 47
     /**
49
-     * Executes this command
48
+     * Executes this command.
50 49
      * @param origin The frame in which this command was issued
51 50
      * @param server The server object that this command is associated with
52 51
      * @param args The user supplied arguments
53 52
      */    
54
-    public void execute(CommandWindow origin, Server server, String... args) {
53
+    public void execute(final CommandWindow origin, final Server server, 
54
+            final String... args) {
55 55
         server.getParser().setNickname(args[0]);
56 56
     }
57 57
     
58
-}
58
+}

+ 4
- 3
src/uk/org/ownage/dmdirc/commandparser/commands/server/Quit.java ファイルの表示

@@ -37,7 +37,7 @@ import uk.org.ownage.dmdirc.commandparser.ServerCommand;
37 37
 public class Quit extends ServerCommand {
38 38
     
39 39
     /**
40
-     * Creates a new instance of Quit
40
+     * Creates a new instance of Quit.
41 41
      */
42 42
     public Quit() {
43 43
         description = "Quits DMDirc, sending the specified quit message to all servers";
@@ -49,12 +49,13 @@ public class Quit extends ServerCommand {
49 49
     }
50 50
     
51 51
     /**
52
-     * Executes this command
52
+     * Executes this command.
53 53
      * @param origin The frame in which this command was issued
54 54
      * @param server The server object that this command is associated with
55 55
      * @param args The user supplied arguments
56 56
      */    
57
-    public void execute(CommandWindow origin, Server server, String... args) {
57
+    public void execute(final CommandWindow origin, final Server server, 
58
+            final String... args) {
58 59
         ServerManager.getServerManager().disconnectAll(implodeArgs(args));
59 60
         Config.save();
60 61
         System.exit(0);

+ 5
- 4
src/uk/org/ownage/dmdirc/commandparser/commands/server/QuitDefault.java ファイルの表示

@@ -37,7 +37,7 @@ import uk.org.ownage.dmdirc.commandparser.ServerCommand;
37 37
 public class QuitDefault extends ServerCommand {
38 38
     
39 39
     /**
40
-     * Creates a new instance of QuitDefault
40
+     * Creates a new instance of QuitDefault.
41 41
      */
42 42
     public QuitDefault() {
43 43
         description = "Quits DMDirc, sending a default quit message to all servers";
@@ -49,13 +49,14 @@ public class QuitDefault extends ServerCommand {
49 49
     }
50 50
     
51 51
     /**
52
-     * Executes this command
52
+     * Executes this command.
53 53
      * @param origin The frame in which this command was issued
54 54
      * @param server The server object that this command is associated with
55 55
      * @param args The user supplied arguments
56 56
      */
57
-    public void execute(CommandWindow origin, Server server, String... args) {
58
-        String def = Config.getOption("general","quitmessage");
57
+    public void execute(final CommandWindow origin, final Server server, 
58
+            final String... args) {
59
+        final String def = Config.getOption("general", "quitmessage");
59 60
         CommandManager.getServerCommad("quit").execute(origin, server, def);
60 61
     }
61 62
     

+ 4
- 3
src/uk/org/ownage/dmdirc/commandparser/commands/server/Raw.java ファイルの表示

@@ -35,7 +35,7 @@ import uk.org.ownage.dmdirc.commandparser.ServerCommand;
35 35
 public class Raw extends ServerCommand {
36 36
     
37 37
     /**
38
-     * Creates a new instance of Quit
38
+     * Creates a new instance of Quit.
39 39
      */
40 40
     public Raw() {
41 41
         description = "Sends a line of text directly to the IRC sServer";
@@ -47,12 +47,13 @@ public class Raw extends ServerCommand {
47 47
     }
48 48
     
49 49
     /**
50
-     * Executes this command
50
+     * Executes this command.
51 51
      * @param origin The frame in which this command was issued
52 52
      * @param server The server object that this command is associated with
53 53
      * @param args The user supplied arguments
54 54
      */    
55
-    public void execute(CommandWindow origin, Server server, String... args) {
55
+    public void execute(final CommandWindow origin, final Server server, 
56
+            final String... args) {
56 57
         final String line = implodeArgs(args);
57 58
         
58 59
         server.getParser().sendLine(line);

+ 7
- 7
src/uk/org/ownage/dmdirc/commandparser/commands/server/ReloadFormatter.java ファイルの表示

@@ -22,22 +22,21 @@
22 22
 
23 23
 package uk.org.ownage.dmdirc.commandparser.commands.server;
24 24
 
25
-import uk.org.ownage.dmdirc.Config;
26 25
 import uk.org.ownage.dmdirc.Server;
27 26
 import uk.org.ownage.dmdirc.commandparser.CommandWindow;
28 27
 import uk.org.ownage.dmdirc.commandparser.ServerCommand;
29 28
 import uk.org.ownage.dmdirc.ui.messages.Formatter;
30 29
 
31 30
 /**
32
- * Allows the user to reload the message formatter
31
+ * Allows the user to reload the message formatter.
33 32
  * @author chris
34 33
  */
35 34
 public class ReloadFormatter extends ServerCommand {
36 35
     
37 36
     /**
38
-     * Creates a new instance of ReloadFormatter
37
+     * Creates a new instance of ReloadFormatter.
39 38
      */
40
-    public ReloadFormatter () {
39
+    public ReloadFormatter() {
41 40
         description = "Reloads the message formatter";
42 41
         arguments = "";
43 42
         polyadic = false;
@@ -47,14 +46,15 @@ public class ReloadFormatter extends ServerCommand {
47 46
     }
48 47
 
49 48
     /**
50
-     * Executes this command
49
+     * Executes this command.
51 50
      * @param origin The frame in which this command was issued
52 51
      * @param server The server object that this command is associated with
53 52
      * @param args The user supplied arguments
54 53
      */    
55
-    public void execute(CommandWindow origin, Server server, String... args) {
54
+    public void execute(final CommandWindow origin, final Server server, 
55
+            final String... args) {
56 56
         Formatter.reload();
57 57
         origin.addLine("Formatter reloaded.");
58 58
     }
59 59
     
60
-}
60
+}

+ 6
- 6
src/uk/org/ownage/dmdirc/commandparser/commands/server/SaveFormatter.java ファイルの表示

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

+ 1
- 1
src/uk/org/ownage/dmdirc/logger/LogLevel.java ファイルの表示

@@ -29,6 +29,6 @@ public enum LogLevel {
29 29
     /**
30 30
      * log levels recognised by the logger.
31 31
      */
32
-    CORE, COMMAND, PARSER,PLUGIN, UI,
32
+    CORE, COMMAND, PARSER, PLUGIN, UI,
33 33
 }
34 34
 

読み込み中…
キャンセル
保存