ソースを参照

Style fixes

Change-Id: Idffa6c2559bcc2112c9657b15349aa80579ab83a
Reviewed-on: http://gerrit.dmdirc.com/1336
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4rc1
Chris Smith 14年前
コミット
5d584f2068
100個のファイルの変更1315行の追加1316行の削除
  1. 4
    4
      src/com/dmdirc/CertificateManager.java
  2. 3
    3
      src/com/dmdirc/ChannelClientProperty.java
  3. 10
    10
      src/com/dmdirc/EventHandler.java
  4. 1
    1
      src/com/dmdirc/GlobalWindow.java
  5. 14
    14
      src/com/dmdirc/Main.java
  6. 3
    3
      src/com/dmdirc/Server.java
  7. 26
    26
      src/com/dmdirc/WritableFrameContainer.java
  8. 19
    19
      src/com/dmdirc/actions/Action.java
  9. 22
    22
      src/com/dmdirc/actions/ActionComponentChain.java
  10. 31
    31
      src/com/dmdirc/actions/ActionCondition.java
  11. 34
    34
      src/com/dmdirc/actions/ActionGroup.java
  12. 2
    2
      src/com/dmdirc/actions/ActionManager.java
  13. 24
    24
      src/com/dmdirc/actions/ActionModel.java
  14. 26
    26
      src/com/dmdirc/actions/ActionSubstitutor.java
  15. 2
    2
      src/com/dmdirc/actions/ActionTypeComparator.java
  16. 17
    17
      src/com/dmdirc/actions/ConditionTreeFactory.java
  17. 12
    12
      src/com/dmdirc/actions/CoreActionComparison.java
  18. 32
    32
      src/com/dmdirc/actions/CoreActionComponent.java
  19. 33
    33
      src/com/dmdirc/actions/CoreActionType.java
  20. 4
    4
      src/com/dmdirc/actions/interfaces/ActionComparison.java
  21. 8
    8
      src/com/dmdirc/actions/interfaces/ActionComponent.java
  22. 6
    6
      src/com/dmdirc/actions/interfaces/ActionMetaType.java
  23. 1
    1
      src/com/dmdirc/actions/metatypes/LinkEvents.java
  24. 9
    9
      src/com/dmdirc/actions/metatypes/PluginEvents.java
  25. 9
    9
      src/com/dmdirc/actions/metatypes/ServerEvents.java
  26. 25
    25
      src/com/dmdirc/actions/wrappers/Alias.java
  27. 16
    16
      src/com/dmdirc/actions/wrappers/AliasWrapper.java
  28. 28
    28
      src/com/dmdirc/actions/wrappers/PerformWrapper.java
  29. 44
    44
      src/com/dmdirc/commandline/CommandLineParser.java
  30. 3
    3
      src/com/dmdirc/commandline/RemoteInterface.java
  31. 11
    11
      src/com/dmdirc/commandline/RemoteServer.java
  32. 5
    5
      src/com/dmdirc/commandparser/CommandArguments.java
  33. 49
    49
      src/com/dmdirc/commandparser/CommandManager.java
  34. 18
    18
      src/com/dmdirc/commandparser/PopupManager.java
  35. 7
    7
      src/com/dmdirc/commandparser/PopupMenu.java
  36. 17
    17
      src/com/dmdirc/commandparser/PopupMenuItem.java
  37. 26
    26
      src/com/dmdirc/commandparser/PopupType.java
  38. 18
    18
      src/com/dmdirc/commandparser/commands/Command.java
  39. 1
    1
      src/com/dmdirc/commandparser/commands/GlobalCommand.java
  40. 2
    2
      src/com/dmdirc/commandparser/commands/IntelligentCommand.java
  41. 13
    13
      src/com/dmdirc/commandparser/commands/PreviousCommand.java
  42. 3
    3
      src/com/dmdirc/commandparser/commands/ValidatingCommand.java
  43. 3
    3
      src/com/dmdirc/commandparser/commands/WrappableCommand.java
  44. 13
    13
      src/com/dmdirc/commandparser/commands/channel/KickReason.java
  45. 7
    7
      src/com/dmdirc/commandparser/commands/channel/Names.java
  46. 15
    15
      src/com/dmdirc/commandparser/commands/channel/SetNickColour.java
  47. 2
    2
      src/com/dmdirc/commandparser/commands/global/Active.java
  48. 10
    10
      src/com/dmdirc/commandparser/commands/global/AliasCommand.java
  49. 11
    11
      src/com/dmdirc/commandparser/commands/global/AllServers.java
  50. 37
    37
      src/com/dmdirc/commandparser/commands/global/Debug.java
  51. 8
    8
      src/com/dmdirc/commandparser/commands/global/Exit.java
  52. 19
    19
      src/com/dmdirc/commandparser/commands/global/Ifplugin.java
  53. 3
    3
      src/com/dmdirc/commandparser/commands/global/Input.java
  54. 8
    8
      src/com/dmdirc/commandparser/commands/global/NewServer.java
  55. 14
    14
      src/com/dmdirc/commandparser/commands/global/Notify.java
  56. 10
    10
      src/com/dmdirc/commandparser/commands/global/OpenWindow.java
  57. 11
    11
      src/com/dmdirc/commandparser/commands/global/ReloadPlugin.java
  58. 11
    11
      src/com/dmdirc/commandparser/commands/global/SaveConfig.java
  59. 5
    5
      src/com/dmdirc/commandparser/commands/global/Set.java
  60. 12
    12
      src/com/dmdirc/commandparser/commands/global/UnloadPlugin.java
  61. 2
    2
      src/com/dmdirc/commandparser/commands/server/AllChannels.java
  62. 8
    8
      src/com/dmdirc/commandparser/commands/server/Back.java
  63. 8
    8
      src/com/dmdirc/commandparser/commands/server/ChangeServer.java
  64. 10
    10
      src/com/dmdirc/commandparser/commands/server/Disconnect.java
  65. 8
    8
      src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java
  66. 12
    12
      src/com/dmdirc/commandparser/commands/server/Nick.java
  67. 10
    10
      src/com/dmdirc/commandparser/commands/server/Notice.java
  68. 13
    13
      src/com/dmdirc/commandparser/commands/server/OpenQuery.java
  69. 9
    9
      src/com/dmdirc/commandparser/commands/server/Raw.java
  70. 12
    12
      src/com/dmdirc/commandparser/commands/server/RawServerCommand.java
  71. 10
    10
      src/com/dmdirc/commandparser/commands/server/Reconnect.java
  72. 7
    7
      src/com/dmdirc/commandparser/parsers/ChannelCommandParser.java
  73. 9
    9
      src/com/dmdirc/commandparser/parsers/GlobalCommandParser.java
  74. 5
    5
      src/com/dmdirc/commandparser/parsers/QueryCommandParser.java
  75. 8
    8
      src/com/dmdirc/commandparser/parsers/ServerCommandParser.java
  76. 20
    20
      src/com/dmdirc/config/CipherUtils.java
  77. 10
    10
      src/com/dmdirc/config/ConfigManager.java
  78. 1
    1
      src/com/dmdirc/config/Identity.java
  79. 72
    72
      src/com/dmdirc/config/IdentityManager.java
  80. 38
    38
      src/com/dmdirc/config/prefs/PreferencesManager.java
  81. 50
    50
      src/com/dmdirc/config/prefs/PreferencesSetting.java
  82. 3
    3
      src/com/dmdirc/config/prefs/SettingChangeListener.java
  83. 3
    3
      src/com/dmdirc/config/prefs/validator/FileNameValidator.java
  84. 3
    3
      src/com/dmdirc/config/prefs/validator/IdentValidator.java
  85. 10
    10
      src/com/dmdirc/config/prefs/validator/NumericalValidator.java
  86. 3
    3
      src/com/dmdirc/config/prefs/validator/PortValidator.java
  87. 2
    2
      src/com/dmdirc/config/prefs/validator/RegexValidator.java
  88. 9
    9
      src/com/dmdirc/config/prefs/validator/ValidationResponse.java
  89. 6
    6
      src/com/dmdirc/config/prefs/validator/Validator.java
  90. 5
    5
      src/com/dmdirc/config/prefs/validator/ValidatorChain.java
  91. 8
    8
      src/com/dmdirc/installer/DefaultSettings.java
  92. 4
    4
      src/com/dmdirc/installer/Installer.java
  93. 18
    19
      src/com/dmdirc/installer/InstallerListener.java
  94. 10
    10
      src/com/dmdirc/installer/WindowsInstaller.java
  95. 13
    13
      src/com/dmdirc/installer/cliparser/CLIParser.java
  96. 7
    7
      src/com/dmdirc/installer/cliparser/IntegerParam.java
  97. 15
    15
      src/com/dmdirc/installer/ui/InstallerDialog.java
  98. 35
    35
      src/com/dmdirc/installer/ui/StepLayout.java
  99. 2
    2
      src/com/dmdirc/installer/ui/StepSettings.java
  100. 0
    0
      src/com/dmdirc/installer/ui/StepWelcome.java

+ 4
- 4
src/com/dmdirc/CertificateManager.java ファイルの表示

@@ -103,7 +103,7 @@ public class CertificateManager implements X509TrustManager {
103 103
 
104 104
     /** Used to synchronise the manager with the certificate dialog. */
105 105
     private final Semaphore actionSem = new Semaphore(0);
106
-    
106
+
107 107
     /** The action to perform. */
108 108
     private CertificateAction action;
109 109
 
@@ -288,7 +288,7 @@ public class CertificateManager implements X509TrustManager {
288 288
 
289 289
         for (X509Certificate cert : chain) {
290 290
             TrustResult trustResult = isTrusted(cert);
291
-            
291
+
292 292
             if (checkDate) {
293 293
                 // Check that the certificate is in-date
294 294
                 try {
@@ -323,7 +323,7 @@ public class CertificateManager implements X509TrustManager {
323 323
             } catch (InterruptedException ie) {
324 324
               throw new CertificateException("Thread aborted, ");
325 325
             }
326
-            
326
+
327 327
             switch (action) {
328 328
                 case DISCONNECT:
329 329
                     throw new CertificateException("Not trusted");
@@ -348,7 +348,7 @@ public class CertificateManager implements X509TrustManager {
348 348
      */
349 349
     public void setAction(final CertificateAction action) {
350 350
         this.action = action;
351
-        
351
+
352 352
         actionSem.release();
353 353
     }
354 354
 

+ 3
- 3
src/com/dmdirc/ChannelClientProperty.java ファイルの表示

@@ -31,13 +31,13 @@ public enum ChannelClientProperty {
31 31
 
32 32
     /** Nicklist client foreground colour. */
33 33
     NICKLIST_FOREGROUND,
34
-    
34
+
35 35
     /** Nicklist client background colour. */
36 36
     NICKLIST_BACKGROUND,
37
-    
37
+
38 38
     /** Textpane client foreground colour. */
39 39
     TEXT_FOREGROUND,
40
-    
40
+
41 41
     /** Textpane client background colour. */
42 42
     TEXT_BACKGROUND;
43 43
 

+ 10
- 10
src/com/dmdirc/EventHandler.java ファイルの表示

@@ -31,18 +31,18 @@ import com.dmdirc.parser.interfaces.callbacks.CallbackInterface;
31 31
 
32 32
 /**
33 33
  * Abstracts some behaviour used by Event Handlers.
34
- * 
34
+ *
35 35
  * @author chris
36 36
  */
37 37
 public abstract class EventHandler implements CallbackInterface {
38
-    
38
+
39 39
     /**
40 40
      * Registers all callbacks that this event handler implements with the
41 41
      * owner's parser.
42 42
      */
43 43
     public void registerCallbacks() {
44 44
         final CallbackManager<?> cbm = getServer().getParser().getCallbackManager();
45
-        
45
+
46 46
         try {
47 47
             for (Class<?> iface : this.getClass().getInterfaces()) {
48 48
                 if (CallbackInterface.class.isAssignableFrom(iface)) {
@@ -54,7 +54,7 @@ public abstract class EventHandler implements CallbackInterface {
54 54
                     exception);
55 55
         }
56 56
     }
57
-    
57
+
58 58
     /**
59 59
      * Unregisters all callbacks that have been registered by this event handler.
60 60
      */
@@ -63,10 +63,10 @@ public abstract class EventHandler implements CallbackInterface {
63 63
             getServer().getParser().getCallbackManager().delAllCallback(this);
64 64
         }
65 65
     }
66
-    
66
+
67 67
     /**
68 68
      * Adds a callback to this event handler.
69
-     * 
69
+     *
70 70
      * @param <T> The type of callback to be added
71 71
      * @param cbm The callback manager to use
72 72
      * @param type The type of the callback to be added
@@ -74,7 +74,7 @@ public abstract class EventHandler implements CallbackInterface {
74 74
      */
75 75
     protected abstract <T extends CallbackInterface> void addCallback(
76 76
             final CallbackManager<?> cbm, final Class<T> type) throws CallbackNotFoundException;
77
-    
77
+
78 78
     /**
79 79
      * Retrieves the server belonging to this EventHandler's owner.
80 80
      *
@@ -82,12 +82,12 @@ public abstract class EventHandler implements CallbackInterface {
82 82
      * @return This EventHandler's expected server
83 83
      */
84 84
     protected abstract Server getServer();
85
-    
85
+
86 86
     /**
87 87
      * Checks that the specified parser is the same as the one the server is
88 88
      * currently claiming to be using. If it isn't, we raise an exception to
89 89
      * prevent further (erroneous) processing.
90
-     * 
90
+     *
91 91
      * @param parser The parser to check
92 92
      */
93 93
     protected void checkParser(final Parser parser) {
@@ -97,6 +97,6 @@ public abstract class EventHandler implements CallbackInterface {
97 97
                     + getServer().getStatus().getParserID(parser)
98 98
                     + ").\n\n " + getServer().getStatus().getTransitionHistory());
99 99
         }
100
-    }    
100
+    }
101 101
 
102 102
 }

+ 1
- 1
src/com/dmdirc/GlobalWindow.java ファイルの表示

@@ -108,7 +108,7 @@ public class GlobalWindow extends WritableFrameContainer<InputWindow> {
108 108
     public TabCompleter getTabCompleter() {
109 109
         return tabCompleter;
110 110
     }
111
-    
111
+
112 112
     /**
113 113
      * Initialises the global window if it's enabled in the config.
114 114
      */

+ 14
- 14
src/com/dmdirc/Main.java ファイルの表示

@@ -88,10 +88,10 @@ public class Main {
88 88
             Logger.appError(ErrorLevel.FATAL, "Exception while initialising", ex);
89 89
         }
90 90
     }
91
-    
91
+
92 92
     /**
93 93
      * Initialises the client.
94
-     * 
94
+     *
95 95
      * @param args The command line arguments
96 96
      */
97 97
     private static void init(final String[] args) {
@@ -116,7 +116,7 @@ public class Main {
116 116
 
117 117
         final PluginManager pm = PluginManager.getPluginManager();
118 118
         checkBundledPlugins(pm, IdentityManager.getGlobalConfig());
119
-        
119
+
120 120
         ThemeManager.loadThemes();
121 121
 
122 122
         clp.applySettings();
@@ -168,7 +168,7 @@ public class Main {
168 168
                 ServerManager.getServerManager().disconnectAll("Unexpected shutdown");
169 169
                 IdentityManager.save();
170 170
             }
171
-        }, "Shutdown thread"));        
171
+        }, "Shutdown thread"));
172 172
     }
173 173
 
174 174
     /**
@@ -323,7 +323,7 @@ public class Main {
323 323
         // Can't find any
324 324
         throw new IllegalStateException("No UIs could be loaded");
325 325
     }
326
-    
326
+
327 327
     /**
328 328
      * Executes the first run or migration wizards as required.
329 329
      */
@@ -348,15 +348,15 @@ public class Main {
348 348
     public static void quit() {
349 349
         quit(0);
350 350
     }
351
-    
351
+
352 352
     /**
353 353
      * Quits the client nicely, with the default closing message.
354
-     * 
355
-     * @param exitCode This is the exit code that will be returned to the 
354
+     *
355
+     * @param exitCode This is the exit code that will be returned to the
356 356
      *                  operating system when the client exits
357 357
      */
358 358
     public static void quit(final int exitCode) {
359
-        quit(IdentityManager.getGlobalConfig().getOption("general", 
359
+        quit(IdentityManager.getGlobalConfig().getOption("general",
360 360
                 "closemessage"), exitCode);
361 361
     }
362 362
 
@@ -368,12 +368,12 @@ public class Main {
368 368
     public static void quit(final String reason) {
369 369
         quit(reason, 0);
370 370
     }
371
-    
371
+
372 372
     /**
373 373
      * Quits the client nicely.
374 374
      *
375 375
      * @param reason The quit reason to send
376
-     * @param exitCode This is the exit code that will be returned to the 
376
+     * @param exitCode This is the exit code that will be returned to the
377 377
      *                  operating system when the client exits
378 378
      */
379 379
     public static void quit(final String reason, final int exitCode) {
@@ -440,9 +440,9 @@ public class Main {
440 440
             final File testFile = new File(configdir);
441 441
             if (!testFile.exists()) {
442 442
                 final String configHome = System.getenv("XDG_CONFIG_HOME");
443
-                configdir = (configHome == null || configHome.isEmpty()) ?
444
-                    System.getProperty("user.home") + fs + ".config" + fs :
445
-                    configHome;
443
+                configdir = (configHome == null || configHome.isEmpty())
444
+                        ? System.getProperty("user.home") + fs + ".config" + fs
445
+                        : configHome;
446 446
                 configdir += fs + "DMDirc" + fs;
447 447
             }
448 448
         }

+ 3
- 3
src/com/dmdirc/Server.java ファイルの表示

@@ -307,7 +307,7 @@ public class Server extends WritableFrameContainer<ServerWindow> implements Conf
307 307
 
308 308
             updateAwayState(null);
309 309
             removeInvites();
310
-            
310
+
311 311
             try {
312 312
                 parserThread = new Thread(parser, "Parser thread");
313 313
                 parserThread.start();
@@ -1223,8 +1223,8 @@ public class Server extends WritableFrameContainer<ServerWindow> implements Conf
1223 1223
      */
1224 1224
     public void sendCTCPReply(final String source, final String type, final String args) {
1225 1225
         if (type.equalsIgnoreCase("VERSION")) {
1226
-            parser.sendCTCPReply(source, "VERSION", "DMDirc " +
1227
-                    getConfigManager().getOption("version", "version")
1226
+            parser.sendCTCPReply(source, "VERSION", "DMDirc "
1227
+                    + getConfigManager().getOption("version", "version")
1228 1228
                     + " - http://www.dmdirc.com/");
1229 1229
         } else if (type.equalsIgnoreCase("PING")) {
1230 1230
             parser.sendCTCPReply(source, "PING", args);

+ 26
- 26
src/com/dmdirc/WritableFrameContainer.java ファイルの表示

@@ -45,10 +45,10 @@ import java.util.List;
45 45
  * @author chris
46 46
  */
47 47
 public abstract class WritableFrameContainer<T extends InputWindow> extends FrameContainer<T> {
48
-    
48
+
49 49
     /** The name of the server notification target. */
50 50
     protected static final String NOTIFICATION_SERVER = "server".intern();
51
-    
51
+
52 52
     /** The name of the channel notification target. */
53 53
     protected static final String NOTIFICATION_CHANNEL = "channel".intern();
54 54
 
@@ -57,7 +57,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
57 57
 
58 58
     /**
59 59
      * Creates a new WritableFrameContainer.
60
-     * 
60
+     *
61 61
      * @param icon The icon to use for this container
62 62
      * @param name The name of this container
63 63
      * @param title The title of this container
@@ -74,7 +74,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
74 74
         this.commandParser = parser;
75 75
         parser.setOwner(this);
76 76
     }
77
-    
77
+
78 78
     /**
79 79
      * Sends a line of text to this container's source.
80 80
      *
@@ -84,7 +84,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
84 84
 
85 85
     /**
86 86
      * Retrieves the command parser to be used for this container.
87
-     * 
87
+     *
88 88
      * @return This container's command parser
89 89
      */
90 90
     public CommandParser getCommandParser() {
@@ -97,7 +97,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
97 97
      * @return This container's tab completer
98 98
      */
99 99
     public abstract TabCompleter getTabCompleter();
100
-    
100
+
101 101
     /**
102 102
      * Returns the maximum length that a line passed to sendLine() should be,
103 103
      * in order to prevent it being truncated or causing protocol violations.
@@ -140,7 +140,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
140 140
 
141 141
         return result;
142 142
     }
143
-    
143
+
144 144
     /**
145 145
      * Returns the number of lines that the specified string would be sent as.
146 146
      *
@@ -150,7 +150,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
150 150
     public final int getNumLines(final String line) {
151 151
         final String[] splitLines = line.split("(\n|\r\n|\r)", Integer.MAX_VALUE);
152 152
         int lines = 0;
153
-        
153
+
154 154
         for (String splitLine : splitLines) {
155 155
             if (getMaxLineLength() <= 0) {
156 156
                 lines++;
@@ -159,7 +159,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
159 159
                         / (double) getMaxLineLength());
160 160
             }
161 161
         }
162
-        
162
+
163 163
         return lines;
164 164
     }
165 165
 
@@ -175,7 +175,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
175 175
             final ActionType actionType, final Object... args) {
176 176
         return doNotification(new Date(), messageType, actionType, args);
177 177
     }
178
-    
178
+
179 179
     /**
180 180
      * Processes and displays a notification.
181 181
      *
@@ -200,7 +200,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
200 200
                 messageArgs.add(arg);
201 201
             }
202 202
         }
203
-        
203
+
204 204
         modifyNotificationArgs(actionArgs, messageArgs);
205 205
 
206 206
         final boolean res = ActionManager.processEvent(actionType, buffer, actionArgs.toArray());
@@ -208,11 +208,11 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
208 208
         handleNotification(date, buffer.toString(), messageArgs.toArray());
209 209
 
210 210
         return res;
211
-    } 
212
-    
211
+    }
212
+
213 213
     /**
214 214
      * Allows subclasses to modify the lists of arguments for notifications.
215
-     * 
215
+     *
216 216
      * @param actionArgs The list of arguments to be passed to the actions system
217 217
      * @param messageArgs The list of arguments to be passed to the formatter
218 218
      */
@@ -220,10 +220,10 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
220 220
             final List<Object> messageArgs) {
221 221
         // Do nothing
222 222
     }
223
-    
223
+
224 224
     /**
225 225
      * Allows subclasses to process specific types of notification arguments.
226
-     * 
226
+     *
227 227
      * @param arg The argument to be processed
228 228
      * @param args The list of arguments that any data should be appended to
229 229
      * @return True if the arg has been processed, false otherwise
@@ -243,7 +243,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
243 243
     public void handleNotification(final String messageType, final Object... args) {
244 244
         handleNotification(new Date(), messageType, args);
245 245
     }
246
-    
246
+
247 247
     /**
248 248
      * Handles general server notifications (i.e., ones not tied to a
249 249
      * specific window). The user can select where the notifications should
@@ -258,10 +258,10 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
258 258
                 messageType) ? getConfigManager().getOption("notifications", messageType)
259 259
                 : "self", args);
260 260
     }
261
-    
261
+
262 262
     /**
263 263
      * Despatches a notification of the specified type to the specified target.
264
-     * 
264
+     *
265 265
      * @param date The date/time at which the event occured
266 266
      * @param messageType The type of the message that is being sent
267 267
      * @param messageTarget The target of the message
@@ -269,10 +269,10 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
269 269
      */
270 270
     protected void despatchNotification(final Date date, final String messageType,
271 271
             final String messageTarget, final Object... args) {
272
-        
272
+
273 273
         String target = messageTarget;
274 274
         String format = messageType;
275
-        
275
+
276 276
         if (target.startsWith("format:")) {
277 277
             format = target.substring(7);
278 278
             format = format.substring(0, format.indexOf(':'));
@@ -284,12 +284,12 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
284 284
                     ? getConfigManager().getOption("notifications", target.substring(6))
285 285
                     : "self";
286 286
         }
287
-        
287
+
288 288
         if (target.startsWith("fork:")) {
289 289
             for (String newtarget : target.substring(5).split("\\|")) {
290 290
                 despatchNotification(date, format, newtarget, args);
291 291
             }
292
-            
292
+
293 293
             return;
294 294
         }
295 295
 
@@ -324,7 +324,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
324 324
             long besttime = 0;
325 325
 
326 326
             final List<FrameContainer<?>> containers = new ArrayList<FrameContainer<?>>();
327
-            
327
+
328 328
             containers.add(getServer());
329 329
             containers.addAll(getServer().getChildren());
330 330
 
@@ -390,6 +390,6 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
390 390
             Logger.userError(ErrorLevel.MEDIUM,
391 391
                     "Invalid notification target for type " + messageType + ": " + target);
392 392
         }
393
-    }          
394
-    
393
+    }
394
+
395 395
 }

+ 19
- 19
src/com/dmdirc/actions/Action.java ファイルの表示

@@ -144,11 +144,11 @@ public class Action extends ActionModel implements ConfigChangeListener {
144 144
         location = dir + name.replaceAll("[^A-Za-z0-9\\-_]", "_");
145 145
 
146 146
         new File(dir).mkdirs();
147
-        
147
+
148 148
         ActionManager.processEvent(CoreActionType.ACTION_CREATED, null, this);
149 149
 
150 150
         save();
151
-        
151
+
152 152
         ActionManager.registerAction(this);
153 153
     }
154 154
 
@@ -178,8 +178,8 @@ public class Action extends ActionModel implements ConfigChangeListener {
178 178
         }
179 179
 
180 180
         if (config.isFlatDomain(DOMAIN_FORMAT)) {
181
-            newFormat = config.getFlatDomain(DOMAIN_FORMAT).size() == 0 ? "" :
182
-                config.getFlatDomain(DOMAIN_FORMAT).get(0);
181
+            newFormat = config.getFlatDomain(DOMAIN_FORMAT).size() == 0 ? ""
182
+                    : config.getFlatDomain(DOMAIN_FORMAT).get(0);
183 183
         }
184 184
 
185 185
         for (int cond = 0; config.isKeyDomain("condition " + cond); cond++) {
@@ -237,11 +237,11 @@ public class Action extends ActionModel implements ConfigChangeListener {
237 237
             if (data.containsKey("author")) {
238 238
                 myGroup.setAuthor(data.get("author"));
239 239
             }
240
-            
240
+
241 241
             if (data.containsKey("version")) {
242 242
                 myGroup.setVersion(new Version(data.get("version")));
243 243
             }
244
-            
244
+
245 245
             if (data.containsKey("component")) {
246 246
                 try {
247 247
                     myGroup.setComponent(Integer.parseInt(data.get("component")));
@@ -254,7 +254,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
254 254
         for (int i = 0; config.isKeyDomain("setting " + i); i++) {
255 255
             final ActionGroup myGroup = ActionManager.getGroup(group);
256 256
             final Map<String, String> data = config.getKeyDomain("setting " + i);
257
-            
257
+
258 258
             if (data.containsKey("type") && data.containsKey("setting")
259 259
                     && data.containsKey("title") && data.containsKey("default")
260 260
                     && data.containsKey("tooltip")) {
@@ -268,7 +268,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
268 268
 
269 269
     /**
270 270
      * Loads a list of triggers with the specified names.
271
-     * 
271
+     *
272 272
      * @param newTriggers A list of trigger names
273 273
      * @return True if all triggers are valid and compatible, false otherwise.
274 274
      */
@@ -297,7 +297,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
297 297
         if (!isModified()) {
298 298
             return;
299 299
         }
300
-        
300
+
301 301
         final ConfigFile newConfig = new ConfigFile(location);
302 302
 
303 303
         final List<String> triggerNames = new ArrayList<String>();
@@ -346,13 +346,13 @@ public class Action extends ActionModel implements ConfigChangeListener {
346 346
             final Map<String, String> data = new HashMap<String, String>();
347 347
 
348 348
             data.put("argument", String.valueOf(condition.getArg()));
349
-            
349
+
350 350
             if (condition.getArg() == -1) {
351 351
                 data.put("starget", condition.getStarget());
352 352
             } else {
353 353
                 data.put("component", condition.getComponent().toString());
354 354
             }
355
-            
355
+
356 356
             data.put("comparison", condition.getComparison().toString());
357 357
             data.put("target", condition.getTarget());
358 358
 
@@ -384,7 +384,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
384 384
 
385 385
     /**
386 386
      * Reads a condition from the specified configuration section.
387
-     * 
387
+     *
388 388
      * @param data The relevant section of the action configuration
389 389
      * @return True if the condition is valid, false otherwise
390 390
      */
@@ -413,7 +413,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
413 413
 
414 414
         if (arg == -1) {
415 415
             starget = data.get("starget");
416
-            
416
+
417 417
             if (starget == null) {
418 418
                 error("No starget specified");
419 419
                 return false;
@@ -422,7 +422,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
422 422
             component = readComponent(data, arg);
423 423
             if (component == null) {
424 424
                 return false;
425
-            }            
425
+            }
426 426
         }
427 427
 
428 428
         // ------ Read the comparison
@@ -433,7 +433,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
433 433
             return false;
434 434
         }
435 435
 
436
-        if ((arg != -1 && !comparison.appliesTo().equals(component.getType())) 
436
+        if ((arg != -1 && !comparison.appliesTo().equals(component.getType()))
437 437
             || (arg == -1 && !comparison.appliesTo().equals(String.class))) {
438 438
             error("Comparison cannot be applied to specified component: " + data.get("comparison"));
439 439
             return false;
@@ -453,13 +453,13 @@ public class Action extends ActionModel implements ConfigChangeListener {
453 453
         } else {
454 454
             conditions.add(new ActionCondition(arg, component, comparison, target));
455 455
         }
456
-        
456
+
457 457
         return true;
458 458
     }
459 459
 
460 460
     /**
461 461
      * Reads a component from the specified data section for the specified argument.
462
-     * 
462
+     *
463 463
      * @param data The relevant section of the action configuration
464 464
      * @param arg The argument number that the component should apply to
465 465
      * @return The corresponding ActionComponent, or null if the specified
@@ -509,7 +509,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
509 509
     public void setName(final String newName) {
510 510
         super.setName(newName);
511 511
 
512
-        new File(location).delete();        
512
+        new File(location).delete();
513 513
         location = ActionManager.getDirectory() + group + File.separator + newName;
514 514
 
515 515
         save();
@@ -525,7 +525,7 @@ public class Action extends ActionModel implements ConfigChangeListener {
525 525
         final String dir = ActionManager.getDirectory() + group + File.separator;
526 526
         location = dir + name;
527 527
 
528
-        new File(dir).mkdirs();        
528
+        new File(dir).mkdirs();
529 529
 
530 530
         save();
531 531
     }

+ 22
- 22
src/com/dmdirc/actions/ActionComponentChain.java ファイルの表示

@@ -36,12 +36,12 @@ import java.util.List;
36 36
  * @author chris
37 37
  */
38 38
 public class ActionComponentChain implements ActionComponent {
39
-    
39
+
40 40
     /**
41 41
      * A list of components in this chain.
42 42
      */
43 43
     private final List<ActionComponent> components = new ArrayList<ActionComponent>();
44
-    
44
+
45 45
     /**
46 46
      * Creates a new component chain from the specified text representation.
47 47
      * Chains are separated with full stops (.).
@@ -51,10 +51,10 @@ public class ActionComponentChain implements ActionComponent {
51 51
      */
52 52
     public ActionComponentChain(final Class<?> source, final String chain) {
53 53
         Class<?> current = source;
54
-        
54
+
55 55
         for (String componentName : chain.split("\\.")) {
56 56
             final ActionComponent component = ActionManager.getActionComponent(componentName);
57
-            
57
+
58 58
             if (component == null) {
59 59
                 throw new IllegalArgumentException("Component " + componentName
60 60
                         + " not found");
@@ -66,72 +66,72 @@ public class ActionComponentChain implements ActionComponent {
66 66
                         + " cannot be applied to " + current.getName());
67 67
             }
68 68
         }
69
-        
69
+
70 70
     }
71
-    
71
+
72 72
     /** {@inheritDoc} */
73 73
     @Override
74 74
     public Object get(final Object argument) {
75 75
         Object res = argument;
76
-        
76
+
77 77
         for (ActionComponent component : components) {
78 78
             if (res == null) {
79 79
                 return null;
80 80
             }
81
-            
81
+
82 82
             res = component.get(res);
83 83
         }
84
-        
84
+
85 85
         return res;
86 86
     }
87
-    
87
+
88 88
     /** {@inheritDoc} */
89 89
     @Precondition("This component chain has one or more components")
90 90
     @Override
91 91
     public Class<?> appliesTo() {
92 92
         Logger.assertTrue(!components.isEmpty());
93
-        
93
+
94 94
         return components.get(0).appliesTo();
95 95
     }
96
-    
96
+
97 97
     /** {@inheritDoc} */
98 98
     @Precondition("This component chain has one or more components")
99 99
     @Override
100 100
     public Class<?> getType() {
101 101
         Logger.assertTrue(!components.isEmpty());
102
-        
102
+
103 103
         return components.get(components.size() - 1).getType();
104 104
     }
105
-    
105
+
106 106
     /** {@inheritDoc} */
107 107
     @Precondition("This component chain has one or more components")
108 108
     @Override
109 109
     public String getName() {
110 110
         Logger.assertTrue(!components.isEmpty());
111
-        
111
+
112 112
         final StringBuilder name = new StringBuilder();
113
-        
113
+
114 114
         for (ActionComponent component : components) {
115 115
             name.append("'s ");
116 116
             name.append(component.getName());
117 117
         }
118
-        
118
+
119 119
         return name.substring(3);
120 120
     }
121
-    
121
+
122 122
     /** {@inheritDoc} */
123 123
     @Override
124 124
     @Precondition("This component chain has one or more components")
125 125
     public String toString() {
126 126
         Logger.assertTrue(!components.isEmpty());
127
-        
127
+
128 128
         final StringBuilder name = new StringBuilder();
129
-        
129
+
130 130
         for (ActionComponent component : components) {
131 131
             name.append('.');
132 132
             name.append(component.toString());
133 133
         }
134
-        
134
+
135 135
         return name.substring(1);
136 136
     }
137 137
 
@@ -165,5 +165,5 @@ public class ActionComponentChain implements ActionComponent {
165 165
 
166 166
         return res;
167 167
     }
168
-    
168
+
169 169
 }

+ 31
- 31
src/com/dmdirc/actions/ActionCondition.java ファイルの表示

@@ -30,26 +30,26 @@ import com.dmdirc.actions.interfaces.ActionComponent;
30 30
  * @author chris
31 31
  */
32 32
 public class ActionCondition {
33
-    
33
+
34 34
     /** The argument number that this action condition applies to. */
35 35
     private int arg;
36
-    
36
+
37 37
     /** The component that this action condition applies to. */
38 38
     private ActionComponent component;
39
-    
39
+
40 40
     /** The comparison that should be used for this condition. */
41 41
     private ActionComparison comparison;
42
-    
42
+
43 43
     /** The target of the comparison for this condition. */
44 44
     private String target = "";
45
-    
45
+
46 46
     /** The source target for this comparison. */
47 47
     private String starget = "";
48
-    
48
+
49 49
     /**
50 50
      * Creates a new instance of ActionCondition that compares the output of
51 51
      * a component to a string.
52
-     * 
52
+     *
53 53
      * @param arg The argument number to be tested
54 54
      * @param component The component to be tested
55 55
      * @param comparison The comparison to be used
@@ -58,16 +58,16 @@ public class ActionCondition {
58 58
     public ActionCondition(final int arg, final ActionComponent component,
59 59
             final ActionComparison comparison, final String target) {
60 60
         super();
61
-        
61
+
62 62
         this.arg = arg;
63 63
         this.component = component;
64 64
         this.comparison = comparison;
65 65
         this.target = target;
66 66
     }
67
-    
67
+
68 68
     /**
69 69
      * Creates a new instance of ActionCondition that compares two strings.
70
-     * 
70
+     *
71 71
      * @param starget The first target for comparison.
72 72
      * @param comparison The comparison to be used
73 73
      * @param target The second target for the comparison
@@ -75,31 +75,31 @@ public class ActionCondition {
75 75
     public ActionCondition(final String starget, final ActionComparison comparison,
76 76
             final String target) {
77 77
         super();
78
-        
78
+
79 79
         this.arg = -1;
80 80
         this.starget = starget;
81 81
         this.comparison = comparison;
82 82
         this.target = target;
83 83
     }
84
-    
84
+
85 85
     /**
86 86
      * Tests to see if this condition holds.
87
-     * 
87
+     *
88 88
      * @param sub The substitutor to use for this
89 89
      * @param args The event arguments to be tested
90 90
      * @return True if the condition holds, false otherwise
91 91
      */
92 92
     public boolean test(final ActionSubstitutor sub, final Object ... args) {
93 93
         final String thisTarget = sub.doSubstitution(getTarget(), args);
94
-        
95
-        if (arg == -1) { 
94
+
95
+        if (arg == -1) {
96 96
             final String thisStarget = sub.doSubstitution(starget, args);
97 97
             return getComparison().test(thisStarget, thisTarget);
98 98
         } else {
99 99
             return getComparison().test(getComponent().get(args[getArg()]), thisTarget);
100 100
         }
101 101
     }
102
-    
102
+
103 103
     /**
104 104
      * Returns the argument number this condition applies to.
105 105
      *
@@ -108,7 +108,7 @@ public class ActionCondition {
108 108
     public int getArg() {
109 109
         return arg;
110 110
     }
111
-    
111
+
112 112
     /**
113 113
      * Returns the component this condition applies to.
114 114
      *
@@ -117,7 +117,7 @@ public class ActionCondition {
117 117
     public ActionComponent getComponent() {
118 118
         return component;
119 119
     }
120
-    
120
+
121 121
     /**
122 122
      * Returns the comparison this condition applies to.
123 123
      *
@@ -126,7 +126,7 @@ public class ActionCondition {
126 126
     public ActionComparison getComparison() {
127 127
         return comparison;
128 128
     }
129
-    
129
+
130 130
     /**
131 131
      * Returns the target of the comparison for this condition.
132 132
      *
@@ -135,7 +135,7 @@ public class ActionCondition {
135 135
     public String getTarget() {
136 136
         return target;
137 137
     }
138
-    
138
+
139 139
     /**
140 140
      * Sets the argument number this condition applies to.
141 141
      *
@@ -144,7 +144,7 @@ public class ActionCondition {
144 144
     public void setArg(final int arg) {
145 145
         this.arg = arg;
146 146
     }
147
-    
147
+
148 148
     /**
149 149
      * Sets the component this condition applies to.
150 150
      *
@@ -153,7 +153,7 @@ public class ActionCondition {
153 153
     public void setComponent(final ActionComponent component) {
154 154
         this.component = component;
155 155
     }
156
-    
156
+
157 157
     /**
158 158
      * Sets the comparison this condition applies to.
159 159
      *
@@ -162,7 +162,7 @@ public class ActionCondition {
162 162
     public void setComparison(final ActionComparison comparison) {
163 163
         this.comparison = comparison;
164 164
     }
165
-    
165
+
166 166
     /**
167 167
      * Sets the target of the comparison for this condition.
168 168
      * @param target Target for comparison
@@ -173,7 +173,7 @@ public class ActionCondition {
173 173
 
174 174
     /**
175 175
      * Retrieves the starget of this condition.
176
-     * 
176
+     *
177 177
      * @return This condition's starget, or null if none was set.
178 178
      */
179 179
     public String getStarget() {
@@ -182,17 +182,17 @@ public class ActionCondition {
182 182
 
183 183
     /**
184 184
      * Sets the starget for this condition.
185
-     * 
185
+     *
186 186
      * @param starget The new starget for this condition.
187 187
      */
188 188
     public void setStarget(final String starget) {
189 189
         this.starget = starget;
190 190
     }
191
-    
191
+
192 192
     /** {@inheritDoc} */
193 193
     @Override
194 194
     public String toString() {
195
-        return "[ arg=" + arg + ", component=" + component + ", comparison=" 
195
+        return "[ arg=" + arg + ", component=" + component + ", comparison="
196 196
                 + comparison + ", target=" + target + ", starget=" + starget + " ]";
197 197
     }
198 198
 
@@ -202,19 +202,19 @@ public class ActionCondition {
202 202
         if (!(obj instanceof ActionCondition)) {
203 203
             return false;
204 204
         }
205
-        
205
+
206 206
         final ActionCondition o = (ActionCondition) obj;
207
-        
207
+
208 208
         return arg == o.getArg() && component == o.getComponent()
209 209
                 && comparison == o.getComparison() && target.equals(o.getTarget())
210 210
                 && starget.equals(o.getStarget());
211 211
     }
212
-    
212
+
213 213
     /** {@inheritDoc} */
214 214
     @Override
215 215
     public int hashCode() {
216 216
         return arg + 100 * (arg == -1 ? starget.hashCode() : component.hashCode())
217 217
                 + 10000 * comparison.hashCode() + 100000 * target.hashCode();
218 218
     }
219
-    
219
+
220 220
 }

+ 34
- 34
src/com/dmdirc/actions/ActionGroup.java ファイルの表示

@@ -35,54 +35,54 @@ import java.util.Map;
35 35
 
36 36
 /**
37 37
  * Represents a group of actions, along with their meta-data.
38
- * 
38
+ *
39 39
  * @author chris
40 40
  */
41 41
 public class ActionGroup implements Iterable<Action> {
42
-    
42
+
43 43
     /**
44 44
      * A version number for this class. It should be changed whenever the class
45 45
      * structure is changed (or anything else that would prevent serialized
46 46
      * objects being unserialized with the new class).
47 47
      */
48
-    private static final long serialVersionUID = 1;    
49
-    
48
+    private static final long serialVersionUID = 1;
49
+
50 50
     /** The actions in this group. */
51 51
     private final List<Action> actions = new ArrayList<Action>();
52
-    
52
+
53 53
     /** The name of this action group. */
54 54
     private final String name;
55
-    
55
+
56 56
     /** The description of this action group. */
57 57
     private String description = null;
58
-    
58
+
59 59
     /** The author of this action group. */
60 60
     private String author = null;
61
-    
61
+
62 62
     /** The component number of this action group (for updating). */
63 63
     private int component = -1;
64
-    
64
+
65 65
     /** The version of this action group. */
66 66
     private Version version = null;
67
-    
67
+
68 68
     /** A list of settings used by this action group. */
69 69
     private final Map<String, PreferencesSetting> settings
70 70
             = new HashMap<String, PreferencesSetting>();
71 71
 
72 72
     /**
73 73
      * Creates a new instance of ActionGroup.
74
-     * 
74
+     *
75 75
      * @param name The name of this action group
76 76
      */
77 77
     public ActionGroup(final String name) {
78 78
         super();
79
-        
79
+
80 80
         this.name = name;
81 81
     }
82 82
 
83 83
     /**
84 84
      * Retrieves the author of this ActionGroup.
85
-     * 
85
+     *
86 86
      * @return This action group's author, or null if the author isn't specified
87 87
      */
88 88
     public String getAuthor() {
@@ -91,7 +91,7 @@ public class ActionGroup implements Iterable<Action> {
91 91
 
92 92
     /**
93 93
      * Sets the author of this ActionGroup.
94
-     * 
94
+     *
95 95
      * @param author The new author for this action group
96 96
      */
97 97
     public void setAuthor(final String author) {
@@ -100,7 +100,7 @@ public class ActionGroup implements Iterable<Action> {
100 100
 
101 101
     /**
102 102
      * Retrieves the description of this action group.
103
-     * 
103
+     *
104 104
      * @return This action group's description, or null if none is specified
105 105
      */
106 106
     public String getDescription() {
@@ -109,7 +109,7 @@ public class ActionGroup implements Iterable<Action> {
109 109
 
110 110
     /**
111 111
      * Sets the description for this action group.
112
-     * 
112
+     *
113 113
      * @param description The new description for this action group
114 114
      */
115 115
     public void setDescription(final String description) {
@@ -118,7 +118,7 @@ public class ActionGroup implements Iterable<Action> {
118 118
 
119 119
     /**
120 120
      * Retrieves the name of this action group.
121
-     * 
121
+     *
122 122
      * @return This action group's name
123 123
      */
124 124
     public String getName() {
@@ -127,7 +127,7 @@ public class ActionGroup implements Iterable<Action> {
127 127
 
128 128
     /**
129 129
      * Retrieves a map settings used by this action group.
130
-     * 
130
+     *
131 131
      * @return A map of setting names to values
132 132
      */
133 133
     public Map<String, PreferencesSetting> getSettings() {
@@ -136,7 +136,7 @@ public class ActionGroup implements Iterable<Action> {
136 136
 
137 137
     /**
138 138
      * Retrieves the version number of this action group.
139
-     * 
139
+     *
140 140
      * @return This action group's version number, or null if none is specified.
141 141
      * @since 0.6.4
142 142
      */
@@ -146,7 +146,7 @@ public class ActionGroup implements Iterable<Action> {
146 146
 
147 147
     /**
148 148
      * Sets the version of this action group.
149
-     * 
149
+     *
150 150
      * @param version This action group's new version.
151 151
      * @since 0.6.4
152 152
      */
@@ -156,7 +156,7 @@ public class ActionGroup implements Iterable<Action> {
156 156
 
157 157
     /**
158 158
      * Retrieves the addon site component number for this action group.
159
-     * 
159
+     *
160 160
      * @return The component number for this action group, or -1 if none is
161 161
      * specified.
162 162
      */
@@ -166,16 +166,16 @@ public class ActionGroup implements Iterable<Action> {
166 166
 
167 167
     /**
168 168
      * Sets the addon site component number for this action group.
169
-     * 
169
+     *
170 170
      * @param component The component number for this action group
171 171
      */
172 172
     public void setComponent(final int component) {
173 173
         this.component = component;
174 174
     }
175
-    
175
+
176 176
     /**
177 177
      * Determines the size of this group.
178
-     * 
178
+     *
179 179
      * @return The size of this group
180 180
      */
181 181
     public int size() {
@@ -184,7 +184,7 @@ public class ActionGroup implements Iterable<Action> {
184 184
 
185 185
     /**
186 186
      * Removes the specified action from this group.
187
-     * 
187
+     *
188 188
      * @param action The action to be removed
189 189
      */
190 190
     public void remove(final Action action) {
@@ -199,7 +199,7 @@ public class ActionGroup implements Iterable<Action> {
199 199
 
200 200
     /**
201 201
      * Retrieves the action at the specified index.
202
-     * 
202
+     *
203 203
      * @param index The index of the action to return
204 204
      * @return The action at the specified index
205 205
      */
@@ -209,7 +209,7 @@ public class ActionGroup implements Iterable<Action> {
209 209
 
210 210
     /**
211 211
      * Determines if this group contains the specified action.
212
-     * 
212
+     *
213 213
      * @param action The action to search for
214 214
      * @return True if the action is contained in this list, false otherwise
215 215
      */
@@ -224,7 +224,7 @@ public class ActionGroup implements Iterable<Action> {
224 224
         for (Action action : new ArrayList<Action>(actions)) {
225 225
             remove(action);
226 226
         }
227
-        
227
+
228 228
         settings.clear();
229 229
         description = null;
230 230
         author = null;
@@ -234,16 +234,16 @@ public class ActionGroup implements Iterable<Action> {
234 234
 
235 235
     /**
236 236
      * Adds the specified action to this group.
237
-     * 
237
+     *
238 238
      * @param action The action to be added
239 239
      */
240 240
     public void add(final Action action) {
241 241
         actions.add(action);
242 242
     }
243
-    
243
+
244 244
     /**
245 245
      * Retrieves a copy of the list of all actions in this group.
246
-     * 
246
+     *
247 247
      * @return A list of actions in this group
248 248
      */
249 249
     public List<Action> getActions() {
@@ -267,14 +267,14 @@ public class ActionGroup implements Iterable<Action> {
267 267
 
268 268
         ActionManager.deleteAction(action);
269 269
     }
270
-    
270
+
271 271
     /**
272 272
      * Determines if this action group is delible or not.
273
-     * 
273
+     *
274 274
      * @return True if the group may be deleted, false if it may not.
275 275
      */
276 276
     public boolean isDelible() {
277 277
         return true;
278 278
     }
279
-    
279
+
280 280
 }

+ 2
- 2
src/com/dmdirc/actions/ActionManager.java ファイルの表示

@@ -380,8 +380,8 @@ public final class ActionManager {
380 380
         boolean res = false;
381 381
 
382 382
         if (LISTENERS.containsKey(type)) {
383
-            for (ActionListener listener :
384
-                new ArrayList<ActionListener>(LISTENERS.get(type))) {
383
+            for (ActionListener listener
384
+                    : new ArrayList<ActionListener>(LISTENERS.get(type))) {
385 385
                 try {
386 386
                     listener.processEvent(type, format, arguments);
387 387
                 } catch (Exception e) {

+ 24
- 24
src/com/dmdirc/actions/ActionModel.java ファイルの表示

@@ -61,10 +61,10 @@ public class ActionModel {
61 61
 
62 62
     /** The conditions for this action. */
63 63
     protected List<ActionCondition> conditions = new ArrayList<ActionCondition>();
64
-    
64
+
65 65
     /** The condition tree used for evaluating conditions. */
66 66
     protected ConditionTree conditionTree;
67
-    
67
+
68 68
     /** Whether this action has been modified or not. */
69 69
     protected boolean modified;
70 70
 
@@ -73,7 +73,7 @@ public class ActionModel {
73 73
 
74 74
     /** The concurrency group this action belongs to, if any. */
75 75
     protected String concurrencyGroup;
76
-    
76
+
77 77
     /**
78 78
      * Creates a new instance of ActionModel with the specified properties.
79 79
      *
@@ -83,8 +83,8 @@ public class ActionModel {
83 83
     public ActionModel(final String group, final String name) {
84 84
         this.group = group;
85 85
         this.name = name;
86
-    }    
87
-    
86
+    }
87
+
88 88
     /**
89 89
      * Creates a new instance of ActionModel with the specified properties.
90 90
      *
@@ -125,9 +125,9 @@ public class ActionModel {
125 125
     public boolean trigger(final StringBuffer format, final Object... arguments) {
126 126
         assert(triggers.length > 0);
127 127
         assert(triggers[0] != null);
128
-        
128
+
129 129
         final ActionSubstitutor sub = new ActionSubstitutor(triggers[0]);
130
-        
130
+
131 131
         if (!test(sub, arguments)) {
132 132
             return true;
133 133
         }
@@ -168,22 +168,22 @@ public class ActionModel {
168 168
 
169 169
         return stop;
170 170
     }
171
-    
171
+
172 172
     /**
173 173
      * Tests to see if this action should be triggered or not.
174
-     * 
174
+     *
175 175
      * @param sub The ActionsSubstitutor to use to substitute args
176 176
      * @param arguments The arguments for the action event
177 177
      * @return True if the action should be executed, false otherwise
178 178
      */
179 179
     public boolean test(final ActionSubstitutor sub, final Object ... arguments) {
180 180
         final boolean[] results = new boolean[conditions.size()];
181
-        
181
+
182 182
         int i = 0;
183 183
         for (ActionCondition condition : conditions) {
184 184
             results[i++] = condition.test(sub, arguments);
185 185
         }
186
-        
186
+
187 187
         return getRealConditionTree().evaluate(results);
188 188
     }
189 189
 
@@ -271,7 +271,7 @@ public class ActionModel {
271 271
     public String getGroup() {
272 272
         return group;
273 273
     }
274
-    
274
+
275 275
     /**
276 276
      * Sets the group of this action.
277 277
      *
@@ -290,7 +290,7 @@ public class ActionModel {
290 290
     public String getName() {
291 291
         return name;
292 292
     }
293
-    
293
+
294 294
     /**
295 295
      * Sets the name of this action.
296 296
      *
@@ -304,18 +304,18 @@ public class ActionModel {
304 304
     /**
305 305
      * Retrieves the condition tree used for this action. Condition trees may
306 306
      * be null, in which case the arguments are conjoined together.
307
-     * 
307
+     *
308 308
      * @return This action's condition tree
309 309
      */
310 310
     public ConditionTree getConditionTree() {
311 311
         return conditionTree;
312 312
     }
313
-    
313
+
314 314
     /**
315 315
      * Retrieves a concrete condition tree used for this action. If there is
316 316
      * no condition tree defined for this action, returns a conjunction tree
317 317
      * for the arguments.
318
-     * 
318
+     *
319 319
      * @since 0.6
320 320
      * @return A {@link ConditionTree} object for this action
321 321
      */
@@ -326,7 +326,7 @@ public class ActionModel {
326 326
 
327 327
     /**
328 328
      * Sets the condition tree used for this action.
329
-     * 
329
+     *
330 330
      * @param conditionTree The new condition tree to be used
331 331
      */
332 332
     public void setConditionTree(final ConditionTree conditionTree) {
@@ -336,7 +336,7 @@ public class ActionModel {
336 336
 
337 337
     /**
338 338
      * Retrieves the concurrency group of this action.
339
-     * 
339
+     *
340 340
      * @return This action's concurrency group
341 341
      * @since 0.6.3
342 342
      */
@@ -358,7 +358,7 @@ public class ActionModel {
358 358
     /**
359 359
      * Determines whether or not this action will stop the event execution
360 360
      * if it is triggered.
361
-     * 
361
+     *
362 362
      * @return The stopping preference of this action
363 363
      * @see #setStopping(boolean)
364 364
      * @since 0.6.4
@@ -380,17 +380,17 @@ public class ActionModel {
380 380
     public void setStopping(boolean stop) {
381 381
         this.stop = stop;
382 382
     }
383
-    
383
+
384 384
     /**
385 385
      * Determine if this model has been modified since it was constructed or
386 386
      * its modified status was reset.
387
-     * 
387
+     *
388 388
      * @return True if this model has been modified, false otherwise
389 389
      */
390 390
     public boolean isModified() {
391 391
         return modified;
392 392
     }
393
-    
393
+
394 394
     /**
395 395
      * Resets the modified status of this model. After a call to
396 396
      * resetModified(), this model will report that it has not been modified,
@@ -399,7 +399,7 @@ public class ActionModel {
399 399
     public void resetModified() {
400 400
         this.modified = false;
401 401
     }
402
-    
402
+
403 403
     /** {@inheritDoc} */
404 404
     @Override
405 405
     public String toString() {
@@ -407,5 +407,5 @@ public class ActionModel {
407 407
                 + Arrays.toString(triggers) + ", response="
408 408
                 + Arrays.toString(response) + ", "
409 409
                 + conditions + ", format='" + newFormat + "']";
410
-    }    
410
+    }
411 411
 }

+ 26
- 26
src/com/dmdirc/actions/ActionSubstitutor.java ファイルの表示

@@ -71,10 +71,10 @@ public class ActionSubstitutor {
71 71
     private static final Pattern COMP_PATTERN = Pattern.compile("([0-9]+)\\.([A-Z_]+(\\.[A-Z_]+)*)");
72 72
     /** Pattern to determine if a substitution is a server component type. */
73 73
     private static final Pattern SERVER_PATTERN = Pattern.compile("[A-Z_]+(\\.[A-Z_]+)*");
74
-    
74
+
75 75
     /** The action type this substitutor is for. */
76 76
     private final ActionType type;
77
-    
77
+
78 78
     /**
79 79
      * Creates a new substitutor for the specified action type.
80 80
      *
@@ -83,7 +83,7 @@ public class ActionSubstitutor {
83 83
     public ActionSubstitutor(final ActionType type) {
84 84
         this.type = type;
85 85
     }
86
-    
86
+
87 87
     /**
88 88
      * Retrieves a list of global config variables that will be substituted.
89 89
      * Note: does not include initial $.
@@ -93,7 +93,7 @@ public class ActionSubstitutor {
93 93
     public Set<String> getConfigSubstitutions() {
94 94
         return IdentityManager.getGlobalConfig().getOptions("actions").keySet();
95 95
     }
96
-    
96
+
97 97
     /**
98 98
      * Retrieves a list of substitutions derived from argument and component
99 99
      * combinations, along with a corresponding friendly name for them.
@@ -103,22 +103,22 @@ public class ActionSubstitutor {
103 103
      */
104 104
     public Map<String, String> getComponentSubstitutions() {
105 105
         final Map<String, String> res = new HashMap<String, String>();
106
-        
106
+
107 107
         int i = 0;
108 108
         for (Class<?> myClass : type.getType().getArgTypes()) {
109 109
             for (ActionComponent comp : ActionManager.getCompatibleComponents(myClass)) {
110 110
                 final String key = "{" + i + "." + comp.toString() + "}";
111 111
                 final String desc = type.getType().getArgNames()[i] + "'s " + comp.getName();
112
-                
112
+
113 113
                 res.put(key, desc);
114 114
             }
115
-            
115
+
116 116
             i++;
117 117
         }
118
-        
118
+
119 119
         return res;
120 120
     }
121
-    
121
+
122 122
     /**
123 123
      * Retrieves a list of server substitutions, if this action type supports
124 124
      * them.
@@ -128,19 +128,19 @@ public class ActionSubstitutor {
128 128
      */
129 129
     public Map<String, String> getServerSubstitutions() {
130 130
         final Map<String, String> res = new HashMap<String, String>();
131
-        
131
+
132 132
         if (hasFrameContainer()) {
133 133
             for (ActionComponent comp : ActionManager.getCompatibleComponents(Server.class)) {
134 134
                 final String key = "{" + comp.toString() + "}";
135 135
                 final String desc = "The connection's " + comp.getName();
136
-                
136
+
137 137
                 res.put(key, desc);
138 138
             }
139 139
         }
140
-        
140
+
141 141
         return res;
142 142
     }
143
-    
143
+
144 144
     /**
145 145
      * Returns true if this action type's first argument is a frame container,
146 146
      * or descendent of one.
@@ -149,18 +149,18 @@ public class ActionSubstitutor {
149 149
      */
150 150
     private boolean hasFrameContainer() {
151 151
         Class<?> target = null;
152
-        
152
+
153 153
         if (type.getType().getArgTypes().length > 0) {
154 154
             target = type.getType().getArgTypes()[0];
155
-            
155
+
156 156
             while (target != null && target != FrameContainer.class) {
157 157
                 target = target.getSuperclass();
158 158
             }
159 159
         }
160
-        
160
+
161 161
         return target == FrameContainer.class;
162 162
     }
163
-    
163
+
164 164
     /**
165 165
      * Determines whether or not word substitutions will work for this action
166 166
      * type. Word substitutions take the form $1, $1-5, $6-, etc.
@@ -172,7 +172,7 @@ public class ActionSubstitutor {
172 172
                 && (type.getType().getArgTypes()[2] == String[].class
173 173
                 || type.getType().getArgTypes()[2] == String.class);
174 174
     }
175
-    
175
+
176 176
     /**
177 177
      * Performs all applicable substitutions on the specified string, with the
178 178
      * specified arguments.
@@ -181,8 +181,8 @@ public class ActionSubstitutor {
181 181
      * @param args The arguments for the action type
182 182
      * @return The substituted string
183 183
      */
184
-    @Precondition("Number of arguments given equals the number of arguments " +
185
-    "required by this substitutor's type")
184
+    @Precondition("Number of arguments given equals the number of arguments "
185
+    + "required by this substitutor's type")
186 186
     public String doSubstitution(final String target, final Object ... args) {
187 187
         if (type.getType().getArity() != args.length) {
188 188
             throw new IllegalArgumentException("Invalid number of arguments "
@@ -205,7 +205,7 @@ public class ActionSubstitutor {
205 205
 
206 206
             res.delete(start, end);
207 207
             res.insert(start, getSubstitution(doSubstitution(group, args), args));
208
-            
208
+
209 209
             bracesMatcher = BRACES_PATTERN.matcher(res);
210 210
             otherMatcher = OTHER_PATTERN.matcher(res);
211 211
         }
@@ -226,9 +226,9 @@ public class ActionSubstitutor {
226 226
         final Matcher serverMatcher = SERVER_PATTERN.matcher(substitution);
227 227
 
228 228
         if (usesWordSubstitutions() && numberMatcher.matches()) {
229
-            final CommandArguments words = args[2] instanceof String ?
230
-                new CommandArguments((String) args[2]) :
231
-                new CommandArguments(Arrays.asList((String[]) args[2]));
229
+            final CommandArguments words = args[2] instanceof String
230
+                    ? new CommandArguments((String) args[2])
231
+                    : new CommandArguments(Arrays.asList((String[]) args[2]));
232 232
 
233 233
             int start, end;
234 234
 
@@ -308,7 +308,7 @@ public class ActionSubstitutor {
308 308
      * specified set of arguments. If any of the arguments is an instance of
309 309
      * {@link FrameContainer} or {@link Window}, the config manager is
310 310
      * requested from them. Otherwise, the global config is returned.
311
-     * 
311
+     *
312 312
      * @param args The arguments to be tested
313 313
      * @return The best config manager to use for those arguments
314 314
      * @since 0.6.3m2
@@ -337,5 +337,5 @@ public class ActionSubstitutor {
337 337
     protected static String escape(final String input) {
338 338
         return input.replace("\\", "\\\\").replace("$", "\\$");
339 339
     }
340
-    
340
+
341 341
 }

+ 2
- 2
src/com/dmdirc/actions/ActionTypeComparator.java ファイルの表示

@@ -29,7 +29,7 @@ import java.util.Comparator;
29 29
 
30 30
 /**
31 31
  * Implements a comparator for action types that compares their names.
32
- * 
32
+ *
33 33
  * @author Chris
34 34
  */
35 35
 public final class ActionTypeComparator implements Comparator<ActionType>, Serializable {
@@ -39,7 +39,7 @@ public final class ActionTypeComparator implements Comparator<ActionType>, Seria
39 39
      * structure is changed (or anything else that would prevent serialized
40 40
      * objects being unserialized with the new class).
41 41
      */
42
-    private static final long serialVersionUID = 1;        
42
+    private static final long serialVersionUID = 1;
43 43
 
44 44
     /** {@inheritDoc} */
45 45
     @Override

+ 17
- 17
src/com/dmdirc/actions/ConditionTreeFactory.java ファイルの表示

@@ -25,27 +25,27 @@ package com.dmdirc.actions;
25 25
 /**
26 26
  * Provides methods to automatically generated condition tree for a specified
27 27
  * number of arguments.
28
- * 
28
+ *
29 29
  * @since 0.6
30 30
  * @author chris
31 31
  */
32 32
 public abstract class ConditionTreeFactory {
33
-        
33
+
34 34
     /**
35 35
      * Retrieves a condition tree for the specified number of arguments.
36
-     * 
36
+     *
37 37
      * @param args The number of arguments in the {@link Action}
38 38
      * @return A ConditionTree for the specified number of args
39 39
      */
40 40
     public abstract ConditionTree getConditionTree(final int args);
41
-    
41
+
42 42
     /**
43 43
      * Retrieves the type this of factory.
44
-     * 
44
+     *
45 45
      * @return This factory's type
46 46
      */
47 47
     public abstract ConditionTreeFactoryType getType();
48
-    
48
+
49 49
     /**
50 50
      * The possible types of ConditionTreeFactories
51 51
      */
@@ -57,7 +57,7 @@ public abstract class ConditionTreeFactory {
57 57
         /** Factories that produce custom trees. */
58 58
         CUSTOM,
59 59
     }
60
-    
60
+
61 61
     /**
62 62
      * Creates condition trees where the arguments are conjoined together.
63 63
      */
@@ -74,7 +74,7 @@ public abstract class ConditionTreeFactory {
74 74
         public ConditionTreeFactoryType getType() {
75 75
             return ConditionTreeFactoryType.CONJUNCTION;
76 76
         }
77
-        
77
+
78 78
     }
79 79
 
80 80
     /**
@@ -87,26 +87,26 @@ public abstract class ConditionTreeFactory {
87 87
         public ConditionTree getConditionTree(final int args) {
88 88
             return ConditionTree.createDisjunction(args);
89 89
         }
90
-        
90
+
91 91
         /** {@inheritDoc} */
92 92
         @Override
93 93
         public ConditionTreeFactoryType getType() {
94 94
             return ConditionTreeFactoryType.DISJUNCTION;
95 95
         }
96
-        
96
+
97 97
     }
98
-    
98
+
99 99
     /**
100 100
      * Creates condition trees with a custom structure.
101 101
      */
102 102
     public static class CustomFactory extends ConditionTreeFactory {
103
-        
103
+
104 104
         /** The condition tree to use. */
105 105
         protected final ConditionTree tree;
106 106
 
107 107
         /**
108 108
          * Creates a new CustomFactory for the specified tree.
109
-         * 
109
+         *
110 110
          * @param tree The tree to use
111 111
          */
112 112
         public CustomFactory(final ConditionTree tree) {
@@ -118,19 +118,19 @@ public abstract class ConditionTreeFactory {
118 118
         public ConditionTree getConditionTree(final int args) {
119 119
             return tree;
120 120
         }
121
-        
121
+
122 122
         /** {@inheritDoc} */
123 123
         @Override
124 124
         public ConditionTreeFactoryType getType() {
125 125
             return ConditionTreeFactoryType.CUSTOM;
126 126
         }
127
-        
127
+
128 128
     }
129
-    
129
+
130 130
     /**
131 131
      * Retrieves a factory that will extrapolate the specified
132 132
      * {@link ConditionTree} for different number of arguments, if applicable.
133
-     * 
133
+     *
134 134
      * @param tree The {@link ConditionTree} that's in use
135 135
      * @param args The number of conditions currently in use
136 136
      * @return A {@link ConditionTreeFactory} that will create relevant

+ 12
- 12
src/com/dmdirc/actions/CoreActionComparison.java ファイルの表示

@@ -34,7 +34,7 @@ import java.util.regex.PatternSyntaxException;
34 34
  * @author chris
35 35
  */
36 36
 public enum CoreActionComparison implements ActionComparison {
37
-    
37
+
38 38
     /** Compares a string to another using a regular expression. */
39 39
     STRING_REGEX {
40 40
         /** {@inheritDoc} */
@@ -53,7 +53,7 @@ public enum CoreActionComparison implements ActionComparison {
53 53
         @Override
54 54
         public String getName() { return "matches regex"; }
55 55
     },
56
-    
56
+
57 57
     /** Compares if two strings content are the same, case insensitive. */
58 58
     STRING_EQUALS {
59 59
         /** {@inheritDoc} */
@@ -68,7 +68,7 @@ public enum CoreActionComparison implements ActionComparison {
68 68
         @Override
69 69
         public String getName() { return "equals"; }
70 70
     },
71
-    
71
+
72 72
     /** Compares if two strings content aren't the same, case insensitive. */
73 73
     STRING_NEQUALS {
74 74
         /** {@inheritDoc} */
@@ -83,7 +83,7 @@ public enum CoreActionComparison implements ActionComparison {
83 83
         @Override
84 84
         public String getName() { return "does not equal"; }
85 85
     },
86
-    
86
+
87 87
     /** Checks if the string starts with another strings. */
88 88
     STRING_STARTSWITH {
89 89
         /** {@inheritDoc} */
@@ -98,7 +98,7 @@ public enum CoreActionComparison implements ActionComparison {
98 98
         @Override
99 99
         public String getName() { return "starts with"; }
100 100
     },
101
-    
101
+
102 102
     /** Checks if the string containts another string. */
103 103
     STRING_CONTAINS {
104 104
         /** {@inheritDoc} */
@@ -128,7 +128,7 @@ public enum CoreActionComparison implements ActionComparison {
128 128
         @Override
129 129
         public String getName() { return "doesn't contain"; }
130 130
     },
131
-    
131
+
132 132
     /** Checks if two boolean values are equal. */
133 133
     BOOL_IS {
134 134
         /** {@inheritDoc} */
@@ -143,7 +143,7 @@ public enum CoreActionComparison implements ActionComparison {
143 143
         @Override
144 144
         public String getName() { return "is"; }
145 145
     },
146
-    
146
+
147 147
     /** Checks if the colour is the same as another colour. */
148 148
     COLOUR_EQUALS {
149 149
         /** {@inheritDoc} */
@@ -158,7 +158,7 @@ public enum CoreActionComparison implements ActionComparison {
158 158
         @Override
159 159
         public String getName() { return "equals"; }
160 160
     },
161
-    
161
+
162 162
     /** Checks if the colour is not the same as another colour. */
163 163
     COLOUR_NEQUALS {
164 164
         /** {@inheritDoc} */
@@ -173,7 +173,7 @@ public enum CoreActionComparison implements ActionComparison {
173 173
         @Override
174 174
         public String getName() { return "does not equal"; }
175 175
     },
176
-    
176
+
177 177
     /** Checks if the int is equals to another int. */
178 178
     INT_EQUALS {
179 179
         /** {@inheritDoc} */
@@ -192,7 +192,7 @@ public enum CoreActionComparison implements ActionComparison {
192 192
         @Override
193 193
         public String getName() { return "equals"; }
194 194
     },
195
-    
195
+
196 196
     /** Checks if the int is larger than another int. */
197 197
     INT_GREATER {
198 198
         /** {@inheritDoc} */
@@ -211,7 +211,7 @@ public enum CoreActionComparison implements ActionComparison {
211 211
         @Override
212 212
         public String getName() { return "is greater than"; }
213 213
     },
214
-    
214
+
215 215
     /** Checks if the int is smaller than another int. */
216 216
     INT_LESS {
217 217
         /** {@inheritDoc} */
@@ -230,5 +230,5 @@ public enum CoreActionComparison implements ActionComparison {
230 230
         @Override
231 231
         public String getName() { return "is less than"; }
232 232
     };
233
-    
233
+
234 234
 }

+ 32
- 32
src/com/dmdirc/actions/CoreActionComponent.java ファイルの表示

@@ -48,7 +48,7 @@ import javax.swing.KeyStroke;
48 48
  * @author chris
49 49
  */
50 50
 public enum CoreActionComponent implements ActionComponent {
51
-    
51
+
52 52
     /** Returns the name of the server. */
53 53
     SERVER_NAME {
54 54
         /** {@inheritDoc} */
@@ -64,7 +64,7 @@ public enum CoreActionComponent implements ActionComponent {
64 64
         @Override
65 65
         public String getName() { return "name"; }
66 66
     },
67
-    
67
+
68 68
     /** Returns the network of the server. */
69 69
     SERVER_NETWORK {
70 70
         /** {@inheritDoc} */
@@ -101,7 +101,7 @@ public enum CoreActionComponent implements ActionComponent {
101 101
         @Override
102 102
         public String getName() { return "protocol"; }
103 103
     },
104
-    
104
+
105 105
     /** Returns the away reason for the server. */
106 106
     SERVER_MYAWAYREASON {
107 107
         /** {@inheritDoc} */
@@ -117,7 +117,7 @@ public enum CoreActionComponent implements ActionComponent {
117 117
         @Override
118 118
         public String getName() { return "away reason"; }
119 119
     },
120
-    
120
+
121 121
     /** Returns the channel umodes for the server. */
122 122
     SERVER_CHANNELUMODES {
123 123
         /** {@inheritDoc} */
@@ -133,8 +133,8 @@ public enum CoreActionComponent implements ActionComponent {
133 133
         /** {@inheritDoc} */
134 134
         @Override
135 135
         public String getName() { return "list of channel usermodes"; }
136
-    },    
137
-    
136
+    },
137
+
138 138
     /** Returns the nickname for the server. */
139 139
     SERVER_MYNICKNAME {
140 140
         /** {@inheritDoc} */
@@ -142,14 +142,14 @@ public enum CoreActionComponent implements ActionComponent {
142 142
         @ComponentOptions(requireConnected=true)
143 143
         public Object get(final Object argument) {
144 144
             final Server server = (Server) argument;
145
-            
145
+
146 146
             if (server == null || server.getParser() == null) {
147 147
                 Logger.appError(ErrorLevel.LOW, "SERVER_MYNICKNAME.get() called with null element",
148 148
                         new UnsupportedOperationException(
149 149
                         server == null ? "Server was null" :
150 150
                             server.getParser() == null ? "Parser was null" : "Unknown"
151 151
                         ));
152
-                
152
+
153 153
                 return "null";
154 154
             } else {
155 155
                 return server.getParser().getLocalClient().getNickname();
@@ -181,7 +181,7 @@ public enum CoreActionComponent implements ActionComponent {
181 181
         @Override
182 182
         public String getName() { return "profile"; }
183 183
     },
184
-    
184
+
185 185
     /** Returns the name of the channel. */
186 186
     CHANNEL_NAME {
187 187
         /** {@inheritDoc} */
@@ -197,7 +197,7 @@ public enum CoreActionComponent implements ActionComponent {
197 197
         @Override
198 198
         public String getName() { return "name"; }
199 199
     },
200
-    
200
+
201 201
     /** Returns the notification colour of the channel. */
202 202
     CHANNEL_COLOUR {
203 203
         /** {@inheritDoc} */
@@ -213,7 +213,7 @@ public enum CoreActionComponent implements ActionComponent {
213 213
         @Override
214 214
         public String getName() { return "notification colour"; }
215 215
     },
216
-    
216
+
217 217
     /** Returns the name of a client. */
218 218
     CLIENT_NAME {
219 219
         /** {@inheritDoc} */
@@ -229,7 +229,7 @@ public enum CoreActionComponent implements ActionComponent {
229 229
         @Override
230 230
         public String getName() { return "nickname"; }
231 231
     },
232
-    
232
+
233 233
     /** Returns the host of a client. */
234 234
     CLIENT_HOST {
235 235
         /** {@inheritDoc} */
@@ -245,7 +245,7 @@ public enum CoreActionComponent implements ActionComponent {
245 245
         @Override
246 246
         public String getName() { return "host"; }
247 247
     },
248
-    
248
+
249 249
     /** Returns the name of a client. */
250 250
     USER_NAME {
251 251
         /** {@inheritDoc} */
@@ -261,7 +261,7 @@ public enum CoreActionComponent implements ActionComponent {
261 261
         @Override
262 262
         public String getName() { return "nickname"; }
263 263
     },
264
-    
264
+
265 265
     /** Returns the modes of a client. */
266 266
     USER_MODES {
267 267
         /** {@inheritDoc} */
@@ -277,7 +277,7 @@ public enum CoreActionComponent implements ActionComponent {
277 277
         @Override
278 278
         public String getName() { return "modes"; }
279 279
     },
280
-    
280
+
281 281
     /** Returns the host of a client. */
282 282
     USER_HOST {
283 283
         /** {@inheritDoc} */
@@ -293,7 +293,7 @@ public enum CoreActionComponent implements ActionComponent {
293 293
         @Override
294 294
         public String getName() { return "host"; }
295 295
     },
296
-    
296
+
297 297
     /** Returns the number of common channels the client is on. */
298 298
     USER_COMCHANS {
299 299
         /** {@inheritDoc} */
@@ -309,7 +309,7 @@ public enum CoreActionComponent implements ActionComponent {
309 309
         @Override
310 310
         public String getName() { return "number of common channels"; }
311 311
     },
312
-    
312
+
313 313
     /** Returns the content of a string. */
314 314
     STRING_STRING {
315 315
         /** {@inheritDoc} */
@@ -325,7 +325,7 @@ public enum CoreActionComponent implements ActionComponent {
325 325
         @Override
326 326
         public String getName() { return "content"; }
327 327
     },
328
-    
328
+
329 329
     /** Returns the content of a string, stripped of formatting. */
330 330
     STRING_STRIPPED {
331 331
         /** {@inheritDoc} */
@@ -340,8 +340,8 @@ public enum CoreActionComponent implements ActionComponent {
340 340
         /** {@inheritDoc} */
341 341
         @Override
342 342
         public String getName() { return "content (without formatting)"; }
343
-    },    
344
-    
343
+    },
344
+
345 345
     /** Returns the length of a string. */
346 346
     STRING_LENGTH {
347 347
         /** {@inheritDoc} */
@@ -357,7 +357,7 @@ public enum CoreActionComponent implements ActionComponent {
357 357
         @Override
358 358
         public String getName() { return "length"; }
359 359
     },
360
-    
360
+
361 361
     /** Returns the size of a string array. */
362 362
     STRINGARRAY_LENGTH {
363 363
         /** {@inheritDoc} */
@@ -373,7 +373,7 @@ public enum CoreActionComponent implements ActionComponent {
373 373
         @Override
374 374
         public String getName() { return "size"; }
375 375
     },
376
-    
376
+
377 377
     /** Returns the readable representation of a date. */
378 378
     CALENDAR_FULLSTRING {
379 379
         /** {@inheritDoc} */
@@ -389,7 +389,7 @@ public enum CoreActionComponent implements ActionComponent {
389 389
         @Override
390 390
         public String getName() { return "full date"; }
391 391
     },
392
-    
392
+
393 393
     /** Returns the name of the key that was pressed. */
394 394
     KEYEVENT_KEYNAME {
395 395
         /** {@inheritDoc} */
@@ -405,7 +405,7 @@ public enum CoreActionComponent implements ActionComponent {
405 405
         @Override
406 406
         public String getName() { return "key name"; }
407 407
     },
408
-    
408
+
409 409
     /** Returns the state of the control key for a key press event. */
410 410
     KEYEVENT_CTRLSTATE {
411 411
         /** {@inheritDoc} */
@@ -423,7 +423,7 @@ public enum CoreActionComponent implements ActionComponent {
423 423
         @Override
424 424
         public String getName() { return "control key state"; }
425 425
     },
426
-    
426
+
427 427
     /** Returns the state of the shift key for a key press event. */
428 428
     KEYEVENT_SHIFTSTATE {
429 429
         /** {@inheritDoc} */
@@ -441,7 +441,7 @@ public enum CoreActionComponent implements ActionComponent {
441 441
         @Override
442 442
         public String getName() { return "shift key state"; }
443 443
     },
444
-    
444
+
445 445
     /** Returns the state of the shift key for a key press event. */
446 446
     KEYEVENT_ALTSTATE {
447 447
         /** {@inheritDoc} */
@@ -459,7 +459,7 @@ public enum CoreActionComponent implements ActionComponent {
459 459
         @Override
460 460
         public String getName() { return "alt key state"; }
461 461
     },
462
-    
462
+
463 463
     /** Returns the host of the query. */
464 464
     QUERY_HOST {
465 465
         /** {@inheritDoc} */
@@ -475,7 +475,7 @@ public enum CoreActionComponent implements ActionComponent {
475 475
         @Override
476 476
         public String getName() { return "host"; }
477 477
     },
478
-    
478
+
479 479
     /** Returns the host of the query. */
480 480
     QUERY_NICK {
481 481
         /** {@inheritDoc} */
@@ -491,7 +491,7 @@ public enum CoreActionComponent implements ActionComponent {
491 491
         @Override
492 492
         public String getName() { return "nick"; }
493 493
     },
494
-    
494
+
495 495
     /** Returns the notification colour of the query. */
496 496
     QUERY_COLOUR {
497 497
         /** {@inheritDoc} */
@@ -523,7 +523,7 @@ public enum CoreActionComponent implements ActionComponent {
523 523
         @Override
524 524
         public String getName() { return "name"; }
525 525
     },
526
-    
526
+
527 527
     /** Returns the notification colour of the window. */
528 528
     WINDOW_COLOUR {
529 529
         /** {@inheritDoc} */
@@ -542,7 +542,7 @@ public enum CoreActionComponent implements ActionComponent {
542 542
 
543 543
     /**
544 544
      * Returns the server of the window.
545
-     * 
545
+     *
546 546
      * @since 0.6.4
547 547
      */
548 548
     WINDOW_SERVER {
@@ -592,5 +592,5 @@ public enum CoreActionComponent implements ActionComponent {
592 592
         @Override
593 593
         public String getName() { return "value"; }
594 594
     };
595
-        
595
+
596 596
 }

+ 33
- 33
src/com/dmdirc/actions/CoreActionType.java ファイルの表示

@@ -37,7 +37,7 @@ import com.dmdirc.actions.metatypes.ServerEvents;
37 37
  * @author chris
38 38
  */
39 39
 public enum CoreActionType implements ActionType {
40
-    
40
+
41 41
     /** Client opened. */
42 42
     CLIENT_OPENED(ClientEvents.CLIENT_EVENT, "Client opened"),
43 43
     /** Client closed. */
@@ -52,10 +52,10 @@ public enum CoreActionType implements ActionType {
52 52
     CLIENT_FOCUS_LOST(ClientEvents.CLIENT_EVENT, "Client lost focus"),
53 53
     /** Client gained focus. */
54 54
     CLIENT_FOCUS_GAINED(ClientEvents.CLIENT_EVENT, "Client gained focus"),
55
-    
55
+
56 56
     /** Function key pressed. */
57 57
     CLIENT_KEY_PRESSED(ClientEvents.CLIENT_EVENT_WITH_KEY, "Function key pressed"),
58
-    
58
+
59 59
     /** Frame changed. */
60 60
     CLIENT_FRAME_CHANGED(ClientEvents.WINDOW_EVENT, "Frame changed"),
61 61
     /** User input. */
@@ -71,10 +71,10 @@ public enum CoreActionType implements ActionType {
71 71
     CLIENT_PREFS_OPENED(ClientEvents.CLIENT_EVENT_WITH_PREFS, "Preferences dialog opened"),
72 72
     /** Prefs dialog closed. */
73 73
     CLIENT_PREFS_CLOSED(ClientEvents.CLIENT_EVENT, "Preferences dialog opened"),
74
-    
74
+
75 75
     /** Unknown command. */
76 76
     UNKNOWN_COMMAND(ClientEvents.UNKNOWN_COMMAND, "Unknown command entered"),
77
-    
77
+
78 78
     /** Server numeric received. */
79 79
     SERVER_NUMERIC(ServerEvents.SERVER_NUMERIC, "Numeric event received"),
80 80
     /** Server connected. */
@@ -82,7 +82,7 @@ public enum CoreActionType implements ActionType {
82 82
     /** Server connecting. */
83 83
     SERVER_CONNECTING(ServerEvents.SERVER_EVENT, "Server connecting"),
84 84
     /** Server connection error. */
85
-    SERVER_CONNECTERROR(ServerEvents.SERVER_EVENT_WITH_ARG, "Server connection error"),    
85
+    SERVER_CONNECTERROR(ServerEvents.SERVER_EVENT_WITH_ARG, "Server connection error"),
86 86
     /** Server disconnected. */
87 87
     SERVER_DISCONNECTED(ServerEvents.SERVER_EVENT, "Server disconnected"),
88 88
     /** Marked as away. */
@@ -91,7 +91,7 @@ public enum CoreActionType implements ActionType {
91 91
     SERVER_AWAY(ServerEvents.SERVER_EVENT_WITH_ARG, "Marked as 'away'"),
92 92
     /** Error. */
93 93
     SERVER_ERROR(ServerEvents.SERVER_EVENT_WITH_ARG, "Server error"),
94
-    
94
+
95 95
     /** Auth notice received. */
96 96
     SERVER_AUTHNOTICE(ServerEvents.SERVER_EVENT_WITH_ARG, "Received auth notice"),
97 97
     /** Unknown action received. */
@@ -100,47 +100,47 @@ public enum CoreActionType implements ActionType {
100 100
     SERVER_UNKNOWNNOTICE(ServerEvents.SERVER_UNKNOWN_EVENT, "Received unknown notice"),
101 101
     /** Unknown message received. */
102 102
     SERVER_UNKNOWNMESSAGE(ServerEvents.SERVER_UNKNOWN_EVENT, "Received unknown message"),
103
-    
103
+
104 104
     /** User modes changed. */
105 105
     SERVER_USERMODES(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "User modes changed"),
106
-    
106
+
107 107
     /** Private CTCP received. */
108 108
     SERVER_CTCP(ServerEvents.SERVER_CTCP_EVENT, "CTCP received"),
109 109
     /** Private CTCPR received. */
110 110
     SERVER_CTCPR(ServerEvents.SERVER_CTCP_EVENT, "CTCP reply received"),
111
-    
111
+
112 112
     /** Private notice received. */
113 113
     SERVER_NOTICE(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Notice received"),
114 114
     /** Private server notice received. */
115 115
     SERVER_SERVERNOTICE(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Server notice received"),
116
-    
116
+
117 117
     /** MOTD starting. */
118 118
     SERVER_MOTDSTART(ServerEvents.SERVER_EVENT_WITH_ARG, "Start of MOTD received"),
119 119
     /** MOTD ended. */
120 120
     SERVER_MOTDEND(ServerEvents.SERVER_EVENT_WITH_ARG, "End of MOTD received"),
121 121
     /** MOTD line. */
122 122
     SERVER_MOTDLINE(ServerEvents.SERVER_EVENT_WITH_ARG, "MOTD line received"),
123
-    
123
+
124 124
     /** Ping reply received. */
125 125
     SERVER_GOTPING(ServerEvents.SERVER_PING, "Received server ping reply"),
126 126
     /** Missed server ping reply. */
127 127
     SERVER_NOPING(ServerEvents.SERVER_PING, "Missed server ping reply"),
128 128
     /** Ping sent. */
129 129
     SERVER_PINGSENT(ServerEvents.SERVER_EVENT, "Ping request sent"),
130
-    
130
+
131 131
     /** Invite received. */
132 132
     SERVER_INVITERECEIVED(ServerEvents.SERVER_INVITE, "Invite received"),
133
-    
133
+
134 134
     /** Wallops. */
135 135
     SERVER_WALLOPS(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Wallop received"),
136 136
     /** Wallusers. */
137
-    SERVER_WALLUSERS(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Walluser received"),    
137
+    SERVER_WALLUSERS(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Walluser received"),
138 138
     /** Walldesync. */
139
-    SERVER_WALLDESYNC(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Walldesync received"),        
140
-    
139
+    SERVER_WALLDESYNC(ServerEvents.SERVER_SOURCED_EVENT_WITH_ARG, "Walldesync received"),
140
+
141 141
     /** Nick change. */
142 142
     SERVER_NICKCHANGE(ServerEvents.SERVER_NICKCHANGE, "My nickname changed"),
143
-    
143
+
144 144
     /** Channel window opened. */
145 145
     CHANNEL_OPENED(ChannelEvents.CHANNEL_EVENT, "Channel window opened"),
146 146
     /** Channel window closed. */
@@ -151,12 +151,12 @@ public enum CoreActionType implements ActionType {
151 151
     CHANNEL_NOTOPIC(ChannelEvents.CHANNEL_EVENT, "Channel topic is not set"),
152 152
     /** Channel topic received. */
153 153
     CHANNEL_GOTTOPIC(ChannelEvents.CHANNEL_TOPICEVENT, "Channel topic received"),
154
-    
154
+
155 155
     /** Channel message sent. */
156 156
     CHANNEL_SELF_MESSAGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel message sent"),
157 157
     /** Channel action sent. */
158 158
     CHANNEL_SELF_ACTION(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel action sent"),
159
-    
159
+
160 160
     /** Channel message received. */
161 161
     CHANNEL_MESSAGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel message received"),
162 162
     /** Channel actions received. */
@@ -165,10 +165,10 @@ public enum CoreActionType implements ActionType {
165 165
     CHANNEL_NOTICE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Channel notice received"),
166 166
     /** Channel mode notice received. @since 0.6.3m2 */
167 167
     CHANNEL_MODE_NOTICE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_CHARARG, "Channel mode notice received"),
168
-    
168
+
169 169
     /** Channel CTCP received. */
170 170
     CHANNEL_CTCP(ChannelEvents.CHANNEL_CTCP, "Channel CTCP received"),
171
-    
171
+
172 172
     /** Someone joined a channel. */
173 173
     CHANNEL_JOIN(ChannelEvents.CHANNEL_SOURCED_EVENT, "Someone joined a channel"),
174 174
     /** Someone left a channel. */
@@ -177,7 +177,7 @@ public enum CoreActionType implements ActionType {
177 177
     CHANNEL_QUIT(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Someone quit IRC"),
178 178
     /** Someone was kicked. */
179 179
     CHANNEL_KICK(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_VICTIM, "Someone kicked someone"),
180
-    
180
+
181 181
     /** Someone marked as away. */
182 182
     CHANNEL_USERAWAY(ChannelEvents.CHANNEL_SOURCED_EVENT, "Someone is marked as 'away'"),
183 183
     /** Someone marked as back. */
@@ -191,13 +191,13 @@ public enum CoreActionType implements ActionType {
191 191
     CHANNEL_MODECHANGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Someone changed channel modes"),
192 192
     /** Someone changed someone else's user modes. */
193 193
     CHANNEL_USERMODECHANGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_VICTIM, "Someone changed someone else's modes"),
194
-    
194
+
195 195
     /** Someone changed nickname. */
196 196
     CHANNEL_NICKCHANGE(ChannelEvents.CHANNEL_NICKEVENT, "Someone changed nicknames"),
197
-    
197
+
198 198
     /** Someone changed a topic. */
199 199
     CHANNEL_TOPICCHANGE(ChannelEvents.CHANNEL_SOURCED_EVENT_WITH_ARG, "Someone changed channel topic"),
200
-    
200
+
201 201
     /** Query opened. */
202 202
     QUERY_OPENED(QueryEvents.QUERY_EVENT, "Query window opened"),
203 203
     /** Query closed. */
@@ -214,12 +214,12 @@ public enum CoreActionType implements ActionType {
214 214
     QUERY_QUIT(QueryEvents.QUERY_EVENT_WITH_ARG, "Query: user quit"),
215 215
     /** Query nick change. */
216 216
     QUERY_NICKCHANGE(QueryEvents.QUERY_EVENT_WITH_ARG, "Query: user changed nicks"),
217
-    
217
+
218 218
     /** Plugin loaded. */
219 219
     PLUGIN_LOADED(PluginEvents.PLUGIN_EVENT, "Plugin loaded"),
220 220
     /** Plugin unloaded. */
221 221
     PLUGIN_UNLOADED(PluginEvents.PLUGIN_EVENT, "Plugin unloaded"),
222
-    
222
+
223 223
     /** Action created. */
224 224
     ACTION_CREATED(ActionEvents.ACTION_EVENT, "Action created"),
225 225
     /** Action updated. */
@@ -233,13 +233,13 @@ public enum CoreActionType implements ActionType {
233 233
     LINK_NICKNAME_CLICKED(LinkEvents.NICKNAME_CLICKED, "A nickname link was clicked"),
234 234
     /** Link clicked. */
235 235
     LINK_URL_CLICKED(LinkEvents.LINK_CLICKED, "A Link was clicked");
236
-    
236
+
237 237
     /** The type of this action. */
238 238
     private final ActionMetaType type;
239
-    
239
+
240 240
     /** The name of this action. */
241 241
     private final String name;
242
-    
242
+
243 243
     /**
244 244
      * Constructs a new core action.
245 245
      * @param type The type of this action
@@ -249,13 +249,13 @@ public enum CoreActionType implements ActionType {
249 249
         this.type = type;
250 250
         this.name = name;
251 251
     }
252
-    
252
+
253 253
     /** {@inheritDoc} */
254 254
     @Override
255 255
     public ActionMetaType getType() {
256 256
         return type;
257 257
     }
258
-    
258
+
259 259
     /** {@inheritDoc} */
260 260
     @Override
261 261
     public String getName() {

+ 4
- 4
src/com/dmdirc/actions/interfaces/ActionComparison.java ファイルの表示

@@ -29,7 +29,7 @@ package com.dmdirc.actions.interfaces;
29 29
  * @author chris
30 30
  */
31 31
 public interface ActionComparison {
32
-    
32
+
33 33
     /**
34 34
      * Tests the specified arguments against each other.
35 35
      * @param arg1 The first argument
@@ -38,13 +38,13 @@ public interface ActionComparison {
38 38
      * otherwise
39 39
      */
40 40
     boolean test(final Object arg1, final Object arg2);
41
-    
41
+
42 42
     /**
43 43
      * Returns the class that this comparison deals with.
44 44
      * @return The Class that this comparison can compare
45 45
      */
46 46
     Class<?> appliesTo();
47
-    
47
+
48 48
     /**
49 49
      * Returns a friendly name for this comparison.
50 50
      *
@@ -59,5 +59,5 @@ public interface ActionComparison {
59 59
      * @return This comparison's internal name
60 60
      */
61 61
     String name();
62
-    
62
+
63 63
 }

+ 8
- 8
src/com/dmdirc/actions/interfaces/ActionComponent.java ファイルの表示

@@ -31,7 +31,7 @@ import java.lang.annotation.Target;
31 31
  * The ActionComponent interface describes the methods that action components
32 32
  * are required to implement. Components are objects that allow the user to
33 33
  * pull a specific piece of information from a certain type of argument.
34
- * 
34
+ *
35 35
  * @author chris
36 36
  */
37 37
 public interface ActionComponent {
@@ -51,28 +51,28 @@ public interface ActionComponent {
51 51
         boolean requireConnected() default false;
52 52
 
53 53
     }
54
-    
54
+
55 55
     /**
56 56
      * Retrieves the component of the specified argument that this component
57 57
      * represents.
58
-     * 
58
+     *
59 59
      * @param argument The object to retrieve the component from
60 60
      * @return The relevant component of the object
61
-     */    
61
+     */
62 62
     Object get(Object argument);
63
-    
63
+
64 64
     /**
65 65
      * Retrieves the type of class that this component applies to.
66 66
      * @return The Class that this component can be applied to
67 67
      */
68 68
     Class<?> appliesTo();
69
-    
69
+
70 70
     /**
71 71
      * Retrieves the type of this component.
72 72
      * @return The Class of this component.
73 73
      */
74 74
     Class<?> getType();
75
-    
75
+
76 76
     /**
77 77
      * Retrives a friendly name for this component.
78 78
      *
@@ -87,5 +87,5 @@ public interface ActionComponent {
87 87
      * @return The internal name of this component
88 88
      */
89 89
     String name();
90
-    
90
+
91 91
 }

+ 6
- 6
src/com/dmdirc/actions/interfaces/ActionMetaType.java ファイルの表示

@@ -27,31 +27,31 @@ package com.dmdirc.actions.interfaces;
27 27
  * @author chris
28 28
  */
29 29
 public interface ActionMetaType {
30
-    
30
+
31 31
     /**
32 32
      * Retrieves the arity of this type.
33 33
      * @return The arity of this action type
34 34
      */
35 35
     int getArity();
36
-    
36
+
37 37
     /**
38 38
      * Retrieves the type of arguments that actions of this type should expect.
39 39
      * @return The type of arguments expected
40 40
      */
41 41
     Class[] getArgTypes();
42
-    
42
+
43 43
     /**
44 44
      * Retrieves the names of the arguments that actions of this type should
45 45
      * expect.
46 46
      * @return The names of the expected arguments
47 47
      */
48 48
     String[] getArgNames();
49
-    
49
+
50 50
     /**
51 51
      * Retrieves the name of a logical group for this meta-type to be put into.
52
-     * 
52
+     *
53 53
      * @return The meta-type's group name
54 54
      */
55 55
     String getGroup();
56
-    
56
+
57 57
 }

+ 1
- 1
src/com/dmdirc/actions/metatypes/LinkEvents.java ファイルの表示

@@ -33,7 +33,7 @@ import com.dmdirc.ui.interfaces.Window;
33 33
 public enum LinkEvents implements ActionMetaType {
34 34
 
35 35
     /** URL Link clicked. */
36
-    LINK_CLICKED(new String[]{"Window","URL"}, Window.class, String.class),
36
+    LINK_CLICKED(new String[]{"Window", "URL"}, Window.class, String.class),
37 37
     /** Channel link clicked. */
38 38
     CHANNEL_CLICKED(new String[]{"Window", "Channel"}, Window.class, String.class),
39 39
     /** Nickname link clicked. */

+ 9
- 9
src/com/dmdirc/actions/metatypes/PluginEvents.java ファイルの表示

@@ -31,15 +31,15 @@ import com.dmdirc.plugins.PluginInfo;
31 31
  * @author Chris
32 32
  */
33 33
 public enum PluginEvents implements ActionMetaType {
34
-    
34
+
35 35
     /** Plugin event type. */
36 36
     PLUGIN_EVENT(new String[]{"plugin"}, PluginInfo.class);
37
-    
37
+
38 38
     /** The names of the arguments for this meta type. */
39 39
     private String[] argNames;
40 40
     /** The classes of the arguments for this meta type. */
41 41
     private Class[] argTypes;
42
-    
42
+
43 43
     /**
44 44
      * Creates a new instance of this meta-type.
45 45
      *
@@ -50,29 +50,29 @@ public enum PluginEvents implements ActionMetaType {
50 50
         this.argNames = argNames;
51 51
         this.argTypes = argTypes;
52 52
     }
53
-    
53
+
54 54
     /** {@inheritDoc} */
55 55
     @Override
56 56
     public int getArity() {
57 57
         return argNames.length;
58 58
     }
59
-    
59
+
60 60
     /** {@inheritDoc} */
61 61
     @Override
62 62
     public Class[] getArgTypes() {
63 63
         return argTypes;
64 64
     }
65
-    
65
+
66 66
     /** {@inheritDoc} */
67 67
     @Override
68 68
     public String[] getArgNames() {
69 69
         return argNames;
70 70
     }
71
-    
71
+
72 72
     /** {@inheritDoc} */
73 73
     @Override
74 74
     public String getGroup() {
75 75
         return "Plugin Events";
76
-    }    
77
-    
76
+    }
77
+
78 78
 }

+ 9
- 9
src/com/dmdirc/actions/metatypes/ServerEvents.java ファイルの表示

@@ -32,7 +32,7 @@ import com.dmdirc.parser.interfaces.ClientInfo;
32 32
  * @author Chris
33 33
  */
34 34
 public enum ServerEvents implements ActionMetaType {
35
-    
35
+
36 36
     /** Server ping event type. */
37 37
     SERVER_PING(new String[]{"server", "ping"}, Server.class, Long.class),
38 38
     /** Server numeric event type. */
@@ -51,12 +51,12 @@ public enum ServerEvents implements ActionMetaType {
51 51
     SERVER_INVITE(new String[]{"server", "source", "channel"}, Server.class, ClientInfo.class, String.class),
52 52
     /** Server event type. */
53 53
     SERVER_EVENT(new String[]{"server"}, Server.class);
54
-    
54
+
55 55
     /** The names of the arguments for this meta type. */
56 56
     private String[] argNames;
57 57
     /** The classes of the arguments for this meta type. */
58 58
     private Class[] argTypes;
59
-    
59
+
60 60
     /**
61 61
      * Creates a new instance of this meta-type.
62 62
      *
@@ -67,29 +67,29 @@ public enum ServerEvents implements ActionMetaType {
67 67
         this.argNames = argNames;
68 68
         this.argTypes = argTypes;
69 69
     }
70
-    
70
+
71 71
     /** {@inheritDoc} */
72 72
     @Override
73 73
     public int getArity() {
74 74
         return argNames.length;
75 75
     }
76
-    
76
+
77 77
     /** {@inheritDoc} */
78 78
     @Override
79 79
     public Class[] getArgTypes() {
80 80
         return argTypes;
81 81
     }
82
-    
82
+
83 83
     /** {@inheritDoc} */
84 84
     @Override
85 85
     public String[] getArgNames() {
86 86
         return argNames;
87 87
     }
88
-    
88
+
89 89
     /** {@inheritDoc} */
90 90
     @Override
91 91
     public String getGroup() {
92 92
         return "Server/Private Events";
93
-    }    
94
-    
93
+    }
94
+
95 95
 }

+ 25
- 25
src/com/dmdirc/actions/wrappers/Alias.java ファイルの表示

@@ -38,23 +38,23 @@ import java.util.List;
38 38
  * Actions alias wrapper.
39 39
  */
40 40
 public final class Alias implements Serializable {
41
-    
41
+
42 42
     /**
43 43
      * A version number for this class. It should be changed whenever the class
44 44
      * structure is changed (or anything else that would prevent serialized
45 45
      * objects being unserialized with the new class).
46 46
      */
47 47
     private static final long serialVersionUID = 1;
48
-    
48
+
49 49
     /** Alias command. */
50 50
     private String command;
51
-    
51
+
52 52
     /** Alias arguments. */
53 53
     private List<ActionCondition> arguments;
54
-    
54
+
55 55
     /** Alias response. */
56 56
     private String[] response;
57
-    
57
+
58 58
     /**
59 59
      * Creates a new Alias wrapper.
60 60
      *
@@ -67,7 +67,7 @@ public final class Alias implements Serializable {
67 67
                 CoreActionComparison.STRING_EQUALS, command));
68 68
         this.response = new String[]{"", };
69 69
     }
70
-    
70
+
71 71
     /**
72 72
      * Wraps an existing Action in an Alias.
73 73
      *
@@ -81,7 +81,7 @@ public final class Alias implements Serializable {
81 81
         this.arguments = new ArrayList<ActionCondition>(arguments);
82 82
         this.response = response.clone();
83 83
     }
84
-    
84
+
85 85
     /**
86 86
      * Returns the aliases command.
87 87
      *
@@ -90,7 +90,7 @@ public final class Alias implements Serializable {
90 90
     public String getCommand() {
91 91
         return command;
92 92
     }
93
-    
93
+
94 94
     /**
95 95
      * Sets the aliases command.
96 96
      *
@@ -99,17 +99,17 @@ public final class Alias implements Serializable {
99 99
     public void setCommand(final String command) {
100 100
         if (!this.command.equals(command)) {
101 101
             this.command = command;
102
-            
102
+
103 103
             ActionCondition argument = arguments.get(0);
104
-            
104
+
105 105
             if (argument.getComparison() != CoreActionComparison.STRING_EQUALS) {
106 106
                 argument = arguments.get(1);
107 107
             }
108
-            
108
+
109 109
             argument.setTarget(command);
110 110
         }
111 111
     }
112
-    
112
+
113 113
     /**
114 114
      * Returns the aliases name.
115 115
      *
@@ -133,7 +133,7 @@ public final class Alias implements Serializable {
133 133
             return command + "-" + comparison + "-" + condition.getTarget();
134 134
         }
135 135
     }
136
-    
136
+
137 137
     /**
138 138
      * Gets the aliases arguments.
139 139
      *
@@ -142,7 +142,7 @@ public final class Alias implements Serializable {
142 142
     public List<ActionCondition> getArguments() {
143 143
         return new ArrayList<ActionCondition>(arguments);
144 144
     }
145
-    
145
+
146 146
     /**
147 147
      * Gets the aliases number of arguments argument.
148 148
      *
@@ -150,7 +150,7 @@ public final class Alias implements Serializable {
150 150
      */
151 151
     public ActionCondition getArgsArgument() {
152 152
         ActionCondition argument = arguments.get(0);
153
-        
153
+
154 154
         if (argument.getComparison() == CoreActionComparison.STRING_EQUALS) {
155 155
             if (arguments.size() > 1) {
156 156
                 argument = arguments.get(1);
@@ -158,10 +158,10 @@ public final class Alias implements Serializable {
158 158
                 argument = null;
159 159
             }
160 160
         }
161
-        
161
+
162 162
         return argument;
163 163
     }
164
-    
164
+
165 165
     /**
166 166
      * Sets the aliases arguments.
167 167
      *
@@ -172,7 +172,7 @@ public final class Alias implements Serializable {
172 172
             this.arguments = new ArrayList<ActionCondition>(arguments);
173 173
         }
174 174
     }
175
-    
175
+
176 176
     /**
177 177
      * Gets the aliases response.
178 178
      *
@@ -181,7 +181,7 @@ public final class Alias implements Serializable {
181 181
     public String[] getResponse() {
182 182
         return response.clone();
183 183
     }
184
-    
184
+
185 185
     /**
186 186
      * Sets the aliases response.
187 187
      *
@@ -192,7 +192,7 @@ public final class Alias implements Serializable {
192 192
             this.response = response.clone();
193 193
         }
194 194
     }
195
-    
195
+
196 196
     /**
197 197
      * Updates this alias with the details of another alias.
198 198
      *
@@ -203,7 +203,7 @@ public final class Alias implements Serializable {
203 203
         setCommand(alias.getCommand());
204 204
         setResponse(alias.getResponse());
205 205
     }
206
-    
206
+
207 207
     /**
208 208
      * Checks if the specified alias matches this one
209 209
      *
@@ -212,13 +212,13 @@ public final class Alias implements Serializable {
212 212
      * @return true iif the alias matches this one
213 213
      */
214 214
     public boolean matches(final Alias alias) {
215
-        return alias.getCommand().equalsIgnoreCase(command) 
215
+        return alias.getCommand().equalsIgnoreCase(command)
216 216
                 && alias.getArguments().equals(arguments);
217 217
     }
218
-    
218
+
219 219
     /**
220 220
      * Creates an action corresponding to this alias.
221
-     * 
221
+     *
222 222
      * @return A new action for this alias.
223 223
      */
224 224
     public Action createAction() {
@@ -230,7 +230,7 @@ public final class Alias implements Serializable {
230 230
                 getArguments(),
231 231
                 "");
232 232
     }
233
-    
233
+
234 234
     /** {@inheritDoc} */
235 235
     @Override
236 236
     public String toString() {

+ 16
- 16
src/com/dmdirc/actions/wrappers/AliasWrapper.java ファイルの表示

@@ -43,20 +43,20 @@ import java.util.List;
43 43
  * @author chris
44 44
  */
45 45
 public final class AliasWrapper extends ActionGroup {
46
-    
46
+
47 47
     /** Singleton instance of the alias wrapper. */
48 48
     private static AliasWrapper me;
49
-    
49
+
50 50
     /** A list of registered alias names. */
51 51
     private final List<String> aliases = new ArrayList<String>();
52
-    
52
+
53 53
     /**
54 54
      * Creates a new instance of AliasWrapper.
55 55
      */
56 56
     private AliasWrapper() {
57 57
         super("aliases");
58 58
     }
59
-    
59
+
60 60
     /**
61 61
      * Retrieves a singleton instance of this alias wrapper.
62 62
      *
@@ -66,24 +66,24 @@ public final class AliasWrapper extends ActionGroup {
66 66
         if (me == null) {
67 67
             me = new AliasWrapper();
68 68
         }
69
-        
69
+
70 70
         return me;
71 71
     }
72
-    
72
+
73 73
     /**
74 74
      * Retrieves a list of alias names registered with this wrapper.
75
-     * 
75
+     *
76 76
      * @return A list of alias names
77 77
      */
78 78
     public List<String> getAliases() {
79 79
         return new ArrayList<String>(aliases);
80 80
     }
81
-    
81
+
82 82
     /** {@inheritDoc} */
83 83
     @Override
84 84
     public void add(final Action action) {
85 85
         if (action.getTriggers()[0].equals(CoreActionType.UNKNOWN_COMMAND)) {
86
-            
86
+
87 87
             final String commandName = getCommandName(action);
88 88
 
89 89
             if (commandName != null) {
@@ -107,23 +107,23 @@ public final class AliasWrapper extends ActionGroup {
107 107
                     + action.getName());
108 108
         }
109 109
     }
110
-    
110
+
111 111
     /** {@inheritDoc} */
112 112
     @Override
113 113
     public void remove(final Action action) {
114 114
         if (action.getTriggers()[0].equals(CoreActionType.UNKNOWN_COMMAND)) {
115 115
             super.remove(action);
116
-            
116
+
117 117
             final String commandName = getCommandName(action);
118
-            
118
+
119 119
             aliases.remove(commandName);
120
-            
120
+
121 121
             for (Server server : ServerManager.getServerManager().getServers()) {
122 122
                 server.getTabCompleter().removeEntry(TabCompletionType.COMMAND, commandName);
123 123
             }
124 124
         }
125 125
     }
126
-    
126
+
127 127
     /**
128 128
      * Retrieves the command name of the specified alias action.
129 129
      *
@@ -137,7 +137,7 @@ public final class AliasWrapper extends ActionGroup {
137 137
                 return CommandManager.getCommandChar() + condition.getTarget();
138 138
             }
139 139
         }
140
-        
140
+
141 141
         // How can we have an alias without a command name?
142 142
         return null;
143 143
     }
@@ -155,5 +155,5 @@ public final class AliasWrapper extends ActionGroup {
155 155
                 + "more other commands. You can manage aliases using the \""
156 156
                 + "Alias Manager\", located in the Settings menu.";
157 157
     }
158
-    
158
+
159 159
 }

+ 28
- 28
src/com/dmdirc/actions/wrappers/PerformWrapper.java ファイルの表示

@@ -146,8 +146,8 @@ public class PerformWrapper extends ActionGroup {
146 146
                 return false;
147 147
             }
148 148
 
149
-            if ((this.profile == null) ? (other.profile != null) :
150
-                !this.profile.equals(other.profile)) {
149
+            if ((this.profile == null) ? (other.profile != null)
150
+                    : !this.profile.equals(other.profile)) {
151 151
                 return false;
152 152
             }
153 153
 
@@ -165,20 +165,20 @@ public class PerformWrapper extends ActionGroup {
165 165
         }
166 166
 
167 167
     }
168
-    
168
+
169 169
     /** A singleton instance of the Perform Wrapper. */
170 170
     private static final PerformWrapper ME = new PerformWrapper();
171 171
 
172 172
     /** The component name for per-profile perform conditions. */
173 173
     private static final String PP_COMP_NAME = "SERVER_PROFILE.IDENTITY_NAME";
174
-    
174
+
175 175
     /**
176 176
      * Creates a new instance of PerformWrapper.
177 177
      */
178 178
     private PerformWrapper() {
179 179
         super("performs");
180 180
     }
181
-    
181
+
182 182
     /**
183 183
      * Retrieves a singleton instance of this perform wrapper.
184 184
      *
@@ -187,7 +187,7 @@ public class PerformWrapper extends ActionGroup {
187 187
     public static PerformWrapper getPerformWrapper() {
188 188
         return ME;
189 189
     }
190
-    
190
+
191 191
     /** {@inheritDoc} */
192 192
     @Override
193 193
     public void add(final Action action) {
@@ -233,9 +233,9 @@ public class PerformWrapper extends ActionGroup {
233 233
      */
234 234
     public void setPerform(final PerformDescription perform, final String[] content) {
235 235
         synchronized (this) {
236
-            Action action = getAction(perform.getType() == PerformType.NETWORK ?
237
-                CoreActionComponent.SERVER_NETWORK : CoreActionComponent.SERVER_NAME,
238
-                perform.getTarget(), perform.getProfile());
236
+            Action action = getAction(perform.getType() == PerformType.NETWORK
237
+                    ? CoreActionComponent.SERVER_NETWORK : CoreActionComponent.SERVER_NAME,
238
+                    perform.getTarget(), perform.getProfile());
239 239
 
240 240
             final boolean empty = isEmpty(content);
241 241
 
@@ -271,9 +271,9 @@ public class PerformWrapper extends ActionGroup {
271 271
      * @since 0.6.4
272 272
      */
273 273
     public String[] getPerform(final PerformDescription perform) {
274
-        final Action action = getAction(perform.getType() == PerformType.NETWORK ?
275
-            CoreActionComponent.SERVER_NETWORK : CoreActionComponent.SERVER_NAME,
276
-            perform.getTarget(), perform.getProfile());
274
+        final Action action = getAction(perform.getType() == PerformType.NETWORK
275
+                ? CoreActionComponent.SERVER_NETWORK : CoreActionComponent.SERVER_NAME,
276
+                perform.getTarget(), perform.getProfile());
277 277
 
278 278
         if (action == null || action.getResponse() == null) {
279 279
             return new String[0];
@@ -376,7 +376,7 @@ public class PerformWrapper extends ActionGroup {
376 376
     public Action getActionForServer(final String server) {
377 377
         return getActionForServer(server, null);
378 378
     }
379
-    
379
+
380 380
     /**
381 381
      * Retrieve the action that handles the perform for the specified server,
382 382
      * or null if no such action exists.
@@ -421,10 +421,10 @@ public class PerformWrapper extends ActionGroup {
421 421
     public Action getActionForNetwork(final String network, final String profile) {
422 422
         return getAction(CoreActionComponent.SERVER_NETWORK, network, profile);
423 423
     }
424
-    
424
+
425 425
     /**
426 426
      * Creates a new, empty, perform wrapper for the specified server.
427
-     * 
427
+     *
428 428
      * @param server The server to create the action for
429 429
      * @return The new perform wrapper action
430 430
      * @deprecated Actions shouldn't be used directly, use get/setPerform instead
@@ -451,7 +451,7 @@ public class PerformWrapper extends ActionGroup {
451 451
 
452 452
     /**
453 453
      * Creates a new, empty, perform wrapper for the specified network.
454
-     * 
454
+     *
455 455
      * @param network The network to create the action for
456 456
      * @return The new perform wrapper action
457 457
      * @deprecated Actions shouldn't be used directly, use get/setPerform instead
@@ -475,26 +475,26 @@ public class PerformWrapper extends ActionGroup {
475 475
     public Action createActionForNetwork(final String network, final String profile) {
476 476
         return createAction("", network, profile);
477 477
     }
478
-    
478
+
479 479
     /**
480 480
      * Creates a new, empty, perform wrapper for the specified server or
481 481
      * network. Note that both server and network must be specified, and
482 482
      * exactly one of them must be empty.
483
-     * 
483
+     *
484 484
      * @param server The server to create the action for
485 485
      * @param network The network to create the action for
486 486
      * @param profile The profile the action is for (or null if "global")
487 487
      * @since 0.6.3
488 488
      * @return The new perform wrapper action
489
-     */    
489
+     */
490 490
     private Action createAction(final String server, final String network,
491 491
             final String profile) {
492 492
         final List<ActionCondition> conditions = new ArrayList<ActionCondition>();
493 493
         final CoreActionComponent component =
494 494
                 server.isEmpty() ? CoreActionComponent.SERVER_NETWORK
495 495
                 : CoreActionComponent.SERVER_NAME;
496
-        
497
-        conditions.add(new ActionCondition(0, component, 
496
+
497
+        conditions.add(new ActionCondition(0, component,
498 498
                 CoreActionComparison.STRING_EQUALS, server + network));
499 499
 
500 500
         if (profile != null) {
@@ -502,13 +502,13 @@ public class PerformWrapper extends ActionGroup {
502 502
                     new ActionComponentChain(Server.class, PP_COMP_NAME),
503 503
                     CoreActionComparison.STRING_EQUALS, profile));
504 504
         }
505
-        
505
+
506 506
         return new Action(getName(), server + network
507 507
                 + (profile == null ? "" : " - " + profile),
508 508
                 new ActionType[]{CoreActionType.SERVER_CONNECTED},
509 509
                 new String[0], conditions, null);
510 510
     }
511
-    
511
+
512 512
     /**
513 513
      * Retrieve an action with a condition that checks the specified component,
514 514
      * and matches it against the specified target.
@@ -519,7 +519,7 @@ public class PerformWrapper extends ActionGroup {
519 519
      * null for a non-profile specific action
520 520
      * @since 0.6.3
521 521
      * @return The matching action if one exists, or null
522
-     */    
522
+     */
523 523
     private Action getAction(final ActionComponent component, final String target,
524 524
             final String profile) {
525 525
         for (Action action : this) {
@@ -540,16 +540,16 @@ public class PerformWrapper extends ActionGroup {
540 540
                 return action;
541 541
             }
542 542
         }
543
-        
543
+
544 544
         return null;
545 545
     }
546
-    
546
+
547 547
     /** {@inheritDoc} */
548 548
     @Override
549 549
     public boolean isDelible() {
550 550
         return false;
551 551
     }
552
-    
552
+
553 553
     /** {@inheritDoc} */
554 554
     @Override
555 555
     public String getDescription() {
@@ -559,5 +559,5 @@ public class PerformWrapper extends ActionGroup {
559 559
                 + "\"Server Settings\" dialog, which can be accessed through "
560 560
                 + "the Settings menu.";
561 561
     }
562
-    
562
+
563 563
 }

+ 44
- 44
src/com/dmdirc/commandline/CommandLineParser.java ファイルの表示

@@ -44,7 +44,7 @@ import java.util.List;
44 44
  * @author Chris
45 45
  */
46 46
 public class CommandLineParser {
47
-    
47
+
48 48
     /**
49 49
      * The arguments that the client supports, in groups of four, in the
50 50
      * following order: short option, long option, description, whether or not
@@ -61,19 +61,19 @@ public class CommandLineParser {
61 61
         {'v', "version", "Display client version and exit", Boolean.FALSE},
62 62
         {'k', "check", "Check if an existing instance of DMDirc exists.", Boolean.FALSE},
63 63
     };
64
-    
64
+
65 65
     /** A list of addresses to autoconnect to. */
66 66
     private final List<URI> addresses = new ArrayList<URI>();
67
-    
67
+
68 68
     /** Whether to disable error reporting or not. */
69 69
     private boolean disablereporting;
70
-    
70
+
71 71
     /** The version string passed for the launcher. */
72 72
     private String launcherVersion = "";
73
-    
73
+
74 74
     /** The RMI server we're using. */
75 75
     private RemoteInterface server;
76
-    
76
+
77 77
     /**
78 78
      * Creates a new instance of CommandLineParser.
79 79
      *
@@ -82,7 +82,7 @@ public class CommandLineParser {
82 82
     public CommandLineParser(final String ... arguments) {
83 83
         boolean inArg = false;
84 84
         char previousArg = '.';
85
-        
85
+
86 86
         for (String arg : arguments) {
87 87
             if (inArg) {
88 88
                 processArgument(previousArg, arg);
@@ -99,11 +99,11 @@ public class CommandLineParser {
99 99
                 }
100 100
             }
101 101
         }
102
-        
102
+
103 103
         if (inArg) {
104 104
             doUnknownArg("Missing parameter for argument: " + previousArg);
105 105
         }
106
-        
106
+
107 107
         if (server != null) {
108 108
             try {
109 109
                 server.connect(addresses);
@@ -113,10 +113,10 @@ public class CommandLineParser {
113 113
                         "Unable to execute remote connection", ex);
114 114
             }
115 115
         }
116
-        
116
+
117 117
         RemoteServer.bind();
118 118
     }
119
-    
119
+
120 120
     /**
121 121
      * Checks whether the specified arg type takes an argument. If it does,
122 122
      * this method returns true. If it doesn't, the method processes the
@@ -127,23 +127,23 @@ public class CommandLineParser {
127 127
      */
128 128
     private boolean checkArgument(final char argument) {
129 129
         boolean needsArg = false;
130
-        
130
+
131 131
         for (Object[] target : ARGUMENTS) {
132 132
             if ((Character) argument == target[0]) {
133 133
                 needsArg = (Boolean) target[3];
134 134
                 break;
135 135
             }
136 136
         }
137
-        
137
+
138 138
         if (needsArg) {
139 139
             return true;
140 140
         } else {
141 141
             processArgument(argument, null);
142
-            
142
+
143 143
             return false;
144 144
         }
145 145
     }
146
-    
146
+
147 147
     /**
148 148
      * Processes the specified string as a single long argument.
149 149
      *
@@ -156,13 +156,13 @@ public class CommandLineParser {
156 156
                 return (Character) target[0];
157 157
             }
158 158
         }
159
-        
159
+
160 160
         doUnknownArg("Unknown argument: " + arg);
161 161
         exit();
162
-        
162
+
163 163
         return '.';
164 164
     }
165
-    
165
+
166 166
     /**
167 167
      * Processes the specified string as a single short argument.
168 168
      *
@@ -175,13 +175,13 @@ public class CommandLineParser {
175 175
                 return (Character) target[0];
176 176
             }
177 177
         }
178
-        
178
+
179 179
         doUnknownArg("Unknown argument: " + arg);
180 180
         exit();
181
-        
181
+
182 182
         return '.';
183 183
     }
184
-    
184
+
185 185
     /**
186 186
      * Processes the specified command-line argument.
187 187
      *
@@ -220,12 +220,12 @@ public class CommandLineParser {
220 220
         default:
221 221
             // This really shouldn't ever happen, but we'll handle it nicely
222 222
             // anyway.
223
-            
223
+
224 224
             doUnknownArg("Unknown argument: " + arg);
225 225
             break;
226 226
         }
227 227
     }
228
-    
228
+
229 229
     /**
230 230
      * Informs the user that they entered an unknown argument, prints the
231 231
      * client help, and exits.
@@ -237,14 +237,14 @@ public class CommandLineParser {
237 237
         System.out.println();
238 238
         doHelp();
239 239
     }
240
-    
240
+
241 241
     /**
242 242
      * Exits DMDirc.
243 243
      */
244 244
     private static void exit() {
245 245
         System.exit(0);
246 246
     }
247
-    
247
+
248 248
     /**
249 249
      * Handles the --connect argument.
250 250
      *
@@ -252,7 +252,7 @@ public class CommandLineParser {
252 252
      */
253 253
     private void doConnect(final String address) {
254 254
         URI myAddress = null;
255
-        
255
+
256 256
         try {
257 257
             myAddress = NewServer.getURI(address);
258 258
             addresses.add(myAddress);
@@ -260,18 +260,18 @@ public class CommandLineParser {
260 260
             doUnknownArg("Invalid address specified: " + ex.getMessage());
261 261
         }
262 262
     }
263
-    
263
+
264 264
     /**
265 265
      * Handles the --existing argument.
266 266
      */
267 267
     private void doExisting() {
268 268
         server = RemoteServer.getServer();
269
-        
269
+
270 270
         if (server == null) {
271 271
             System.err.println("Unable to connect to existing instance");
272 272
         }
273 273
     }
274
-    
274
+
275 275
     /**
276 276
      * Handles the --check argument.
277 277
      */
@@ -284,7 +284,7 @@ public class CommandLineParser {
284 284
             System.exit(0);
285 285
         }
286 286
     }
287
-    
287
+
288 288
     /**
289 289
      * Sets the config directory to the one specified.
290 290
      *
@@ -297,7 +297,7 @@ public class CommandLineParser {
297 297
             Main.setConfigDir(dir + File.separator);
298 298
         }
299 299
     }
300
-    
300
+
301 301
     /**
302 302
      * Prints out the client version and exits.
303 303
      */
@@ -310,7 +310,7 @@ public class CommandLineParser {
310 310
                 + IdentityManager.getGlobalConfig().getOption("updater", "channel"));
311 311
         exit();
312 312
     }
313
-    
313
+
314 314
     /**
315 315
      * Prints out client help and exits.
316 316
      */
@@ -319,35 +319,35 @@ public class CommandLineParser {
319 319
         System.out.println();
320 320
         System.out.println("Valid options:");
321 321
         System.out.println();
322
-        
322
+
323 323
         int maxLength = 0;
324
-        
324
+
325 325
         for (Object[] arg : ARGUMENTS) {
326 326
             final String needsArg = ((Boolean) arg[3]) ? " <argument>" : "";
327
-            
327
+
328 328
             if ((arg[1] + needsArg).length() > maxLength) {
329 329
                 maxLength = (arg[1] + needsArg).length();
330 330
             }
331 331
         }
332
-        
332
+
333 333
         for (Object[] arg : ARGUMENTS) {
334 334
             final String needsArg = ((Boolean) arg[3]) ? " <argument>" : "";
335 335
             final StringBuilder desc = new StringBuilder(maxLength + 1);
336
-            
336
+
337 337
             desc.append(arg[1]);
338
-            
338
+
339 339
             while (desc.length() < maxLength + 1) {
340 340
                 desc.append(' ');
341 341
             }
342
-            
342
+
343 343
             System.out.print("   -" + arg[0] + needsArg);
344 344
             System.out.println(" --" + desc + needsArg + " " + arg[2]);
345 345
             System.out.println();
346 346
         }
347
-        
347
+
348 348
         exit();
349 349
     }
350
-    
350
+
351 351
     /**
352 352
      * Applies any applicable settings to the config identity.
353 353
      */
@@ -355,12 +355,12 @@ public class CommandLineParser {
355 355
         if (disablereporting) {
356 356
             IdentityManager.getConfigIdentity().setOption("temp", "noerrorreporting", true);
357 357
         }
358
-        
358
+
359 359
         if (!launcherVersion.isEmpty()) {
360 360
             LauncherComponent.setLauncherInfo(launcherVersion);
361 361
         }
362 362
     }
363
-    
363
+
364 364
     /**
365 365
      * Processes arguments once the client has been loaded properly.
366 366
      * This allows us to auto-connect to servers, etc.
@@ -370,5 +370,5 @@ public class CommandLineParser {
370 370
             ServerManager.getServerManager().connectToAddress(address);
371 371
         }
372 372
     }
373
-    
373
+
374 374
 }

+ 3
- 3
src/com/dmdirc/commandline/RemoteInterface.java ファイルの表示

@@ -29,14 +29,14 @@ import java.util.List;
29 29
 
30 30
 /**
31 31
  * Defines the interface that is available using RMI.
32
- * 
32
+ *
33 33
  * @author chris
34 34
  */
35 35
 public interface RemoteInterface extends Remote {
36
-    
36
+
37 37
     /**
38 38
      * Connects to the specified list of addresses.
39
-     * 
39
+     *
40 40
      * @param addresses The addresses to connect to.
41 41
      * @throws java.rmi.RemoteException on problems communicating
42 42
      * @since 0.6.3

+ 11
- 11
src/com/dmdirc/commandline/RemoteServer.java ファイルの表示

@@ -36,40 +36,40 @@ import java.util.List;
36 36
 
37 37
 /**
38 38
  * An RMI server that allows other clients to interact with DMDirc.
39
- * 
39
+ *
40 40
  * @author chris
41 41
  */
42 42
 public class RemoteServer implements RemoteInterface {
43
-    
43
+
44 44
     /** The minimum port to use for RMI binding. */
45 45
     private static final int MINPORT = 3634;
46 46
     /** The maximum port to use for RMI binding. */
47 47
     private static final int MAXPORT = MINPORT + 5;
48 48
     /** The interface we're exposing. */
49 49
     private static final RemoteServer SERVER = new RemoteServer();
50
-    
50
+
51 51
     /** {@inheritDoc} */
52 52
     @Override
53 53
     public void connect(final List<URI> addresses) throws RemoteException {
54 54
         for (URI address : addresses) {
55 55
             ServerManager.getServerManager().connectToAddress(address);
56 56
         }
57
-    }    
58
-    
57
+    }
58
+
59 59
     /**
60 60
      * Binds to the RMI registry so that other clients may find this remote
61 61
      * server.
62 62
      */
63 63
     public static void bind() {
64 64
         RemoteInterface stub;
65
-        
65
+
66 66
         try {
67 67
             stub = (RemoteInterface) UnicastRemoteObject.exportObject(SERVER, 0);
68 68
         } catch (RemoteException ex) {
69 69
             Logger.appError(ErrorLevel.MEDIUM, "Unable to export remote interface", ex);
70 70
             return;
71 71
         }
72
-        
72
+
73 73
         for (int port = MINPORT; port < MAXPORT; port++) {
74 74
             try {
75 75
                 final Registry registry = LocateRegistry.createRegistry(port);
@@ -80,12 +80,12 @@ public class RemoteServer implements RemoteInterface {
80 80
             }
81 81
         }
82 82
     }
83
-    
83
+
84 84
     /**
85 85
      * Retrieves a reference to an existing RemoteServer, if there is one.
86 86
      * Note that this must be called before bind(), unless you want a reference
87 87
      * to our own client for some reason.
88
-     * 
88
+     *
89 89
      * @return The RemoteServer instance, or null if none was available
90 90
      */
91 91
     public static RemoteInterface getServer() {
@@ -93,7 +93,7 @@ public class RemoteServer implements RemoteInterface {
93 93
             try {
94 94
                 final Registry registry = LocateRegistry.getRegistry("localhost", port);
95 95
                 final RemoteInterface iface = (RemoteInterface) registry.lookup("DMDirc");
96
-                
96
+
97 97
                 if (iface == null) {
98 98
                     continue;
99 99
                 } else {
@@ -105,7 +105,7 @@ public class RemoteServer implements RemoteInterface {
105 105
                 continue;
106 106
             }
107 107
         }
108
-        
108
+
109 109
         // No RMI server found
110 110
         return null;
111 111
     }

+ 5
- 5
src/com/dmdirc/commandparser/CommandArguments.java ファイルの表示

@@ -109,7 +109,7 @@ public class CommandArguments {
109 109
      */
110 110
     public String[] getWords() {
111 111
         parse();
112
-        
112
+
113 113
         return words;
114 114
     }
115 115
 
@@ -133,7 +133,7 @@ public class CommandArguments {
133 133
      */
134 134
     public String getArgumentsAsString() {
135 135
         parse();
136
-        
136
+
137 137
         return getArgumentsAsString(0);
138 138
     }
139 139
 
@@ -160,7 +160,7 @@ public class CommandArguments {
160 160
      */
161 161
     public String getWordsAsString(final int start) {
162 162
         parse();
163
-        
163
+
164 164
         return getWordsAsString(start, words.length - 1);
165 165
     }
166 166
 
@@ -207,8 +207,8 @@ public class CommandArguments {
207 207
      * @return True if the input was a silenced command, false otherwise
208 208
      */
209 209
     public boolean isSilent() {
210
-        return isCommand() && line.length() >= 2 &&
211
-                line.charAt(1) == CommandManager.getSilenceChar();
210
+        return isCommand() && line.length() >= 2
211
+                && line.charAt(1) == CommandManager.getSilenceChar();
212 212
     }
213 213
 
214 214
     /**

+ 49
- 49
src/com/dmdirc/commandparser/CommandManager.java ファイルの表示

@@ -46,34 +46,34 @@ import java.util.Map;
46 46
 /**
47 47
  * The command manager creates and manages a single instance of all commands,
48 48
  * and provides methods to load each group of commands into a parser instance.
49
- * 
49
+ *
50 50
  * @author chris
51 51
  */
52 52
 public final class CommandManager {
53
-    
53
+
54 54
     /** A list of commands that have been instansiated. */
55 55
     private static final Map<CommandInfo, Command> COMMANDS
56 56
             = new HashMap<CommandInfo, Command>();
57
-    
57
+
58 58
     /** A list of command parsers that have been instansiated. */
59 59
     private static final MapList<CommandType, CommandParser> PARSERS
60 60
             = new MapList<CommandType, CommandParser>();
61
-    
61
+
62 62
     /** The command char we're using. */
63 63
     private static char commandChar = IdentityManager.getGlobalConfig()
64 64
             .getOptionChar("general", "commandchar");
65
-    
65
+
66 66
     /** The silence char we're using. */
67 67
     private static char silenceChar = IdentityManager.getGlobalConfig()
68 68
             .getOptionChar("general", "silencechar");
69
-    
69
+
70 70
     /**
71 71
      * Prevents creation of a new command manager.
72 72
      */
73 73
     private CommandManager() {
74 74
         // Do nothing
75 75
     }
76
-    
76
+
77 77
     /**
78 78
      * Returns the current command character.
79 79
      *
@@ -82,7 +82,7 @@ public final class CommandManager {
82 82
     public static char getCommandChar() {
83 83
         return commandChar;
84 84
     }
85
-    
85
+
86 86
     /**
87 87
      * Returns the current silence character.
88 88
      *
@@ -91,10 +91,10 @@ public final class CommandManager {
91 91
     public static char getSilenceChar() {
92 92
         return silenceChar;
93 93
     }
94
-    
94
+
95 95
     /**
96 96
      * Registers a command with the command manager.
97
-     * 
97
+     *
98 98
      * @param command The command to be registered
99 99
      * @param info The information about the command
100 100
      * @since 0.6.3m1
@@ -115,17 +115,17 @@ public final class CommandManager {
115 115
     public static <T extends Command & CommandInfo> void registerCommand(final T command) {
116 116
         registerCommand(command, command);
117 117
     }
118
-    
118
+
119 119
     /**
120 120
      * Unregisters a command with the command manager.
121
-     * 
121
+     *
122 122
      * @param info The information object for the command that should be unregistered
123 123
      * @since 0.6.3m1
124 124
      */
125 125
     public static void unregisterCommand(final CommandInfo info) {
126 126
         registerCommand(info, COMMANDS.get(info), false);
127 127
     }
128
-    
128
+
129 129
     /**
130 130
      * Registers or unregisters a command.
131 131
      *
@@ -140,7 +140,7 @@ public final class CommandManager {
140 140
         if (PARSERS.containsKey(info.getType())) {
141 141
             registerCommand(info, command, PARSERS.get(info.getType()), register);
142 142
         }
143
-        
143
+
144 144
         if (register) {
145 145
             COMMANDS.put(info, command);
146 146
         } else {
@@ -149,7 +149,7 @@ public final class CommandManager {
149 149
 
150 150
         registerCommandName(info, register);
151 151
     }
152
-    
152
+
153 153
     /**
154 154
      * Registers or unregisters the specified command with all of the specified parsers.
155 155
      *
@@ -169,7 +169,7 @@ public final class CommandManager {
169 169
             }
170 170
         }
171 171
     }
172
-    
172
+
173 173
     /**
174 174
      * Registers or unregisters the specified command's name with the relevant
175 175
      * tab completers.
@@ -186,11 +186,11 @@ public final class CommandManager {
186 186
 
187 187
         // TODO: This logic is probably in two places. Abstract it.
188 188
         for (Server server : ServerManager.getServerManager().getServers()) {
189
-            if (command.getType() == CommandType.TYPE_SERVER ||
190
-                    command.getType() == CommandType.TYPE_GLOBAL) {
189
+            if (command.getType() == CommandType.TYPE_SERVER
190
+                    || command.getType() == CommandType.TYPE_GLOBAL) {
191 191
                 registerCommandName(server.getTabCompleter(), commandName, register);
192 192
             }
193
-            
193
+
194 194
             if (command.getType() == CommandType.TYPE_CHANNEL
195 195
                     || command.getType() == CommandType.TYPE_CHAT) {
196 196
                 for (String channelName : server.getChannels()) {
@@ -198,7 +198,7 @@ public final class CommandManager {
198 198
                             commandName, register);
199 199
                 }
200 200
             }
201
-            
201
+
202 202
             if (command.getType() == CommandType.TYPE_QUERY
203 203
                     || command.getType() == CommandType.TYPE_CHAT) {
204 204
                 for (Query query : server.getQueries()) {
@@ -208,7 +208,7 @@ public final class CommandManager {
208 208
             }
209 209
         }
210 210
     }
211
-    
211
+
212 212
     /**
213 213
      * Registers or unregisters the specified command with the specified tab-
214 214
      * completer.
@@ -226,14 +226,14 @@ public final class CommandManager {
226 226
             completer.removeEntry(TabCompletionType.COMMAND, name);
227 227
         }
228 228
     }
229
-        
229
+
230 230
     /**
231 231
      * Instansiates the default commands.
232 232
      */
233 233
     public static void initCommands() {
234 234
         // Chat commands
235 235
         new Me();
236
-        
236
+
237 237
         // Channel commands
238 238
         new Ban();
239 239
         new ChannelSettings();
@@ -245,7 +245,7 @@ public final class CommandManager {
245 245
         new Part();
246 246
         new SetNickColour();
247 247
         new ShowTopic();
248
-        
248
+
249 249
         // Server commands
250 250
         new AllChannels();
251 251
         new Away();
@@ -263,16 +263,16 @@ public final class CommandManager {
263 263
         new Reconnect();
264 264
         new ServerSettings();
265 265
         new Umode();
266
-        
266
+
267 267
         new RawServerCommand("lusers");
268 268
         new RawServerCommand("map");
269 269
         new RawServerCommand("motd");
270 270
         new RawServerCommand("oper");
271 271
         new RawServerCommand("whois");
272 272
         new RawServerCommand("who");
273
-        
273
+
274 274
         // Query commands
275
-        
275
+
276 276
         // Global commands
277 277
         new Active();
278 278
         new AliasCommand();
@@ -294,7 +294,7 @@ public final class CommandManager {
294 294
         new SaveConfig();
295 295
         new Set();
296 296
         new Input();
297
-        
297
+
298 298
         // Set up a listener for config changes
299 299
         final ConfigChangeListener listener = new ConfigChangeListener() {
300 300
             @Override
@@ -305,7 +305,7 @@ public final class CommandManager {
305 305
                         .getOptionChar("general", "silencechar");
306 306
             }
307 307
         };
308
-        
308
+
309 309
         IdentityManager.getGlobalConfig().addChangeListener("general", "commandchar", listener);
310 310
         IdentityManager.getGlobalConfig().addChangeListener("general", "silencechar", listener);
311 311
     }
@@ -330,7 +330,7 @@ public final class CommandManager {
330 330
             }
331 331
         }
332 332
     }
333
-    
333
+
334 334
     /**
335 335
      * Retrieves the command identified by the specified name, regardless of
336 336
      * type.
@@ -341,10 +341,10 @@ public final class CommandManager {
341 341
     public static Map.Entry<CommandInfo, Command> getCommand(final String name) {
342 342
         return getCommand(null, name);
343 343
     }
344
-    
344
+
345 345
     /**
346 346
      * Retrieves a command of the specified type with the specified name.
347
-     * 
347
+     *
348 348
      * @param type The type of the command to look for
349 349
      * @param name The name to look for
350 350
      * @return A command with a matching signature, or null if none were found
@@ -352,13 +352,13 @@ public final class CommandManager {
352 352
     public static Map.Entry<CommandInfo, Command> getCommand(final CommandType type,
353 353
             final String name) {
354 354
         final Map<CommandInfo, Command> res = getCommands(type, name);
355
-        
355
+
356 356
         return res.isEmpty() ? null : res.entrySet().iterator().next();
357
-    }    
358
-     
357
+    }
358
+
359 359
     /**
360 360
      * Determines if the specified command is a valid channel command.
361
-     * 
361
+     *
362 362
      * @param command The name of the command to test
363 363
      * @return True iff the command is a channel command, false otherwise
364 364
      */
@@ -366,56 +366,56 @@ public final class CommandManager {
366 366
         return getCommand(CommandType.TYPE_CHANNEL, command) != null
367 367
                 || getCommand(CommandType.TYPE_CHAT, command) != null;
368 368
     }
369
-       
369
+
370 370
     /**
371 371
      * Retrieves a list of the names of all commands of the specified type.
372
-     * 
372
+     *
373 373
      * @param type The type of command to list
374 374
      * @return A list of command names
375 375
      */
376 376
     public static List<String> getCommandNames(final CommandType type) {
377 377
         final List<String> res = new ArrayList<String>();
378
-        
378
+
379 379
         for (CommandInfo command : getCommands(type).keySet()) {
380 380
             res.add(getCommandChar() + command.getName());
381 381
         }
382
-        
382
+
383 383
         return res;
384 384
     }
385
-    
385
+
386 386
     /**
387 387
      * Retrieves a map of all {@link CommandInfo}s and their associated
388 388
      * {@link Command}s of the specified type.
389
-     * 
389
+     *
390 390
      * @param type The type of command to list
391 391
      * @return A map of commands
392 392
      * @since 0.6.3m1
393
-     */    
393
+     */
394 394
     public static Map<CommandInfo, Command> getCommands(final CommandType type) {
395 395
         return getCommands(type, null);
396 396
     }
397
-    
397
+
398 398
     /**
399 399
      * Retrieves a map of all commands of the specified type, with the
400 400
      * specified name.
401
-     * 
401
+     *
402 402
      * @param type The type of command to list, or null for all types
403 403
      * @param name The name of the command to look for, or null for any name
404 404
      * @return A map of {@link CommandInfo}s and their associated {@link Command}.
405 405
      * @since 0.6.3m1
406
-     */    
406
+     */
407 407
     private static Map<CommandInfo, Command> getCommands(final CommandType type,
408 408
             final String name) {
409 409
         final Map<CommandInfo, Command> res = new HashMap<CommandInfo, Command>();
410
-        
410
+
411 411
         for (Map.Entry<CommandInfo, Command> entry : COMMANDS.entrySet()) {
412 412
             if ((type == null || type.equals(entry.getKey().getType()))
413 413
                     && (name == null || name.equals(entry.getKey().getName()))) {
414 414
                 res.put(entry.getKey(), entry.getValue());
415 415
             }
416 416
         }
417
-        
417
+
418 418
         return res;
419 419
     }
420
-    
420
+
421 421
 }

+ 18
- 18
src/com/dmdirc/commandparser/PopupManager.java ファイルの表示

@@ -33,41 +33,41 @@ import com.dmdirc.config.ConfigManager;
33 33
  * @author Chris
34 34
  */
35 35
 public class PopupManager {
36
-    
36
+
37 37
     /**
38 38
      * Creates a new instance of PopupManager.
39 39
      */
40 40
     private PopupManager() {
41 41
         // Shouldn't be instansiated.
42 42
     }
43
-    
43
+
44 44
     /**
45 45
      * Returns the popup menu that should be used for the specified type.
46 46
      * Configuration data is read from the specified config manager.
47
-     * 
47
+     *
48 48
      * @param menuType The type of the menu that is needed
49 49
      * @param configManager The config manager to be used for the menu
50 50
      * @return The PopupMenu that should be displayed
51 51
      */
52 52
     public static PopupMenu getMenu(final PopupType menuType, final ConfigManager configManager) {
53 53
         final PopupMenu menu = getMenu(menuType.toString(), configManager);
54
-        
55
-        ActionManager.processEvent(CoreActionType.CLIENT_POPUP_GENERATED, 
54
+
55
+        ActionManager.processEvent(CoreActionType.CLIENT_POPUP_GENERATED,
56 56
                 null, menuType, menu, configManager);
57
-        
57
+
58 58
         return menu;
59 59
     }
60
-    
60
+
61 61
     /**
62 62
      * Retrieves the menu with the specified name.
63
-     * 
63
+     *
64 64
      * @param menuName The name of the menu to read
65 65
      * @param configManager The config manager to be used for the menu
66 66
      * @return The PopupMenu with the specified name
67 67
      */
68 68
     private static PopupMenu getMenu(final String menuName, final ConfigManager configManager) {
69 69
         final PopupMenu res = new PopupMenu();
70
-        
70
+
71 71
         for (String item : configManager.getOptionList("popups", menuName)) {
72 72
             if (item.length() > 0 && item.charAt(0) == '<') {
73 73
                 res.addAll(getMenu(item.substring(1), configManager).getItems());
@@ -75,41 +75,41 @@ public class PopupManager {
75 75
                 res.add(getItem(item, configManager));
76 76
             }
77 77
         }
78
-        
78
+
79 79
         return res;
80 80
     }
81
-    
81
+
82 82
     /**
83 83
      * Creates a PopupMenuItem for the specified item.
84
-     * 
84
+     *
85 85
      * @param item The item to be turned into a PopupMenuItem
86 86
      * @param configManager The config manager to beused for the menu
87 87
      * @return The corresponding PopupMenuItem
88 88
      */
89 89
     private static PopupMenuItem getItem(final String item, final ConfigManager configManager) {
90 90
         PopupMenuItem res;
91
-        
91
+
92 92
         if ("-".equals(item)) {
93 93
             res = new PopupMenuItem();
94 94
         } else {
95 95
             final int colon = item.indexOf(':');
96
-            
96
+
97 97
             if (colon == -1) {
98 98
                 throw new IllegalArgumentException("Invalid popup menu item: "
99 99
                         + item);
100 100
             }
101
-            
101
+
102 102
             final String name = item.substring(0, colon);
103 103
             final String command = item.substring(colon + 1);
104
-            
104
+
105 105
             if (command.length() > 0 && command.charAt(0) == '<') {
106 106
                 res = new PopupMenuItem(name, getMenu(command.substring(1), configManager));
107 107
             } else {
108 108
                 res = new PopupMenuItem(name, command);
109 109
             }
110 110
         }
111
-        
111
+
112 112
         return res;
113 113
     }
114
-    
114
+
115 115
 }

+ 7
- 7
src/com/dmdirc/commandparser/PopupMenu.java ファイルの表示

@@ -28,17 +28,17 @@ import java.util.List;
28 28
 
29 29
 /**
30 30
  * Represents an abstract, UI-independent popup menu.
31
- * 
31
+ *
32 32
  * @author chris
33 33
  */
34 34
 public class PopupMenu {
35
-    
35
+
36 36
     /** The items contained within this popup menu. */
37 37
     private final List<PopupMenuItem> items = new ArrayList<PopupMenuItem>();
38
-    
38
+
39 39
     /**
40 40
      * Retrieves a list of items contained within this popup menu.
41
-     * 
41
+     *
42 42
      * @return A list of this popup menu's items.
43 43
      */
44 44
     public List<PopupMenuItem> getItems() {
@@ -47,7 +47,7 @@ public class PopupMenu {
47 47
 
48 48
     /**
49 49
      * Adds the specified item to this popup menu.
50
-     * 
50
+     *
51 51
      * @param e The item to be added to the popup menu.
52 52
      */
53 53
     public void add(final PopupMenuItem e) {
@@ -56,11 +56,11 @@ public class PopupMenu {
56 56
 
57 57
     /**
58 58
      * Adds all of the items in the specified collection to this popup menu.
59
-     * 
59
+     *
60 60
      * @param c The collection whose items should be added.
61 61
      */
62 62
     public void addAll(final Collection<? extends PopupMenuItem> c) {
63 63
         items.addAll(c);
64
-    }    
64
+    }
65 65
 
66 66
 }

+ 17
- 17
src/com/dmdirc/commandparser/PopupMenuItem.java ファイルの表示

@@ -24,11 +24,11 @@ package com.dmdirc.commandparser;
24 24
 
25 25
 /**
26 26
  * Represents an abstract, UI-independent popup menu item.
27
- * 
27
+ *
28 28
  * @author chris
29 29
  */
30 30
 public class PopupMenuItem {
31
-   
31
+
32 32
     /** Whether this item is a divider. */
33 33
     private boolean divider = false;
34 34
     /** The submenu for this item, if any. */
@@ -37,17 +37,17 @@ public class PopupMenuItem {
37 37
     private String name;
38 38
     /** The command for this item, if any. */
39 39
     private String command;
40
-    
40
+
41 41
     /**
42 42
      * Creates a new PopupMenuItem that is used as a divider.
43 43
      */
44 44
     public PopupMenuItem() {
45 45
         divider = true;
46 46
     }
47
-    
47
+
48 48
     /**
49 49
      * Creates a new PopupMenuItem that is used as a submenu.
50
-     * 
50
+     *
51 51
      * @param name The name of the menu item
52 52
      * @param submenu The submenu of this item
53 53
      */
@@ -55,10 +55,10 @@ public class PopupMenuItem {
55 55
         this.name = name;
56 56
         this.submenu = submenu;
57 57
     }
58
-    
58
+
59 59
     /**
60 60
      * Creates a new PopupMenuItem that executes a command.
61
-     * 
61
+     *
62 62
      * @param name The name of the menu item
63 63
      * @param command The command to be executed
64 64
      */
@@ -66,10 +66,10 @@ public class PopupMenuItem {
66 66
         this.name = name;
67 67
         this.command = command;
68 68
     }
69
-    
69
+
70 70
     /**
71 71
      * Determines if this menu item is a divider or not.
72
-     * 
72
+     *
73 73
      * @return True if this item is a divider, false otherwise.
74 74
      */
75 75
     public boolean isDivider() {
@@ -78,35 +78,35 @@ public class PopupMenuItem {
78 78
 
79 79
     /**
80 80
      * Determines if this menu item contains a submenu or not.
81
-     * 
81
+     *
82 82
      * @return True if this item contains a submenu, false otherwise.
83
-     */    
83
+     */
84 84
     public boolean isSubMenu() {
85 85
         return submenu != null;
86 86
     }
87
-    
87
+
88 88
     /**
89 89
      * Retrieves the submenu associated with this item.
90
-     * 
90
+     *
91 91
      * @return This menu item's submenu.
92 92
      */
93 93
     public PopupMenu getSubMenu() {
94 94
         return submenu;
95 95
     }
96
-    
96
+
97 97
     /**
98 98
      * Retrieves the name of this menu item.
99
-     * 
99
+     *
100 100
      * @return This menu item's name.
101 101
      */
102 102
     public String getName() {
103 103
         return name;
104 104
     }
105
-    
105
+
106 106
     /**
107 107
      * Retrieves the command for this menu item, with the specified argumenwits
108 108
      * substituted in.
109
-     * 
109
+     *
110 110
      * @param arguments The arguments needed for this command
111 111
      * @return The command to be passed to a command parser
112 112
      */

+ 26
- 26
src/com/dmdirc/commandparser/PopupType.java ファイルの表示

@@ -25,93 +25,93 @@ package com.dmdirc.commandparser;
25 25
 /**
26 26
  * An enumeration of the types of popup menu which are supported by the
27 27
  * PopupManager.
28
- * 
28
+ *
29 29
  * @author chris
30 30
  */
31 31
 public enum PopupType {
32
-    
32
+
33 33
     /**
34 34
      * The menu that appears when right clicking in a channel window.
35
-     * 
35
+     *
36 36
      * Expected arguments: none.
37 37
      */
38 38
     CHAN_NORMAL,
39
-    
39
+
40 40
     /**
41 41
      * The menu that appears when right clicking in a nickname in a channel window.
42
-     * 
42
+     *
43 43
      * Expected arguments: the nickname of the user who was clicked on.
44 44
      */
45 45
     CHAN_NICK,
46
-    
46
+
47 47
     /**
48 48
      * The menu that appears when right clicking in a channel in a channel window.
49
-     * 
49
+     *
50 50
      * Expected arguments: the nickname of the user who was clicked on.
51 51
      */
52 52
     CHAN_CHANNEL,
53
-    
53
+
54 54
     /**
55 55
      * The menu that appears when right clicking in a hyperlink in a channel window.
56
-     * 
56
+     *
57 57
      * Expected arguments: the hyperlink clicked.
58 58
      */
59 59
     CHAN_HYPERLINK,
60
-    
60
+
61 61
     /**
62 62
      * The menu that appears when right clicking in a query window.
63
-     * 
63
+     *
64 64
      * Expected arguments: the nickname of the user who the query is with.
65 65
      */
66 66
     QUERY_NORMAL,
67
-    
67
+
68 68
     /**
69 69
      * The menu that appears when right clicking in a nickname in a query window.
70
-     * 
70
+     *
71 71
      * Expected arguments: the nickname of the user who the query is with.
72 72
      */
73 73
     QUERY_NICK,
74
-    
74
+
75 75
     /**
76 76
      * The menu that appears when right clicking in a channel in a query window.
77
-     * 
77
+     *
78 78
      * Expected arguments: the nickname of the user who the query is with.
79 79
      */
80 80
     QUERY_CHANNEL,
81
-    
81
+
82 82
     /**
83 83
      * The menu that appears when right clicking in a hyperlink in a query window.
84
-     * 
84
+     *
85 85
      * Expected arguments: the hyperlink clicked.
86 86
      */
87 87
     QUERY_HYPERLINK,
88
-    
88
+
89 89
     /**
90 90
      * The menu that appears when right clicking in a server window.
91
-     * 
91
+     *
92 92
      * Expected arguments: the nickname of the user who the query is with.
93 93
      */
94 94
     SERVER_NORMAL,
95
-    
95
+
96 96
     /**
97 97
      * The menu that appears when right clicking in a nickname in a server window.
98
-     * 
98
+     *
99 99
      * Expected arguments: the nickname of the user who the query is with.
100 100
      */
101 101
     SERVER_NICK,
102
-    
102
+
103 103
     /**
104 104
      * The menu that appears when right clicking in a channel in a server window.
105
-     * 
105
+     *
106 106
      * Expected arguments: the nickname of the user who the query is with.
107 107
      */
108 108
     SERVER_CHANNEL,
109
-    
109
+
110 110
     /**
111 111
      * The menu that appears when right clicking in a hyperlink in a server window.
112
-     * 
112
+     *
113 113
      * Expected arguments: the hyperlink clicked.
114 114
      */
115 115
     SERVER_HYPERLINK;
116
-       
116
+
117 117
 }

+ 18
- 18
src/com/dmdirc/commandparser/commands/Command.java ファイルの表示

@@ -34,13 +34,13 @@ import com.dmdirc.ui.messages.Styliser;
34 34
  * @author chris
35 35
  */
36 36
 public abstract class Command {
37
-    
37
+
38 38
     /** The format name used for command output. */
39 39
     protected static final String FORMAT_OUTPUT = "commandOutput";
40
-    
40
+
41 41
     /** The format name used for command errors. */
42 42
     protected static final String FORMAT_ERROR = "commandError";
43
-    
43
+
44 44
     /**
45 45
      * Sends a line, if appropriate, to the specified target.
46 46
      * @param target The command window to send the line to
@@ -54,10 +54,10 @@ public abstract class Command {
54 54
             target.addLine(type, args);
55 55
         }
56 56
     }
57
-    
57
+
58 58
     /**
59 59
      * Sends a usage line, if appropriate, to the specified target.
60
-     * 
60
+     *
61 61
      * @param target The command window to send the line to
62 62
      * @param isSilent Whether this command is being silenced or not
63 63
      * @param name The name of the command that's raising the error
@@ -67,13 +67,13 @@ public abstract class Command {
67 67
             final boolean isSilent, final String name, final String args) {
68 68
         sendLine(target, isSilent, "commandUsage", CommandManager.getCommandChar(),
69 69
                 name, args);
70
-    }    
71
-    
70
+    }
71
+
72 72
     /**
73 73
      * Formats the specified data into a table suitable for output in the
74 74
      * textpane. It is expected that each String[] in data has the same number
75 75
      * of elements as the headers array.
76
-     * 
76
+     *
77 77
      * @param headers The headers of the table.
78 78
      * @param data The contents of the table.
79 79
      * @return A string containing an ASCII table
@@ -82,35 +82,35 @@ public abstract class Command {
82 82
         final StringBuilder res = new StringBuilder();
83 83
         res.append(Styliser.CODE_FIXED);
84 84
         res.append(Styliser.CODE_BOLD);
85
-        
85
+
86 86
         int[] maxsizes = new int[headers.length];
87
-        
87
+
88 88
         for (int i = 0; i < headers.length; i++) {
89 89
             maxsizes[i] = headers[i].length() + 3;
90
-            
90
+
91 91
             for (String[] row : data) {
92 92
                 maxsizes[i] = Math.max(maxsizes[i], row[i].length() + 3);
93 93
             }
94
-            
94
+
95 95
             doPadding(res, headers[i], maxsizes[i]);
96 96
         }
97
-                
97
+
98 98
         for (String[] source : data) {
99 99
             res.append('\n');
100 100
             res.append(Styliser.CODE_FIXED);
101
-            
101
+
102 102
             for (int i = 0; i < source.length; i++) {
103 103
                 doPadding(res, source[i], maxsizes[i]);
104 104
             }
105 105
         }
106
-        
106
+
107 107
         return res.toString();
108 108
     }
109
-    
109
+
110 110
     /**
111 111
      * Adds the specified data to the stringbuilder, padding with spaces to
112 112
      * the specified size.
113
-     * 
113
+     *
114 114
      * @param builder The stringbuilder to append data to
115 115
      * @param data The data to be added
116 116
      * @param size The minimum size that should be used
@@ -118,7 +118,7 @@ public abstract class Command {
118 118
     private static void doPadding(final StringBuilder builder, final String data,
119 119
             final int size) {
120 120
         builder.append(data);
121
-        
121
+
122 122
         for (int i = 0; i < size - data.length(); i++) {
123 123
             builder.append(' ');
124 124
         }

+ 1
- 1
src/com/dmdirc/commandparser/commands/GlobalCommand.java ファイルの表示

@@ -34,7 +34,7 @@ import com.dmdirc.commandparser.CommandType;
34 34
  */
35 35
 @Deprecated
36 36
 public abstract class GlobalCommand extends Command implements CommandInfo {
37
-        
37
+
38 38
     /** {@inheritDoc} */
39 39
     @Override
40 40
     public CommandType getType() {

+ 2
- 2
src/com/dmdirc/commandparser/commands/IntelligentCommand.java ファイルの表示

@@ -66,7 +66,7 @@ public interface IntelligentCommand {
66 66
 
67 67
         /**
68 68
          * Retrieves the window that the command was entered in.
69
-         * 
69
+         *
70 70
          * @return The command's input window
71 71
          */
72 72
         public InputWindow getWindow() {
@@ -103,5 +103,5 @@ public interface IntelligentCommand {
103 103
      * @since 0.6.4
104 104
      */
105 105
     AdditionalTabTargets getSuggestions(int arg, IntelligentCommandContext context);
106
-    
106
+
107 107
 }

+ 13
- 13
src/com/dmdirc/commandparser/commands/PreviousCommand.java ファイルの表示

@@ -26,39 +26,39 @@ import java.util.Date;
26 26
 
27 27
 /**
28 28
  * Stores information about a previously executed command.
29
- * 
29
+ *
30 30
  * @author chris
31 31
  */
32 32
 public final class PreviousCommand {
33
-   
33
+
34 34
     /** The full command that was executed. */
35 35
     private final String line;
36
-    
36
+
37 37
     /** The timestamp of its execution. */
38 38
     private final long time;
39
-    
39
+
40 40
     /**
41 41
      * Creates a new record of the specified command.
42
-     * 
42
+     *
43 43
      * @param line The full command that was executed
44 44
      */
45 45
     public PreviousCommand(final String line) {
46 46
         this.line = line;
47 47
         this.time = new Date().getTime();
48 48
     }
49
-    
49
+
50 50
     /**
51 51
      * Retrieves the time that the command was executed at.
52
-     * 
52
+     *
53 53
      * @return The timestamp that the command was executed at
54 54
      */
55 55
     public long getTime() {
56 56
         return time;
57 57
     }
58
-    
58
+
59 59
     /**
60 60
      * Retrieves the command that was executed.
61
-     * 
61
+     *
62 62
      * @return The command that was executed.
63 63
      */
64 64
     public String getLine() {
@@ -71,17 +71,17 @@ public final class PreviousCommand {
71 71
         if (obj == null) {
72 72
             return false;
73 73
         }
74
-        
74
+
75 75
         if (getClass() != obj.getClass()) {
76 76
             return false;
77 77
         }
78
-        
78
+
79 79
         final PreviousCommand other = (PreviousCommand) obj;
80 80
         if (this.line != other.line
81 81
                 && (this.line == null || !this.line.equals(other.line))) {
82 82
             return false;
83 83
         }
84
-        
84
+
85 85
         return true;
86 86
     }
87 87
 
@@ -92,5 +92,5 @@ public final class PreviousCommand {
92 92
         hash = 97 * hash + (this.line == null ? 0 : this.line.hashCode());
93 93
         return hash;
94 94
     }
95
-    
95
+
96 96
 }

+ 3
- 3
src/com/dmdirc/commandparser/commands/ValidatingCommand.java ファイルの表示

@@ -28,14 +28,14 @@ import com.dmdirc.ui.interfaces.InputWindow;
28 28
 /**
29 29
  * Validating commands are capable of validating their arguments to determine
30 30
  * whether the input would be valid or not.
31
- * 
31
+ *
32 32
  * @author chris
33 33
  */
34 34
 public interface ValidatingCommand {
35
-    
35
+
36 36
     /**
37 37
      * Validates the specified arguments.
38
-     * 
38
+     *
39 39
      * @param origin The window the command is being executed in
40 40
      * @param arguments The arguments that the user has entered (so far)
41 41
      * @return A validation response indicating the validity of the arguments

+ 3
- 3
src/com/dmdirc/commandparser/commands/WrappableCommand.java ファイルの表示

@@ -28,15 +28,15 @@ import com.dmdirc.ui.interfaces.InputWindow;
28 28
 /**
29 29
  * Wrapping commands are commands whose arguments may be wrapped into multiple
30 30
  * lines when sending.
31
- * 
31
+ *
32 32
  * @author chris
33 33
  */
34 34
 public interface WrappableCommand {
35
-    
35
+
36 36
     /**
37 37
      * Determines the number of lines that the specified arguments will be
38 38
      * wrapped as.
39
-     * 
39
+     *
40 40
      * @param origin The window the command is being executed in
41 41
      * @param arguments The arguments that the user has entered (so far)
42 42
      * @return The number of lines that the arguments will result in

+ 13
- 13
src/com/dmdirc/commandparser/commands/channel/KickReason.java ファイルの表示

@@ -45,14 +45,14 @@ import com.dmdirc.ui.input.TabCompletionType;
45 45
 @CommandOptions(allowOffline=false)
46 46
 public final class KickReason extends Command implements IntelligentCommand,
47 47
         CommandInfo {
48
-    
48
+
49 49
     /** Creates a new instance of KickReason. */
50 50
     public KickReason() {
51 51
         super();
52
-        
52
+
53 53
         CommandManager.registerCommand(this);
54 54
     }
55
-    
55
+
56 56
     /** {@inheritDoc} */
57 57
     @Override
58 58
     public void execute(final FrameContainer<?> origin,
@@ -62,25 +62,25 @@ public final class KickReason extends Command implements IntelligentCommand,
62 62
             showUsage(origin, args.isSilent(), "kick", "<user> [reason]");
63 63
             return;
64 64
         }
65
-        
65
+
66 66
         final ChannelClientInfo victim = channel.getChannelInfo().getChannelClient(args
67 67
                 .getArguments()[0]);
68
-        
68
+
69 69
         if (victim == null) {
70 70
             sendLine(origin, args.isSilent(), FORMAT_ERROR, "User not found: "
71 71
                     + args.getArguments()[0]);
72 72
         } else {
73
-            victim.kick(args.getArguments().length > 1 ? args.getArgumentsAsString(1) :
74
-                origin.getConfigManager().getOption("general", "kickmessage"));
73
+            victim.kick(args.getArguments().length > 1 ? args.getArgumentsAsString(1)
74
+                    : origin.getConfigManager().getOption("general", "kickmessage"));
75 75
         }
76 76
     }
77
-    
77
+
78 78
     /** {@inheritDoc} */
79 79
     @Override
80 80
     public String getName() {
81 81
         return "kick";
82 82
     }
83
-    
83
+
84 84
     /** {@inheritDoc} */
85 85
     @Override
86 86
     public boolean showInHelp() {
@@ -92,7 +92,7 @@ public final class KickReason extends Command implements IntelligentCommand,
92 92
     public CommandType getType() {
93 93
         return CommandType.TYPE_CHANNEL;
94 94
     }
95
-    
95
+
96 96
     /** {@inheritDoc} */
97 97
     @Override
98 98
     public String getHelp() {
@@ -104,13 +104,13 @@ public final class KickReason extends Command implements IntelligentCommand,
104 104
     public AdditionalTabTargets getSuggestions(final int arg,
105 105
             final IntelligentCommandContext context) {
106 106
         final AdditionalTabTargets res = new AdditionalTabTargets();
107
-        
107
+
108 108
         if (arg == 0) {
109 109
             res.excludeAll();
110 110
             res.include(TabCompletionType.CHANNEL_NICK);
111 111
         }
112
-        
112
+
113 113
         return res;
114 114
     }
115
-    
115
+
116 116
 }

+ 7
- 7
src/com/dmdirc/commandparser/commands/channel/Names.java ファイルの表示

@@ -39,21 +39,21 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
39 39
 
40 40
 /**
41 41
  * Sends a names request.
42
- * 
42
+ *
43 43
  * @author chris
44 44
  */
45 45
 @CommandOptions(allowOffline=false)
46
-public class Names extends Command implements IntelligentCommand, 
46
+public class Names extends Command implements IntelligentCommand,
47 47
         ExternalCommand, CommandInfo {
48
-    
48
+
49 49
     /**
50 50
      * Creates a new instance of Names.
51 51
      */
52 52
     public Names() {
53 53
         super();
54
-        
54
+
55 55
         CommandManager.registerCommand(this);
56
-    }    
56
+    }
57 57
 
58 58
     /** {@inheritDoc} */
59 59
     @Override
@@ -63,14 +63,14 @@ public class Names extends Command implements IntelligentCommand,
63 63
         channel.getServer().getParser().sendRawMessage("NAMES "
64 64
                 + channel.getChannelInfo().getName());
65 65
     }
66
-    
66
+
67 67
 
68 68
     /** {@inheritDoc} */
69 69
     @Override
70 70
     public void execute(final FrameContainer<?> origin, final Server server,
71 71
             final String channel, final boolean isSilent, final CommandArguments args) {
72 72
         server.getParser().sendRawMessage("NAMES " + channel);
73
-    }    
73
+    }
74 74
 
75 75
     /** {@inheritDoc} */
76 76
     @Override

+ 15
- 15
src/com/dmdirc/commandparser/commands/channel/SetNickColour.java ファイルの表示

@@ -47,24 +47,24 @@ import java.awt.Color;
47 47
  */
48 48
 public final class SetNickColour extends Command implements IntelligentCommand,
49 49
         CommandInfo {
50
-    
50
+
51 51
     /** Creates a new instance of SetNickColour. */
52 52
     public SetNickColour() {
53 53
         super();
54
-        
54
+
55 55
         CommandManager.registerCommand(this);
56 56
     }
57
-    
57
+
58 58
     /** {@inheritDoc} */
59 59
     @Override
60 60
     public void execute(final FrameContainer<?> origin,
61 61
             final CommandArguments args, final CommandContext context) {
62 62
         final Channel channel = ((ChannelCommandContext) context).getChannel();
63
-        
63
+
64 64
         int offset = 0;
65 65
         boolean nicklist = true;
66 66
         boolean text = true;
67
-        
67
+
68 68
         if (args.getArguments().length > offset && args.getArguments()[offset]
69 69
                 .equalsIgnoreCase("--nicklist")) {
70 70
             text = false;
@@ -74,16 +74,16 @@ public final class SetNickColour extends Command implements IntelligentCommand,
74 74
             nicklist = false;
75 75
             offset++;
76 76
         }
77
-        
77
+
78 78
         if (args.getArguments().length <= offset) {
79 79
             showUsage(origin, args.isSilent(), "setnickcolour", "[--nicklist|--text] <nick> [colour]");
80 80
             return;
81 81
         }
82
-        
82
+
83 83
         final ChannelClientInfo target = channel.getChannelInfo()
84 84
                 .getChannelClient(args.getArguments()[offset]);
85 85
         offset++;
86
-        
86
+
87 87
         if (target == null) {
88 88
             sendLine(origin, args.isSilent(), FORMAT_ERROR, "No such nickname ("
89 89
                     + args.getArguments()[offset - 1] + ")!");
@@ -120,13 +120,13 @@ public final class SetNickColour extends Command implements IntelligentCommand,
120 120
             }
121 121
         }
122 122
     }
123
-    
123
+
124 124
     /** {@inheritDoc} */
125 125
     @Override
126 126
     public String getName() {
127 127
         return "setnickcolour";
128 128
     }
129
-    
129
+
130 130
     /** {@inheritDoc} */
131 131
     @Override
132 132
     public boolean showInHelp() {
@@ -138,7 +138,7 @@ public final class SetNickColour extends Command implements IntelligentCommand,
138 138
     public CommandType getType() {
139 139
         return CommandType.TYPE_CHANNEL;
140 140
     }
141
-    
141
+
142 142
     /** {@inheritDoc} */
143 143
     @Override
144 144
     public String getHelp() {
@@ -152,17 +152,17 @@ public final class SetNickColour extends Command implements IntelligentCommand,
152 152
             final IntelligentCommandContext context) {
153 153
         final AdditionalTabTargets targets = new AdditionalTabTargets();
154 154
         targets.excludeAll();
155
-        
155
+
156 156
         if (arg == 0) {
157 157
             targets.include(TabCompletionType.CHANNEL_NICK);
158 158
             targets.add("--nicklist");
159 159
             targets.add("--text");
160 160
         } else if (arg == 1 && (context.getPreviousArgs().get(0).equals("--text")
161 161
                 || context.getPreviousArgs().get(0).equals("--nicklist"))) {
162
-            targets.include(TabCompletionType.CHANNEL_NICK);            
162
+            targets.include(TabCompletionType.CHANNEL_NICK);
163 163
         }
164
-        
164
+
165 165
         return targets;
166 166
     }
167
-    
167
+
168 168
 }

+ 2
- 2
src/com/dmdirc/commandparser/commands/global/Active.java ファイルの表示

@@ -87,8 +87,8 @@ public final class Active extends Command implements IntelligentCommand,
87 87
     /** {@inheritDoc} */
88 88
     @Override
89 89
     public String getHelp() {
90
-        return "active <command> - executes the command as though it had been" +
91
-                " typed in the active window";
90
+        return "active <command> - executes the command as though it had been"
91
+                + " typed in the active window";
92 92
     }
93 93
 
94 94
     /** {@inheritDoc} */

+ 10
- 10
src/com/dmdirc/commandparser/commands/global/AliasCommand.java ファイルの表示

@@ -39,7 +39,7 @@ import com.dmdirc.ui.input.TabCompleter;
39 39
 
40 40
 /**
41 41
  * The alias command allows users to create aliases on-the-fly.
42
- * 
42
+ *
43 43
  * @author chris
44 44
  */
45 45
 public final class AliasCommand extends Command implements
@@ -69,11 +69,11 @@ public final class AliasCommand extends Command implements
69 69
                     ? args.getArguments()[1].substring(1) : args.getArguments()[1];
70 70
 
71 71
             if (doRemove(name)) {
72
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Alias '" + name +
73
-                         "' removed.");
72
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Alias '"
73
+                        + name + "' removed.");
74 74
             } else {
75
-                sendLine(origin, args.isSilent(), FORMAT_ERROR, "Alias '" + name +
76
-                         "' not found.");
75
+                sendLine(origin, args.isSilent(), FORMAT_ERROR, "Alias '"
76
+                        + name + "' not found.");
77 77
             }
78 78
 
79 79
             return;
@@ -85,8 +85,8 @@ public final class AliasCommand extends Command implements
85 85
         for (Action alias : AliasWrapper.getAliasWrapper()) {
86 86
             if (AliasWrapper.getCommandName(alias).substring(1).equalsIgnoreCase(
87 87
                     name)) {
88
-                sendLine(origin, args.isSilent(), FORMAT_ERROR, "Alias '" + name +
89
-                         "' already exists.");
88
+                sendLine(origin, args.isSilent(), FORMAT_ERROR, "Alias '" + name
89
+                        + "' already exists.");
90 90
                 return;
91 91
             }
92 92
         }
@@ -95,13 +95,13 @@ public final class AliasCommand extends Command implements
95 95
         myAlias.setResponse(new String[]{args.getArgumentsAsString(1)});
96 96
         myAlias.createAction().save();
97 97
 
98
-        sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Alias '" + name +
99
-                 "' created.");
98
+        sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Alias '" + name
99
+                + "' created.");
100 100
     }
101 101
 
102 102
     /**
103 103
      * Removes the alias with the specified name.
104
-     * 
104
+     *
105 105
      * @param name The name of the alias to remove
106 106
      * @return True if the alias was deleted, false otherwise
107 107
      */

+ 11
- 11
src/com/dmdirc/commandparser/commands/global/AllServers.java ファイルの表示

@@ -41,32 +41,32 @@ import com.dmdirc.ui.input.TabCompleter;
41 41
  */
42 42
 public final class AllServers extends Command implements IntelligentCommand,
43 43
         CommandInfo{
44
-    
44
+
45 45
     /** Creates a new instance of AllServers. */
46 46
     public AllServers() {
47 47
         super();
48
-        
48
+
49 49
         CommandManager.registerCommand(this);
50 50
     }
51
-    
51
+
52 52
     /** {@inheritDoc} */
53 53
     @Override
54 54
     public void execute(final FrameContainer<?> origin,
55 55
             final CommandArguments args, final CommandContext context) {
56 56
         final String command = args.getArgumentsAsString();
57
-        
57
+
58 58
         for (Server target : ServerManager.getServerManager().getServers()) {
59 59
             target.getCommandParser().parseCommand(target, context.getSource(), command);
60 60
         }
61 61
     }
62
-    
63
-    
62
+
63
+
64 64
     /** {@inheritDoc} */
65 65
     @Override
66 66
     public String getName() {
67 67
         return "allservers";
68 68
     }
69
-    
69
+
70 70
     /** {@inheritDoc} */
71 71
     @Override
72 72
     public boolean showInHelp() {
@@ -78,12 +78,12 @@ public final class AllServers extends Command implements IntelligentCommand,
78 78
     public CommandType getType() {
79 79
         return CommandType.TYPE_GLOBAL;
80 80
     }
81
-    
81
+
82 82
     /** {@inheritDoc} */
83 83
     @Override
84 84
     public String getHelp() {
85
-        return "allservers <command> - executes the command as though it had" +
86
-                " been entered on all servers";
85
+        return "allservers <command> - executes the command as though it had"
86
+                + " been entered on all servers";
87 87
     }
88 88
 
89 89
     /** {@inheritDoc} */
@@ -92,5 +92,5 @@ public final class AllServers extends Command implements IntelligentCommand,
92 92
             final IntelligentCommandContext context) {
93 93
         return TabCompleter.getIntelligentResults(arg, context, 0);
94 94
     }
95
-    
95
+
96 96
 }

+ 37
- 37
src/com/dmdirc/commandparser/commands/global/Debug.java ファイルの表示

@@ -57,14 +57,14 @@ import java.util.Map.Entry;
57 57
  * @author Chris
58 58
  */
59 59
 public class Debug extends Command implements IntelligentCommand, CommandInfo {
60
-    
60
+
61 61
     /**
62 62
      * Creates a new instance of Debug.
63 63
      */
64 64
     public Debug() {
65 65
         CommandManager.registerCommand(this);
66 66
     }
67
-    
67
+
68 68
     /** {@inheritDoc} */
69 69
     @Override
70 70
     public void execute(final FrameContainer<?> origin,
@@ -110,7 +110,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
110 110
             sendLine(origin, args.isSilent(), FORMAT_ERROR, "Unknown debug action.");
111 111
         }
112 112
     }
113
-    
113
+
114 114
     /**
115 115
      * Generates a fake error.
116 116
      *
@@ -120,7 +120,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
120 120
         ErrorLevel el = ErrorLevel.HIGH;
121 121
         if (args.length > 2) {
122 122
             final String level = args[2];
123
-            
123
+
124 124
             if (level.equals("low")) {
125 125
                 el = ErrorLevel.LOW;
126 126
             } else if (level.equals("medium")) {
@@ -131,14 +131,14 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
131 131
                 el = ErrorLevel.UNKNOWN;
132 132
             }
133 133
         }
134
-        
134
+
135 135
         if (args.length > 1 && args[1].equals("user")) {
136 136
             Logger.userError(el, "Debug error message");
137 137
         } else {
138 138
             Logger.appError(el, "Debug error message", new Exception());
139 139
         }
140 140
     }
141
-    
141
+
142 142
     /**
143 143
      * Attempts to show the server's raw window.
144 144
      *
@@ -152,7 +152,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
152 152
             origin.getServer().addRaw();
153 153
         }
154 154
     }
155
-    
155
+
156 156
     /**
157 157
      * Shows stats related to the config system.
158 158
      *
@@ -264,7 +264,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
264 264
         sortedStats.addAll(ConfigManager.getStats().entrySet());
265 265
         return sortedStats;
266 266
     }
267
-    
267
+
268 268
     /**
269 269
      * Shows memory usage information.
270 270
      *
@@ -279,7 +279,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
279 279
         sendLine(origin, isSilent, FORMAT_OUTPUT, "Used Memory: "
280 280
                 + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()));
281 281
     }
282
-    
282
+
283 283
     /**
284 284
      * Outputs 100 lines containing various colours.
285 285
      *
@@ -295,7 +295,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
295 295
                     + ((char) 3) + "6Colour! " + ((char) 3) + "7Colour! ");
296 296
         }
297 297
     }
298
-    
298
+
299 299
     /**
300 300
      * Manually runs the garbage collector.
301 301
      *
@@ -306,7 +306,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
306 306
         System.gc();
307 307
         sendLine(origin, isSilent, FORMAT_OUTPUT, "Invoked garbage collector.");
308 308
     }
309
-    
309
+
310 310
     /**
311 311
      * Shows information about the config manager.
312 312
      *
@@ -319,7 +319,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
319 319
                     + source + "(" + source.getTarget().getOrder() + ")");
320 320
         }
321 321
     }
322
-    
322
+
323 323
     /**
324 324
      * Shows information about the global config manager.
325 325
      *
@@ -332,7 +332,7 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
332 332
                     + source + "(" + source.getTarget().getOrder() + ")");
333 333
         }
334 334
     }
335
-    
335
+
336 336
     /**
337 337
      * Forces the update checker to check for updates.
338 338
      *
@@ -382,10 +382,10 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
382 382
             sendLine(origin, isSilent, FORMAT_OUTPUT, server.getStatus().getTransitionHistory());
383 383
         }
384 384
     }
385
-    
385
+
386 386
     /**
387 387
      * Shows information about the current server.
388
-     * 
388
+     *
389 389
      * @param origin The window this command was executed in
390 390
      * @param isSilent Whether this command has been silenced or not
391 391
      */
@@ -408,36 +408,36 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
408 408
                     + server.getParser().getDoubleParameterChannelModes());
409 409
         }
410 410
     }
411
-    
411
+
412 412
     /**
413 413
      * Benchmarks the textpane.
414
-     * 
414
+     *
415 415
      * @param origin The window this command was executed in
416 416
      */
417 417
     private static void doBenchmark(final FrameContainer<?> origin) {
418 418
         long[] results = new long[10];
419
-        
419
+
420 420
         for (int i = 0; i < results.length; i++) {
421 421
             final long start = System.nanoTime();
422
-            
422
+
423 423
             for (int j = 0; j < 5000; j++) {
424 424
                 origin.addLine(FORMAT_OUTPUT, "This is a benchmark. Lorem ipsum doler...");
425 425
             }
426
-            
426
+
427 427
             final long end = System.nanoTime();
428
-            
428
+
429 429
             results[i] = end - start;
430 430
         }
431
-        
431
+
432 432
         for (int i = 0; i < results.length; i++) {
433 433
             origin.addLine(FORMAT_OUTPUT, "Iteration " + i + ": " + results[i]
434 434
                     + " nanoseconds.");
435 435
         }
436 436
     }
437
-    
437
+
438 438
     /**
439 439
      * Shows information about all the current services available to plugins.
440
-     * 
440
+     *
441 441
      * @param origin The window this command was executed in
442 442
      * @param isSilent Whether this command has been silenced or not
443 443
      * @param args The arguments that were passed to the command
@@ -456,13 +456,13 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
456 456
             }
457 457
         }
458 458
     }
459
-    
459
+
460 460
     /** {@inheritDoc} */
461 461
     @Override
462 462
     public String getName() {
463 463
         return "debug";
464 464
     }
465
-    
465
+
466 466
     /** {@inheritDoc} */
467 467
     @Override
468 468
     public boolean showInHelp() {
@@ -474,21 +474,21 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
474 474
     public CommandType getType() {
475 475
         return CommandType.TYPE_GLOBAL;
476 476
     }
477
-    
477
+
478 478
     /** {@inheritDoc} */
479 479
     @Override
480 480
     public String getHelp() {
481 481
         return null;
482 482
     }
483
-    
483
+
484 484
     /** {@inheritDoc} */
485 485
     @Override
486 486
     public AdditionalTabTargets getSuggestions(final int arg,
487 487
             final IntelligentCommandContext context) {
488 488
         final AdditionalTabTargets res = new AdditionalTabTargets();
489
-        
489
+
490 490
         res.excludeAll();
491
-        
491
+
492 492
         if (arg == 0) {
493 493
             res.add("error");
494 494
             res.add("showraw");
@@ -519,33 +519,33 @@ public class Debug extends Command implements IntelligentCommand, CommandInfo {
519 519
             res.add("fatal");
520 520
             res.add("unknown");
521 521
         }
522
-        
522
+
523 523
         return res;
524 524
     }
525
-    
525
+
526 526
     /** Reverse value comparator for a map entry. */
527 527
     private static class ValueComparator implements
528 528
             Comparator<Entry<String, Integer>>, Serializable {
529
-        
529
+
530 530
         /**
531 531
          * A version number for this class. It should be changed whenever the
532 532
          * class structure is changed (or anything else that would prevent
533 533
          * serialized objects being unserialized with the new class).
534 534
          */
535 535
         private static final long serialVersionUID = 1;
536
-        
536
+
537 537
         /** {@inheritDoc} */
538 538
         @Override
539 539
         public int compare(final Entry<String, Integer> o1,
540 540
                 final Entry<String, Integer> o2) {
541 541
             int returnValue = o1.getValue().compareTo(o2.getValue()) * -1;
542
-            
542
+
543 543
             if (returnValue == 0) {
544 544
                 returnValue = o1.getKey().compareToIgnoreCase(o2.getKey());
545 545
             }
546
-            
546
+
547 547
             return returnValue;
548 548
         }
549 549
     }
550
-    
550
+
551 551
 }

+ 8
- 8
src/com/dmdirc/commandparser/commands/global/Exit.java ファイルの表示

@@ -38,16 +38,16 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
38 38
  * @author chris
39 39
  */
40 40
 public final class Exit extends Command implements CommandInfo {
41
-    
41
+
42 42
     /**
43 43
      * Creates a new instance of Exit.
44 44
      */
45 45
     public Exit() {
46 46
         super();
47
-        
47
+
48 48
         CommandManager.registerCommand(this);
49 49
     }
50
-    
50
+
51 51
     /** {@inheritDoc} */
52 52
     @Override
53 53
     public void execute(final FrameContainer<?> origin,
@@ -55,14 +55,14 @@ public final class Exit extends Command implements CommandInfo {
55 55
         Main.quit(args.getArguments().length > 0 ? args.getArgumentsAsString()
56 56
                 : origin.getConfigManager().getOption("general", "closemessage"));
57 57
     }
58
-    
59
-    
58
+
59
+
60 60
     /** {@inheritDoc}. */
61 61
     @Override
62 62
     public String getName() {
63 63
         return "exit";
64 64
     }
65
-    
65
+
66 66
     /** {@inheritDoc}. */
67 67
     @Override
68 68
     public boolean showInHelp() {
@@ -74,11 +74,11 @@ public final class Exit extends Command implements CommandInfo {
74 74
     public CommandType getType() {
75 75
         return CommandType.TYPE_GLOBAL;
76 76
     }
77
-        
77
+
78 78
     /** {@inheritDoc}. */
79 79
     @Override
80 80
     public String getHelp() {
81 81
         return "exit [reason] - exits the client";
82 82
     }
83
-    
83
+
84 84
 }

+ 19
- 19
src/com/dmdirc/commandparser/commands/global/Ifplugin.java ファイルの表示

@@ -45,16 +45,16 @@ import com.dmdirc.ui.input.TabCompleter;
45 45
  */
46 46
 public final class Ifplugin extends Command implements IntelligentCommand,
47 47
         CommandInfo {
48
-    
48
+
49 49
     /**
50 50
      * Creates a new instance of Ifplugin.
51 51
      */
52 52
     public Ifplugin() {
53 53
         super();
54
-        
54
+
55 55
         CommandManager.registerCommand(this);
56 56
     }
57
-    
57
+
58 58
     /** {@inheritDoc} */
59 59
     @Override
60 60
     public void execute(final FrameContainer<?> origin,
@@ -63,19 +63,19 @@ public final class Ifplugin extends Command implements IntelligentCommand,
63 63
             showUsage(origin, args.isSilent(), "ifplugin", "<[!]plugin> <command>");
64 64
             return;
65 65
         }
66
-        
66
+
67 67
         final boolean negative = args.getArguments()[0].charAt(0) == '!';
68
-        
68
+
69 69
         final String pname = args.getArguments()[0].substring(negative ? 1 : 0);
70
-        
70
+
71 71
         final PluginInfo pluginInfo = PluginManager.getPluginManager().getPluginInfoByName(pname);
72
-        
72
+
73 73
         boolean result = true;
74
-        
74
+
75 75
         if (pluginInfo == null || !pluginInfo.isLoaded()) {
76 76
             result = false;
77 77
         }
78
-        
78
+
79 79
         if (result != negative) {
80 80
             if (origin == null) {
81 81
                 GlobalCommandParser.getGlobalCommandParser().parseCommand(null,
@@ -86,13 +86,13 @@ public final class Ifplugin extends Command implements IntelligentCommand,
86 86
             }
87 87
         }
88 88
     }
89
-    
89
+
90 90
     /** {@inheritDoc} */
91 91
     @Override
92 92
     public String getName() {
93 93
         return "ifplugin";
94 94
     }
95
-    
95
+
96 96
     /** {@inheritDoc} */
97 97
     @Override
98 98
     public boolean showInHelp() {
@@ -104,12 +104,12 @@ public final class Ifplugin extends Command implements IntelligentCommand,
104 104
     public CommandType getType() {
105 105
         return CommandType.TYPE_GLOBAL;
106 106
     }
107
-    
107
+
108 108
     /** {@inheritDoc} */
109 109
     @Override
110 110
     public String getHelp() {
111
-        return "ifplugin <[!]plugin> <command> - executes a command if the " +
112
-                "specified plugin is/isn't loaded";
111
+        return "ifplugin <[!]plugin> <command> - executes a command if the "
112
+                + "specified plugin is/isn't loaded";
113 113
     }
114 114
 
115 115
     /** {@inheritDoc} */
@@ -117,7 +117,7 @@ public final class Ifplugin extends Command implements IntelligentCommand,
117 117
     public AdditionalTabTargets getSuggestions(final int arg,
118 118
             final IntelligentCommandContext context) {
119 119
         final AdditionalTabTargets res;
120
-        
120
+
121 121
         if (arg == 0) {
122 122
             res = new AdditionalTabTargets().excludeAll();
123 123
 
@@ -125,12 +125,12 @@ public final class Ifplugin extends Command implements IntelligentCommand,
125 125
                     : PluginManager.getPluginManager().getPluginInfos()) {
126 126
                 res.add(possPlugin.getName());
127 127
                 res.add("!" + possPlugin.getName());
128
-            }            
128
+            }
129 129
         } else {
130 130
             res = TabCompleter.getIntelligentResults(arg, context, 1);
131 131
         }
132
-        
132
+
133 133
         return res;
134
-    }    
135
-    
134
+    }
135
+
136 136
 }

+ 3
- 3
src/com/dmdirc/commandparser/commands/global/Input.java ファイルの表示

@@ -90,8 +90,8 @@ public class Input extends Command implements IntelligentCommand, CommandInfo {
90 90
     /** {@inheritDoc} */
91 91
     @Override
92 92
     public String getHelp() {
93
-        return "input [--clear] <text to insert into inputfield> - Adds text to" +
94
-                " the active window's input field";
93
+        return "input [--clear] <text to insert into inputfield> - Adds text to"
94
+                + " the active window's input field";
95 95
     }
96 96
 
97 97
     /** {@inheritDoc} */
@@ -99,7 +99,7 @@ public class Input extends Command implements IntelligentCommand, CommandInfo {
99 99
     public AdditionalTabTargets getSuggestions(final int arg,
100 100
             final IntelligentCommandContext context) {
101 101
         final AdditionalTabTargets res = new AdditionalTabTargets();
102
-        
102
+
103 103
         if (arg == 0) {
104 104
             res.add("--clear");
105 105
         }

+ 8
- 8
src/com/dmdirc/commandparser/commands/global/NewServer.java ファイルの表示

@@ -152,8 +152,8 @@ public final class NewServer extends Command implements IntelligentCommand,
152 152
         // Check for SSL
153 153
         if (args.getArguments()[offset].equalsIgnoreCase("--ssl")) {
154 154
             Logger.userError(ErrorLevel.LOW,
155
-                    "Using /newserver --ssl is deprecated, and may be removed in the future." +
156
-                    " Use /newserver <host>:+<port> instead.");
155
+                    "Using /newserver --ssl is deprecated, and may be removed in the future."
156
+                    + " Use /newserver <host>:+<port> instead.");
157 157
 
158 158
             ssl = true;
159 159
             offset++;
@@ -167,8 +167,8 @@ public final class NewServer extends Command implements IntelligentCommand,
167 167
                 if (origin != null) {
168 168
                     origin.addLine(FORMAT_ERROR, "Invalid port specified");
169 169
                 } else {
170
-                    Logger.userError(ErrorLevel.LOW, "Invalid port specified " +
171
-                            "in newserver command");
170
+                    Logger.userError(ErrorLevel.LOW, "Invalid port specified "
171
+                            + "in newserver command");
172 172
                 }
173 173
                 return null;
174 174
             }
@@ -185,16 +185,16 @@ public final class NewServer extends Command implements IntelligentCommand,
185 185
                 if (origin != null) {
186 186
                     origin.addLine(FORMAT_ERROR, "Invalid port specified");
187 187
                 } else {
188
-                    Logger.userError(ErrorLevel.LOW, "Invalid port specified " +
189
-                            "in newserver command");
188
+                    Logger.userError(ErrorLevel.LOW, "Invalid port specified "
189
+                            + "in newserver command");
190 190
                 }
191 191
                 return null;
192 192
             }
193 193
 
194 194
             if (port <= 0 || port > 65535) {
195 195
                 if (origin == null) {
196
-                    Logger.userError(ErrorLevel.LOW, "Port must be between 1 " +
197
-                            "and 65535 in newserver command");
196
+                    Logger.userError(ErrorLevel.LOW, "Port must be between 1 "
197
+                            + "and 65535 in newserver command");
198 198
                 } else if (!args.isSilent()) {
199 199
                     origin.addLine(FORMAT_ERROR, "Port must be between 1 and 65535");
200 200
                 }

+ 14
- 14
src/com/dmdirc/commandparser/commands/global/Notify.java ファイルの表示

@@ -38,21 +38,21 @@ import java.awt.Color;
38 38
 /**
39 39
  * The notify command allows the user to set the notification colour for a
40 40
  * window.
41
- * 
41
+ *
42 42
  * @author chris
43 43
  */
44 44
 public final class Notify extends Command implements IntelligentCommand,
45 45
         CommandInfo {
46
-    
46
+
47 47
     /**
48 48
      * Creates a new instance of Notify.
49 49
      */
50 50
     public Notify() {
51 51
         super();
52
-        
52
+
53 53
         CommandManager.registerCommand(this);
54 54
     }
55
-    
55
+
56 56
     /** {@inheritDoc} */
57 57
     @Override
58 58
     public void execute(final FrameContainer<?> origin,
@@ -61,26 +61,26 @@ public final class Notify extends Command implements IntelligentCommand,
61 61
             showUsage(origin, args.isSilent(), "notify", "<colour>");
62 62
             return;
63 63
         }
64
-        
64
+
65 65
         final Color colour = ColourManager.parseColour(args.getArguments()[0], null);
66
-        
66
+
67 67
         if (colour == null) {
68 68
             showUsage(origin, args.isSilent(), "notify",
69
-                    "<colour> - colour must be an IRC colour code (0-15) or a " +
70
-                    "hex string (e.g. FFFF00).");
71
-        } else if (origin != null) {            
69
+                    "<colour> - colour must be an IRC colour code (0-15) or a "
70
+                    + "hex string (e.g. FFFF00).");
71
+        } else if (origin != null) {
72 72
             // There's not much point echoing an error if the origin isn't
73 73
             // valid, as errors go to the origin!
74 74
             origin.sendNotification(colour);
75 75
         }
76 76
     }
77
-    
77
+
78 78
     /** {@inheritDoc} */
79 79
     @Override
80 80
     public String getName() {
81 81
         return "notify";
82 82
     }
83
-    
83
+
84 84
     /** {@inheritDoc} */
85 85
     @Override
86 86
     public boolean showInHelp() {
@@ -92,7 +92,7 @@ public final class Notify extends Command implements IntelligentCommand,
92 92
     public CommandType getType() {
93 93
         return CommandType.TYPE_GLOBAL;
94 94
     }
95
-    
95
+
96 96
     /** {@inheritDoc} */
97 97
     @Override
98 98
     public String getHelp() {
@@ -104,6 +104,6 @@ public final class Notify extends Command implements IntelligentCommand,
104 104
     public AdditionalTabTargets getSuggestions(final int arg,
105 105
             final IntelligentCommandContext context) {
106 106
         return new AdditionalTabTargets().excludeAll();
107
-    } 
108
-    
107
+    }
108
+
109 109
 }

+ 10
- 10
src/com/dmdirc/commandparser/commands/global/OpenWindow.java ファイルの表示

@@ -36,17 +36,17 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
36 36
 
37 37
 /**
38 38
  * Opens a new window.
39
- * 
39
+ *
40 40
  * @author chris
41 41
  */
42 42
 public class OpenWindow extends Command implements IntelligentCommand, CommandInfo {
43
-    
43
+
44 44
     /**
45 45
      * Creates a new instance of OpenWindow.
46 46
      */
47 47
     public OpenWindow() {
48 48
         CommandManager.registerCommand(this);
49
-    }    
49
+    }
50 50
 
51 51
     /** {@inheritDoc} */
52 52
     @Override
@@ -74,15 +74,15 @@ public class OpenWindow extends Command implements IntelligentCommand, CommandIn
74 74
                     "[--server|--child] <name> [title]");
75 75
         } else {
76 76
             final FrameContainer<?> window;
77
-            
77
+
78 78
             if (parent == null) {
79 79
                 window = WindowManager.findCustomWindow(args.getArguments()[start]);
80 80
             } else {
81 81
                 window = WindowManager.findCustomWindow(parent, args.getArguments()[start]);
82 82
             }
83
-            
84
-            final String title = args.getArguments().length > start + 1 ?
85
-                args.getArgumentsAsString(start + 1): args.getArguments()[start];
83
+
84
+            final String title = args.getArguments().length > start + 1
85
+                ? args.getArgumentsAsString(start + 1) : args.getArguments()[start];
86 86
 
87 87
             if (window == null) {
88 88
                 if (parent == null) {
@@ -127,13 +127,13 @@ public class OpenWindow extends Command implements IntelligentCommand, CommandIn
127 127
     public AdditionalTabTargets getSuggestions(final int arg,
128 128
             final IntelligentCommandContext context) {
129 129
         final AdditionalTabTargets res = new AdditionalTabTargets();
130
-        
130
+
131 131
         if (arg == 0) {
132 132
             res.add("--server");
133 133
             res.add("--child");
134 134
         }
135
-        
135
+
136 136
         return res;
137
-    } 
137
+    }
138 138
 
139 139
 }

+ 11
- 11
src/com/dmdirc/commandparser/commands/global/ReloadPlugin.java ファイルの表示

@@ -36,21 +36,21 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
36 36
 
37 37
 /**
38 38
  * Allows the user to reload a plugin.
39
- * 
39
+ *
40 40
  * @author chris
41 41
  */
42 42
 public final class ReloadPlugin extends Command implements IntelligentCommand,
43 43
         CommandInfo {
44
-    
44
+
45 45
     /**
46 46
      * Creates a new instance of ReloadPlugin.
47 47
      */
48 48
     public ReloadPlugin() {
49 49
         super();
50
-        
50
+
51 51
         CommandManager.registerCommand(this);
52 52
     }
53
-    
53
+
54 54
     /** {@inheritDoc} */
55 55
     @Override
56 56
     public void execute(final FrameContainer<?> origin,
@@ -59,7 +59,7 @@ public final class ReloadPlugin extends Command implements IntelligentCommand,
59 59
             showUsage(origin, args.isSilent(), "reloadplugin", "<plugin>");
60 60
             return;
61 61
         }
62
-        
62
+
63 63
         final PluginInfo plugin = PluginManager.getPluginManager()
64 64
                 .getPluginInfoByName(args.getArguments()[0]);
65 65
         if (plugin == null) {
@@ -71,13 +71,13 @@ public final class ReloadPlugin extends Command implements IntelligentCommand,
71 71
             sendLine(origin, args.isSilent(), FORMAT_ERROR, "Plugin Reloading failed");
72 72
         }
73 73
     }
74
-    
74
+
75 75
     /** {@inheritDoc} */
76 76
     @Override
77 77
     public String getName() {
78 78
         return "reloadplugin";
79 79
     }
80
-    
80
+
81 81
     /** {@inheritDoc} */
82 82
     @Override
83 83
     public boolean showInHelp() {
@@ -89,7 +89,7 @@ public final class ReloadPlugin extends Command implements IntelligentCommand,
89 89
     public CommandType getType() {
90 90
         return CommandType.TYPE_GLOBAL;
91 91
     }
92
-    
92
+
93 93
     /** {@inheritDoc} */
94 94
     @Override
95 95
     public String getHelp() {
@@ -101,14 +101,14 @@ public final class ReloadPlugin extends Command implements IntelligentCommand,
101 101
     public AdditionalTabTargets getSuggestions(final int arg,
102 102
             final IntelligentCommandContext context) {
103 103
         final AdditionalTabTargets res = new AdditionalTabTargets().excludeAll();
104
-        
104
+
105 105
         if (arg == 0) {
106 106
             for (PluginInfo possPlugin : PluginManager.getPluginManager().getPluginInfos()) {
107 107
                 res.add(possPlugin.getName());
108 108
             }
109 109
         }
110
-        
110
+
111 111
         return res;
112 112
     }
113
-    
113
+
114 114
 }

+ 11
- 11
src/com/dmdirc/commandparser/commands/global/SaveConfig.java ファイルの表示

@@ -35,37 +35,37 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
35 35
 
36 36
 /**
37 37
  * Allows the user to save the config file.
38
- * 
38
+ *
39 39
  * @author chris
40 40
  */
41 41
 public final class SaveConfig extends Command implements IntelligentCommand,
42 42
         CommandInfo {
43
-    
43
+
44 44
     /**
45 45
      * Creates a new instance of SaveConfig.
46 46
      */
47 47
     public SaveConfig() {
48 48
         super();
49
-        
49
+
50 50
         CommandManager.registerCommand(this);
51 51
     }
52
-    
52
+
53 53
     /** {@inheritDoc} */
54 54
     @Override
55 55
     public void execute(final FrameContainer<?> origin,
56 56
             final CommandArguments args, final CommandContext context) {
57 57
         IdentityManager.save();
58
-        
58
+
59 59
         sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Configuration file saved.");
60 60
     }
61
-    
62
-    
61
+
62
+
63 63
     /** {@inheritDoc} */
64 64
     @Override
65 65
     public String getName() {
66 66
         return "saveconfig";
67 67
     }
68
-    
68
+
69 69
     /** {@inheritDoc} */
70 70
     @Override
71 71
     public boolean showInHelp() {
@@ -77,7 +77,7 @@ public final class SaveConfig extends Command implements IntelligentCommand,
77 77
     public CommandType getType() {
78 78
         return CommandType.TYPE_GLOBAL;
79 79
     }
80
-    
80
+
81 81
     /** {@inheritDoc} */
82 82
     @Override
83 83
     public String getHelp() {
@@ -89,6 +89,6 @@ public final class SaveConfig extends Command implements IntelligentCommand,
89 89
     public AdditionalTabTargets getSuggestions(final int arg,
90 90
             final IntelligentCommandContext context) {
91 91
         return new AdditionalTabTargets().excludeAll();
92
-    } 
93
-    
92
+    }
93
+
94 94
 }

+ 5
- 5
src/com/dmdirc/commandparser/commands/global/Set.java ファイルの表示

@@ -188,8 +188,8 @@ public final class Set extends Command implements IntelligentCommand, CommandInf
188 188
             final String domain, final String option, final String newvalue) {
189 189
         identity.setOption(domain, option, newvalue);
190 190
 
191
-        sendLine(origin, isSilent, FORMAT_OUTPUT, domain + "." + option +
192
-                " has been set to: " + newvalue);
191
+        sendLine(origin, isSilent, FORMAT_OUTPUT, domain + "." + option
192
+                + " has been set to: " + newvalue);
193 193
     }
194 194
 
195 195
     /**
@@ -205,10 +205,10 @@ public final class Set extends Command implements IntelligentCommand, CommandInf
205 205
      */
206 206
     private void doAppendOption(final FrameContainer<?> origin,
207 207
             final boolean isSilent, final Identity identity, final ConfigManager manager,
208
-            final String domain,final String option, final String data) {
208
+            final String domain, final String option, final String data) {
209 209
         doSetOption(origin, isSilent, identity, domain, option,
210
-                (manager.hasOptionString(domain, option) ?
211
-                    manager.getOption(domain, option) : "") + data);
210
+                (manager.hasOptionString(domain, option)
211
+                ? manager.getOption(domain, option) : "") + data);
212 212
     }
213 213
 
214 214
     /**

+ 12
- 12
src/com/dmdirc/commandparser/commands/global/UnloadPlugin.java ファイルの表示

@@ -36,21 +36,21 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
36 36
 
37 37
 /**
38 38
  * Allows the user to unload a plugin.
39
- * 
39
+ *
40 40
  * @author chris
41 41
  */
42 42
 public final class UnloadPlugin extends Command implements IntelligentCommand,
43 43
         CommandInfo {
44
-    
44
+
45 45
     /**
46 46
      * Creates a new instance of UnloadPlugin.
47 47
      */
48 48
     public UnloadPlugin() {
49 49
         super();
50
-        
50
+
51 51
         CommandManager.registerCommand(this);
52 52
     }
53
-    
53
+
54 54
     /** {@inheritDoc} */
55 55
     @Override
56 56
     public void execute(final FrameContainer<?> origin,
@@ -59,7 +59,7 @@ public final class UnloadPlugin extends Command implements IntelligentCommand,
59 59
             showUsage(origin, args.isSilent(), "unloadplugin", "<plugin>");
60 60
             return;
61 61
         }
62
-        
62
+
63 63
         final PluginInfo plugin = PluginManager.getPluginManager()
64 64
                 .getPluginInfoByName(args.getArguments()[0]);
65 65
         if (plugin == null) {
@@ -71,13 +71,13 @@ public final class UnloadPlugin extends Command implements IntelligentCommand,
71 71
             sendLine(origin, args.isSilent(), FORMAT_ERROR, "Plugin Unloading failed");
72 72
         }
73 73
     }
74
-    
74
+
75 75
     /** {@inheritDoc} */
76 76
     @Override
77 77
     public String getName() {
78 78
         return "unloadplugin";
79 79
     }
80
-    
80
+
81 81
     /** {@inheritDoc} */
82 82
     @Override
83 83
     public boolean showInHelp() {
@@ -89,7 +89,7 @@ public final class UnloadPlugin extends Command implements IntelligentCommand,
89 89
     public CommandType getType() {
90 90
         return CommandType.TYPE_GLOBAL;
91 91
     }
92
-    
92
+
93 93
     /** {@inheritDoc} */
94 94
     @Override
95 95
     public String getHelp() {
@@ -101,16 +101,16 @@ public final class UnloadPlugin extends Command implements IntelligentCommand,
101 101
     public AdditionalTabTargets getSuggestions(final int arg,
102 102
             final IntelligentCommandContext context) {
103 103
         final AdditionalTabTargets res = new AdditionalTabTargets().excludeAll();
104
-        
105
-        if (arg == 0) {            
104
+
105
+        if (arg == 0) {
106 106
             for (PluginInfo possPlugin : PluginManager.getPluginManager().getPluginInfos()) {
107 107
                 if (possPlugin.isLoaded()) {
108 108
                     res.add(possPlugin.getName());
109 109
                 }
110 110
             }
111 111
         }
112
-        
112
+
113 113
         return res;
114 114
     }
115
-    
115
+
116 116
 }

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/AllChannels.java ファイルの表示

@@ -85,8 +85,8 @@ public final class AllChannels extends Command implements IntelligentCommand,
85 85
     /** {@inheritDoc} */
86 86
     @Override
87 87
     public String getHelp() {
88
-        return "allchannels <command> - executes the command as though it had" +
89
-                "been entered on all channels";
88
+        return "allchannels <command> - executes the command as though it had"
89
+                + " been entered on all channels";
90 90
     }
91 91
 
92 92
     /** {@inheritDoc} */

+ 8
- 8
src/com/dmdirc/commandparser/commands/server/Back.java ファイルの表示

@@ -41,16 +41,16 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
41 41
  */
42 42
 @CommandOptions(allowOffline=false)
43 43
 public final class Back extends Command implements IntelligentCommand, CommandInfo {
44
-    
44
+
45 45
     /**
46 46
      * Creates a new instance of Back.
47 47
      */
48 48
     public Back() {
49 49
         super();
50
-        
50
+
51 51
         CommandManager.registerCommand(this);
52 52
     }
53
-    
53
+
54 54
     /** {@inheritDoc} */
55 55
     @Override
56 56
     public void execute(final FrameContainer<?> origin,
@@ -58,14 +58,14 @@ public final class Back extends Command implements IntelligentCommand, CommandIn
58 58
         final Server server = ((ServerCommandContext) context).getServer();
59 59
         server.getParser().getLocalClient().setBack();
60 60
     }
61
-    
62
-    
61
+
62
+
63 63
     /** {@inheritDoc}. */
64 64
     @Override
65 65
     public String getName() {
66 66
         return "back";
67 67
     }
68
-    
68
+
69 69
     /** {@inheritDoc}. */
70 70
     @Override
71 71
     public boolean showInHelp() {
@@ -77,7 +77,7 @@ public final class Back extends Command implements IntelligentCommand, CommandIn
77 77
     public CommandType getType() {
78 78
         return CommandType.TYPE_SERVER;
79 79
     }
80
-    
80
+
81 81
     /** {@inheritDoc}. */
82 82
     @Override
83 83
     public String getHelp() {
@@ -90,5 +90,5 @@ public final class Back extends Command implements IntelligentCommand, CommandIn
90 90
             final IntelligentCommandContext context) {
91 91
         return new AdditionalTabTargets().excludeAll();
92 92
     }
93
-    
93
+
94 94
 }

+ 8
- 8
src/com/dmdirc/commandparser/commands/server/ChangeServer.java ファイルの表示

@@ -38,20 +38,20 @@ import java.net.URISyntaxException;
38 38
 
39 39
 /**
40 40
  * The /server command allows the user to connect to a new server.
41
- * 
41
+ *
42 42
  * @author chris
43 43
  */
44 44
 public final class ChangeServer extends Command implements CommandInfo {
45
-    
45
+
46 46
     /**
47 47
      * Creates a new instance of ChangeServer.
48 48
      */
49 49
     public ChangeServer() {
50 50
         super();
51
-        
51
+
52 52
         CommandManager.registerCommand(this);
53 53
     }
54
-    
54
+
55 55
     /** {@inheritDoc} */
56 56
     @Override
57 57
     public void execute(final FrameContainer<?> origin,
@@ -79,13 +79,13 @@ public final class ChangeServer extends Command implements CommandInfo {
79 79
 
80 80
         server.connect(address, server.getProfile());
81 81
     }
82
-    
82
+
83 83
     /** {@inheritDoc} */
84 84
     @Override
85 85
     public String getName() {
86 86
         return "server";
87 87
     }
88
-    
88
+
89 89
     /** {@inheritDoc} */
90 90
     @Override
91 91
     public boolean showInHelp() {
@@ -97,11 +97,11 @@ public final class ChangeServer extends Command implements CommandInfo {
97 97
     public CommandType getType() {
98 98
         return CommandType.TYPE_SERVER;
99 99
     }
100
-    
100
+
101 101
     /** {@inheritDoc} */
102 102
     @Override
103 103
     public String getHelp() {
104 104
         return "server <host[:[+]port]> [password] - connect to a different server";
105 105
     }
106
-    
106
+
107 107
 }

+ 10
- 10
src/com/dmdirc/commandparser/commands/server/Disconnect.java ファイルの表示

@@ -37,39 +37,39 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
37 37
  * @author chris
38 38
  */
39 39
 public final class Disconnect extends Command implements CommandInfo {
40
-    
40
+
41 41
     /**
42 42
      * Creates a new instance of Disconnect.
43 43
      */
44 44
     public Disconnect() {
45 45
         super();
46
-        
46
+
47 47
         CommandManager.registerCommand(this);
48 48
     }
49
-    
49
+
50 50
     /** {@inheritDoc} */
51 51
     @Override
52 52
     public void execute(final FrameContainer<?> origin,
53 53
             final CommandArguments args, final CommandContext context) {
54 54
         final Server server = ((ServerCommandContext) context).getServer();
55 55
         final String line;
56
-        
56
+
57 57
         if (args.getArguments().length == 0) {
58 58
             line = origin.getConfigManager().getOption("general", "quitmessage");
59 59
         } else {
60 60
             line = args.getArgumentsAsString();
61 61
         }
62
-        
62
+
63 63
         server.disconnect(line);
64 64
     }
65
-    
66
-    
65
+
66
+
67 67
     /** {@inheritDoc} */
68 68
     @Override
69 69
     public String getName() {
70 70
         return "disconnect";
71 71
     }
72
-    
72
+
73 73
     /** {@inheritDoc} */
74 74
     @Override
75 75
     public boolean showInHelp() {
@@ -81,11 +81,11 @@ public final class Disconnect extends Command implements CommandInfo {
81 81
     public CommandType getType() {
82 82
         return CommandType.TYPE_SERVER;
83 83
     }
84
-    
84
+
85 85
     /** {@inheritDoc} */
86 86
     @Override
87 87
     public String getHelp() {
88 88
         return "disconnect [reason] - disconnect from this server";
89 89
     }
90
-    
90
+
91 91
 }

+ 8
- 8
src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java ファイルの表示

@@ -56,17 +56,17 @@ public class JoinChannelCommand extends Command implements
56 56
     /** A map of channel name mentions. */
57 57
     private final MapList<FrameContainer<?>, String> mentions
58 58
             = new MapList<FrameContainer<?>, String>();
59
-    
59
+
60 60
     /**
61 61
      * Creates a new instance of the join channel command.
62 62
      */
63 63
     public JoinChannelCommand() {
64 64
         super();
65
-        
65
+
66 66
         CommandManager.registerCommand(this);
67 67
         ActionManager.addListener(this, CoreActionType.CLIENT_LINE_ADDED);
68 68
     }
69
-    
69
+
70 70
     /** {@inheritDoc} */
71 71
     @Override
72 72
     public void execute(final FrameContainer<?> origin,
@@ -92,14 +92,14 @@ public class JoinChannelCommand extends Command implements
92 92
 
93 93
         server.join(!args.isSilent(), channels.toArray(new ChannelJoinRequest[0]));
94 94
     }
95
-    
96
-    
95
+
96
+
97 97
     /** {@inheritDoc} */
98 98
     @Override
99 99
     public String getName() {
100 100
         return "join";
101 101
     }
102
-    
102
+
103 103
     /** {@inheritDoc} */
104 104
     @Override
105 105
     public boolean showInHelp() {
@@ -111,7 +111,7 @@ public class JoinChannelCommand extends Command implements
111 111
     public CommandType getType() {
112 112
         return CommandType.TYPE_SERVER;
113 113
     }
114
-    
114
+
115 115
     /** {@inheritDoc} */
116 116
     @Override
117 117
     public String getHelp() {
@@ -208,5 +208,5 @@ public class JoinChannelCommand extends Command implements
208 208
 
209 209
         return results;
210 210
     }
211
-    
211
+
212 212
 }

+ 12
- 12
src/com/dmdirc/commandparser/commands/server/Nick.java ファイルの表示

@@ -43,16 +43,16 @@ import com.dmdirc.ui.input.TabCompletionType;
43 43
 @CommandOptions(allowOffline=false)
44 44
 public final class Nick extends Command implements IntelligentCommand,
45 45
         CommandInfo {
46
-    
46
+
47 47
     /**
48 48
      * Creates a new instance of Nick.
49 49
      */
50 50
     public Nick() {
51 51
         super();
52
-        
52
+
53 53
         CommandManager.registerCommand(this);
54 54
     }
55
-    
55
+
56 56
     /** {@inheritDoc} */
57 57
     @Override
58 58
     public void execute(final FrameContainer<?> origin,
@@ -62,17 +62,17 @@ public final class Nick extends Command implements IntelligentCommand,
62 62
             showUsage(origin, args.isSilent(), "nick", "<new nickname>");
63 63
             return;
64 64
         }
65
-        
65
+
66 66
         server.getParser().getLocalClient().setNickname(args.getArguments()[0]);
67 67
     }
68
-    
69
-    
68
+
69
+
70 70
     /** {@inheritDoc} */
71 71
     @Override
72 72
     public String getName() {
73 73
         return "nick";
74 74
     }
75
-    
75
+
76 76
     /** {@inheritDoc} */
77 77
     @Override
78 78
     public boolean showInHelp() {
@@ -84,7 +84,7 @@ public final class Nick extends Command implements IntelligentCommand,
84 84
     public CommandType getType() {
85 85
         return CommandType.TYPE_SERVER;
86 86
     }
87
-    
87
+
88 88
     /** {@inheritDoc} */
89 89
     @Override
90 90
     public String getHelp() {
@@ -96,14 +96,14 @@ public final class Nick extends Command implements IntelligentCommand,
96 96
     public AdditionalTabTargets getSuggestions(final int arg,
97 97
             final IntelligentCommandContext context) {
98 98
         final AdditionalTabTargets res = new AdditionalTabTargets();
99
-        
99
+
100 100
         res.exclude(TabCompletionType.COMMAND);
101
-        
101
+
102 102
         if (arg > 0) {
103 103
             res.excludeAll();
104 104
         }
105
-        
105
+
106 106
         return res;
107 107
     }
108
-    
108
+
109 109
 }

+ 10
- 10
src/com/dmdirc/commandparser/commands/server/Notice.java ファイルの表示

@@ -43,16 +43,16 @@ import com.dmdirc.ui.input.TabCompletionType;
43 43
 @CommandOptions(allowOffline=false)
44 44
 public final class Notice extends Command implements IntelligentCommand,
45 45
         CommandInfo {
46
-    
46
+
47 47
     /**
48 48
      * Creates a new instance of Notice.
49 49
      */
50 50
     public Notice() {
51 51
         super();
52
-        
52
+
53 53
         CommandManager.registerCommand(this);
54 54
     }
55
-    
55
+
56 56
     /** {@inheritDoc} */
57 57
     @Override
58 58
     public void execute(final FrameContainer<?> origin,
@@ -67,14 +67,14 @@ public final class Notice extends Command implements IntelligentCommand,
67 67
                     args.getArgumentsAsString(1));
68 68
         }
69 69
     }
70
-    
71
-    
70
+
71
+
72 72
     /** {@inheritDoc} */
73 73
     @Override
74 74
     public String getName() {
75 75
         return "notice";
76 76
     }
77
-    
77
+
78 78
     /** {@inheritDoc} */
79 79
     @Override
80 80
     public boolean showInHelp() {
@@ -86,7 +86,7 @@ public final class Notice extends Command implements IntelligentCommand,
86 86
     public CommandType getType() {
87 87
         return CommandType.TYPE_SERVER;
88 88
     }
89
-    
89
+
90 90
     /** {@inheritDoc} */
91 91
     @Override
92 92
     public String getHelp() {
@@ -98,12 +98,12 @@ public final class Notice extends Command implements IntelligentCommand,
98 98
     public AdditionalTabTargets getSuggestions(final int arg,
99 99
             final IntelligentCommandContext context) {
100 100
         final AdditionalTabTargets targets = new AdditionalTabTargets();
101
-        
101
+
102 102
         if (arg == 0) {
103 103
             targets.exclude(TabCompletionType.COMMAND);
104 104
         }
105
-        
105
+
106 106
         return targets;
107 107
     }
108
-    
108
+
109 109
 }

+ 13
- 13
src/com/dmdirc/commandparser/commands/server/OpenQuery.java ファイルの表示

@@ -44,16 +44,16 @@ import com.dmdirc.ui.messages.Styliser;
44 44
  */
45 45
 public final class OpenQuery extends Command implements IntelligentCommand,
46 46
         WrappableCommand, CommandInfo {
47
-    
47
+
48 48
     /**
49 49
      * Creates a new instance of Query.
50 50
      */
51 51
     public OpenQuery() {
52 52
         super();
53
-        
53
+
54 54
         CommandManager.registerCommand(this);
55 55
     }
56
-    
56
+
57 57
     /** {@inheritDoc} */
58 58
     @Override
59 59
     public void execute(final FrameContainer<?> origin,
@@ -63,7 +63,7 @@ public final class OpenQuery extends Command implements IntelligentCommand,
63 63
             showUsage(origin, args.isSilent(), "query", "<target> <message>");
64 64
             return;
65 65
         }
66
-            
66
+
67 67
         if (server.getParser().isValidChannelName(args.getArguments()[0])) {
68 68
             sendLine(origin, args.isSilent(), FORMAT_ERROR, "You can't open a query "
69 69
                     + "with a channel; maybe you meant " + Styliser.CODE_FIXED
@@ -83,14 +83,14 @@ public final class OpenQuery extends Command implements IntelligentCommand,
83 83
                     args.getArguments()[0]);
84 84
         }
85 85
     }
86
-    
87
-    
86
+
87
+
88 88
     /** {@inheritDoc} */
89 89
     @Override
90 90
     public String getName() {
91 91
         return "query";
92 92
     }
93
-    
93
+
94 94
     /** {@inheritDoc} */
95 95
     @Override
96 96
     public boolean showInHelp() {
@@ -102,27 +102,27 @@ public final class OpenQuery extends Command implements IntelligentCommand,
102 102
     public CommandType getType() {
103 103
         return CommandType.TYPE_SERVER;
104 104
     }
105
-    
105
+
106 106
     /** {@inheritDoc} */
107 107
     @Override
108 108
     public String getHelp() {
109 109
         return "query <user> [message] - opens a query with the specified user";
110 110
     }
111
-    
111
+
112 112
     /** {@inheritDoc} */
113 113
     @Override
114 114
     public AdditionalTabTargets getSuggestions(final int arg,
115 115
             final IntelligentCommandContext context) {
116 116
         final AdditionalTabTargets targets = new AdditionalTabTargets();
117
-        
117
+
118 118
         if (arg == 0) {
119 119
             targets.excludeAll();
120 120
             targets.include(TabCompletionType.CHANNEL_NICK);
121 121
         }
122
-        
122
+
123 123
         return targets;
124 124
     }
125
-    
125
+
126 126
     /** {@inheritDoc} */
127 127
     @Override
128 128
     public int getLineCount(final InputWindow origin, final CommandArguments arguments) {
@@ -134,5 +134,5 @@ public final class OpenQuery extends Command implements IntelligentCommand,
134 134
             return 1;
135 135
         }
136 136
     }
137
-    
137
+
138 138
 }

+ 9
- 9
src/com/dmdirc/commandparser/commands/server/Raw.java ファイルの表示

@@ -40,34 +40,34 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
40 40
  */
41 41
 @CommandOptions(allowOffline=false)
42 42
 public final class Raw extends Command implements CommandInfo {
43
-    
43
+
44 44
     /**
45 45
      * Creates a new instance of Raw.
46 46
      */
47 47
     public Raw() {
48 48
         super();
49
-        
49
+
50 50
         CommandManager.registerCommand(this);
51 51
     }
52
-    
52
+
53 53
     /** {@inheritDoc} */
54 54
     @Override
55 55
     public void execute(final FrameContainer<?> origin,
56 56
             final CommandArguments args, final CommandContext context) {
57 57
         final Server server = ((ServerCommandContext) context).getServer();
58 58
         final String line = args.getArgumentsAsString();
59
-        
59
+
60 60
         server.getParser().sendRawMessage(line);
61 61
         sendLine(origin, args.isSilent(), "rawCommand", line);
62 62
     }
63
-    
64
-    
63
+
64
+
65 65
     /** {@inheritDoc} */
66 66
     @Override
67 67
     public String getName() {
68 68
         return "raw";
69 69
     }
70
-    
70
+
71 71
     /** {@inheritDoc} */
72 72
     @Override
73 73
     public boolean showInHelp() {
@@ -79,11 +79,11 @@ public final class Raw extends Command implements CommandInfo {
79 79
     public CommandType getType() {
80 80
         return CommandType.TYPE_SERVER;
81 81
     }
82
-    
82
+
83 83
     /** {@inheritDoc} */
84 84
     @Override
85 85
     public String getHelp() {
86 86
         return "raw <text> - sends the specified text directly to the server";
87 87
     }
88
-    
88
+
89 89
 }

+ 12
- 12
src/com/dmdirc/commandparser/commands/server/RawServerCommand.java ファイルの表示

@@ -36,28 +36,28 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
36 36
 /**
37 37
  * Implements a raw server command (i.e., a command that is sent to the server
38 38
  * as-is.
39
- * 
39
+ *
40 40
  * @author chris
41 41
  */
42 42
 @CommandOptions(allowOffline=false)
43 43
 public final class RawServerCommand extends Command implements CommandInfo {
44
-    
44
+
45 45
     /** The name of this raw command. */
46 46
     private final String myName;
47
-    
47
+
48 48
     /**
49 49
      * Creates a new instance of RawServerCommand.
50
-     * 
50
+     *
51 51
      * @param command The command name for this raw command
52 52
      */
53 53
     public RawServerCommand(final String command) {
54 54
         super();
55
-        
55
+
56 56
         myName = command;
57
-        
57
+
58 58
         CommandManager.registerCommand(this);
59 59
     }
60
-    
60
+
61 61
     /** {@inheritDoc} */
62 62
     @Override
63 63
     public void execute(final FrameContainer<?> origin,
@@ -65,14 +65,14 @@ public final class RawServerCommand extends Command implements CommandInfo {
65 65
         final Server server = ((ServerCommandContext) context).getServer();
66 66
         server.getParser().sendRawMessage(myName.toUpperCase() + " " + args.getArgumentsAsString());
67 67
     }
68
-    
69
-    
68
+
69
+
70 70
     /** {@inheritDoc} */
71 71
     @Override
72 72
     public String getName() {
73 73
         return myName;
74 74
     }
75
-    
75
+
76 76
     /** {@inheritDoc} */
77 77
     @Override
78 78
     public boolean showInHelp() {
@@ -84,11 +84,11 @@ public final class RawServerCommand extends Command implements CommandInfo {
84 84
     public CommandType getType() {
85 85
         return CommandType.TYPE_SERVER;
86 86
     }
87
-    
87
+
88 88
     /** {@inheritDoc} */
89 89
     @Override
90 90
     public String getHelp() {
91 91
         return myName + " [arguments] - sends a " + myName + " command to the server";
92 92
     }
93
-    
93
+
94 94
 }

+ 10
- 10
src/com/dmdirc/commandparser/commands/server/Reconnect.java ファイルの表示

@@ -37,39 +37,39 @@ import com.dmdirc.commandparser.commands.context.ServerCommandContext;
37 37
  * @author chris
38 38
  */
39 39
 public final class Reconnect extends Command implements CommandInfo {
40
-    
40
+
41 41
     /**
42 42
      * Creates a new instance of Reconnect.
43 43
      */
44 44
     public Reconnect() {
45 45
         super();
46
-        
46
+
47 47
         CommandManager.registerCommand(this);
48 48
     }
49
-    
49
+
50 50
     /** {@inheritDoc} */
51 51
     @Override
52 52
     public void execute(final FrameContainer<?> origin,
53 53
             final CommandArguments args, final CommandContext context) {
54 54
         final Server server = ((ServerCommandContext) context).getServer();
55 55
         final String line;
56
-        
56
+
57 57
         if (args.getArguments().length == 0) {
58 58
             line = origin.getConfigManager().getOption("general", "reconnectmessage");
59 59
         } else {
60 60
             line = args.getArgumentsAsString();
61 61
         }
62
-        
62
+
63 63
         server.reconnect(line);
64 64
     }
65
-    
66
-    
65
+
66
+
67 67
     /** {@inheritDoc} */
68 68
     @Override
69 69
     public String getName() {
70 70
         return "reconnect";
71 71
     }
72
-    
72
+
73 73
     /** {@inheritDoc} */
74 74
     @Override
75 75
     public boolean showInHelp() {
@@ -81,11 +81,11 @@ public final class Reconnect extends Command implements CommandInfo {
81 81
     public CommandType getType() {
82 82
         return CommandType.TYPE_SERVER;
83 83
     }
84
-    
84
+
85 85
     /** {@inheritDoc} */
86 86
     @Override
87 87
     public String getHelp() {
88 88
         return "reconnect [reason] - reconnect to this server";
89 89
     }
90
-    
90
+
91 91
 }

+ 7
- 7
src/com/dmdirc/commandparser/parsers/ChannelCommandParser.java ファイルの表示

@@ -35,23 +35,23 @@ import com.dmdirc.ui.interfaces.Window;
35 35
 
36 36
 /**
37 37
  * A command parser that is tailored for use in a channel environment.
38
- * 
38
+ *
39 39
  * @author chris
40 40
  */
41 41
 public class ChannelCommandParser extends ChatCommandParser {
42
-    
42
+
43 43
     /**
44 44
      * A version number for this class. It should be changed whenever the class
45 45
      * structure is changed (or anything else that would prevent serialized
46 46
      * objects being unserialized with the new class).
47 47
      */
48 48
     private static final long serialVersionUID = 1;
49
-    
49
+
50 50
     /**
51 51
      * The channel instance that this parser is attached to.
52 52
      */
53 53
     private Channel channel;
54
-    
54
+
55 55
     /**
56 56
      * Creates a new instance of ChannelCommandParser.
57 57
      *
@@ -70,14 +70,14 @@ public class ChannelCommandParser extends ChatCommandParser {
70 70
 
71 71
         super.setOwner(owner);
72 72
     }
73
-    
73
+
74 74
     /** {@inheritDoc} */
75 75
     @Override
76 76
     protected void loadCommands() {
77 77
         CommandManager.loadCommands(this, CommandType.TYPE_GLOBAL,
78 78
                 CommandType.TYPE_SERVER, CommandType.TYPE_CHANNEL);
79 79
     }
80
-    
80
+
81 81
     /** {@inheritDoc} */
82 82
     @Override
83 83
     protected void executeCommand(final FrameContainer<?> origin,
@@ -89,5 +89,5 @@ public class ChannelCommandParser extends ChatCommandParser {
89 89
             super.executeCommand(origin, window, commandInfo, command, args);
90 90
         }
91 91
     }
92
-    
92
+
93 93
 }

+ 9
- 9
src/com/dmdirc/commandparser/parsers/GlobalCommandParser.java ファイルの表示

@@ -38,25 +38,25 @@ import com.dmdirc.ui.interfaces.Window;
38 38
  * @author chris
39 39
  */
40 40
 public class GlobalCommandParser extends CommandParser {
41
-    
41
+
42 42
     /**
43 43
      * A version number for this class. It should be changed whenever the class
44 44
      * structure is changed (or anything else that would prevent serialized
45 45
      * objects being unserialized with the new class).
46 46
      */
47 47
     private static final long serialVersionUID = 1;
48
-    
48
+
49 49
     /**
50 50
      * The singleton instance of this command parser.
51 51
      */
52 52
     private static GlobalCommandParser me;
53
-    
53
+
54 54
     /** {@inheritDoc} */
55 55
     @Override
56 56
     public void setOwner(final FrameContainer<?> owner) {
57 57
         // Don't care
58 58
     }
59
-    
59
+
60 60
     /**
61 61
      * Retrieves a singleton instance of the global command parser.
62 62
      * @return A GlobalCommandParser
@@ -65,16 +65,16 @@ public class GlobalCommandParser extends CommandParser {
65 65
         if (me == null) {
66 66
             me = new GlobalCommandParser();
67 67
         }
68
-        
68
+
69 69
         return me;
70 70
     }
71
-    
71
+
72 72
     /** Loads the relevant commands into the parser. */
73 73
     @Override
74 74
     protected void loadCommands() {
75 75
         CommandManager.loadCommands(this, CommandType.TYPE_GLOBAL);
76 76
     }
77
-    
77
+
78 78
     /** {@inheritDoc} */
79 79
     @Override
80 80
     protected void executeCommand(final FrameContainer<?> origin,
@@ -82,7 +82,7 @@ public class GlobalCommandParser extends CommandParser {
82 82
             final Command command, final CommandArguments args) {
83 83
         command.execute(origin, args, new CommandContext(window, commandInfo));
84 84
     }
85
-    
85
+
86 86
     /**
87 87
      * Called when the input was a line of text that was not a command. This normally
88 88
      * means it is sent to the server/channel/user as-is, with no further processing.
@@ -97,5 +97,5 @@ public class GlobalCommandParser extends CommandParser {
97 97
             origin.addLine("commandError", "Invalid global command: " + line);
98 98
         }
99 99
     }
100
-    
100
+
101 101
 }

+ 5
- 5
src/com/dmdirc/commandparser/parsers/QueryCommandParser.java ファイルの表示

@@ -39,14 +39,14 @@ import com.dmdirc.ui.interfaces.Window;
39 39
  * @author chris
40 40
  */
41 41
 public class QueryCommandParser extends ChatCommandParser {
42
-    
42
+
43 43
     /**
44 44
      * A version number for this class. It should be changed whenever the class
45 45
      * structure is changed (or anything else that would prevent serialized
46 46
      * objects being unserialized with the new class).
47 47
      */
48 48
     private static final long serialVersionUID = 1;
49
-    
49
+
50 50
     /**
51 51
      * The query instance that this parser is attached to.
52 52
      */
@@ -70,14 +70,14 @@ public class QueryCommandParser extends ChatCommandParser {
70 70
 
71 71
         super.setOwner(query);
72 72
     }
73
-    
73
+
74 74
     /** Loads the relevant commands into the parser. */
75 75
     @Override
76 76
     protected void loadCommands() {
77 77
         CommandManager.loadCommands(this, CommandType.TYPE_GLOBAL,
78 78
                 CommandType.TYPE_SERVER, CommandType.TYPE_QUERY);
79 79
     }
80
-    
80
+
81 81
     /** {@inheritDoc} */
82 82
     @Override
83 83
     protected void executeCommand(final FrameContainer<?> origin,
@@ -89,5 +89,5 @@ public class QueryCommandParser extends ChatCommandParser {
89 89
             super.executeCommand(origin, window, commandInfo, command, args);
90 90
         }
91 91
     }
92
-    
92
+
93 93
 }

+ 8
- 8
src/com/dmdirc/commandparser/parsers/ServerCommandParser.java ファイルの表示

@@ -35,23 +35,23 @@ import com.dmdirc.ui.interfaces.Window;
35 35
 
36 36
 /**
37 37
  * A command parser used in the context of a server.
38
- * 
38
+ *
39 39
  * @author chris
40 40
  */
41 41
 public class ServerCommandParser extends GlobalCommandParser {
42
-    
42
+
43 43
     /**
44 44
      * A version number for this class. It should be changed whenever the class
45 45
      * structure is changed (or anything else that would prevent serialized
46 46
      * objects being unserialized with the new class).
47 47
      */
48 48
     private static final long serialVersionUID = 1;
49
-    
49
+
50 50
     /**
51 51
      * The server instance that this parser is attached to.
52 52
      */
53 53
     private Server server;
54
-    
54
+
55 55
     /** {@inheritDoc} */
56 56
     @Override
57 57
     public void setOwner(final FrameContainer<?> owner) {
@@ -61,13 +61,13 @@ public class ServerCommandParser extends GlobalCommandParser {
61 61
 
62 62
         super.setOwner(owner);
63 63
     }
64
-    
64
+
65 65
     /** Loads the relevant commands into the parser. */
66 66
     @Override
67 67
     protected void loadCommands() {
68 68
         CommandManager.loadCommands(this, CommandType.TYPE_GLOBAL, CommandType.TYPE_SERVER);
69 69
     }
70
-    
70
+
71 71
     /** {@inheritDoc} */
72 72
     @Override
73 73
     protected void executeCommand(final FrameContainer<?> origin,
@@ -88,7 +88,7 @@ public class ServerCommandParser extends GlobalCommandParser {
88 88
             super.executeCommand(origin, window, commandInfo, command, args);
89 89
         }
90 90
     }
91
-    
91
+
92 92
     /**
93 93
      * Called when the input was a line of text that was not a command. This normally
94 94
      * means it is sent to the server/channel/user as-is, with no further processing.
@@ -99,5 +99,5 @@ public class ServerCommandParser extends GlobalCommandParser {
99 99
     protected void handleNonCommand(final FrameContainer<?> origin, final String line) {
100 100
         server.sendLine(line);
101 101
     }
102
-    
102
+
103 103
 }

+ 20
- 20
src/com/dmdirc/config/CipherUtils.java ファイルの表示

@@ -52,41 +52,41 @@ import net.miginfocom.Base64;
52 52
  * Helper class to encrypt and decrypt strings, requests passwords if needed.
53 53
  */
54 54
 public class CipherUtils {
55
-    
55
+
56 56
     /** Singleton instance. */
57 57
     private static CipherUtils me;
58
-    
58
+
59 59
     /** Encryption cipher. */
60 60
     private Cipher ecipher;
61
-    
61
+
62 62
     /** Decryption cipher. */
63 63
     private Cipher dcipher;
64
-    
64
+
65 65
     /** Salt. */
66 66
     private static final byte[] SALT = {
67 67
         (byte) 0xA9, (byte) 0x9B, (byte) 0xC8, (byte) 0x32,
68 68
         (byte) 0x56, (byte) 0x35, (byte) 0xE3, (byte) 0x03,
69 69
     };
70
-    
70
+
71 71
     /** Iteration count. */
72 72
     private static final int ITERATIONS = 19;
73
-    
73
+
74 74
     /** Number of auth attemps before failing the attempt. */
75 75
     private static final int AUTH_TRIES = 4;
76
-    
76
+
77 77
     /** User password. */
78 78
     private String password;
79
-    
79
+
80 80
     /**
81 81
      * Prevents creation of a new instance of Encipher.
82 82
      */
83 83
     protected CipherUtils() {
84 84
         // Do nothing
85 85
     }
86
-    
86
+
87 87
     /**
88 88
      * Retrieves a singleton instance of CipherUtils.
89
-     * 
89
+     *
90 90
      * @return A singleton cipher utils instance.
91 91
      */
92 92
     public static CipherUtils getCipherUtils() {
@@ -94,11 +94,11 @@ public class CipherUtils {
94 94
             if (me == null) {
95 95
                 me = new CipherUtils();
96 96
             }
97
-            
97
+
98 98
             return me;
99 99
         }
100 100
     }
101
-    
101
+
102 102
     /**
103 103
      * Encrypts a string using the stored settings. Will return null if the
104 104
      * automatic user authentication fails - use checkauth and auth.
@@ -125,7 +125,7 @@ public class CipherUtils {
125 125
 
126 126
         return null;
127 127
     }
128
-    
128
+
129 129
     /**
130 130
      * Encrypts a string using the stored settings. Will return null if the
131 131
      * automatic user authentication fails - use checkauth and auth.
@@ -149,7 +149,7 @@ public class CipherUtils {
149 149
         }
150 150
         return null;
151 151
     }
152
-    
152
+
153 153
     /**
154 154
      * Performs a SHA-512 hash.
155 155
      * @param data String to hashed
@@ -166,7 +166,7 @@ public class CipherUtils {
166 166
         }
167 167
         return null;
168 168
     }
169
-    
169
+
170 170
     /**
171 171
      * Checks if a user is authed.
172 172
      *
@@ -175,7 +175,7 @@ public class CipherUtils {
175 175
     public boolean checkAuthed() {
176 176
         return dcipher != null && ecipher != null;
177 177
     }
178
-    
178
+
179 179
     /**
180 180
      * creates ciphers.
181 181
      */
@@ -213,7 +213,7 @@ public class CipherUtils {
213 213
             dcipher = null;
214 214
         }
215 215
     }
216
-    
216
+
217 217
     /**
218 218
      * Auths a user and sets the password.
219 219
      *
@@ -236,7 +236,7 @@ public class CipherUtils {
236 236
                 password = getPassword(prompt);
237 237
                 if (passwordHash == null) {
238 238
                     passwordHash = hash(password);
239
-                    IdentityManager.getConfigIdentity().setOption("encryption", 
239
+                    IdentityManager.getConfigIdentity().setOption("encryption",
240 240
                             "passwordHash", passwordHash);
241 241
                 }
242 242
                 if (!hash(password).equals(passwordHash)) {
@@ -252,10 +252,10 @@ public class CipherUtils {
252 252
         }
253 253
         return true;
254 254
     }
255
-    
255
+
256 256
     /**
257 257
      * Requests the encryption password from the user.
258
-     * 
258
+     *
259 259
      * @param prompt The prompt to show
260 260
      * @return The user-specified password
261 261
      */

+ 10
- 10
src/com/dmdirc/config/ConfigManager.java ファイルの表示

@@ -101,7 +101,7 @@ public class ConfigManager extends ConfigSource implements ConfigChangeListener,
101 101
         this.network = network;
102 102
         this.server = server;
103 103
         this.channel = chanName;
104
-        
104
+
105 105
         sources = IdentityManager.getSources(this);
106 106
 
107 107
         if (LOGGER.isLoggable(Level.FINE)) {
@@ -219,10 +219,10 @@ public class ConfigManager extends ConfigSource implements ConfigChangeListener,
219 219
 
220 220
         return null;
221 221
     }
222
-    
222
+
223 223
     /**
224 224
      * Checks whether the specified identity applies to this config manager.
225
-     * 
225
+     *
226 226
      * @param identity The identity to test
227 227
      * @return True if the identity applies, false otherwise
228 228
      */
@@ -262,7 +262,7 @@ public class ConfigManager extends ConfigSource implements ConfigChangeListener,
262 262
                     + identity.getTarget().getData() + " (" + identity + "). Result: "
263 263
                     + result);
264 264
         }
265
-        
265
+
266 266
         return result;
267 267
     }
268 268
 
@@ -285,7 +285,7 @@ public class ConfigManager extends ConfigSource implements ConfigChangeListener,
285 285
     /**
286 286
      * Called whenever there is a new identity available. Checks if the
287 287
      * identity is relevant for this manager, and adds it if it is.
288
-     * 
288
+     *
289 289
      * @param identity The identity to be checked
290 290
      */
291 291
     public void checkIdentity(final Identity identity) {
@@ -295,7 +295,7 @@ public class ConfigManager extends ConfigSource implements ConfigChangeListener,
295 295
                 identity.addListener(this);
296 296
                 Collections.sort(sources);
297 297
             }
298
-            
298
+
299 299
             // Determine which settings will have changed
300 300
             for (String domain : identity.getDomains()) {
301 301
                 for (String option : identity.getOptions(domain).keySet()) {
@@ -303,7 +303,7 @@ public class ConfigManager extends ConfigSource implements ConfigChangeListener,
303 303
                         configChanged(domain, option);
304 304
                     }
305 305
                 }
306
-            }            
306
+            }
307 307
         }
308 308
     }
309 309
 
@@ -320,7 +320,7 @@ public class ConfigManager extends ConfigSource implements ConfigChangeListener,
320 320
                 res.addAll(source.getDomains());
321 321
             }
322 322
         }
323
-        
323
+
324 324
         return res;
325 325
     }
326 326
 
@@ -368,7 +368,7 @@ public class ConfigManager extends ConfigSource implements ConfigChangeListener,
368 368
                     + this.channel + " to " + protocol + ", " + ircd + ", "
369 369
                     + network + ", " + server + ", " + channel);
370 370
         }
371
-        
371
+
372 372
         this.protocol = protocol;
373 373
         this.ircd = ircd;
374 374
         this.network = network;
@@ -495,5 +495,5 @@ public class ConfigManager extends ConfigSource implements ConfigChangeListener,
495 495
     public void identityRemoved(final Identity identity) {
496 496
         removeIdentity(identity);
497 497
     }
498
-    
498
+
499 499
 }

+ 1
- 1
src/com/dmdirc/config/Identity.java ファイルの表示

@@ -506,7 +506,7 @@ public class Identity extends ConfigSource implements Comparable<Identity> {
506 506
                         : file.getKeyDomains().entrySet()) {
507 507
                     final String domain = entry.getKey();
508 508
 
509
-                    for (Map.Entry<String, String> subentry : 
509
+                    for (Map.Entry<String, String> subentry :
510 510
                         new HashSet<Map.Entry<String, String>>(entry.getValue().entrySet())) {
511 511
                         final String key = subentry.getKey();
512 512
                         final String value = subentry.getValue();

+ 72
- 72
src/com/dmdirc/config/IdentityManager.java ファイルの表示

@@ -42,27 +42,27 @@ import java.util.LinkedHashSet;
42 42
 import java.util.List;
43 43
 import java.util.Map;
44 44
 import java.util.Set;
45
-    
45
+
46 46
 /**
47 47
  * The identity manager manages all known identities, providing easy methods
48 48
  * to access them.
49
- * 
49
+ *
50 50
  * @author chris
51 51
  */
52 52
 public final class IdentityManager {
53
-    
53
+
54 54
     /**
55 55
      * The identities that have been loaded into this manager.
56
-     * 
56
+     *
57 57
      * Standard identities are inserted with a <code>null</code> key, custom
58 58
      * identities use their custom type as the key.
59 59
      */
60 60
     private static final MapList<String, Identity> IDENTITIES
61 61
             = new MapList<String, Identity>();
62
-    
62
+
63 63
     /**
64 64
      * The {@link IdentityListener}s that have registered with this manager.
65
-     * 
65
+     *
66 66
      * Listeners for standard identities are inserted with a <code>null</code>
67 67
      * key, listeners for a specific custom type use their type as the key.
68 68
      */
@@ -72,26 +72,26 @@ public final class IdentityManager {
72 72
     /** A logger for this class. */
73 73
     private static final java.util.logging.Logger LOGGER = java.util.logging
74 74
             .Logger.getLogger(IdentityManager.class.getName());
75
-    
75
+
76 76
     /** The identity file used for the global config. */
77 77
     private static Identity config;
78
-    
78
+
79 79
     /** The identity file used for addon defaults. */
80 80
     private static Identity addonConfig;
81 81
 
82 82
     /** The identity file bundled with the client containing version info. */
83 83
     private static Identity versionConfig;
84
-    
84
+
85 85
     /** The config manager used for global settings. */
86 86
     private static ConfigManager globalconfig;
87
-    
87
+
88 88
     /** Creates a new instance of IdentityManager. */
89 89
     private IdentityManager() {
90 90
     }
91
-    
91
+
92 92
     /**
93 93
      * Loads all identity files.
94
-     * 
94
+     *
95 95
      * @throws InvalidIdentityFileException If there is an error with the config
96 96
      *                                      file.
97 97
      */
@@ -103,7 +103,7 @@ public final class IdentityManager {
103 103
         loadDefaults();
104 104
         loadUser();
105 105
         loadConfig();
106
-        
106
+
107 107
         if (getProfiles().size() == 0) {
108 108
             try {
109 109
                 Identity.buildProfile("Default Profile");
@@ -111,31 +111,31 @@ public final class IdentityManager {
111 111
                 Logger.userError(ErrorLevel.FATAL, "Unable to write default profile", ex);
112 112
             }
113 113
         }
114
-        
114
+
115 115
         // Set up the identity used for the addons defaults
116 116
         final ConfigTarget target = new ConfigTarget();
117 117
         target.setGlobalDefault();
118 118
         target.setOrder(500000);
119
-        
119
+
120 120
         final ConfigFile addonConfigFile = new ConfigFile((File) null);
121 121
         final Map<String, String> addonSettings = new HashMap<String, String>();
122 122
         addonSettings.put("name", "Addon defaults");
123 123
         addonConfigFile.addDomain("identity", addonSettings);
124
-        
124
+
125 125
         addonConfig = new Identity(addonConfigFile, target);
126 126
         IdentityManager.addIdentity(addonConfig);
127
-        
127
+
128 128
         if (!getGlobalConfig().hasOptionString("identity", "defaultsversion")) {
129 129
             Logger.userError(ErrorLevel.FATAL, "Default settings "
130 130
                     + "could not be loaded");
131 131
         }
132 132
     }
133
-    
133
+
134 134
     /** Loads the default (built in) identities. */
135 135
     private static void loadDefaults() {
136 136
         final String[] targets = {"default", "modealiases"};
137 137
         final String dir = getDirectory();
138
-        
138
+
139 139
         for (String target : targets) {
140 140
             File file = new File(dir + target);
141 141
 
@@ -191,11 +191,11 @@ public final class IdentityManager {
191 191
                     + "formatters: " + ex.getMessage());
192 192
         }
193 193
     }
194
-    
194
+
195 195
     /**
196 196
      * Extracts the specific set of default identities to the user's identity
197 197
      * folder.
198
-     * 
198
+     *
199 199
      * @param target The target to be extracted
200 200
      */
201 201
     private static void extractIdentities(final String target) {
@@ -211,17 +211,17 @@ public final class IdentityManager {
211 211
 
212 212
     /**
213 213
      * Retrieves the directory used to store identities in.
214
-     * 
214
+     *
215 215
      * @return The identity directory path
216 216
      */
217 217
     public static String getDirectory() {
218
-        return Main.getConfigDir() + "identities" + System.getProperty("file.separator"); 
218
+        return Main.getConfigDir() + "identities" + System.getProperty("file.separator");
219 219
     }
220
-    
220
+
221 221
     /** Loads user-defined identity files. */
222 222
     public static void loadUser() {
223 223
         final File dir = new File(getDirectory());
224
-        
224
+
225 225
         if (!dir.exists()) {
226 226
             try {
227 227
                 dir.mkdirs();
@@ -230,13 +230,13 @@ public final class IdentityManager {
230 230
                 Logger.userError(ErrorLevel.MEDIUM, "Unable to create identity dir");
231 231
             }
232 232
         }
233
-        
233
+
234 234
         loadUser(dir);
235 235
     }
236
-     
236
+
237 237
     /**
238 238
      * Recursively loads files from the specified directory.
239
-     * 
239
+     *
240 240
      * @param dir The directory to be loaded
241 241
      */
242 242
     @Precondition({
@@ -246,7 +246,7 @@ public final class IdentityManager {
246 246
     private static void loadUser(final File dir) {
247 247
         Logger.assertTrue(dir != null);
248 248
         Logger.assertTrue(dir.isDirectory());
249
-        
249
+
250 250
         if (dir.listFiles() == null) {
251 251
             Logger.userError(ErrorLevel.MEDIUM,
252 252
                     "Unable to load user identity files from "
@@ -261,11 +261,11 @@ public final class IdentityManager {
261 261
             }
262 262
         }
263 263
     }
264
-    
264
+
265 265
     /**
266 266
      * Loads an identity from the specified file. If the identity already
267 267
      * exists, it is told to reload instead.
268
-     * 
268
+     *
269 269
      * @param file The file to load the identity from.
270 270
      */
271 271
     private static void loadIdentity(final File file) {
@@ -286,7 +286,7 @@ public final class IdentityManager {
286 286
                 }
287 287
             }
288 288
         }
289
-        
289
+
290 290
         try {
291 291
             addIdentity(new Identity(file, false));
292 292
         } catch (InvalidIdentityFileException ex) {
@@ -341,21 +341,21 @@ public final class IdentityManager {
341 341
             Logger.appError(ErrorLevel.FATAL, "Unable to load version information", ex);
342 342
         }
343 343
     }
344
-    
344
+
345 345
     /**
346 346
      * Loads the config identity.
347
-     * 
347
+     *
348 348
      * @throws InvalidIdentityFileException if there is a problem with the
349 349
      * config file.
350 350
      */
351 351
     private static void loadConfig() throws InvalidIdentityFileException {
352 352
         try {
353 353
             final File file = new File(Main.getConfigDir() + "dmdirc.config");
354
-            
354
+
355 355
             if (!file.exists()) {
356 356
                 file.createNewFile();
357 357
             }
358
-            
358
+
359 359
             config = new Identity(file, true);
360 360
             config.setOption("identity", "name", "Global config");
361 361
             addIdentity(config);
@@ -364,7 +364,7 @@ public final class IdentityManager {
364 364
                     + ex.getMessage(), ex);
365 365
         }
366 366
     }
367
-    
367
+
368 368
     /**
369 369
      * Retrieves the identity used for the global config.
370 370
      *
@@ -373,10 +373,10 @@ public final class IdentityManager {
373 373
     public static Identity getConfigIdentity() {
374 374
         return config;
375 375
     }
376
-    
376
+
377 377
     /**
378 378
      * Retrieves the identity used for addons defaults.
379
-     * 
379
+     *
380 380
      * @return The addons defaults identity
381 381
      */
382 382
     public static Identity getAddonIdentity() {
@@ -393,7 +393,7 @@ public final class IdentityManager {
393 393
     public static Identity getVersionIdentity() {
394 394
         return versionConfig;
395 395
     }
396
-    
396
+
397 397
     /**
398 398
      * Saves all modified identity files to disk.
399 399
      */
@@ -404,7 +404,7 @@ public final class IdentityManager {
404 404
             }
405 405
         }
406 406
     }
407
-    
407
+
408 408
     /**
409 409
      * Adds the specific identity to this manager.
410 410
      * @param identity The identity to be added
@@ -431,7 +431,7 @@ public final class IdentityManager {
431 431
             }
432 432
         }
433 433
     }
434
-    
434
+
435 435
     /**
436 436
      * Removes an identity from this manager.
437 437
      * @param identity The identity to be removed
@@ -446,18 +446,18 @@ public final class IdentityManager {
446 446
         final String group = getGroup(identity);
447 447
 
448 448
         Logger.assertTrue(IDENTITIES.containsValue(group, identity));
449
-        
449
+
450 450
         synchronized (IDENTITIES) {
451 451
             IDENTITIES.remove(group, identity);
452 452
         }
453
-        
453
+
454 454
         synchronized (LISTENERS) {
455 455
             for (IdentityListener listener : LISTENERS.safeGet(group)) {
456 456
                 listener.identityRemoved(identity);
457 457
             }
458 458
         }
459 459
     }
460
-    
460
+
461 461
     /**
462 462
      * Adds a config manager to this manager.
463 463
      *
@@ -493,12 +493,12 @@ public final class IdentityManager {
493 493
     @Precondition("The specified listener is not null")
494 494
     public static void addIdentityListener(final String type, final IdentityListener listener) {
495 495
         Logger.assertTrue(listener != null);
496
-        
496
+
497 497
         synchronized (LISTENERS) {
498 498
             LISTENERS.add(type, listener);
499 499
         }
500 500
     }
501
-    
501
+
502 502
     /**
503 503
      * Retrieves a list of identities that serve as profiles.
504 504
      *
@@ -521,18 +521,18 @@ public final class IdentityManager {
521 521
     public static List<Identity> getCustomIdentities(final String type) {
522 522
         return Collections.unmodifiableList(IDENTITIES.safeGet(type));
523 523
     }
524
-    
524
+
525 525
     /**
526 526
      * Retrieves a list of all config sources that should be applied to the
527 527
      * specified config manager.
528
-     * 
528
+     *
529 529
      * @param manager The manager requesting sources
530 530
      * @return A list of all matching config sources
531 531
      */
532 532
     public static List<Identity> getSources(final ConfigManager manager) {
533
-        
533
+
534 534
         final List<Identity> sources = new ArrayList<Identity>();
535
-        
535
+
536 536
         synchronized (IDENTITIES) {
537 537
             for (Identity identity : IDENTITIES.safeGet(null)) {
538 538
                 if (manager.identityApplies(identity)) {
@@ -540,12 +540,12 @@ public final class IdentityManager {
540 540
                 }
541 541
             }
542 542
         }
543
-        
543
+
544 544
         Collections.sort(sources);
545
-        
545
+
546 546
         return sources;
547 547
     }
548
-    
548
+
549 549
     /**
550 550
      * Retrieves the global config manager.
551 551
      *
@@ -555,10 +555,10 @@ public final class IdentityManager {
555 555
         if (globalconfig == null) {
556 556
             globalconfig = new ConfigManager("", "", "", "");
557 557
         }
558
-        
558
+
559 559
         return globalconfig;
560 560
     }
561
-    
561
+
562 562
     /**
563 563
      * Retrieves the config for the specified channel@network. The config is
564 564
      * created if it doesn't exist.
@@ -576,14 +576,14 @@ public final class IdentityManager {
576 576
             throw new IllegalArgumentException("getChannelConfig called "
577 577
                     + "with null or empty network\n\nNetwork: " + network);
578 578
         }
579
-        
579
+
580 580
         if (channel == null || channel.isEmpty()) {
581 581
             throw new IllegalArgumentException("getChannelConfig called "
582 582
                     + "with null or empty channel\n\nChannel: " + channel);
583
-        }        
583
+        }
584 584
 
585 585
         final String myTarget = (channel + "@" + network).toLowerCase();
586
-        
586
+
587 587
         synchronized (IDENTITIES) {
588 588
             for (Identity identity : IDENTITIES.safeGet(null)) {
589 589
                 if (identity.getTarget().getType() == ConfigTarget.TYPE.CHANNEL
@@ -592,7 +592,7 @@ public final class IdentityManager {
592 592
                 }
593 593
             }
594 594
         }
595
-        
595
+
596 596
         // We need to create one
597 597
         final ConfigTarget target = new ConfigTarget();
598 598
         target.setChannel(myTarget);
@@ -604,7 +604,7 @@ public final class IdentityManager {
604 604
             return null;
605 605
         }
606 606
     }
607
-    
607
+
608 608
     /**
609 609
      * Retrieves the config for the specified network. The config is
610 610
      * created if it doesn't exist.
@@ -620,7 +620,7 @@ public final class IdentityManager {
620 620
         }
621 621
 
622 622
         final String myTarget = network.toLowerCase();
623
-        
623
+
624 624
         synchronized (IDENTITIES) {
625 625
             for (Identity identity : IDENTITIES.safeGet(null)) {
626 626
                 if (identity.getTarget().getType() == ConfigTarget.TYPE.NETWORK
@@ -629,11 +629,11 @@ public final class IdentityManager {
629 629
                 }
630 630
             }
631 631
         }
632
-        
632
+
633 633
         // We need to create one
634 634
         final ConfigTarget target = new ConfigTarget();
635 635
         target.setNetwork(myTarget);
636
-        
636
+
637 637
         try {
638 638
             return Identity.buildIdentity(target);
639 639
         } catch (IOException ex) {
@@ -641,11 +641,11 @@ public final class IdentityManager {
641 641
             return null;
642 642
         }
643 643
     }
644
-    
644
+
645 645
     /**
646 646
      * Retrieves the config for the specified server. The config is
647 647
      * created if it doesn't exist.
648
-     * 
648
+     *
649 649
      * @param server The name of the server
650 650
      * @return A config source for the server
651 651
      */
@@ -655,9 +655,9 @@ public final class IdentityManager {
655 655
             throw new IllegalArgumentException("getServerConfig called "
656 656
                     + "with null or empty server\n\nServer: " + server);
657 657
         }
658
-        
658
+
659 659
         final String myTarget = server.toLowerCase();
660
-        
660
+
661 661
         synchronized (IDENTITIES) {
662 662
             for (Identity identity : IDENTITIES.safeGet(null)) {
663 663
                 if (identity.getTarget().getType() == ConfigTarget.TYPE.SERVER
@@ -666,17 +666,17 @@ public final class IdentityManager {
666 666
                 }
667 667
             }
668 668
         }
669
-        
669
+
670 670
         // We need to create one
671 671
         final ConfigTarget target = new ConfigTarget();
672 672
         target.setServer(myTarget);
673
-        
673
+
674 674
         try {
675 675
             return Identity.buildIdentity(target);
676 676
         } catch (IOException ex) {
677 677
             Logger.userError(ErrorLevel.HIGH, "Unable to create network identity", ex);
678 678
             return null;
679 679
         }
680
-    }    
681
-    
680
+    }
681
+
682 682
 }

+ 38
- 38
src/com/dmdirc/config/prefs/PreferencesManager.java ファイルの表示

@@ -145,12 +145,12 @@ public class PreferencesManager {
145 145
                 "Show a confirmation message when you try to close the client"));
146 146
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
147 147
                 "channel", "splitusermodes", "Split user modes",
148
-                "Show individual mode lines for each mode change that affects" +
149
-                " a user (e.g. op, devoice)"));
148
+                "Show individual mode lines for each mode change that affects"
149
+                + " a user (e.g. op, devoice)"));
150 150
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
151 151
                 "channel", "sendwho", "Send channel WHOs",
152
-                "Request information (away state, hostname, etc) on channel " +
153
-                "users automatically"));
152
+                "Request information (away state, hostname, etc) on channel "
153
+                + "users automatically"));
154 154
         category.addSetting(new PreferencesSetting(PreferencesType.DURATION,
155 155
                 "general", "whotime", "Who request interval",
156 156
                 "How often to send WHO requests for a channel (if enabled)"));
@@ -165,8 +165,8 @@ public class PreferencesManager {
165 165
                 "Show an indicator in windows when you are marked as away"));
166 166
         category.addSetting(new PreferencesSetting(PreferencesType.OPTIONALINTEGER,
167 167
                 new OptionalValidator(new NumericalValidator(0, 100)), "ui", "pasteProtectionLimit",
168
-                "Paste protection trigger", "Confirm pasting of text that " +
169
-                "contains more than this many lines."));
168
+                "Paste protection trigger", "Confirm pasting of text that "
169
+                + "contains more than this many lines."));
170 170
 
171 171
         addTabCompletionCategory(category);
172 172
         addCategory(category.setInlineAfter());
@@ -186,15 +186,15 @@ public class PreferencesManager {
186 186
         }
187 187
 
188 188
         category.addSetting(new PreferencesSetting("tabcompletion", "style",
189
-                "Tab completion style", "Determines the behaviour of " +
190
-                "the tab completer when there are multiple matches", taboptions));
189
+                "Tab completion style", "Determines the behaviour of "
190
+                + "the tab completer when there are multiple matches", taboptions));
191 191
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
192 192
                 "tabcompletion", "casesensitive", "Case-sensitive tab completion",
193 193
                 "Respect case when tab completing"));
194 194
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
195 195
                 "tabcompletion", "allowempty", "Allow empty tab completion",
196
-                "Attempt to tab complete when the Tab key is pressed even " +
197
-                "if there is nothing to complete"));
196
+                "Attempt to tab complete when the Tab key is pressed even "
197
+                + "if there is nothing to complete"));
198 198
 
199 199
         parent.addSubCategory(category.setInline());
200 200
     }
@@ -211,27 +211,27 @@ public class PreferencesManager {
211 211
                 "Close channel windows when you manually disconnect from the server"));
212 212
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
213 213
                 "general", "closechannelsondisconnect",
214
-                "Close channels on disconnect", "Close channel windows when " +
215
-                "the server is disconnected (because of an error)"));
214
+                "Close channels on disconnect", "Close channel windows when "
215
+                + "the server is disconnected (because of an error)"));
216 216
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
217 217
                 "general", "closequeriesonquit", "Close queries on quit",
218 218
                 "Close query windows when you manually disconnect from the server"));
219 219
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
220 220
                 "general", "closequeriesondisconnect",
221
-                "Close queries on disconnect", "Close query windows when " +
222
-                "the server is disconnected (because of an error)"));
221
+                "Close queries on disconnect", "Close query windows when "
222
+                + "the server is disconnected (because of an error)"));
223 223
         category.addSetting(new PreferencesSetting(PreferencesType.DURATION,
224 224
                 "server", "pingtimer", "Ping warning time",
225
-                "How long to wait after a ping reply is sent before showing " +
226
-                "a warning message"));
225
+                "How long to wait after a ping reply is sent before showing "
226
+                + "a warning message"));
227 227
         category.addSetting(new PreferencesSetting(PreferencesType.DURATION,
228 228
                 "server", "pingtimeout", "Ping timeout",
229
-                "How long to wait for a server to reply to a PING request " +
230
-                "before assuming the server has died"));
229
+                "How long to wait for a server to reply to a PING request "
230
+                + "before assuming the server has died"));
231 231
         category.addSetting(new PreferencesSetting(PreferencesType.DURATION,
232 232
                 "server", "pingfrequency", "Ping frequency",
233
-                "How often a PING request should be sent to the server (to " +
234
-                "check that it is still alive)"));
233
+                "How often a PING request should be sent to the server (to "
234
+                + "check that it is still alive)"));
235 235
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
236 236
                 "general", "reconnectonconnectfailure", "Reconnect on failure",
237 237
                 "Attempt to reconnect if there is an error when connecting"));
@@ -381,8 +381,8 @@ public class PreferencesManager {
381 381
 
382 382
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
383 383
                 "browser", "uselaunchdelay", "Use browser launch delay",
384
-                "Enable delay between browser launches (to prevent mistakenly" +
385
-                " double clicking)"));
384
+                "Enable delay between browser launches (to prevent mistakenly"
385
+                + " double clicking)"));
386 386
         category.addSetting(new PreferencesSetting(PreferencesType.DURATION,
387 387
                 "browser", "launchdelay", "Browser launch delay",
388 388
                 "Minimum time between opening of URLs if enabled"));
@@ -393,8 +393,8 @@ public class PreferencesManager {
393 393
                 "general", "logerrors", "Log errors to disk",
394 394
                 "Save copies of all client errors to disk"));
395 395
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
396
-                "ui", "quickCopy", "Quick copy", "Automatically copy" +
397
-                " text that's selected when the mouse button is released"));
396
+                "ui", "quickCopy", "Quick copy", "Automatically copy"
397
+                + " text that's selected when the mouse button is released"));
398 398
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
399 399
                 "ui", "showversion", "Show version",
400 400
                 "Show the current DMDirc version in the titlebar"));
@@ -420,11 +420,11 @@ public class PreferencesManager {
420 420
         category.addSetting(new PreferencesSetting("general", "ui", "Active UI",
421 421
                 "User interface to use", uiOptions).setRestartNeeded());
422 422
         category.addSetting(new PreferencesSetting(PreferencesType.COLOUR,
423
-                "ui", "backgroundcolour", "Background colour", "Default " +
424
-                "background colour to use"));
423
+                "ui", "backgroundcolour", "Background colour", "Default "
424
+                + "background colour to use"));
425 425
         category.addSetting(new PreferencesSetting(PreferencesType.COLOUR,
426
-                "ui", "foregroundcolour", "Foreground colour", "Default " +
427
-                "foreground colour to use"));
426
+                "ui", "foregroundcolour", "Foreground colour", "Default "
427
+                + "foreground colour to use"));
428 428
         category.addSetting(new PreferencesSetting(PreferencesType.OPTIONALCOLOUR,
429 429
                 "ui", "inputbackgroundcolour", "Input background colour",
430 430
                 "Default background colour to use for input fields"));
@@ -457,20 +457,20 @@ public class PreferencesManager {
457 457
      * @since 0.6.4
458 458
      */
459 459
     private void addStyleSubCategory(PreferencesCategory parent) {
460
-        final PreferencesCategory category = new PreferencesCategory("Link styles" +
461
-                " and colours", "");
460
+        final PreferencesCategory category = new PreferencesCategory("Link styles"
461
+                + " and colours", "");
462 462
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
463
-                "ui", "stylelinks", "Style hyperlinks", "Style hyperlinks in " +
464
-                "text areas with underlines"));
463
+                "ui", "stylelinks", "Style hyperlinks", "Style hyperlinks in "
464
+                + "text areas with underlines"));
465 465
         category.addSetting(new PreferencesSetting(PreferencesType.OPTIONALCOLOUR,
466
-                "ui", "linkcolour", "Hyperlink colour", "Default colour to use " +
467
-                "for hyperlinks in the text area"));
466
+                "ui", "linkcolour", "Hyperlink colour", "Default colour to use "
467
+                + "for hyperlinks in the text area"));
468 468
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
469
-                "ui", "stylechannels", "Style channel links", "Styles channel " +
470
-                "links in text areas with underlines"));
469
+                "ui", "stylechannels", "Style channel links", "Styles channel "
470
+                + "links in text areas with underlines"));
471 471
         category.addSetting(new PreferencesSetting(PreferencesType.OPTIONALCOLOUR,
472
-                "ui", "channelcolour", "Channel link colour", "Default colour to use " +
473
-                "for channel links in the text area"));
472
+                "ui", "channelcolour", "Channel link colour", "Default colour to use "
473
+                + "for channel links in the text area"));
474 474
 
475 475
         parent.addSubCategory(category.setInline());
476 476
     }

+ 50
- 50
src/com/dmdirc/config/prefs/PreferencesSetting.java ファイルの表示

@@ -32,47 +32,47 @@ import java.util.Map;
32 32
 
33 33
 /**
34 34
  * Represents a single setting.
35
- * 
35
+ *
36 36
  * @author chris
37 37
  */
38 38
 public class PreferencesSetting {
39
-    
39
+
40 40
     /** The type of this setting. */
41 41
     protected final PreferencesType type;
42
-    
42
+
43 43
     /** The possible options for a multichoice setting. */
44 44
     protected final Map<String, String> combooptions;
45 45
 
46 46
     /** The validator to use to validate this setting. */
47 47
     protected final Validator<String> validator;
48
-    
48
+
49 49
     /** The domain of the setting. */
50 50
     protected final String domain;
51
-    
51
+
52 52
     /** The option name of the setting. */
53 53
     protected final String option;
54
-    
54
+
55 55
     /** The title of this setting. */
56 56
     protected final String title;
57
-    
57
+
58 58
     /** Text to inform the user what the setting is for. */
59 59
     protected final String helptext;
60
-    
60
+
61 61
     /** The current value of the setting. */
62 62
     protected String current;
63
-    
63
+
64 64
     /** The original value of this vsetting. */
65 65
     private String original;
66
-    
66
+
67 67
     /** Whether or not we need a restart. */
68 68
     protected boolean restartNeeded;
69
-    
69
+
70 70
     /** A list of change listeners. */
71 71
     private final List<SettingChangeListener> listeners = new ArrayList<SettingChangeListener>();
72 72
 
73 73
     /**
74 74
      * Creates a new preferences setting for any type except multi-choice.
75
-     * 
75
+     *
76 76
      * @param type The type of the setting to create
77 77
      * @param validator A validator to validate the setting's value
78 78
      * @param domain The domain of the setting
@@ -84,10 +84,10 @@ public class PreferencesSetting {
84 84
             final Validator<String> validator, final String domain,
85 85
             final String option, final String title, final String helptext) {
86 86
         if (PreferencesType.MULTICHOICE.equals(type)) {
87
-            throw new IllegalArgumentException("Multi-choice preferences must " +
88
-                    "have their options specified.");
87
+            throw new IllegalArgumentException("Multi-choice preferences must "
88
+                    + "have their options specified.");
89 89
         }
90
-        
90
+
91 91
         this.type = type;
92 92
         this.combooptions = null;
93 93
         this.validator = validator;
@@ -95,15 +95,15 @@ public class PreferencesSetting {
95 95
         this.option = option;
96 96
         this.title = title;
97 97
         this.helptext = helptext;
98
-        
98
+
99 99
         current = IdentityManager.getGlobalConfig().getOption(domain, option);
100 100
         original = current;
101 101
     }
102
-    
102
+
103 103
     /**
104 104
      * Creates a new preferences setting for any type except multi-choice, with
105 105
      * a default permissive validator.
106
-     * 
106
+     *
107 107
      * @param type The type of the setting to create
108 108
      * @param domain The domain of the setting
109 109
      * @param option The option name of the setting
@@ -113,10 +113,10 @@ public class PreferencesSetting {
113 113
     public PreferencesSetting(final PreferencesType type, final String domain,
114 114
             final String option, final String title, final String helptext) {
115 115
         if (PreferencesType.MULTICHOICE.equals(type)) {
116
-            throw new IllegalArgumentException("Multi-choice preferences must " +
117
-                    "have their options specified.");
116
+            throw new IllegalArgumentException("Multi-choice preferences must "
117
+                    + "have their options specified.");
118 118
         }
119
-        
119
+
120 120
         this.type = type;
121 121
         this.combooptions = null;
122 122
         this.validator = new PermissiveValidator<String>();
@@ -124,14 +124,14 @@ public class PreferencesSetting {
124 124
         this.option = option;
125 125
         this.title = title;
126 126
         this.helptext = helptext;
127
-        
127
+
128 128
         current = IdentityManager.getGlobalConfig().getOption(domain, option);
129 129
         original = current;
130
-    }    
131
-    
130
+    }
131
+
132 132
     /**
133 133
      * Creates a new preferences setting for multi-choice preferences.
134
-     * 
134
+     *
135 135
      * @param domain The domain of the setting
136 136
      * @param option The option name of the setting
137 137
      * @param options A map of setting values to display names for this setting
@@ -148,18 +148,18 @@ public class PreferencesSetting {
148 148
         this.option = option;
149 149
         this.title = title;
150 150
         this.helptext = helptext;
151
-        
151
+
152 152
         current = IdentityManager.getGlobalConfig().getOption(domain, option);
153 153
         original = current;
154
-        
154
+
155 155
         if (!combooptions.containsKey(current)) {
156 156
             combooptions.put(current, "Current (" + current + ")");
157 157
         }
158
-    }    
158
+    }
159 159
 
160 160
     /**
161 161
      * Retrieves the possible options for use in a multi-choice preference.
162
-     * 
162
+     *
163 163
      * @return A map of setting values to display names, representing the
164 164
      * possible options for this setting.
165 165
      */
@@ -169,7 +169,7 @@ public class PreferencesSetting {
169 169
 
170 170
     /**
171 171
      * Retrieves the help text for this setting.
172
-     * 
172
+     *
173 173
      * @return This setting's help text.
174 174
      */
175 175
     public String getHelptext() {
@@ -178,7 +178,7 @@ public class PreferencesSetting {
178 178
 
179 179
     /**
180 180
      * Retrieves the title of this setting.
181
-     * 
181
+     *
182 182
      * @return This setting's title.
183 183
      */
184 184
     public String getTitle() {
@@ -187,7 +187,7 @@ public class PreferencesSetting {
187 187
 
188 188
     /**
189 189
      * Retrieves the current value of this setting.
190
-     * 
190
+     *
191 191
      * @return The current value of this setting.
192 192
      */
193 193
     public String getValue() {
@@ -196,7 +196,7 @@ public class PreferencesSetting {
196 196
 
197 197
     /**
198 198
      * Retieves the type of this setting.
199
-     * 
199
+     *
200 200
      * @return This setting's type.
201 201
      */
202 202
     public PreferencesType getType() {
@@ -205,22 +205,22 @@ public class PreferencesSetting {
205 205
 
206 206
     /**
207 207
      * Returns a validator that can validate this setting.
208
-     * 
208
+     *
209 209
      * @return This setting's validator.
210 210
      */
211 211
     public Validator<String> getValidator() {
212 212
         return validator;
213 213
     }
214
-    
214
+
215 215
     /**
216 216
      * Sets the current value of this setting. Note that the setting is not
217 217
      * saved to the configuration file until the save method is called.
218
-     * 
218
+     *
219 219
      * @param newValue The new value of the setting
220 220
      */
221 221
     public void setValue(final String newValue) {
222 222
         current = newValue;
223
-        
223
+
224 224
         for (SettingChangeListener listener : listeners) {
225 225
             listener.settingChanged(this);
226 226
         }
@@ -228,7 +228,7 @@ public class PreferencesSetting {
228 228
 
229 229
     /**
230 230
      * Determines whether or not this setting needs a restart when it's changed.
231
-     * 
231
+     *
232 232
      * @return True if this setting needs a restart, false otherwise
233 233
      */
234 234
     public boolean isRestartNeeded() {
@@ -238,35 +238,35 @@ public class PreferencesSetting {
238 238
     /**
239 239
      * Sets the "restart needed" flag for this setting, indicating a client
240 240
      * restart is needed before the setting takes effect.
241
-     * 
241
+     *
242 242
      * @return A reference to this setting, for convenience
243 243
      */
244 244
     public PreferencesSetting setRestartNeeded() {
245 245
         restartNeeded = true;
246 246
         return this;
247 247
     }
248
-    
248
+
249 249
     /**
250 250
      * Registers the specified setting change listener.
251
-     * 
251
+     *
252 252
      * @param listener The listener to be registered
253 253
      * @return A reference to this setting, for convenience
254 254
      */
255 255
     public PreferencesSetting registerChangeListener(final SettingChangeListener listener) {
256 256
         listeners.add(listener);
257 257
         return this;
258
-    }    
259
-    
258
+    }
259
+
260 260
     /**
261 261
      * Saves the current value of this setting to the global configuration.
262
-     * 
262
+     *
263 263
      * @return True if the setting has changed, false otherwise
264 264
      */
265 265
     public boolean save() {
266 266
         if (!needsSaving()) {
267 267
             return false;
268 268
         }
269
-        
269
+
270 270
         if (current == null) {
271 271
             IdentityManager.getConfigIdentity().unsetOption(domain, option);
272 272
         } else {
@@ -276,7 +276,7 @@ public class PreferencesSetting {
276 276
         original = current;
277 277
         return true;
278 278
     }
279
-    
279
+
280 280
     /**
281 281
      * Dismisses changes to this setting.
282 282
      */
@@ -285,17 +285,17 @@ public class PreferencesSetting {
285 285
                 || (original == null && current == null)) {
286 286
             return;
287 287
         }
288
-        
288
+
289 289
         current = original;
290
-        
290
+
291 291
         for (SettingChangeListener listener : listeners) {
292 292
             listener.settingChanged(this);
293 293
         }
294 294
     }
295
-    
295
+
296 296
     /**
297 297
      * Does the setting need saving?
298
-     * 
298
+     *
299 299
      * @return true iif the setting will be changed if saved
300 300
      */
301 301
     public boolean needsSaving() {

+ 3
- 3
src/com/dmdirc/config/prefs/SettingChangeListener.java ファイルの表示

@@ -24,14 +24,14 @@ package com.dmdirc.config.prefs;
24 24
 
25 25
 /**
26 26
  * Defines the methods required for setting change listeners.
27
- * 
27
+ *
28 28
  * @author chris
29 29
  */
30 30
 public interface SettingChangeListener {
31
-    
31
+
32 32
     /**
33 33
      * Called to indicate that the specified setting has changed.
34
-     * 
34
+     *
35 35
      * @param setting The setting that was changed
36 36
      */
37 37
     void settingChanged(final PreferencesSetting setting);

+ 3
- 3
src/com/dmdirc/config/prefs/validator/FileNameValidator.java ファイルの表示

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

+ 3
- 3
src/com/dmdirc/config/prefs/validator/IdentValidator.java ファイルの表示

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

+ 10
- 10
src/com/dmdirc/config/prefs/validator/NumericalValidator.java ファイルの表示

@@ -23,20 +23,20 @@ package com.dmdirc.config.prefs.validator;
23 23
 
24 24
 /**
25 25
  * Validates that a number is within certain bounds.
26
- * 
26
+ *
27 27
  * @author chris
28 28
  */
29 29
 public class NumericalValidator implements Validator<String> {
30
-    
30
+
31 31
     /** The minimum value for this number. */
32 32
     protected final int min;
33
-    
33
+
34 34
     /** The maximum value for this number. */
35 35
     protected final int max;
36 36
 
37 37
     /**
38 38
      * Creates a new numerical validator with the specified bounds.
39
-     * 
39
+     *
40 40
      * @param min The minimum value for the number, or -1 for unlimited.
41 41
      * @param max The maximum value for the number, or -1 for unlimited.
42 42
      */
@@ -47,7 +47,7 @@ public class NumericalValidator implements Validator<String> {
47 47
 
48 48
     /**
49 49
      * Retrieves the maximum value that this validator will allow.
50
-     * 
50
+     *
51 51
      * @return This validator's maximum value
52 52
      */
53 53
     public int getMax() {
@@ -56,24 +56,24 @@ public class NumericalValidator implements Validator<String> {
56 56
 
57 57
     /**
58 58
      * Retrieves the minimum value that this validator will allow.
59
-     * 
59
+     *
60 60
      * @return This validator's minimum value
61
-     */    
61
+     */
62 62
     public int getMin() {
63 63
         return min == -1 ? Integer.MIN_VALUE : min;
64 64
     }
65
-    
65
+
66 66
     /** {@inheritDoc} */
67 67
     @Override
68 68
     public ValidationResponse validate(final String object) {
69 69
         int intv;
70
-        
70
+
71 71
         try {
72 72
             intv = Integer.parseInt(object);
73 73
         } catch (NumberFormatException ex) {
74 74
             return new ValidationResponse("Must be a valid number");
75 75
         }
76
-        
76
+
77 77
         if (intv < min && min != -1) {
78 78
             return new ValidationResponse("Must be at least " + min);
79 79
         } else if (intv > max && max != -1) {

+ 3
- 3
src/com/dmdirc/config/prefs/validator/PortValidator.java ファイルの表示

@@ -23,14 +23,14 @@ package com.dmdirc.config.prefs.validator;
23 23
 
24 24
 /**
25 25
  * Validates a port number.
26
- * 
26
+ *
27 27
  * @author chris
28 28
  */
29 29
 public class PortValidator extends NumericalValidator {
30
-    
30
+
31 31
     /** The minimum port number. */
32 32
     private static final int MIN_PORT = 1;
33
-    
33
+
34 34
     /** The maximum port number. */
35 35
     private static final int MAX_PORT = 65535;
36 36
 

+ 2
- 2
src/com/dmdirc/config/prefs/validator/RegexValidator.java ファイルの表示

@@ -24,7 +24,7 @@ package com.dmdirc.config.prefs.validator;
24 24
 
25 25
 /**
26 26
  * Validates a regular expression.
27
- * 
27
+ *
28 28
  * @author chris
29 29
  */
30 30
 public class RegexValidator implements Validator<String> {
@@ -35,7 +35,7 @@ public class RegexValidator implements Validator<String> {
35 35
         try {
36 36
             // Is there a proper way of doing this, as opposed to just seeing
37 37
             // if it breaks?
38
-            
38
+
39 39
             "abc".matches(object);
40 40
             return new ValidationResponse();
41 41
         } catch (Exception ex) {

+ 9
- 9
src/com/dmdirc/config/prefs/validator/ValidationResponse.java ファイルの表示

@@ -24,42 +24,42 @@ package com.dmdirc.config.prefs.validator;
24 24
 /**
25 25
  * Describes the response from a Validator. The response may be either positive
26 26
  * or negative. Negative responses have an associated failure reason.
27
- * 
27
+ *
28 28
  * @author chris
29 29
  */
30 30
 public class ValidationResponse {
31
-   
31
+
32 32
     /** The failure reason, or null if the validation passed. */
33 33
     private final String failure;
34
-    
34
+
35 35
     /**
36 36
      * Creates a new ValidationResponse for a positive response.
37 37
      */
38 38
     public ValidationResponse() {
39 39
         this.failure = null;
40 40
     }
41
-    
41
+
42 42
     /**
43 43
      * Creates a new ValidationResponse for a negative response.
44
-     * 
44
+     *
45 45
      * @param failure The reason for the negative response.
46 46
      */
47 47
     public ValidationResponse(final String failure) {
48 48
         this.failure = failure;
49 49
     }
50
-    
50
+
51 51
     /**
52 52
      * Determines whether or not this response indicates that a failure occured.
53
-     * 
53
+     *
54 54
      * @return True if a failure occured, false otherwise.
55 55
      */
56 56
     public boolean isFailure() {
57 57
         return failure != null;
58 58
     }
59
-    
59
+
60 60
     /**
61 61
      * Retrieves the reason for the validation failure.
62
-     * 
62
+     *
63 63
      * @return The reason for the validation failure.
64 64
      */
65 65
     public String getFailureReason() {

+ 6
- 6
src/com/dmdirc/config/prefs/validator/Validator.java ファイルの表示

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -24,16 +24,16 @@ package com.dmdirc.config.prefs.validator;
24 24
 
25 25
 /**
26 26
  * Validator interface.
27
- * 
27
+ *
28 28
  * @param V Type to validate
29 29
  */
30 30
 public interface Validator<V> {
31 31
 
32 32
     /**
33 33
      * Validates the object.
34
-     * 
34
+     *
35 35
      * @param object Object to validate
36
-     * 
36
+     *
37 37
      * @return A validation response indicating the success/failure of the
38 38
      * validation
39 39
      */

+ 5
- 5
src/com/dmdirc/config/prefs/validator/ValidatorChain.java ファイルの表示

@@ -27,19 +27,19 @@ import java.util.List;
27 27
 
28 28
 /**
29 29
  * Allows multiple validators to be chained together.
30
- * 
30
+ *
31 31
  * @param A The type of class that this chain validates
32 32
  * @author chris
33 33
  */
34 34
 public class ValidatorChain<A> implements Validator<A> {
35
-    
35
+
36 36
     /** A list of validators to use. */
37 37
     private final List<Validator<A>> validatorList
38 38
             = new ArrayList<Validator<A>>();
39 39
 
40 40
     /**
41 41
      * Creates a new validator chain containing the specified validators.
42
-     * 
42
+     *
43 43
      * @param validators The validators to be used in this chain.
44 44
      */
45 45
     public ValidatorChain(final Validator<A> ... validators) {
@@ -53,12 +53,12 @@ public class ValidatorChain<A> implements Validator<A> {
53 53
     public ValidationResponse validate(final A object) {
54 54
         for (Validator<A> validator : validatorList) {
55 55
             final ValidationResponse res = validator.validate(object);
56
-            
56
+
57 57
             if (res.isFailure()) {
58 58
                 return res;
59 59
             }
60 60
         }
61
-        
61
+
62 62
         return new ValidationResponse();
63 63
     }
64 64
 

+ 8
- 8
src/com/dmdirc/installer/DefaultSettings.java ファイルの表示

@@ -32,29 +32,29 @@ public class DefaultSettings implements Settings {
32 32
     /** {@inheritDoc} */
33 33
     @Override
34 34
     public boolean getShortcutMenuState() {
35
-        return (CLIParser.getCLIParser().getParamNumber("-no-shortcut-menu") ==
36
-                0);
35
+        return CLIParser.getCLIParser().getParamNumber("-no-shortcut-menu")
36
+                == 0;
37 37
     }
38 38
 
39 39
     /** {@inheritDoc} */
40 40
     @Override
41 41
     public boolean getShortcutDesktopState() {
42
-        return (CLIParser.getCLIParser().getParamNumber("-no-shortcut-desktop") ==
43
-                0);
42
+        return CLIParser.getCLIParser().getParamNumber("-no-shortcut-desktop")
43
+                == 0;
44 44
     }
45 45
 
46 46
     /** {@inheritDoc} */
47 47
     @Override
48 48
     public boolean getShortcutQuickState() {
49
-        return (CLIParser.getCLIParser().getParamNumber(
50
-                "-no-shortcut-quicklaunch") == 0);
49
+        return CLIParser.getCLIParser().getParamNumber("-no-shortcut-quicklaunch")
50
+                == 0;
51 51
     }
52 52
 
53 53
     /** {@inheritDoc} */
54 54
     @Override
55 55
     public boolean getShortcutProtocolState() {
56
-        return (CLIParser.getCLIParser().getParamNumber("-no-shortcut-protocol") ==
57
-                0);
56
+        return CLIParser.getCLIParser().getParamNumber("-no-shortcut-protocol")
57
+                == 0;
58 58
     }
59 59
 
60 60
     /** {@inheritDoc} */

+ 4
- 4
src/com/dmdirc/installer/Installer.java ファイルの表示

@@ -99,12 +99,12 @@ public abstract class Installer extends Thread {
99 99
 
100 100
         if (Main.getInstaller().supportsShortcut(ShortcutType.MENU)) {
101 101
             if (settings.getShortcutMenuState()) {
102
-                step.addText("Setting up " + Main.getInstaller().getMenuName() +
103
-                             " shortcut");
102
+                step.addText("Setting up " + Main.getInstaller().getMenuName()
103
+                        + " shortcut");
104 104
                 setupShortcut(location, ShortcutType.MENU);
105 105
             } else {
106
-                step.addText("Not setting up " +
107
-                             Main.getInstaller().getMenuName() + " shortcut");
106
+                step.addText("Not setting up "
107
+                        + Main.getInstaller().getMenuName() + " shortcut");
108 108
             }
109 109
         }
110 110
 

+ 18
- 19
src/com/dmdirc/installer/InstallerListener.java ファイルの表示

@@ -1,17 +1,17 @@
1 1
 /*
2
- * 
2
+ *
3 3
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
4
- * 
4
+ *
5 5
  * Permission is hereby granted, free of charge, to any person obtaining a copy
6 6
  * of this software and associated documentation files (the "Software"), to deal
7 7
  * in the Software without restriction, including without limitation the rights
8 8
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 9
  * copies of the Software, and to permit persons to whom the Software is
10 10
  * furnished to do so, subject to the following conditions:
11
- * 
11
+ *
12 12
  * The above copyright notice and this permission notice shall be included in
13 13
  * all copies or substantial portions of the Software.
14
- * 
14
+ *
15 15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 16
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 17
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -93,20 +93,19 @@ public class InstallerListener implements WizardListener, StepListener {
93 93
                     getMenuName() + " shortcut\n";
94 94
         }
95 95
 
96
-        if (Main.getInstaller().supportsShortcut(ShortcutType.DESKTOP) &&
97
-            settings.getShortcutDesktopState()) {
96
+        if (Main.getInstaller().supportsShortcut(ShortcutType.DESKTOP)
97
+                && settings.getShortcutDesktopState()) {
98 98
             shortcutText = shortcutText + " - Create desktop shortcut\n";
99 99
         }
100 100
 
101
-        if (Main.getInstaller().supportsShortcut(ShortcutType.QUICKLAUNCH) &&
102
-            settings.getShortcutQuickState()) {
101
+        if (Main.getInstaller().supportsShortcut(ShortcutType.QUICKLAUNCH)
102
+                && settings.getShortcutQuickState()) {
103 103
             shortcutText = shortcutText + " - Create Quick Launch shortcut\n";
104 104
         }
105 105
 
106
-        if (Main.getInstaller().supportsShortcut(ShortcutType.PROTOCOL) &&
107
-            settings.getShortcutProtocolState()) {
108
-            shortcutText = shortcutText +
109
-                           " - Make DMDirc handle irc:// links\n";
106
+        if (Main.getInstaller().supportsShortcut(ShortcutType.PROTOCOL)
107
+                && settings.getShortcutProtocolState()) {
108
+            shortcutText = shortcutText + " - Make DMDirc handle irc:// links\n";
110 109
         }
111 110
 
112 111
 
@@ -117,16 +116,16 @@ public class InstallerListener implements WizardListener, StepListener {
117 116
             final TextStep textStep = (TextStep) step;
118 117
             if (installLocation.isEmpty()) {
119 118
                 textStep.setText(
120
-                        "You have chosen an invalid install location\n\n" +
121
-                        "Please press the \"Previous\" button to go back and correct it.");
119
+                        "You have chosen an invalid install location\n\n"
120
+                        + "Please press the \"Previous\" button to go back and correct it.");
122 121
                Main.getWizardFrame().enableNextStep(false);
123 122
             } else {
124 123
                 textStep.setText(
125
-                        "Please review your chosen settings:\n\n" +
126
-                        " - Install Location:\n" + "    " + installLocation +
127
-                        "\n" + shortcutText + "\n" + "If you wish to change " +
128
-                        "any of these settings, press the \"Previous\" " +
129
-                        "button, otherwise click \"Next\" to begin the installation");
124
+                        "Please review your chosen settings:\n\n"
125
+                        + " - Install Location:\n" + "    " + installLocation
126
+                        + "\n" + shortcutText + "\n" + "If you wish to change "
127
+                        + "any of these settings, press the \"Previous\" "
128
+                        + "button, otherwise click \"Next\" to begin the installation");
130 129
                 Main.getWizardFrame().enableNextStep(true);
131 130
            }
132 131
         }

+ 10
- 10
src/com/dmdirc/installer/WindowsInstaller.java ファイルの表示

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -30,7 +30,7 @@ import java.util.ArrayList;
30 30
 
31 31
 /**
32 32
  * Installs DMDirc on windows
33
- * 
33
+ *
34 34
  * @author Shane Mc Cormack
35 35
  */
36 36
 public class WindowsInstaller extends Installer {
@@ -70,7 +70,7 @@ public class WindowsInstaller extends Installer {
70 70
 
71 71
     /**
72 72
      * Are we running vista? -_-
73
-     * 
73
+     *
74 74
      * @return True if this is vista.
75 75
      */
76 76
     public boolean isVista() {
@@ -79,7 +79,7 @@ public class WindowsInstaller extends Installer {
79 79
 
80 80
     /**
81 81
      * Are we running NT?
82
-     * 
82
+     *
83 83
      * @return True if this is NT.
84 84
      */
85 85
     public boolean isNT() {
@@ -118,7 +118,7 @@ public class WindowsInstaller extends Installer {
118 118
 
119 119
     /**
120 120
      * Add a registry key.
121
-     * 
121
+     *
122 122
      * @param key
123 123
      *            Key to add.
124 124
      */
@@ -130,7 +130,7 @@ public class WindowsInstaller extends Installer {
130 130
 
131 131
     /**
132 132
      * Modify a registry value.
133
-     * 
133
+     *
134 134
      * @param key
135 135
      *            Key to use.
136 136
      * @param value
@@ -145,7 +145,7 @@ public class WindowsInstaller extends Installer {
145 145
 
146 146
     /**
147 147
      * Modify a registry value.
148
-     * 
148
+     *
149 149
      * @param key
150 150
      *            Key to use.
151 151
      * @param value
@@ -181,7 +181,7 @@ public class WindowsInstaller extends Installer {
181 181
 
182 182
     /**
183 183
      * Execute and wait for the requested command
184
-     * 
184
+     *
185 185
      * @param cmd
186 186
      *            Command array to execute/
187 187
      * @return return value from command, or -1 if there was an error.

+ 13
- 13
src/com/dmdirc/installer/cliparser/CLIParser.java ファイルの表示

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Shane Mc Cormack
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -57,7 +57,7 @@ public class CLIParser {
57 57
 
58 58
     /**
59 59
      * Get a reference to the CLIParser.
60
-     * 
60
+     *
61 61
      * @return CLI parser instance
62 62
      */
63 63
     public static synchronized CLIParser getCLIParser() {
@@ -80,7 +80,7 @@ public class CLIParser {
80 80
 
81 81
     /**
82 82
      * Add a CLIParam to the cliparser.
83
-     * 
83
+     *
84 84
      * @param param
85 85
      *            CLIParam sub-class to use as a parameter.
86 86
      * @return true if added, false if already exists.
@@ -108,7 +108,7 @@ public class CLIParser {
108 108
      * Get the number of times a param was given.
109 109
      * In the case of params with both a char and string value, this number is
110 110
      * the total for both.
111
-     * 
111
+     *
112 112
      * @param flag
113 113
      *            Flag to get count for
114 114
      * @return number, or -1 if the param is invalud
@@ -123,7 +123,7 @@ public class CLIParser {
123 123
 
124 124
     /**
125 125
      * Get a CLIParam object for a given flag.
126
-     * 
126
+     *
127 127
      * @param flag
128 128
      *            Flag to get param for
129 129
      * @return CLIParam object, or null if there is none.
@@ -138,7 +138,7 @@ public class CLIParser {
138 138
 
139 139
     /**
140 140
      * Get the list of params.
141
-     * 
141
+     *
142 142
      * @return list of params.
143 143
      */
144 144
     public List<CLIParam> getParamList() {
@@ -147,7 +147,7 @@ public class CLIParser {
147 147
 
148 148
     /**
149 149
      * Get the list of redundant strings.
150
-     * 
150
+     *
151 151
      * @return list of redundant strings.
152 152
      */
153 153
     public List<String> getRedundant() {
@@ -160,7 +160,7 @@ public class CLIParser {
160 160
 
161 161
     /**
162 162
      * Set the "help" command.
163
-     * 
163
+     *
164 164
      * @param param
165 165
      *            Param to look for in wantsHelp.
166 166
      */
@@ -170,9 +170,9 @@ public class CLIParser {
170 170
 
171 171
     /**
172 172
      * Check if the help parameter has been passed to the CLI.
173
-     * 
173
+     *
174 174
      * @param args Command line arguments to parse
175
-     * 
175
+     *
176 176
      * @return true iif help param is passed
177 177
      */
178 178
     public boolean wantsHelp(final String[] args) {
@@ -220,7 +220,7 @@ public class CLIParser {
220 220
 
221 221
     /**
222 222
      * Given a string array of arguments, parse as CLI Params.
223
-     * 
223
+     *
224 224
      * @param args
225 225
      *            Arguments to pass
226 226
      * @param strict

+ 7
- 7
src/com/dmdirc/installer/cliparser/IntegerParam.java ファイルの表示

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Shane Mc Cormack
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -31,7 +31,7 @@ public class IntegerParam extends CLIParam {
31 31
 
32 32
     /**
33 33
      * Create a new IntegerParam.
34
-     * 
34
+     *
35 35
      * @param chr
36 36
      *            Single Character flag for this param.
37 37
      * @param str
@@ -45,7 +45,7 @@ public class IntegerParam extends CLIParam {
45 45
 
46 46
     /**
47 47
      * Set the value of this param to the value given by a string.
48
-     * 
48
+     *
49 49
      * @param value
50 50
      *            String taken from command line to use as value.
51 51
      * @return true if value was valid, else false.
@@ -62,7 +62,7 @@ public class IntegerParam extends CLIParam {
62 62
 
63 63
     /**
64 64
      * Get the value of this param.
65
-     * 
65
+     *
66 66
      * @return Value of this parameter
67 67
      */
68 68
     public int getValue() {
@@ -71,7 +71,7 @@ public class IntegerParam extends CLIParam {
71 71
 
72 72
     /**
73 73
      * Return the value of this param as a string.
74
-     * 
74
+     *
75 75
      * @return The value of this param as a string.
76 76
      */
77 77
     @Override

+ 15
- 15
src/com/dmdirc/installer/ui/InstallerDialog.java ファイルの表示

@@ -1,17 +1,17 @@
1 1
 /*
2
- * 
2
+ *
3 3
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
4
- * 
4
+ *
5 5
  * Permission is hereby granted, free of charge, to any person obtaining a copy
6 6
  * of this software and associated documentation files (the "Software"), to deal
7 7
  * in the Software without restriction, including without limitation the rights
8 8
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 9
  * copies of the Software, and to permit persons to whom the Software is
10 10
  * furnished to do so, subject to the following conditions:
11
- * 
11
+ *
12 12
  * The above copyright notice and this permission notice shall be included in
13 13
  * all copies or substantial portions of the Software.
14
- * 
14
+ *
15 15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 16
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 17
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -60,7 +60,7 @@ public class InstallerDialog extends JFrame implements ActionListener {
60 60
 
61 61
     /**
62 62
      * Instantiates a new installer dialog
63
-     * 
63
+     *
64 64
      * @param dialogTitle
65 65
      */
66 66
     public InstallerDialog(final String dialogTitle) {
@@ -74,13 +74,13 @@ public class InstallerDialog extends JFrame implements ActionListener {
74 74
 
75 75
 
76 76
         title.setBorder(BorderFactory.createCompoundBorder(
77
-                BorderFactory.createEmptyBorder(SMALL_GAP, SMALL_GAP,SMALL_GAP,
77
+                BorderFactory.createEmptyBorder(SMALL_GAP, SMALL_GAP, SMALL_GAP,
78 78
                 SMALL_GAP), title.getBorder()));
79 79
         wizard.setBorder(BorderFactory.createCompoundBorder(
80
-                BorderFactory.createEmptyBorder(SMALL_GAP, SMALL_GAP,SMALL_GAP,
80
+                BorderFactory.createEmptyBorder(SMALL_GAP, SMALL_GAP, SMALL_GAP,
81 81
                 SMALL_GAP), wizard.getBorder()));
82 82
         control.setBorder(BorderFactory.createCompoundBorder(
83
-                BorderFactory.createEmptyBorder(SMALL_GAP, SMALL_GAP,SMALL_GAP,
83
+                BorderFactory.createEmptyBorder(SMALL_GAP, SMALL_GAP, SMALL_GAP,
84 84
                 SMALL_GAP), control.getBorder()));
85 85
 
86 86
         add(title, BorderLayout.NORTH);
@@ -99,7 +99,7 @@ public class InstallerDialog extends JFrame implements ActionListener {
99 99
 
100 100
     /**
101 101
      * Adds a step.
102
-     * 
102
+     *
103 103
      * @param step Step to add
104 104
      */
105 105
     public void addStep(final SwingStep step) {
@@ -132,7 +132,7 @@ public class InstallerDialog extends JFrame implements ActionListener {
132 132
 
133 133
     /**
134 134
      * Displays the installer with these steps added.
135
-     * 
135
+     *
136 136
      * @param steps Steps to add
137 137
      */
138 138
     public void display(final List<Step> steps) {
@@ -165,7 +165,7 @@ public class InstallerDialog extends JFrame implements ActionListener {
165 165
 
166 166
     /**
167 167
      * shows the cancel confirmation.
168
-     * 
168
+     *
169 169
      * @return true if confirmed
170 170
      */
171 171
     public boolean showCancelConfirmation() {
@@ -239,7 +239,7 @@ public class InstallerDialog extends JFrame implements ActionListener {
239 239
 
240 240
     /**
241 241
      * Informs listeners a step is about to be hidden.
242
-     * 
242
+     *
243 243
      * @param step Step to be hidden
244 244
      */
245 245
     void fireStepHidden(final Step step) {
@@ -250,7 +250,7 @@ public class InstallerDialog extends JFrame implements ActionListener {
250 250
 
251 251
     /**
252 252
      * Adds a step listener to this installer.
253
-     * 
253
+     *
254 254
      * @param listener Listener to add
255 255
      */
256 256
     public void addStepListener(final StepListener listener) {
@@ -296,7 +296,7 @@ public class InstallerDialog extends JFrame implements ActionListener {
296 296
 
297 297
     /**
298 298
      * Removes  a wizard listener from this installer
299
-     * 
299
+     *
300 300
      * @param listener Listener to remove
301 301
      */
302 302
     public void removeWizardListener(final WizardListener listener) {
@@ -326,7 +326,7 @@ public class InstallerDialog extends JFrame implements ActionListener {
326 326
         } catch (IllegalAccessException ex) {
327 327
             throw new UnsupportedOperationException("Unable to switch to the " +
328 328
                                                     "system look and feel", ex);
329
-        }   
329
+        }
330 330
 
331 331
         UIManager.put("swing.useSystemFontSettings", true);
332 332
         UIManager.put("swing.boldMetal", false);

+ 35
- 35
src/com/dmdirc/installer/ui/StepLayout.java ファイルの表示

@@ -62,7 +62,7 @@ public class StepLayout implements LayoutManager2, Serializable {
62 62
 
63 63
     /**
64 64
      * Instantiates a new step layout.
65
-     * 
65
+     *
66 66
      * @param parent Parent component
67 67
      */
68 68
     public StepLayout(final Container parent) {
@@ -71,7 +71,7 @@ public class StepLayout implements LayoutManager2, Serializable {
71 71
 
72 72
     /**
73 73
      * Instantiates a new step layout with the specified gaps.
74
-     * 
74
+     *
75 75
      * @param hGap Horizontal gap
76 76
      * @param vGap Vertical gap
77 77
      */
@@ -81,7 +81,7 @@ public class StepLayout implements LayoutManager2, Serializable {
81 81
 
82 82
     /**
83 83
      * Instantiates a new step layout with the specified gaps.
84
-     * 
84
+     *
85 85
      * @param hGap Horizontal gap
86 86
      * @param vGap Vertical gap
87 87
      * @param parent Parent component
@@ -95,7 +95,7 @@ public class StepLayout implements LayoutManager2, Serializable {
95 95
 
96 96
     /**
97 97
      * Returns the number of steps in the layout.
98
-     * 
98
+     *
99 99
      * @return number of steps >= 0
100 100
      */
101 101
     public int size() {
@@ -104,7 +104,7 @@ public class StepLayout implements LayoutManager2, Serializable {
104 104
 
105 105
     /**
106 106
      * Checks if the layout is empty
107
-     * 
107
+     *
108 108
      * @return true iif the layout has no steps
109 109
      */
110 110
     public boolean isEmpty() {
@@ -113,9 +113,9 @@ public class StepLayout implements LayoutManager2, Serializable {
113 113
 
114 114
     /**
115 115
      * Returns the specified step from the layout.
116
-     * 
116
+     *
117 117
      * @param index Step to retrieve
118
-     * 
118
+     *
119 119
      * @return Step
120 120
      */
121 121
     public Step getStep(final int index) {
@@ -124,7 +124,7 @@ public class StepLayout implements LayoutManager2, Serializable {
124 124
 
125 125
     /**
126 126
      * Returns the step list.
127
-     * 
127
+     *
128 128
      * @return List of steps
129 129
      */
130 130
     public List<SwingStep> getSteps() {
@@ -160,7 +160,7 @@ public class StepLayout implements LayoutManager2, Serializable {
160 160
 
161 161
     /**
162 162
      * Show the first step.
163
-     * 
163
+     *
164 164
      * @param parent Parent container
165 165
      */
166 166
     public void first(final Container parent) {
@@ -169,7 +169,7 @@ public class StepLayout implements LayoutManager2, Serializable {
169 169
 
170 170
     /**
171 171
      * Show the last step.
172
-     * 
172
+     *
173 173
      * @param parent Parent container
174 174
      */
175 175
     public void last(final Container parent) {
@@ -178,16 +178,16 @@ public class StepLayout implements LayoutManager2, Serializable {
178 178
 
179 179
     /**
180 180
      * Show the next step.
181
-     * 
181
+     *
182 182
      * @param parent Parent container
183 183
      */
184 184
     public void next(final Container parent) {
185 185
         show(currentStep + 1, parent);
186 186
     }
187 187
 
188
-    /** 
188
+    /**
189 189
      * Show the previous step.
190
-     * 
190
+     *
191 191
      * @param parent Parent container
192 192
      */
193 193
     public void previous(final Container parent) {
@@ -196,7 +196,7 @@ public class StepLayout implements LayoutManager2, Serializable {
196 196
 
197 197
     /**
198 198
      * Show the specified step.
199
-     * 
199
+     *
200 200
      * @param step Step to show
201 201
      * @param parent Parent container
202 202
      */
@@ -206,7 +206,7 @@ public class StepLayout implements LayoutManager2, Serializable {
206 206
 
207 207
     /**
208 208
      * Show the step at the specified index.
209
-     * 
209
+     *
210 210
      * @param step Step to show
211 211
      * @param parent Parent container
212 212
      */
@@ -247,12 +247,12 @@ public class StepLayout implements LayoutManager2, Serializable {
247 247
         addLayoutComponent((SwingStep) comp);
248 248
     }
249 249
 
250
-    /** 
250
+    /**
251 251
      * {@inheritDoc}
252
-     * 
253
-     * @deprecated Use addLayoutComponent(Component, Object) or 
252
+     *
253
+     * @deprecated Use addLayoutComponent(Component, Object) or
254 254
      * addLayoutComponent(Component)
255
-     * 
255
+     *
256 256
      * @see addLayoutComponent(Component)
257 257
      * @see addLayoutComponent(Component, Object)
258 258
      */
@@ -268,7 +268,7 @@ public class StepLayout implements LayoutManager2, Serializable {
268 268
 
269 269
     /**
270 270
      * Adds a component to the layout.
271
-     * 
271
+     *
272 272
      * @param step Component to add
273 273
      */
274 274
     public void addLayoutComponent(final SwingStep step) {
@@ -292,9 +292,9 @@ public class StepLayout implements LayoutManager2, Serializable {
292 292
         }
293 293
     }
294 294
 
295
-    /** 
295
+    /**
296 296
      * {@inheritDoc}
297
-     * 
297
+     *
298 298
      * @return Returns the preferred size of the container
299 299
      */
300 300
     @Override
@@ -317,9 +317,9 @@ public class StepLayout implements LayoutManager2, Serializable {
317 317
         }
318 318
     }
319 319
 
320
-    /** 
320
+    /**
321 321
      * {@inheritDoc}
322
-     * 
322
+     *
323 323
      * @return Returns the minimum size of the container
324 324
      */
325 325
     @Override
@@ -342,11 +342,11 @@ public class StepLayout implements LayoutManager2, Serializable {
342 342
         }
343 343
     }
344 344
 
345
-    /** 
345
+    /**
346 346
      * {@inheritDoc}
347
-     * 
347
+     *
348 348
      * @param parent Container to get the size for
349
-     * 
349
+     *
350 350
      * @return Returns the maximum size of the container
351 351
      */
352 352
     @Override
@@ -354,11 +354,11 @@ public class StepLayout implements LayoutManager2, Serializable {
354 354
         return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
355 355
     }
356 356
 
357
-    /** 
357
+    /**
358 358
      * {@inheritDoc}
359
-     * 
359
+     *
360 360
      * @param target Container to get the alignment from
361
-     * 
361
+     *
362 362
      * @return Alignment
363 363
      */
364 364
     @Override
@@ -366,11 +366,11 @@ public class StepLayout implements LayoutManager2, Serializable {
366 366
         return 0.5f;
367 367
     }
368 368
 
369
-    /** 
369
+    /**
370 370
      * {@inheritDoc}
371
-     * 
371
+     *
372 372
      * @param target Container to get the alignment from
373
-     * 
373
+     *
374 374
      * @return Alignment
375 375
      */
376 376
     @Override
@@ -378,9 +378,9 @@ public class StepLayout implements LayoutManager2, Serializable {
378 378
         return 0.5f;
379 379
     }
380 380
 
381
-    /** 
381
+    /**
382 382
      * {@inheritDoc}
383
-     * 
383
+     *
384 384
      * @param target  Container to invalidate
385 385
      */
386 386
     @Override

+ 2
- 2
src/com/dmdirc/installer/ui/StepSettings.java ファイルの表示

@@ -83,8 +83,8 @@ public final class StepSettings extends SwingStep implements Settings {
83 83
         constraints.gridx = 0;
84 84
         constraints.gridy = 0;
85 85
         constraints.gridwidth = 2;
86
-        add(new TextLabel("Here you can choose options for the install." +
87
-                          "\n\nInstall Location:"), constraints);
86
+        add(new TextLabel("Here you can choose options for the install."
87
+                + "\n\nInstall Location:"), constraints);
88 88
 
89 89
         constraints.fill = GridBagConstraints.HORIZONTAL;
90 90
         constraints.gridx = 1;

+ 0
- 0
src/com/dmdirc/installer/ui/StepWelcome.java ファイルの表示


変更されたファイルが多すぎるため、一部のファイルは表示されません

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