Bladeren bron

Autoformat all the plugins.

Change-Id: I35bf8ce93d7be8fb714b1a58adc9dd66672ec717
Reviewed-on: http://gerrit.dmdirc.com/3124
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.8
Chris Smith 10 jaren geleden
bovenliggende
commit
74aa499be4
100 gewijzigde bestanden met toevoegingen van 1035 en 939 verwijderingen
  1. 3
    2
      src/com/dmdirc/addons/activewindow/ActiveCommand.java
  2. 1
    2
      src/com/dmdirc/addons/activewindow/ActiveWindowManager.java
  3. 0
    1
      src/com/dmdirc/addons/activewindow/ActiveWindowMessageSink.java
  4. 1
    2
      src/com/dmdirc/addons/activewindow/ActiveWindowModule.java
  5. 4
    4
      src/com/dmdirc/addons/audio/AudioPlayer.java
  6. 0
    1
      src/com/dmdirc/addons/audio/AudioPluginModule.java
  7. 3
    3
      src/com/dmdirc/addons/calc/CalcCommand.java
  8. 1
    2
      src/com/dmdirc/addons/calc/CalcModule.java
  9. 1
    0
      src/com/dmdirc/addons/calc/CalcPlugin.java
  10. 1
    2
      src/com/dmdirc/addons/calc/Evaluator.java
  11. 3
    2
      src/com/dmdirc/addons/calc/Lexer.java
  12. 20
    17
      src/com/dmdirc/addons/calc/Parser.java
  13. 1
    3
      src/com/dmdirc/addons/calc/Token.java
  14. 26
    32
      src/com/dmdirc/addons/calc/TokenType.java
  15. 2
    2
      src/com/dmdirc/addons/calc/TokenTypeArity.java
  16. 0
    2
      src/com/dmdirc/addons/calc/TreeToken.java
  17. 82
    43
      src/com/dmdirc/addons/conditional_execute/ConditionalExecuteCommand.java
  18. 1
    2
      src/com/dmdirc/addons/conditional_execute/ConditionalExecuteModule.java
  19. 13
    14
      src/com/dmdirc/addons/conditional_execute/ConditionalExecuteNamespace.java
  20. 3
    2
      src/com/dmdirc/addons/conditional_execute/ConditionalExecutePlugin.java
  21. 1
    1
      src/com/dmdirc/addons/contactlist/ContactListCommand.java
  22. 7
    3
      src/com/dmdirc/addons/contactlist/ContactListListener.java
  23. 1
    0
      src/com/dmdirc/addons/contactlist/ContactListPlugin.java
  24. 10
    10
      src/com/dmdirc/addons/dcc/ChatContainer.java
  25. 1
    1
      src/com/dmdirc/addons/dcc/DCCChatHandler.java
  26. 25
    32
      src/com/dmdirc/addons/dcc/DCCCommand.java
  27. 4
    5
      src/com/dmdirc/addons/dcc/DCCCommandParser.java
  28. 7
    8
      src/com/dmdirc/addons/dcc/DCCFrameContainer.java
  29. 62
    69
      src/com/dmdirc/addons/dcc/DCCManager.java
  30. 2
    3
      src/com/dmdirc/addons/dcc/DCCTransferHandler.java
  31. 7
    7
      src/com/dmdirc/addons/dcc/PlaceholderContainer.java
  32. 16
    28
      src/com/dmdirc/addons/dcc/TransferContainer.java
  33. 12
    13
      src/com/dmdirc/addons/dcc/actions/DCCActions.java
  34. 8
    6
      src/com/dmdirc/addons/dcc/actions/DCCEvents.java
  35. 29
    33
      src/com/dmdirc/addons/dcc/io/DCC.java
  36. 12
    29
      src/com/dmdirc/addons/dcc/io/DCCTransfer.java
  37. 3
    6
      src/com/dmdirc/addons/dcc/kde/KDialogProcess.java
  38. 49
    41
      src/com/dmdirc/addons/dcc/kde/KFileChooser.java
  39. 2
    2
      src/com/dmdirc/addons/dcc/ui/PlaceholderPanel.java
  40. 5
    8
      src/com/dmdirc/addons/dcc/ui/TransferPanel.java
  41. 2
    0
      src/com/dmdirc/addons/dcop/DcopPlugin.java
  42. 12
    14
      src/com/dmdirc/addons/debug/Debug.java
  43. 22
    23
      src/com/dmdirc/addons/debug/DebugCommand.java
  44. 57
    19
      src/com/dmdirc/addons/debug/DebugModule.java
  45. 3
    2
      src/com/dmdirc/addons/debug/commands/Benchmark.java
  46. 1
    0
      src/com/dmdirc/addons/debug/commands/FakeError.java
  47. 11
    6
      src/com/dmdirc/addons/debug/commands/FakeUpdates.java
  48. 1
    1
      src/com/dmdirc/addons/debug/commands/FirstRun.java
  49. 3
    3
      src/com/dmdirc/addons/debug/commands/ForceUpdate.java
  50. 1
    1
      src/com/dmdirc/addons/debug/commands/GlobalConfigInfo.java
  51. 3
    3
      src/com/dmdirc/addons/debug/commands/Identities.java
  52. 1
    1
      src/com/dmdirc/addons/debug/commands/Services.java
  53. 3
    3
      src/com/dmdirc/addons/debug/commands/StatusbarMessage.java
  54. 2
    3
      src/com/dmdirc/addons/debug/commands/Time.java
  55. 5
    4
      src/com/dmdirc/addons/exec/ExecCommand.java
  56. 1
    0
      src/com/dmdirc/addons/exec/ExecPlugin.java
  57. 7
    5
      src/com/dmdirc/addons/freedesktop_notifications/FDNotifyCommand.java
  58. 10
    5
      src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java
  59. 24
    18
      src/com/dmdirc/addons/identd/IdentClient.java
  60. 38
    38
      src/com/dmdirc/addons/identd/IdentdPlugin.java
  61. 6
    9
      src/com/dmdirc/addons/identd/IdentdServer.java
  62. 7
    5
      src/com/dmdirc/addons/lagdisplay/LagDisplayPanel.java
  63. 18
    13
      src/com/dmdirc/addons/lagdisplay/LagDisplayPlugin.java
  64. 4
    7
      src/com/dmdirc/addons/lagdisplay/PingHistoryPanel.java
  65. 6
    8
      src/com/dmdirc/addons/lagdisplay/ServerInfoDialog.java
  66. 4
    4
      src/com/dmdirc/addons/logging/HistoryWindow.java
  67. 14
    8
      src/com/dmdirc/addons/logging/LoggingCommand.java
  68. 108
    73
      src/com/dmdirc/addons/logging/LoggingPlugin.java
  69. 8
    6
      src/com/dmdirc/addons/mediasource_dbus/DBusMediaSource.java
  70. 9
    5
      src/com/dmdirc/addons/mediasource_dbus/MPRISSource.java
  71. 2
    1
      src/com/dmdirc/addons/mediasource_dcop/DcopMediaSourcePlugin.java
  72. 1
    1
      src/com/dmdirc/addons/mediasource_dcop/NoatunSource.java
  73. 1
    2
      src/com/dmdirc/addons/mediasource_linux_title/TitleMediaSource.java
  74. 7
    7
      src/com/dmdirc/addons/mediasource_linux_title/TitleMediaSourcePlugin.java
  75. 6
    6
      src/com/dmdirc/addons/mediasource_mplayer/MplayerMediaSourcePlugin.java
  76. 3
    5
      src/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePlugin.java
  77. 9
    8
      src/com/dmdirc/addons/mediasource_windows/DllSource.java
  78. 1
    2
      src/com/dmdirc/addons/mediasource_windows/MediaInfoOutput.java
  79. 4
    1
      src/com/dmdirc/addons/mediasource_windows/WindowsMediaSourcePlugin.java
  80. 5
    5
      src/com/dmdirc/addons/nickcolours/ColourRenderer.java
  81. 16
    16
      src/com/dmdirc/addons/nickcolours/NickColourInputDialog.java
  82. 17
    15
      src/com/dmdirc/addons/nickcolours/NickColourManager.java
  83. 3
    2
      src/com/dmdirc/addons/nickcolours/NickColourModule.java
  84. 7
    8
      src/com/dmdirc/addons/nickcolours/NickColourPanel.java
  85. 1
    3
      src/com/dmdirc/addons/nickcolours/NickColourPlugin.java
  86. 6
    10
      src/com/dmdirc/addons/nma/NotifyMyAndroidClient.java
  87. 5
    6
      src/com/dmdirc/addons/nma/NotifyMyAndroidCommand.java
  88. 1
    2
      src/com/dmdirc/addons/nma/NotifyMyAndroidPlugin.java
  89. 6
    5
      src/com/dmdirc/addons/notifications/NotificationCommand.java
  90. 5
    4
      src/com/dmdirc/addons/notifications/NotificationConfig.java
  91. 15
    13
      src/com/dmdirc/addons/notifications/NotificationsPlugin.java
  92. 8
    10
      src/com/dmdirc/addons/nowplaying/ConfigPanel.java
  93. 4
    2
      src/com/dmdirc/addons/nowplaying/MediaSource.java
  94. 7
    8
      src/com/dmdirc/addons/nowplaying/MediaSourceComparator.java
  95. 2
    2
      src/com/dmdirc/addons/nowplaying/MediaSourceManager.java
  96. 15
    14
      src/com/dmdirc/addons/nowplaying/MediaSourceState.java
  97. 13
    11
      src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java
  98. 37
    34
      src/com/dmdirc/addons/nowplaying/NowPlayingPlugin.java
  99. 8
    6
      src/com/dmdirc/addons/nowplaying/NowPlayingSubsitutionPanel.java
  100. 0
    0
      src/com/dmdirc/addons/osd/OsdCommand.java

+ 3
- 2
src/com/dmdirc/addons/activewindow/ActiveCommand.java Bestand weergeven

@@ -19,6 +19,7 @@
19 19
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 20
  * SOFTWARE.
21 21
  */
22
+
22 23
 package com.dmdirc.addons.activewindow;
23 24
 
24 25
 import com.dmdirc.FrameContainer;
@@ -47,7 +48,6 @@ public class ActiveCommand extends Command implements IntelligentCommand {
47 48
     public static final CommandInfo INFO = new BaseCommandInfo("active",
48 49
             "active <command> - executes the command as though it had been "
49 50
             + "executed in the active window", CommandType.TYPE_GLOBAL);
50
-
51 51
     /** Parent MainFrame. */
52 52
     private final MainFrame mainFrame;
53 53
 
@@ -55,7 +55,7 @@ public class ActiveCommand extends Command implements IntelligentCommand {
55 55
      * Creates a new active command.
56 56
      *
57 57
      * @param controller The controller to use for command information.
58
-     * @param mainFrame Parent MainFrame
58
+     * @param mainFrame  Parent MainFrame
59 59
      */
60 60
     @Inject
61 61
     public ActiveCommand(final CommandController controller, final MainFrame mainFrame) {
@@ -82,4 +82,5 @@ public class ActiveCommand extends Command implements IntelligentCommand {
82 82
             final IntelligentCommandContext context) {
83 83
         return TabCompleter.getIntelligentResults(arg, context, 0);
84 84
     }
85
+
85 86
 }

+ 1
- 2
src/com/dmdirc/addons/activewindow/ActiveWindowManager.java Bestand weergeven

@@ -33,7 +33,6 @@ public class ActiveWindowManager {
33 33
 
34 34
     /** The message sink to register and unregister. */
35 35
     private final ActiveWindowMessageSink sink;
36
-
37 36
     /** The manager to add and remove the sink from. */
38 37
     private final MessageSinkManager sinkManager;
39 38
 
@@ -41,7 +40,7 @@ public class ActiveWindowManager {
41 40
      * Creates a new instance of {@link ActiveWindowManager}.
42 41
      *
43 42
      * @param sinkManager The manager to add and remove sinks from.
44
-     * @param sink The sink to be added and removed.
43
+     * @param sink        The sink to be added and removed.
45 44
      */
46 45
     @Inject
47 46
     public ActiveWindowManager(

+ 0
- 1
src/com/dmdirc/addons/activewindow/ActiveWindowMessageSink.java Bestand weergeven

@@ -40,7 +40,6 @@ public class ActiveWindowMessageSink implements MessageSink {
40 40
 
41 41
     /** The pattern to use to match this sink. */
42 42
     private static final Pattern PATTERN = Pattern.compile("active");
43
-
44 43
     /** The main frame to use to get the currently active frame. */
45 44
     private final MainFrame mainFrame;
46 45
 

+ 1
- 2
src/com/dmdirc/addons/activewindow/ActiveWindowModule.java Bestand weergeven

@@ -29,7 +29,6 @@ import dagger.Module;
29 29
 /**
30 30
  * DI module for the active window plugin.
31 31
  */
32
-@Module(injects={ActiveWindowManager.class, ActiveCommand.class}, addsTo = SwingModule.class)
32
+@Module(injects = {ActiveWindowManager.class, ActiveCommand.class}, addsTo = SwingModule.class)
33 33
 public class ActiveWindowModule {
34
-
35 34
 }

+ 4
- 4
src/com/dmdirc/addons/audio/AudioPlayer.java Bestand weergeven

@@ -44,7 +44,6 @@ public final class AudioPlayer implements Runnable {
44 44
         WAV, INVALID;
45 45
 
46 46
     }
47
-
48 47
     /** The file object of the file to play */
49 48
     final File myFile;
50 49
 
@@ -83,6 +82,7 @@ public final class AudioPlayer implements Runnable {
83 82
      * Check if this File is a supported file type
84 83
      *
85 84
      * @param file the File to check
85
+     *
86 86
      * @return true if playable, else false.
87 87
      */
88 88
     public static boolean isValid(final File file) {
@@ -94,6 +94,7 @@ public final class AudioPlayer implements Runnable {
94 94
      * Get the AudioType of a given file
95 95
      *
96 96
      * @param file the File to check
97
+     *
97 98
      * @return AudioType for this file.
98 99
      */
99 100
     public static AudioType getAudioType(final File file) {
@@ -108,9 +109,8 @@ public final class AudioPlayer implements Runnable {
108 109
     }
109 110
 
110 111
     /**
111
-     * Play the file as a wav file, using the Applet class.
112
-     * (This code seems to work better than the non-applet version, but can't play
113
-     * streams)
112
+     * Play the file as a wav file, using the Applet class. (This code seems to work better than the
113
+     * non-applet version, but can't play streams)
114 114
      */
115 115
     private void playWav() {
116 116
         try {

+ 0
- 1
src/com/dmdirc/addons/audio/AudioPluginModule.java Bestand weergeven

@@ -31,5 +31,4 @@ import dagger.Module;
31 31
  */
32 32
 @Module(injects = {AudioCommand.class, BeepCommand.class}, addsTo = ClientModule.class)
33 33
 public class AudioPluginModule {
34
-
35 34
 }

+ 3
- 3
src/com/dmdirc/addons/calc/CalcCommand.java Bestand weergeven

@@ -36,15 +36,15 @@ import java.text.ParseException;
36 36
 import javax.inject.Inject;
37 37
 
38 38
 /**
39
- * A command which allows users to evaluate various mathematical expressions,
40
- * and perform basic calculations.
39
+ * A command which allows users to evaluate various mathematical expressions, and perform basic
40
+ * calculations.
41 41
  */
42 42
 public class CalcCommand extends Command {
43 43
 
44 44
     /** A command info object for this command. */
45 45
     public static final CommandInfo INFO = new BaseCommandInfo("calc",
46 46
             "calc [--showexpr] <expr> - evaluate mathematical expression",
47
-            CommandType.TYPE_GLOBAL) ;
47
+            CommandType.TYPE_GLOBAL);
48 48
 
49 49
     /**
50 50
      * Creates a new instance of this command.

+ 1
- 2
src/com/dmdirc/addons/calc/CalcModule.java Bestand weergeven

@@ -29,7 +29,6 @@ import dagger.Module;
29 29
 /**
30 30
  * DI Module for the calc plugin.
31 31
  */
32
-@Module(injects={CalcCommand.class}, addsTo = ClientModule.class)
32
+@Module(injects = {CalcCommand.class}, addsTo = ClientModule.class)
33 33
 public class CalcModule {
34
-
35 34
 }

+ 1
- 0
src/com/dmdirc/addons/calc/CalcPlugin.java Bestand weergeven

@@ -39,4 +39,5 @@ public class CalcPlugin extends BaseCommandPlugin {
39 39
         setObjectGraph(graph.plus(new CalcModule()));
40 40
         registerCommand(CalcCommand.class, CalcCommand.INFO);
41 41
     }
42
+
42 43
 }

+ 1
- 2
src/com/dmdirc/addons/calc/Evaluator.java Bestand weergeven

@@ -23,8 +23,7 @@
23 23
 package com.dmdirc.addons.calc;
24 24
 
25 25
 /**
26
- * A simple evaluator which just requests that the {@link TreeToken} evaluates
27
- * itself.
26
+ * A simple evaluator which just requests that the {@link TreeToken} evaluates itself.
28 27
  */
29 28
 public class Evaluator {
30 29
 

+ 3
- 2
src/com/dmdirc/addons/calc/Lexer.java Bestand weergeven

@@ -28,8 +28,8 @@ import java.util.Arrays;
28 28
 import java.util.List;
29 29
 
30 30
 /**
31
- * The lexer takes a String input and produces an ordered list of {@link Token}s
32
- * corresponding to the input.
31
+ * The lexer takes a String input and produces an ordered list of {@link Token}s corresponding to
32
+ * the input.
33 33
  */
34 34
 public class Lexer {
35 35
 
@@ -49,6 +49,7 @@ public class Lexer {
49 49
      * Tokenises the input string into an ordered list of tokens.
50 50
      *
51 51
      * @return A list of tokens corresponding to the input string
52
+     *
52 53
      * @throws ParseException If an expected token is not found
53 54
      */
54 55
     public List<Token> tokenise() throws ParseException {

+ 20
- 17
src/com/dmdirc/addons/calc/Parser.java Bestand weergeven

@@ -30,14 +30,13 @@ import java.util.Comparator;
30 30
 import java.util.List;
31 31
 
32 32
 /**
33
- * The parser takes the output from a {@link Lexer} and applies precdence rules
34
- * to build the tokens into a tree.
33
+ * The parser takes the output from a {@link Lexer} and applies precdence rules to build the tokens
34
+ * into a tree.
35 35
  */
36 36
 public class Parser {
37 37
 
38 38
     /** A list of token types sorted by their precendece. */
39 39
     protected static final List<TokenType> TOKENS_BY_PRECEDENCE;
40
-
41 40
     /** The lexer whose output will be parsed. */
42 41
     protected final Lexer lexer;
43 42
 
@@ -53,13 +52,14 @@ public class Parser {
53 52
     }
54 53
 
55 54
     /**
56
-     * Parses the output of this parser's lexer, and returns a {@link TreeToken}
57
-     * representing the parsed formula.
55
+     * Parses the output of this parser's lexer, and returns a {@link TreeToken} representing the
56
+     * parsed formula.
58 57
      *
59 58
      * @return A token tree corresponding to the lexer's token output
60
-     * @throws ParseException If the lexer encounters a parse error, or if an
61
-     * error occurs while parsing the lexer's output (such as a non-sensical
62
-     * formula such as one involving a mis-matched bracket).
59
+     *
60
+     * @throws ParseException If the lexer encounters a parse error, or if an error occurs while
61
+     *                        parsing the lexer's output (such as a non-sensical formula such as one
62
+     *                        involving a mis-matched bracket).
63 63
      */
64 64
     public TreeToken parse() throws ParseException {
65 65
         final List<TreeToken> tokens = new ArrayList<>();
@@ -75,7 +75,9 @@ public class Parser {
75 75
      * Parses the specified tokens into a tree.
76 76
      *
77 77
      * @param tokens The tokens to be parsed
78
+     *
78 79
      * @return A single tree containing all of the specified tokens
80
+     *
79 81
      * @throws ParseException If the tokens contain mismatched brackets
80 82
      */
81 83
     protected TreeToken parse(final List<TreeToken> tokens)
@@ -113,8 +115,8 @@ public class Parser {
113 115
      *
114 116
      * @param tokens The supply of tokens from which the operator will be parsed
115 117
      * @param offset The offset at which the operator occurs
116
-     * @throws ParseException If the operator is a bracket and that bracket is
117
-     * mismatched
118
+     *
119
+     * @throws ParseException If the operator is a bracket and that bracket is mismatched
118 120
      */
119 121
     protected void parseNullaryOperator(final List<TreeToken> tokens,
120 122
             final int offset)
@@ -134,8 +136,8 @@ public class Parser {
134 136
      *
135 137
      * @param tokens The supply of tokens from which the operator will be parsed
136 138
      * @param offset The offset at which the operator occurs
137
-     * @throws ParseException If the operator is a bracket and that bracket is
138
-     * mismatched
139
+     *
140
+     * @throws ParseException If the operator is a bracket and that bracket is mismatched
139 141
      */
140 142
     protected void parseBracket(final List<TreeToken> tokens, final int offset)
141 143
             throws ParseException {
@@ -189,8 +191,8 @@ public class Parser {
189 191
     }
190 192
 
191 193
     /**
192
-     * Parses an operator that does not actually correspond to a piece of the
193
-     * input (such as the START and END operators).
194
+     * Parses an operator that does not actually correspond to a piece of the input (such as the
195
+     * START and END operators).
194 196
      *
195 197
      * @param tokens The supply of tokens from which the operator will be parsed
196 198
      * @param offset The offset at which the operator occurs
@@ -211,11 +213,12 @@ public class Parser {
211 213
     }
212 214
 
213 215
     /**
214
-     * Retrieves the offset of the first token within the input list that has
215
-     * a type corresponding to the specified {@link TokenType}.
216
+     * Retrieves the offset of the first token within the input list that has a type corresponding
217
+     * to the specified {@link TokenType}.
216 218
      *
217 219
      * @param tokens The tokens to be searched
218
-     * @param type The desired token type
220
+     * @param type   The desired token type
221
+     *
219 222
      * @return The index of the first token with that type, or -1 if none found
220 223
      */
221 224
     protected static int findTokenType(final List<TreeToken> tokens,

+ 1
- 3
src/com/dmdirc/addons/calc/Token.java Bestand weergeven

@@ -23,14 +23,12 @@
23 23
 package com.dmdirc.addons.calc;
24 24
 
25 25
 /**
26
- * Describes a distinct piece of a mathematical formula, as tokenised by a
27
- * {@link Lexer}.
26
+ * Describes a distinct piece of a mathematical formula, as tokenised by a {@link Lexer}.
28 27
  */
29 28
 public class Token {
30 29
 
31 30
     /** The type of this token. */
32 31
     private final TokenType type;
33
-
34 32
     /** The content of this token, if any. */
35 33
     private final String content;
36 34
 

+ 26
- 32
src/com/dmdirc/addons/calc/TokenType.java Bestand weergeven

@@ -28,8 +28,8 @@ import java.util.regex.Matcher;
28 28
 import java.util.regex.Pattern;
29 29
 
30 30
 /**
31
- * Describes the different types of possible token, their arities, precedence,
32
- * and the types of token that may follow them.
31
+ * Describes the different types of possible token, their arities, precedence, and the types of
32
+ * token that may follow them.
33 33
  */
34 34
 public enum TokenType {
35 35
 
@@ -37,35 +37,32 @@ public enum TokenType {
37 37
     START(TokenTypeArity.HIDDEN, "^", 0, "NUMBER_*", "BRACKET_OPEN", "MOD_*"),
38 38
     /** The end of an input string. */
39 39
     END(TokenTypeArity.HIDDEN, "$", 0),
40
-
41 40
     /** An opening bracket. */
42 41
     BRACKET_OPEN(TokenTypeArity.NULLARY, "\\(", 0, "NUMBER_*", "MOD_*",
43
-                "BRACKET_OPEN"),
42
+    "BRACKET_OPEN"),
44 43
     /** A closing bracket. */
45 44
     BRACKET_CLOSE(TokenTypeArity.NULLARY, "\\)", 50, "OP_*", "BRACKET_*",
46
-                "END"),
47
-
45
+    "END"),
48 46
     /** A floating point number. */
49 47
     NUMBER_FLOAT(TokenTypeArity.NULLARY, "[0-9]+\\.[0-9]+", 1, "OP_*",
50
-                "BRACKET_*", "END") {
48
+    "BRACKET_*", "END") {
51 49
         /** {@inheritDoc} */
52 50
         @Override
53 51
         public Number evaluate(final TreeToken token) {
54 52
             return Float.valueOf(token.getToken().getContent());
55 53
         }
56 54
     },
57
-
58 55
     /** An integer. */
59 56
     NUMBER_INT(TokenTypeArity.NULLARY, "[0-9]+", 1, "OP_*",
60
-                "BRACKET_*", "END") {
57
+    "BRACKET_*", "END") {
61 58
         /** {@inheritDoc} */
62 59
         @Override
63 60
         public Number evaluate(final TreeToken token) {
64 61
             return Float.valueOf(token.getToken().getContent());
65 62
         }
66 63
     },
67
-
68
-    /** A modifier signalling the following number is positive. */
64
+    /** A modifier signalling the
65
+     * following number is positive. */
69 66
     MOD_POSITIVE(TokenTypeArity.UNARY, "\\+", 100, "NUMBER_*") {
70 67
         /** {@inheritDoc} */
71 68
         @Override
@@ -73,8 +70,8 @@ public enum TokenType {
73 70
             return token.getChildren().get(0).evaluate();
74 71
         }
75 72
     },
76
-
77
-    /** A modifier signalling the following number is negative. */
73
+    /** A modifier signalling the
74
+     * following number is negative. */
78 75
     MOD_NEGATIVE(TokenTypeArity.UNARY, "-", 100, "NUMBER_*") {
79 76
         /** {@inheritDoc} */
80 77
         @Override
@@ -82,7 +79,6 @@ public enum TokenType {
82 79
             return -1 * token.getChildren().get(0).evaluate().floatValue();
83 80
         }
84 81
     },
85
-
86 82
     /** The addition operator. */
87 83
     OP_PLUS(TokenTypeArity.BINARY, "\\+", 7, "NUMBER_*", "BRACKET_OPEN") {
88 84
         /** {@inheritDoc} */
@@ -92,7 +88,6 @@ public enum TokenType {
92 88
                     + token.getChildren().get(1).evaluate().floatValue();
93 89
         }
94 90
     },
95
-
96 91
     /** The subtraction operator. */
97 92
     OP_MINUS(TokenTypeArity.BINARY, "-", 6, "NUMBER_*", "BRACKET_OPEN") {
98 93
         /** {@inheritDoc} */
@@ -102,10 +97,9 @@ public enum TokenType {
102 97
                     - token.getChildren().get(1).evaluate().floatValue();
103 98
         }
104 99
     },
105
-
106 100
     /** The multiplication operator. */
107 101
     OP_MULT(TokenTypeArity.BINARY, "(?=\\()|\\*", 9, "NUMBER_*",
108
-            "BRACKET_OPEN") {
102
+    "BRACKET_OPEN") {
109 103
         /** {@inheritDoc} */
110 104
         @Override
111 105
         public Number evaluate(final TreeToken token) {
@@ -113,7 +107,6 @@ public enum TokenType {
113 107
                     * token.getChildren().get(1).evaluate().floatValue();
114 108
         }
115 109
     },
116
-
117 110
     /** The division operator. */
118 111
     OP_DIVIDE(TokenTypeArity.BINARY, "/", 10, "NUMBER_*", "BRACKET_OPEN") {
119 112
         /** {@inheritDoc} */
@@ -123,7 +116,6 @@ public enum TokenType {
123 116
                     / token.getChildren().get(1).evaluate().floatValue();
124 117
         }
125 118
     },
126
-
127 119
     /** The modulo operator. */
128 120
     OP_MOD(TokenTypeArity.BINARY, "%", 8, "NUMBER_*", "BRACKET_OPEN") {
129 121
         /** {@inheritDoc} */
@@ -133,7 +125,6 @@ public enum TokenType {
133 125
                     % token.getChildren().get(1).evaluate().floatValue();
134 126
         }
135 127
     },
136
-
137 128
     /** The power operator. */
138 129
     OP_POWER(TokenTypeArity.BINARY, "\\^", 11, "NUMBER_*", "BRACKET_OPEN") {
139 130
         /** {@inheritDoc} */
@@ -144,7 +135,6 @@ public enum TokenType {
144 135
                     token.getChildren().get(1).evaluate().doubleValue()));
145 136
         }
146 137
     };
147
-
148 138
     /** The string representation of tokens that may follow this one. */
149 139
     private final String[] strfollows;
150 140
     /** The precedence of this token. */
@@ -159,13 +149,13 @@ public enum TokenType {
159 149
     /**
160 150
      * Creates a new token type with the specified arguments.
161 151
      *
162
-     * @param arity The arity of this token
163
-     * @param regex The regular expression used to match this token
152
+     * @param arity      The arity of this token
153
+     * @param regex      The regular expression used to match this token
164 154
      * @param precedence The precendence of this token
165
-     * @param follows The names of the tokens which may follow this one
155
+     * @param follows    The names of the tokens which may follow this one
166 156
      */
167 157
     TokenType(final TokenTypeArity arity, final String regex,
168
-            final int precedence, final String ... follows) {
158
+            final int precedence, final String... follows) {
169 159
         this.arity = arity;
170 160
         this.strfollows = follows;
171 161
         this.precedence = precedence;
@@ -198,13 +188,14 @@ public enum TokenType {
198 188
     }
199 189
 
200 190
     /**
201
-     * Attempts to match this token type against the specified input string
202
-     * (starting at the specified offset).
191
+     * Attempts to match this token type against the specified input string (starting at the
192
+     * specified offset).
203 193
      *
204
-     * @param input The string to be matched
194
+     * @param input  The string to be matched
205 195
      * @param offset The offset within the string to start at
206
-     * @return -1 if no match was made, otherwise the number of characters that
207
-     * were matched as part of this token type.
196
+     *
197
+     * @return -1 if no match was made, otherwise the number of characters that were matched as part
198
+     *         of this token type.
208 199
      */
209 200
     public int match(final String input, final int offset) {
210 201
         final Matcher matcher = regex.matcher(input);
@@ -219,6 +210,7 @@ public enum TokenType {
219 210
      * Evaluates the specified token of this token type into a number.
220 211
      *
221 212
      * @param token The token to be evaluated
213
+     *
222 214
      * @return A numerical representation of the specified token
223 215
      */
224 216
     public Number evaluate(final TreeToken token) {
@@ -226,10 +218,11 @@ public enum TokenType {
226 218
     }
227 219
 
228 220
     /**
229
-     * Retrieves a list of types which match the specified name. The name
230
-     * may end with an asterisk (*), which is treated as a wild card.
221
+     * Retrieves a list of types which match the specified name. The name may end with an asterisk
222
+     * (*), which is treated as a wild card.
231 223
      *
232 224
      * @param name The name to be searched for
225
+     *
233 226
      * @return A list of matching tokens
234 227
      */
235 228
     protected static List<TokenType> searchValueOf(final String name) {
@@ -244,4 +237,5 @@ public enum TokenType {
244 237
 
245 238
         return res;
246 239
     }
240
+
247 241
 }

+ 2
- 2
src/com/dmdirc/addons/calc/TokenTypeArity.java Bestand weergeven

@@ -28,8 +28,8 @@ package com.dmdirc.addons.calc;
28 28
 public enum TokenTypeArity {
29 29
 
30 30
     /**
31
-     * A special type which does not have any operands and does not correspond
32
-     * to any input (e.g. the special START and END tokens).
31
+     * A special type which does not have any operands and does not correspond to any input (e.g.
32
+     * the special START and END tokens).
33 33
      */
34 34
     HIDDEN,
35 35
     /** A type which takes no operands. */

+ 0
- 2
src/com/dmdirc/addons/calc/TreeToken.java Bestand weergeven

@@ -32,10 +32,8 @@ public class TreeToken {
32 32
 
33 33
     /** The children of this node. */
34 34
     private final List<TreeToken> children = new ArrayList<>();
35
-
36 35
     /** The token at the root of the tree. */
37 36
     private final Token token;
38
-
39 37
     /** Whether or not this tree has been processed. */
40 38
     private boolean processed = false;
41 39
 

+ 82
- 43
src/com/dmdirc/addons/conditional_execute/ConditionalExecuteCommand.java Bestand weergeven

@@ -37,15 +37,14 @@ import java.util.Map;
37 37
 import javax.inject.Inject;
38 38
 
39 39
 /**
40
- * The ConditionalExecute command allows the user to conditionally execute a
41
- * command based on external and pre-determined conditions.
40
+ * The ConditionalExecute command allows the user to conditionally execute a command based on
41
+ * external and pre-determined conditions.
42 42
  */
43 43
 public class ConditionalExecuteCommand extends Command {
44 44
 
45 45
     /** A command info object for this command. */
46 46
     public static final BaseCommandInfo INFO = new BaseCommandInfo("conditionalexecute",
47 47
             "conditionalexecute <args> - Conditionally execute a command", CommandType.TYPE_GLOBAL);
48
-
49 48
     /** Store details about current namespaces. */
50 49
     private final Map<String, ConditionalExecuteNamespace> namespaces = new HashMap<>();
51 50
 
@@ -61,7 +60,8 @@ public class ConditionalExecuteCommand extends Command {
61 60
 
62 61
     /** {@inheritDoc} */
63 62
     @Override
64
-    public void execute(final FrameContainer origin, final CommandArguments args, final CommandContext context) {
63
+    public void execute(final FrameContainer origin, final CommandArguments args,
64
+            final CommandContext context) {
65 65
         final String cmdname = args.getWordsAsString(0, 0);
66 66
 
67 67
         ConditionalExecuteNamespace namespace = null;
@@ -77,47 +77,72 @@ public class ConditionalExecuteCommand extends Command {
77 77
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Usage:");
78 78
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "");
79 79
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, cmdname + " <args>");
80
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, cmdname + " --namespace <name> <namespace commands>");
81
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, cmdname + " --namespace <name> [--inverse] </commandToRun <command args>>");
80
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, cmdname
81
+                        + " --namespace <name> <namespace commands>");
82
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, cmdname
83
+                        + " --namespace <name> [--inverse] </commandToRun <command args>>");
82 84
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "");
83
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Commands can only be specified if no other non-namespace args are given.");
85
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
86
+                        "Commands can only be specified if no other non-namespace args are given.");
84 87
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "");
85
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "When trying to run a command, the namespace will be checked to see if the command can be run.");
86
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "The checks performed are as follows:");
87
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "   1) Does the namespace exist? if not, run the command and create the namespace.");
88
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "   2) Is the namespace inhibited? - Do not run the command.");
89
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "   3) Is the namespace in forced mode? - Run the command.");
90
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "   4) If --inverse is specified, are we under the limit time? Run the command");
91
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "   5) If --inverse is not specified, are we over the limit time? Run the command");
88
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
89
+                        "When trying to run a command, the namespace will be checked to see if the command can be run.");
90
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
91
+                        "The checks performed are as follows:");
92
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
93
+                        "   1) Does the namespace exist? if not, run the command and create the namespace.");
94
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
95
+                        "   2) Is the namespace inhibited? - Do not run the command.");
96
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
97
+                        "   3) Is the namespace in forced mode? - Run the command.");
98
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
99
+                        "   4) If --inverse is specified, are we under the limit time? Run the command");
100
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
101
+                        "   5) If --inverse is not specified, are we over the limit time? Run the command");
92 102
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "   6) Do not run the command.");
93 103
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "");
94 104
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "General Arguments.");
95
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --list                   - List all current namespaces and their status");
96
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --help                   - Print this help.");
97
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --reset                  - Remove all namespaces.");
105
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
106
+                        "  --list                   - List all current namespaces and their status");
107
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
108
+                        "  --help                   - Print this help.");
109
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
110
+                        "  --reset                  - Remove all namespaces.");
98 111
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "");
99 112
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Useful things:");
100
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --namespace <name>       - Namespace to modify. If the namespace does not exist, it will be created. Namespaces are not remembered across sessions.");
113
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
114
+                        "  --namespace <name>       - Namespace to modify. If the namespace does not exist, it will be created. Namespaces are not remembered across sessions.");
101 115
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "");
102 116
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Arguments related to a namespace:");
103
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --settime <time>         - Set the limit time on this namespace. Time can be either a time in seconds, 'now' for now, or 'nowifless' to set to now only if it is currently less.");
104
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --delay <seconds>        - Increase the 'limit' time on this namespace by <seconds> seconds");
105
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --inhibit                - Prevent any attempts at running commands in this namespace from executing");
106
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --force                  - Any future attempts at running commands in this namespace will always execute");
107
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --allow                  - Disable '--force' or '--inhibit' and resume normal operation.");
108
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --remove                 - Remove this namespace.");
109
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --status                 - Show the status of this namespace.");
117
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
118
+                        "  --settime <time>         - Set the limit time on this namespace. Time can be either a time in seconds, 'now' for now, or 'nowifless' to set to now only if it is currently less.");
119
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
120
+                        "  --delay <seconds>        - Increase the 'limit' time on this namespace by <seconds> seconds");
121
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
122
+                        "  --inhibit                - Prevent any attempts at running commands in this namespace from executing");
123
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
124
+                        "  --force                  - Any future attempts at running commands in this namespace will always execute");
125
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
126
+                        "  --allow                  - Disable '--force' or '--inhibit' and resume normal operation.");
127
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
128
+                        "  --remove                 - Remove this namespace.");
129
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
130
+                        "  --status                 - Show the status of this namespace.");
110 131
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "");
111 132
                 sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Arguments when running a command:");
112
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "  --inverse              - Inverse the match against the 'limit' time.");
133
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
134
+                        "  --inverse              - Inverse the match against the 'limit' time.");
113 135
                 return;
114 136
             } else if (arg.equalsIgnoreCase("--list")) {
115 137
                 if (namespaces.isEmpty()) {
116
-                    sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "There are currently no known namespaces.");
138
+                    sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
139
+                            "There are currently no known namespaces.");
117 140
                 } else {
118 141
                     sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Current namespaces: ");
119
-                    for (final Map.Entry<String, ConditionalExecuteNamespace> e : namespaces.entrySet()) {
120
-                        sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "    " + e.getValue().toString());
142
+                    for (final Map.Entry<String, ConditionalExecuteNamespace> e : namespaces.
143
+                            entrySet()) {
144
+                        sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "    " + e.getValue().
145
+                                toString());
121 146
                     }
122 147
                 }
123 148
                 return;
@@ -128,11 +153,13 @@ public class ConditionalExecuteCommand extends Command {
128 153
             } else if (namespace == null) {
129 154
                 if (arg.equalsIgnoreCase("--namespace")) {
130 155
                     if (nextArg.isEmpty()) {
131
-                        sendLine(origin, args.isSilent(), FORMAT_ERROR, "Error: You must specify a namespace.");
156
+                        sendLine(origin, args.isSilent(), FORMAT_ERROR,
157
+                                "Error: You must specify a namespace.");
132 158
                         return;
133 159
                     } else {
134 160
                         if (!namespaces.containsKey(nextArg.toLowerCase())) {
135
-                            namespaces.put(nextArg.toLowerCase(), new ConditionalExecuteNamespace(nextArg.toLowerCase()));
161
+                            namespaces.put(nextArg.toLowerCase(), new ConditionalExecuteNamespace(
162
+                                    nextArg.toLowerCase()));
136 163
                         }
137 164
                         namespace = namespaces.get(nextArg.toLowerCase());
138 165
 
@@ -140,7 +167,8 @@ public class ConditionalExecuteCommand extends Command {
140 167
                         i++;
141 168
                     }
142 169
                 } else {
143
-                    sendLine(origin, args.isSilent(), FORMAT_ERROR, "Error: You must specify a namespace first.");
170
+                    sendLine(origin, args.isSilent(), FORMAT_ERROR,
171
+                            "Error: You must specify a namespace first.");
144 172
                     return;
145 173
                 }
146 174
             } else if (arg.equalsIgnoreCase("--inhibit")) {
@@ -154,13 +182,14 @@ public class ConditionalExecuteCommand extends Command {
154 182
                 manipulated = true;
155 183
             } else if (arg.equalsIgnoreCase("--settime")) {
156 184
                 if (nextArg.isEmpty()) {
157
-                    sendLine(origin, args.isSilent(), FORMAT_ERROR, "Error: You must provide a time to use.");
185
+                    sendLine(origin, args.isSilent(), FORMAT_ERROR,
186
+                            "Error: You must provide a time to use.");
158 187
                     return;
159 188
                 } else if (nextArg.equalsIgnoreCase("now")) {
160 189
                     namespace.setLimit(System.currentTimeMillis());
161 190
                     i++;
162 191
                     manipulated = true;
163
-               } else if (nextArg.equalsIgnoreCase("nowifless")) {
192
+                } else if (nextArg.equalsIgnoreCase("nowifless")) {
164 193
                     if (namespace.getLimitTime() < System.currentTimeMillis()) {
165 194
                         namespace.setLimit(System.currentTimeMillis());
166 195
                     }
@@ -172,13 +201,15 @@ public class ConditionalExecuteCommand extends Command {
172 201
                         i++;
173 202
                         manipulated = true;
174 203
                     } catch (final NumberFormatException nfe) {
175
-                        sendLine(origin, args.isSilent(), FORMAT_ERROR, "Error: Invalid time: " + nextArg);
204
+                        sendLine(origin, args.isSilent(), FORMAT_ERROR, "Error: Invalid time: "
205
+                                + nextArg);
176 206
                         return;
177 207
                     }
178 208
                 }
179 209
             } else if (arg.equalsIgnoreCase("--delay")) {
180 210
                 if (nextArg.isEmpty()) {
181
-                    sendLine(origin, args.isSilent(), FORMAT_ERROR, "Error: You must provide a delay to use.");
211
+                    sendLine(origin, args.isSilent(), FORMAT_ERROR,
212
+                            "Error: You must provide a delay to use.");
182 213
                     return;
183 214
                 } else {
184 215
                     try {
@@ -186,13 +217,15 @@ public class ConditionalExecuteCommand extends Command {
186 217
                         i++;
187 218
                         manipulated = true;
188 219
                     } catch (final NumberFormatException nfe) {
189
-                        sendLine(origin, args.isSilent(), FORMAT_ERROR, "Error: Invalid delay: " + nextArg);
220
+                        sendLine(origin, args.isSilent(), FORMAT_ERROR, "Error: Invalid delay: "
221
+                                + nextArg);
190 222
                         return;
191 223
                     }
192 224
                 }
193 225
             } else if (arg.equalsIgnoreCase("--remove")) {
194 226
                 namespaces.remove(namespace.getName());
195
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Removed namespace '" + namespace.getName() + "'");
227
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Removed namespace '" + namespace.
228
+                        getName() + "'");
196 229
                 return;
197 230
             } else if (arg.equalsIgnoreCase("--status")) {
198 231
                 // Show the current status, incase some manipulations occured prior to this.
@@ -201,11 +234,13 @@ public class ConditionalExecuteCommand extends Command {
201 234
             } else if (arg.equalsIgnoreCase("--inverse")) {
202 235
                 inverse = true;
203 236
             } else if (manipulated) {
204
-                sendLine(origin, args.isSilent(), FORMAT_ERROR, "You can't run commands and manipulate the namespace at the same time, ignored.");
237
+                sendLine(origin, args.isSilent(), FORMAT_ERROR,
238
+                        "You can't run commands and manipulate the namespace at the same time, ignored.");
205 239
             } else {
206 240
                 // Command to run!
207 241
                 if (namespace.canRun(inverse) && origin instanceof WritableFrameContainer) {
208
-                    ((WritableFrameContainer) origin).getCommandParser().parseCommand(origin, args.getArgumentsAsString(i++));
242
+                    ((WritableFrameContainer) origin).getCommandParser().parseCommand(origin, args.
243
+                            getArgumentsAsString(i++));
209 244
                 }
210 245
                 return;
211 246
             }
@@ -220,10 +255,14 @@ public class ConditionalExecuteCommand extends Command {
220 255
             sendLine(origin, args.isSilent(), FORMAT_ERROR, "Usage:");
221 256
             sendLine(origin, args.isSilent(), FORMAT_ERROR, "");
222 257
             sendLine(origin, args.isSilent(), FORMAT_ERROR, cmdname + " <args>");
223
-            sendLine(origin, args.isSilent(), FORMAT_ERROR, cmdname + " --namespace <name> <namespace commands>");
224
-            sendLine(origin, args.isSilent(), FORMAT_ERROR, cmdname + " --namespace <name> [--inverse] </commandToRun <command args>>");
258
+            sendLine(origin, args.isSilent(), FORMAT_ERROR, cmdname
259
+                    + " --namespace <name> <namespace commands>");
260
+            sendLine(origin, args.isSilent(), FORMAT_ERROR, cmdname
261
+                    + " --namespace <name> [--inverse] </commandToRun <command args>>");
225 262
             sendLine(origin, args.isSilent(), FORMAT_ERROR, "");
226
-            sendLine(origin, args.isSilent(), FORMAT_ERROR, "For more information, see " + cmdname + " --help");
263
+            sendLine(origin, args.isSilent(), FORMAT_ERROR, "For more information, see " + cmdname
264
+                    + " --help");
227 265
         }
228 266
     }
267
+
229 268
 }

+ 1
- 2
src/com/dmdirc/addons/conditional_execute/ConditionalExecuteModule.java Bestand weergeven

@@ -29,7 +29,6 @@ import dagger.Module;
29 29
 /**
30 30
  * DI for the conditional execute plugin.
31 31
  */
32
-@Module(injects={ConditionalExecuteCommand.class}, addsTo = ClientModule.class)
32
+@Module(injects = {ConditionalExecuteCommand.class}, addsTo = ClientModule.class)
33 33
 public class ConditionalExecuteModule {
34
-
35 34
 }

+ 13
- 14
src/com/dmdirc/addons/conditional_execute/ConditionalExecuteNamespace.java Bestand weergeven

@@ -29,15 +29,13 @@ import java.text.SimpleDateFormat;
29 29
  * Class representing a ConditionalExecute Namespace.
30 30
  */
31 31
 public class ConditionalExecuteNamespace {
32
+
32 33
     /** Name of this namespace. */
33 34
     private final String name;
34
-
35 35
     /** Are we currently inhibited? */
36 36
     private boolean inhibited = false;
37
-
38 37
     /** Are we currently forced? */
39 38
     private boolean forced = false;
40
-
41 39
     /** What is the current limit time? */
42 40
     private long limitTime = 0L;
43 41
 
@@ -53,14 +51,12 @@ public class ConditionalExecuteNamespace {
53 51
     /**
54 52
      * Can a command in this namespace be run?
55 53
      *
56
-     * This checks as follows:
57
-     *   - Is the namespace inhibited? - return False
58
-     *   - Is the namespace in "force" mode?  - return True
59
-     *   - If inverse is true, are we under the limit time? return True
60
-     *   - If inverse is false, are we over the limit time? return True
61
-     *   - return False
54
+     * This checks as follows: - Is the namespace inhibited? - return False - Is the namespace in
55
+     * "force" mode? - return True - If inverse is true, are we under the limit time? return True -
56
+     * If inverse is false, are we over the limit time? return True - return False
62 57
      *
63 58
      * @param inverse Check if we are *before* the limit time rather than after?
59
+     *
64 60
      * @return True if the command can be run.
65 61
      */
66 62
     public boolean canRun(final boolean inverse) {
@@ -89,6 +85,7 @@ public class ConditionalExecuteNamespace {
89 85
      * Change the limit time on this namespace.
90 86
      *
91 87
      * @param difference Change (in milliseconds) to make to the limit time.
88
+     *
92 89
      * @return New limit time.
93 90
      */
94 91
     public long changeLimit(final long difference) {
@@ -100,6 +97,7 @@ public class ConditionalExecuteNamespace {
100 97
      * Set the limit time on this namespace.
101 98
      *
102 99
      * @param time new Limit time (in milliseconds)
100
+     *
103 101
      * @return New limit time.
104 102
      */
105 103
     public long setLimit(final long time) {
@@ -148,13 +146,13 @@ public class ConditionalExecuteNamespace {
148 146
     public String toString() {
149 147
         final StringBuilder sb = new StringBuilder(getName());
150 148
         if (isForced()) {
151
-          sb.append(" - Forced");
149
+            sb.append(" - Forced");
152 150
         } else if (isInhibited()) {
153
-          sb.append(" - Inhibited");
151
+            sb.append(" - Inhibited");
154 152
         } else {
155
-          sb.append(" - Limit Time: ");
156
-          final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
157
-          sb.append(dateFormat.format(limitTime));
153
+            sb.append(" - Limit Time: ");
154
+            final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
155
+            sb.append(dateFormat.format(limitTime));
158 156
         }
159 157
         if (canRun(false)) {
160 158
             sb.append(" [Can Run]");
@@ -164,4 +162,5 @@ public class ConditionalExecuteNamespace {
164 162
         }
165 163
         return sb.toString();
166 164
     }
165
+
167 166
 }

+ 3
- 2
src/com/dmdirc/addons/conditional_execute/ConditionalExecutePlugin.java Bestand weergeven

@@ -28,8 +28,8 @@ import com.dmdirc.plugins.implementations.BaseCommandPlugin;
28 28
 import dagger.ObjectGraph;
29 29
 
30 30
 /**
31
- * The ConditionalExecute plugin allows the user to run commands only if
32
- * external conditions have been met.
31
+ * The ConditionalExecute plugin allows the user to run commands only if external conditions have
32
+ * been met.
33 33
  */
34 34
 public final class ConditionalExecutePlugin extends BaseCommandPlugin {
35 35
 
@@ -39,4 +39,5 @@ public final class ConditionalExecutePlugin extends BaseCommandPlugin {
39 39
         setObjectGraph(graph.plus(new ConditionalExecuteModule()));
40 40
         registerCommand(ConditionalExecuteCommand.class, ConditionalExecuteCommand.INFO);
41 41
     }
42
+
42 43
 }

+ 1
- 1
src/com/dmdirc/addons/contactlist/ContactListCommand.java Bestand weergeven

@@ -42,7 +42,7 @@ public class ContactListCommand extends Command implements IntelligentCommand {
42 42
     /** A command info object for this command. */
43 43
     public static final CommandInfo INFO = new BaseCommandInfo("contactlist",
44 44
             "contactlist - show a contact list for the current channel",
45
-            CommandType.TYPE_CHANNEL) ;
45
+            CommandType.TYPE_CHANNEL);
46 46
 
47 47
     /**
48 48
      * Creates a new instance of this command.

+ 7
- 3
src/com/dmdirc/addons/contactlist/ContactListListener.java Bestand weergeven

@@ -59,7 +59,8 @@ public class ContactListListener implements NicklistListener,
59 59
     public void addListeners() {
60 60
         channel.addNicklistListener(this);
61 61
         channel.addCloseListener(this);
62
-        ActionManager.getActionManager().registerListener(this, CoreActionType.CHANNEL_USERAWAY, CoreActionType.CHANNEL_USERBACK);
62
+        ActionManager.getActionManager().registerListener(this, CoreActionType.CHANNEL_USERAWAY,
63
+                CoreActionType.CHANNEL_USERBACK);
63 64
     }
64 65
 
65 66
     /**
@@ -88,7 +89,8 @@ public class ContactListListener implements NicklistListener,
88 89
     /** {@inheritDoc} */
89 90
     @Override
90 91
     public void clientAdded(final ChannelClientInfo client) {
91
-        final Query query = channel.getConnection().getQuery(client.getClient().getNickname(), false);
92
+        final Query query = channel.getConnection().
93
+                getQuery(client.getClient().getNickname(), false);
92 94
 
93 95
         query.setIcon("query-" + client.getClient().getAwayState().name().toLowerCase());
94 96
     }
@@ -101,7 +103,8 @@ public class ContactListListener implements NicklistListener,
101 103
 
102 104
     /** {@inheritDoc} */
103 105
     @Override
104
-    public void processEvent(final ActionType type, final StringBuffer format, final Object... arguments) {
106
+    public void processEvent(final ActionType type, final StringBuffer format,
107
+            final Object... arguments) {
105 108
         if (arguments[0] == channel) {
106 109
             clientAdded((ChannelClientInfo) arguments[1]);
107 110
         }
@@ -112,4 +115,5 @@ public class ContactListListener implements NicklistListener,
112 115
     public void windowClosing(final FrameContainer window) {
113 116
         removeListeners();
114 117
     }
118
+
115 119
 }

+ 1
- 0
src/com/dmdirc/addons/contactlist/ContactListPlugin.java Bestand weergeven

@@ -39,4 +39,5 @@ public final class ContactListPlugin extends BaseCommandPlugin {
39 39
         super(commandController);
40 40
         registerCommand(new ContactListCommand(commandController), ContactListCommand.INFO);
41 41
     }
42
+
42 43
 }

+ 10
- 10
src/com/dmdirc/addons/dcc/ChatContainer.java Bestand weergeven

@@ -49,15 +49,15 @@ public class ChatContainer extends DCCFrameContainer implements DCCChatHandler {
49 49
     /**
50 50
      * Creates a new instance of DCCChatWindow with a given DCCChat object.
51 51
      *
52
-     * @param dcc The DCCChat object this window wraps around
53
-     * @param configManager Config manager
54
-     * @param commandController The controller to use in the command parser.
55
-     * @param title The title of this window
56
-     * @param nick My Current Nickname
57
-     * @param targetNick Nickname of target
52
+     * @param dcc                 The DCCChat object this window wraps around
53
+     * @param configManager       Config manager
54
+     * @param commandController   The controller to use in the command parser.
55
+     * @param title               The title of this window
56
+     * @param nick                My Current Nickname
57
+     * @param targetNick          Nickname of target
58 58
      * @param tabCompleterFactory The factory to use to create tab completers.
59
-     * @param messageSinkManager The sink manager to use to despatch messages.
60
-     * @param urlBuilder The URL builder to use when finding icons.
59
+     * @param messageSinkManager  The sink manager to use to despatch messages.
60
+     * @param urlBuilder          The URL builder to use when finding icons.
61 61
      */
62 62
     public ChatContainer(
63 63
             final DCCChat dcc,
@@ -75,8 +75,8 @@ public class ChatContainer extends DCCFrameContainer implements DCCChatHandler {
75 75
                 tabCompleterFactory,
76 76
                 urlBuilder,
77 77
                 Arrays.asList(
78
-                    WindowComponent.TEXTAREA.getIdentifier(),
79
-                    WindowComponent.INPUTFIELD.getIdentifier()));
78
+                WindowComponent.TEXTAREA.getIdentifier(),
79
+                WindowComponent.INPUTFIELD.getIdentifier()));
80 80
         dccChat = dcc;
81 81
         dcc.setHandler(this);
82 82
         nickname = nick;

+ 1
- 1
src/com/dmdirc/addons/dcc/DCCChatHandler.java Bestand weergeven

@@ -32,7 +32,7 @@ public interface DCCChatHandler {
32 32
     /**
33 33
      * Handle a received message.
34 34
      *
35
-     * @param dcc The DCCChat that this message is from
35
+     * @param dcc     The DCCChat that this message is from
36 36
      * @param message The message
37 37
      */
38 38
     void handleChatMessage(DCCChat dcc, String message);

+ 25
- 32
src/com/dmdirc/addons/dcc/DCCCommand.java Bestand weergeven

@@ -65,7 +65,6 @@ public class DCCCommand extends Command implements IntelligentCommand {
65 65
     public static final CommandInfo INFO = new BaseCommandInfo("dcc",
66 66
             "dcc <SEND|CHAT> <target> [params] - starts a DCC",
67 67
             CommandType.TYPE_SERVER);
68
-
69 68
     /** My Plugin. */
70 69
     private final DCCManager myPlugin;
71 70
     /** Main frame instance used as the parent for dialogs. */
@@ -82,13 +81,13 @@ public class DCCCommand extends Command implements IntelligentCommand {
82 81
     /**
83 82
      * Creates a new instance of DCCCommand.
84 83
      *
85
-     * @param controller The controller to use for command information.
86
-     * @param mainFrame mainFrame instance to use
87
-     * @param plugin The DCC Plugin that this command belongs to
88
-     * @param messageSinkManager The sink manager to use to despatch messages.
89
-     * @param windowManager Window management
84
+     * @param controller          The controller to use for command information.
85
+     * @param mainFrame           mainFrame instance to use
86
+     * @param plugin              The DCC Plugin that this command belongs to
87
+     * @param messageSinkManager  The sink manager to use to despatch messages.
88
+     * @param windowManager       Window management
90 89
      * @param tabCompleterFactory The factory to use for tab completers.
91
-     * @param urlBuilder The URL builder to use when finding icons.
90
+     * @param urlBuilder          The URL builder to use when finding icons.
92 91
      */
93 92
     @Inject
94 93
     public DCCCommand(
@@ -122,7 +121,6 @@ public class DCCCommand extends Command implements IntelligentCommand {
122 121
                     || parser.getStringConverter().equalsIgnoreCase(target,
123 122
                     myNickname)) {
124 123
                 new Thread(new Runnable() {
125
-
126 124
                     /** {@inheritDoc} */
127 125
                     @Override
128 126
                     public void run() {
@@ -137,7 +135,6 @@ public class DCCCommand extends Command implements IntelligentCommand {
137 135
                                     JOptionPane.ERROR_MESSAGE);
138 136
                         }
139 137
                     }
140
-
141 138
                 }, "DCC-Error-Message").start();
142 139
                 return;
143 140
             }
@@ -159,12 +156,12 @@ public class DCCCommand extends Command implements IntelligentCommand {
159 156
     /**
160 157
      * Starts a DCC Chat.
161 158
      *
162
-     * @param parser Parser from which command originated
159
+     * @param parser     Parser from which command originated
163 160
      * @param connection Server from which command originated
164
-     * @param origin Frame container from which command originated
161
+     * @param origin     Frame container from which command originated
165 162
      * @param myNickname My current nickname
166
-     * @param target Target of the command
167
-     * @param isSilent Is this a silent command
163
+     * @param target     Target of the command
164
+     * @param isSilent   Is this a silent command
168 165
      */
169 166
     private void startChat(final Parser parser, final Connection connection,
170 167
             final FrameContainer origin, final String myNickname,
@@ -193,11 +190,12 @@ public class DCCCommand extends Command implements IntelligentCommand {
193 190
     /**
194 191
      * Ask for the file to send, then start the send.
195 192
      *
196
-     * @param target Person this dcc is to.
197
-     * @param origin The InputWindow this command was issued on
193
+     * @param target     Person this dcc is to.
194
+     * @param origin     The InputWindow this command was issued on
198 195
      * @param connection The server instance that this command is being executed on
199
-     * @param isSilent Whether this command is silenced or not
200
-     * @param filename The file to send
196
+     * @param isSilent   Whether this command is silenced or not
197
+     * @param filename   The file to send
198
+     *
201 199
      * @since 0.6.3m1
202 200
      */
203 201
     public void sendFile(final String target, final FrameContainer origin,
@@ -205,14 +203,13 @@ public class DCCCommand extends Command implements IntelligentCommand {
205 203
         // New thread to ask the user what file to send
206 204
         final File givenFile = new File(filename);
207 205
         final File selectedFile = UIUtilities.invokeAndWait(new Callable<File>() {
208
-
209 206
             @Override
210 207
             public File call() {
211 208
                 final JFileChooser jc = givenFile.exists()
212 209
                         ? KFileChooser.getFileChooser(origin.getConfigManager(),
213
-                                myPlugin, givenFile)
210
+                        myPlugin, givenFile)
214 211
                         : KFileChooser.getFileChooser(origin.getConfigManager(),
215
-                                myPlugin);
212
+                        myPlugin);
216 213
                 final int result = showFileChooser(givenFile, target, jc);
217 214
 
218 215
                 if (result != JFileChooser.APPROVE_OPTION
@@ -226,7 +223,6 @@ public class DCCCommand extends Command implements IntelligentCommand {
226 223
             return;
227 224
         }
228 225
         new Thread(new Runnable() {
229
-
230 226
             /** {@inheritDoc} */
231 227
             @Override
232 228
             public void run() {
@@ -279,7 +275,6 @@ public class DCCCommand extends Command implements IntelligentCommand {
279 275
                     }
280 276
                 }
281 277
             }
282
-
283 278
         }, "openFileThread").start();
284 279
     }
285 280
 
@@ -308,15 +303,14 @@ public class DCCCommand extends Command implements IntelligentCommand {
308 303
      * Sets up and display a file chooser.
309 304
      *
310 305
      * @param givenFile File to display
311
-     * @param target DCC target
312
-     * @param jc File chooser
306
+     * @param target    DCC target
307
+     * @param jc        File chooser
313 308
      *
314
-     * @return   the return state of the file chooser on popdown:
309
+     * @return the return state of the file chooser on popdown:
315 310
      * <ul>
316 311
      * <li>JFileChooser.CANCEL_OPTION
317 312
      * <li>JFileChooser.APPROVE_OPTION
318
-     * <li>JFileChooser.ERROR_OPTION if an error occurs or the
319
-     *                               dialog is dismissed
313
+     * <li>JFileChooser.ERROR_OPTION if an error occurs or the dialog is dismissed
320 314
      * </ul>
321 315
      */
322 316
     private int showFileChooser(final File givenFile, final String target,
@@ -325,10 +319,10 @@ public class DCCCommand extends Command implements IntelligentCommand {
325 319
             jc.setSelectedFile(givenFile);
326 320
             return JFileChooser.APPROVE_OPTION;
327 321
         } else {
328
-        jc.setDialogTitle("Send file to " + target + " - DMDirc ");
329
-        jc.setFileSelectionMode(JFileChooser.FILES_ONLY);
330
-        jc.setMultiSelectionEnabled(false);
331
-        return jc.showOpenDialog(mainFrame);
322
+            jc.setDialogTitle("Send file to " + target + " - DMDirc ");
323
+            jc.setFileSelectionMode(JFileChooser.FILES_ONLY);
324
+            jc.setMultiSelectionEnabled(false);
325
+            return jc.showOpenDialog(mainFrame);
332 326
         }
333 327
     }
334 328
 
@@ -353,4 +347,3 @@ public class DCCCommand extends Command implements IntelligentCommand {
353 347
     }
354 348
 
355 349
 }
356
-

+ 4
- 5
src/com/dmdirc/addons/dcc/DCCCommandParser.java Bestand weergeven

@@ -40,7 +40,7 @@ public class DCCCommandParser extends GlobalCommandParser {
40 40
     /**
41 41
      * Creates a new instance of the GlobalCommandParser.
42 42
      *
43
-     * @param configManager Config manager
43
+     * @param configManager     Config manager
44 44
      * @param commandController The controller to load commands and command info from.
45 45
      */
46 46
     public DCCCommandParser(
@@ -56,12 +56,11 @@ public class DCCCommandParser extends GlobalCommandParser {
56 56
     }
57 57
 
58 58
     /**
59
-     * Called when the input was a line of text that was not a command.
60
-     * This normally means it is sent to the server/channel/user as-is, with
61
-     * no further processing.
59
+     * Called when the input was a line of text that was not a command. This normally means it is
60
+     * sent to the server/channel/user as-is, with no further processing.
62 61
      *
63 62
      * @param origin The window in which the command was typed
64
-     * @param line The line input by the user
63
+     * @param line   The line input by the user
65 64
      */
66 65
     @Override
67 66
     protected void handleNonCommand(final FrameContainer origin, final String line) {

+ 7
- 8
src/com/dmdirc/addons/dcc/DCCFrameContainer.java Bestand weergeven

@@ -40,21 +40,20 @@ public abstract class DCCFrameContainer extends WritableFrameContainer {
40 40
 
41 41
     /** The factory to use to create tab completers. */
42 42
     private final TabCompleterFactory tabCompleterFactory;
43
-
44 43
     /** The Window we're using. */
45 44
     private boolean windowClosing = false;
46 45
 
47 46
     /**
48 47
      * Creates a new instance of DCCFrame.
49 48
      *
50
-     * @param title The title of this window
51
-     * @param icon The icon to use
52
-     * @param configManager Config manager
53
-     * @param parser Command parser to use for this window
54
-     * @param messageSinkManager The sink manager to use to despatch messages.
49
+     * @param title               The title of this window
50
+     * @param icon                The icon to use
51
+     * @param configManager       Config manager
52
+     * @param parser              Command parser to use for this window
53
+     * @param messageSinkManager  The sink manager to use to despatch messages.
55 54
      * @param tabCompleterFactory The factory to use to create tab completers.
56
-     * @param urlBuilder The URL builder to use when finding icons.
57
-     * @param components The UI components that this frame requires
55
+     * @param urlBuilder          The URL builder to use when finding icons.
56
+     * @param components          The UI components that this frame requires
58 57
      */
59 58
     public DCCFrameContainer(
60 59
             final String title,

+ 62
- 69
src/com/dmdirc/addons/dcc/DCCManager.java Bestand weergeven

@@ -101,18 +101,18 @@ public class DCCManager implements ActionListener {
101 101
     /**
102 102
      * Creates a new instance of this plugin.
103 103
      *
104
-     * @param mainFrame The main frame that will own any new windows.
105
-     * @param pluginInfo This plugin's plugin info
106
-     * @param identityController The Identity controller that provides the current config
107
-     * @param globalConfig The configuration to read settings from.
108
-     * @param commandController Command controller to register commands
109
-     * @param messageSinkManager The sink manager to use to despatch messages.
110
-     * @param windowManager Window Management
111
-     * @param tabCompleterFactory The factory to use for tab completers.
112
-     * @param windowFactory The window factory to register the DCC implementations with.
104
+     * @param mainFrame             The main frame that will own any new windows.
105
+     * @param pluginInfo            This plugin's plugin info
106
+     * @param identityController    The Identity controller that provides the current config
107
+     * @param globalConfig          The configuration to read settings from.
108
+     * @param commandController     Command controller to register commands
109
+     * @param messageSinkManager    The sink manager to use to despatch messages.
110
+     * @param windowManager         Window Management
111
+     * @param tabCompleterFactory   The factory to use for tab completers.
112
+     * @param windowFactory         The window factory to register the DCC implementations with.
113 113
      * @param componentFrameFactory Factory to use to create new component frames for DCC windows.
114
-     * @param urlBuilder The URL builder to use when finding icons.
115
-     * @param baseDirectory The directory to create a downloads directory within.
114
+     * @param urlBuilder            The URL builder to use when finding icons.
115
+     * @param baseDirectory         The directory to create a downloads directory within.
116 116
      */
117 117
     @Inject
118 118
     public DCCManager(
@@ -141,19 +141,19 @@ public class DCCManager implements ActionListener {
141 141
         windowFactory.registerImplementation(
142 142
                 new HashSet<>(Arrays.asList("com.dmdirc.addons.dcc.ui.PlaceholderPanel")),
143 143
                 new SwingWindowFactory.WindowProvider() {
144
-                    @Override
145
-                    public TextFrame getWindow(final FrameContainer container) {
146
-                        return componentFrameFactory.getComponentFrame(container);
147
-                    }
148
-                });
144
+            @Override
145
+            public TextFrame getWindow(final FrameContainer container) {
146
+                return componentFrameFactory.getComponentFrame(container);
147
+            }
148
+        });
149 149
         windowFactory.registerImplementation(
150 150
                 new HashSet<>(Arrays.asList("com.dmdirc.addons.dcc.ui.TransferPanel")),
151 151
                 new SwingWindowFactory.WindowProvider() {
152
-                    @Override
153
-                    public TextFrame getWindow(final FrameContainer container) {
154
-                        return componentFrameFactory.getComponentFrame(container);
155
-                    }
156
-                });
152
+            @Override
153
+            public TextFrame getWindow(final FrameContainer container) {
154
+                return componentFrameFactory.getComponentFrame(container);
155
+            }
156
+        });
157 157
 
158 158
         final ConfigProvider defaults = identityController.getAddonSettings();
159 159
         defaults.setOption(domain, "receive.savelocation",
@@ -165,22 +165,20 @@ public class DCCManager implements ActionListener {
165 165
     }
166 166
 
167 167
     /**
168
-     * Ask a question, if the answer is the answer required, then recall
169
-     * handleProcessEvent.
168
+     * Ask a question, if the answer is the answer required, then recall handleProcessEvent.
170 169
      *
171
-     * @param question Question to ask
172
-     * @param title Title of question dialog
170
+     * @param question      Question to ask
171
+     * @param title         Title of question dialog
173 172
      * @param desiredAnswer Answer required
174
-     * @param type Actiontype to pass back
175
-     * @param format StringBuffer to pass back
176
-     * @param arguments arguments to pass back
173
+     * @param type          Actiontype to pass back
174
+     * @param format        StringBuffer to pass back
175
+     * @param arguments     arguments to pass back
177 176
      */
178 177
     public void askQuestion(final String question, final String title,
179 178
             final int desiredAnswer, final ActionType type,
180 179
             final StringBuffer format, final Object... arguments) {
181 180
         // New thread to ask the question in to stop us locking the UI
182 181
         new Thread(new Runnable() {
183
-
184 182
             /** {@inheritDoc} */
185 183
             @Override
186 184
             public void run() {
@@ -190,7 +188,6 @@ public class DCCManager implements ActionListener {
190 188
                     handleProcessEvent(type, format, true, arguments);
191 189
                 }
192 190
             }
193
-
194 191
         }, "QuestionThread: " + title).start();
195 192
     }
196 193
 
@@ -198,16 +195,15 @@ public class DCCManager implements ActionListener {
198 195
      * Ask the location to save a file, then start the download.
199 196
      *
200 197
      * @param nickname Person this dcc is from.
201
-     * @param send The DCCSend to save for.
202
-     * @param parser The parser this send was received on
203
-     * @param reverse Is this a reverse dcc?
204
-     * @param token Token used in reverse dcc.
198
+     * @param send     The DCCSend to save for.
199
+     * @param parser   The parser this send was received on
200
+     * @param reverse  Is this a reverse dcc?
201
+     * @param token    Token used in reverse dcc.
205 202
      */
206 203
     public void saveFile(final String nickname, final DCCTransfer send,
207 204
             final Parser parser, final boolean reverse, final String token) {
208 205
         // New thread to ask the user where to save in to stop us locking the UI
209 206
         new Thread(new Runnable() {
210
-
211 207
             /** {@inheritDoc} */
212 208
             @Override
213 209
             public void run() {
@@ -224,7 +220,7 @@ public class DCCManager implements ActionListener {
224 220
                     return;
225 221
                 }
226 222
                 send.setFileName(jc.getSelectedFile().getPath());
227
-                if (!handleExists(send, jc, nickname, parser,reverse, token)) {
223
+                if (!handleExists(send, jc, nickname, parser, reverse, token)) {
228 224
                     return;
229 225
                 }
230 226
                 final boolean resume = handleResume(jc);
@@ -268,19 +264,18 @@ public class DCCManager implements ActionListener {
268 264
                     }
269 265
                 }
270 266
             }
271
-
272 267
         }, "saveFileThread: " + send.getShortFileName()).start();
273 268
     }
274 269
 
275 270
     /**
276 271
      * Checks if the selected file exists and prompts the user as required.
277 272
      *
278
-     * @param send DCC Transfer
279
-     * @param jc File chooser
273
+     * @param send     DCC Transfer
274
+     * @param jc       File chooser
280 275
      * @param nickname Remote nickname
281
-     * @param parser Parser
282
-     * @param reverse Reverse DCC?
283
-     * @param token DCC token
276
+     * @param parser   Parser
277
+     * @param reverse  Reverse DCC?
278
+     * @param token    DCC token
284 279
      *
285 280
      * @return true if the user wants to continue, false if they wish to abort
286 281
      */
@@ -332,21 +327,20 @@ public class DCCManager implements ActionListener {
332 327
      * Sets up and display a file chooser.
333 328
      *
334 329
      * @param send DCCTransfer object sending the file
335
-     * @param jc File chooser
330
+     * @param jc   File chooser
336 331
      *
337
-     * @return   the return state of the file chooser on popdown:
332
+     * @return the return state of the file chooser on popdown:
338 333
      * <ul>
339 334
      * <li>JFileChooser.CANCEL_OPTION
340 335
      * <li>JFileChooser.APPROVE_OPTION
341
-     * <li>JFileChooser.ERROR_OPTION if an error occurs or the
342
-     *                               dialog is dismissed
336
+     * <li>JFileChooser.ERROR_OPTION if an error occurs or the dialog is dismissed
343 337
      * </ul>
344 338
      */
345 339
     private int showFileChooser(final DCCTransfer send, final JFileChooser jc) {
346 340
         jc.setDialogTitle("Save " + send.getShortFileName() + " As - DMDirc");
347
-                jc.setFileSelectionMode(JFileChooser.FILES_ONLY);
348
-                jc.setMultiSelectionEnabled(false);
349
-                jc.setSelectedFile(new File(send.getFileName()));
341
+        jc.setFileSelectionMode(JFileChooser.FILES_ONLY);
342
+        jc.setMultiSelectionEnabled(false);
343
+        jc.setSelectedFile(new File(send.getFileName()));
350 344
         return jc.showSaveDialog(mainFrame);
351 345
     }
352 346
 
@@ -358,11 +352,11 @@ public class DCCManager implements ActionListener {
358 352
     }
359 353
 
360 354
     /**
361
-     * Make the given DCC start listening.
362
-     * This will either call dcc.listen() or dcc.listen(startPort, endPort)
363
-     * depending on config.
355
+     * Make the given DCC start listening. This will either call dcc.listen() or
356
+     * dcc.listen(startPort, endPort) depending on config.
364 357
      *
365 358
      * @param dcc DCC to start listening.
359
+     *
366 360
      * @return True if Socket was opened.
367 361
      */
368 362
     protected boolean listen(final DCC dcc) {
@@ -387,9 +381,9 @@ public class DCCManager implements ActionListener {
387 381
     /**
388 382
      * Process an event of the specified type.
389 383
      *
390
-     * @param type The type of the event to process
391
-     * @param format Format of messages that are about to be sent. (May be null)
392
-     * @param dontAsk Don't ask any questions, assume yes.
384
+     * @param type      The type of the event to process
385
+     * @param format    Format of messages that are about to be sent. (May be null)
386
+     * @param dontAsk   Don't ask any questions, assume yes.
393 387
      * @param arguments The arguments for the event
394 388
      */
395 389
     public void handleProcessEvent(final ActionType type,
@@ -421,10 +415,10 @@ public class DCCManager implements ActionListener {
421 415
     /**
422 416
      * Handles a DCC chat request.
423 417
      *
424
-     * @param type The type of the event to process
425
-     * @param format Format of messages that are about to be sent. (May be null)
426
-     * @param dontAsk Don't ask any questions, assume yes.
427
-     * @param ctcpData CTCP data bits
418
+     * @param type      The type of the event to process
419
+     * @param format    Format of messages that are about to be sent. (May be null)
420
+     * @param dontAsk   Don't ask any questions, assume yes.
421
+     * @param ctcpData  CTCP data bits
428 422
      * @param arguments The arguments for the event
429 423
      */
430 424
     private void handleChat(final ActionType type, final StringBuffer format,
@@ -464,10 +458,10 @@ public class DCCManager implements ActionListener {
464 458
     /**
465 459
      * Handles a DCC send request.
466 460
      *
467
-     * @param type The type of the event to process
468
-     * @param format Format of messages that are about to be sent. (May be null)
469
-     * @param dontAsk Don't ask any questions, assume yes.
470
-     * @param ctcpData CTCP data bits
461
+     * @param type      The type of the event to process
462
+     * @param format    Format of messages that are about to be sent. (May be null)
463
+     * @param dontAsk   Don't ask any questions, assume yes.
464
+     * @param ctcpData  CTCP data bits
471 465
      * @param arguments The arguments for the event
472 466
      */
473 467
     private void handleSend(final ActionType type, final StringBuffer format,
@@ -578,7 +572,7 @@ public class DCCManager implements ActionListener {
578 572
     /**
579 573
      * Handles a DCC chat request.
580 574
      *
581
-     * @param ctcpData CTCP data bits
575
+     * @param ctcpData  CTCP data bits
582 576
      * @param arguments The arguments for the event
583 577
      */
584 578
     private void handleReceive(final String[] ctcpData,
@@ -613,8 +607,8 @@ public class DCCManager implements ActionListener {
613 607
         try {
614 608
             port = Integer.parseInt(ctcpData[++i]);
615 609
             position = Integer.parseInt(ctcpData[++i]);
616
-            } catch (NumberFormatException nfe) {
617
-                return;
610
+        } catch (NumberFormatException nfe) {
611
+            return;
618 612
         }
619 613
         final String token = (ctcpData.length - 1 > i) ? " "
620 614
                 + ctcpData[++i] : "";
@@ -630,7 +624,7 @@ public class DCCManager implements ActionListener {
630 624
                 final Parser parser = ((Connection) arguments[0]).getParser();
631 625
                 final String nick = ((ClientInfo) arguments[1]).getNickname();
632 626
                 if (ctcpData[0].equalsIgnoreCase("resume")) {
633
-                    parser.sendCTCP(nick, "DCC", "ACCEPT "+ ((quoted) ? "\""
627
+                    parser.sendCTCP(nick, "DCC", "ACCEPT " + ((quoted) ? "\""
634 628
                             + filename + "\"" : filename) + " " + port + " "
635 629
                             + send.setFileStart(position) + token);
636 630
                 } else {
@@ -663,8 +657,6 @@ public class DCCManager implements ActionListener {
663 657
         }
664 658
     }
665 659
 
666
-
667
-
668 660
     /**
669 661
      * Retrieves the container for the placeholder.
670 662
      *
@@ -736,6 +728,7 @@ public class DCCManager implements ActionListener {
736 728
      * Get the IP Address we should send as our listening IP.
737 729
      *
738 730
      * @param parser Parser the IRC Parser where this dcc is initiated
731
+     *
739 732
      * @return The IP Address we should send as our listening IP.
740 733
      */
741 734
     public String getListenIP(final Parser parser) {

+ 2
- 3
src/com/dmdirc/addons/dcc/DCCTransferHandler.java Bestand weergeven

@@ -25,8 +25,7 @@ package com.dmdirc.addons.dcc;
25 25
 import com.dmdirc.addons.dcc.io.DCCTransfer;
26 26
 
27 27
 /**
28
- * This interfaces allows DCC Transfer Windows to receive data from a
29
- * DCCTransfer.
28
+ * This interfaces allows DCC Transfer Windows to receive data from a DCCTransfer.
30 29
  *
31 30
  * @author Shane 'Dataforce' McCormack
32 31
  */
@@ -49,7 +48,7 @@ public interface DCCTransferHandler {
49 48
     /**
50 49
      * Called when data is sent/recieved.
51 50
      *
52
-     * @param dcc The DCCTransfer that this message is from
51
+     * @param dcc   The DCCTransfer that this message is from
53 52
      * @param bytes The number of new bytes that were transfered
54 53
      */
55 54
     void dataTransfered(final DCCTransfer dcc, final int bytes);

+ 7
- 7
src/com/dmdirc/addons/dcc/PlaceholderContainer.java Bestand weergeven

@@ -45,9 +45,9 @@ public class PlaceholderContainer extends FrameContainer {
45 45
     /**
46 46
      * Creates a placeholder DCC frame.
47 47
      *
48
-     * @param plugin The plugin which owns this placeholder
49
-     * @param config Config manager
50
-     * @param mainFrame Frame that will own new dialogs.
48
+     * @param plugin     The plugin which owns this placeholder
49
+     * @param config     Config manager
50
+     * @param mainFrame  Frame that will own new dialogs.
51 51
      * @param urlBuilder The URL builder to use when finding icons.
52 52
      */
53 53
     public PlaceholderContainer(
@@ -80,10 +80,9 @@ public class PlaceholderContainer extends FrameContainer {
80 80
                     "Closing this window will cause all existing DCCs "
81 81
                     + "to terminate, are you sure you want to do this?") {
82 82
                 /**
83
-                 * A version number for this class. It should be changed
84
-                 * whenever the class structure is changed (or anything else
85
-                 * that would prevent serialized objects being unserialized
86
-                 * with the new class).
83
+                 * A version number for this class. It should be changed whenever the class
84
+                 * structure is changed (or anything else that would prevent serialized objects
85
+                 * being unserialized with the new class).
87 86
                  */
88 87
                 private static final long serialVersionUID = 1;
89 88
 
@@ -122,4 +121,5 @@ public class PlaceholderContainer extends FrameContainer {
122 121
             close();
123 122
         }
124 123
     }
124
+
125 125
 }

+ 16
- 28
src/com/dmdirc/addons/dcc/TransferContainer.java Bestand weergeven

@@ -49,46 +49,35 @@ public class TransferContainer extends FrameContainer implements
49 49
 
50 50
     /** The dcc plugin that owns this frame */
51 51
     protected final DCCManager plugin;
52
-
53 52
     /** Config manager. */
54 53
     private final AggregateConfigProvider config;
55
-
56 54
     /** The Window we're using. */
57 55
     private boolean windowClosing = false;
58
-
59 56
     /** The DCCSend object we are a window for */
60 57
     private final DCCTransfer dcc;
61
-
62 58
     /** Other Nickname */
63 59
     private final String otherNickname;
64
-
65 60
     /** Total data transfered */
66 61
     private volatile long transferCount = 0;
67
-
68 62
     /** Time Started */
69 63
     private long timeStarted = 0;
70
-
71 64
     /** Plugin that this send belongs to. */
72 65
     private final DCCManager myPlugin;
73
-
74 66
     /** IRC Parser that caused this send */
75 67
     private Parser parser = null;
76
-
77 68
     /** Connection the send was initiated on. */
78 69
     private Connection connection = null;
79
-
80 70
     /** Show open button. */
81
-    private boolean showOpen = Desktop.isDesktopSupported() &&
82
-            Desktop.getDesktop().isSupported(Desktop.Action.OPEN);
71
+    private boolean showOpen = Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(
72
+            Desktop.Action.OPEN);
83 73
 
84 74
     /**
85
-     * Creates a new instance of DCCTransferWindow with a given DCCTransfer
86
-     * object.
75
+     * Creates a new instance of DCCTransferWindow with a given DCCTransfer object.
87 76
      *
88
-     * @param plugin the DCC Plugin responsible for this window
89
-     * @param dcc The DCCTransfer object this window wraps around
90
-     * @param config Config manager
91
-     * @param title The title of this window
77
+     * @param plugin     the DCC Plugin responsible for this window
78
+     * @param dcc        The DCCTransfer object this window wraps around
79
+     * @param config     Config manager
80
+     * @param title      The title of this window
92 81
      * @param targetNick Nickname of target
93 82
      * @param connection The connection that the send was that initiated on
94 83
      * @param urlBuilder The URL builder to use when finding icons.
@@ -137,6 +126,7 @@ public class TransferContainer extends FrameContainer implements
137 126
      * Retrieves the nickname of the other party involved in this transfer.
138 127
      *
139 128
      * @return The other party's nickname
129
+     *
140 130
      * @since 0.6.4
141 131
      */
142 132
     public String getOtherNickname() {
@@ -146,7 +136,7 @@ public class TransferContainer extends FrameContainer implements
146 136
     /**
147 137
      * Called when data is sent/recieved
148 138
      *
149
-     * @param dcc The DCCSend that this message is from
139
+     * @param dcc   The DCCSend that this message is from
150 140
      * @param bytes The number of new bytes that were transfered
151 141
      */
152 142
     @Override
@@ -162,7 +152,9 @@ public class TransferContainer extends FrameContainer implements
162 152
 
163 153
         if (percentageInTitle) {
164 154
             final StringBuilder title = new StringBuilder();
165
-            if (dcc.isListenSocket()) { title.append("*"); }
155
+            if (dcc.isListenSocket()) {
156
+                title.append("*");
157
+            }
166 158
             title.append(dcc.getType() == DCCTransfer.TransferType.SEND
167 159
                     ? "Sending: " : "Recieving: ");
168 160
             title.append(otherNickname);
@@ -224,8 +216,7 @@ public class TransferContainer extends FrameContainer implements
224 216
      * Retrieves the timestamp at which this transfer started.
225 217
      *
226 218
      * @since 0.6.4
227
-     * @return The timestamp (milliseconds since 01/01/1970) at which this
228
-     * transfer started.
219
+     * @return The timestamp (milliseconds since 01/01/1970) at which this transfer started.
229 220
      */
230 221
     public long getStartTime() {
231 222
         return timeStarted;
@@ -252,8 +243,7 @@ public class TransferContainer extends FrameContainer implements
252 243
     }
253 244
 
254 245
     /**
255
-     * Determines whether the "Open" button should be displayed for this
256
-     * transfer.
246
+     * Determines whether the "Open" button should be displayed for this transfer.
257 247
      *
258 248
      * @since 0.6.4
259 249
      * @return True if the open button should be displayed, false otherwise
@@ -318,7 +308,6 @@ public class TransferContainer extends FrameContainer implements
318 308
             if (connection.getParser().getStringConverter().equalsIgnoreCase(
319 309
                     otherNickname, myNickname)) {
320 310
                 final Thread errorThread = new Thread(new Runnable() {
321
-
322 311
                     /** {@inheritDoc} */
323 312
                     @Override
324 313
                     public void run() {
@@ -326,13 +315,12 @@ public class TransferContainer extends FrameContainer implements
326 315
                                 "You can't DCC yourself.", "DCC Error",
327 316
                                 JOptionPane.ERROR_MESSAGE);
328 317
                     }
329
-
330 318
                 }, "DCC-Error-Message");
331 319
                 errorThread.start();
332 320
             } else {
333 321
                 if (config.getOptionBool(plugin.getDomain(), "send.reverse")) {
334
-                    parser.sendCTCP(otherNickname, "DCC", "SEND \"" +
335
-                            new File(dcc.getFileName()).getName() + "\" "
322
+                    parser.sendCTCP(otherNickname, "DCC", "SEND \"" + new File(dcc.getFileName()).
323
+                            getName() + "\" "
336 324
                             + DCC.ipToLong(myPlugin.getListenIP(parser))
337 325
                             + " 0 " + dcc.getFileSize() + " " + dcc.makeToken()
338 326
                             + ((dcc.isTurbo()) ? " T" : ""));

+ 12
- 13
src/com/dmdirc/addons/dcc/actions/DCCActions.java Bestand weergeven

@@ -32,46 +32,45 @@ public enum DCCActions implements ActionType {
32 32
 
33 33
     /** DCC Chat Request. */
34 34
     DCC_CHAT_REQUEST(DCCEvents.DCC_CHAT_REQUEST,
35
-        "DCC chat requested"),
35
+    "DCC chat requested"),
36 36
     /** DCC Chat Request Sent. */
37 37
     DCC_CHAT_REQUEST_SENT(DCCEvents.DCC_CHAT_REQUEST_SENT,
38
-        "DCC chat request sent"),
38
+    "DCC chat request sent"),
39 39
     /** DCC Message from another person. */
40 40
     DCC_CHAT_MESSAGE(DCCEvents.DCC_CHAT_MESSAGE,
41
-        "DCC chat message recieved"),
41
+    "DCC chat message recieved"),
42 42
     /** DCC Message to another person. */
43 43
     DCC_CHAT_SELFMESSAGE(DCCEvents.DCC_CHAT_SELFMESSAGE,
44
-        "DCC chat message sent"),
44
+    "DCC chat message sent"),
45 45
     /** DCC Chat Socket Closed. */
46 46
     DCC_CHAT_SOCKETCLOSED(DCCEvents.DCC_CHAT_SOCKETCLOSED,
47
-        "DCC chat socket closed"),
47
+    "DCC chat socket closed"),
48 48
     /** DCC Chat Socket Opened. */
49 49
     DCC_CHAT_SOCKETOPENED(DCCEvents.DCC_CHAT_SOCKETOPENED,
50
-        "DCC chat socket opened"),
50
+    "DCC chat socket opened"),
51 51
     /** DCC Send Socket Closed. */
52 52
     DCC_SEND_SOCKETCLOSED(DCCEvents.DCC_SEND_SOCKETCLOSED,
53
-        "DCC send socket closed"),
53
+    "DCC send socket closed"),
54 54
     /** DCC Send Socket Opened. */
55 55
     DCC_SEND_SOCKETOPENED(DCCEvents.DCC_SEND_SOCKETOPENED,
56
-        "DCC send socket opened"),
56
+    "DCC send socket opened"),
57 57
     /** DCC Send Data Transfered. */
58 58
     DCC_SEND_DATATRANSFERED(DCCEvents.DCC_SEND_DATATRANSFERED,
59
-        "DCC send data transferred"),
59
+    "DCC send data transferred"),
60 60
     /** DCC Send Request. */
61 61
     DCC_SEND_REQUEST(DCCEvents.DCC_SEND_REQUEST,
62
-        "DCC send requested"),
62
+    "DCC send requested"),
63 63
     /** DCC Send Request Sent. */
64 64
     DCC_SEND_REQUEST_SENT(DCCEvents.DCC_SEND_REQUEST_SENT,
65
-        "DCC send request sent");
66
-
65
+    "DCC send request sent");
67 66
     /** The type of this action. */
68 67
     private final ActionMetaType type;
69
-
70 68
     /** The name of this action. */
71 69
     private final String name;
72 70
 
73 71
     /**
74 72
      * Constructs a new core action.
73
+     *
75 74
      * @param type The type of this action
76 75
      * @param name The name of this action
77 76
      */

+ 8
- 6
src/com/dmdirc/addons/dcc/actions/DCCEvents.java Bestand weergeven

@@ -39,7 +39,8 @@ public enum DCCEvents implements ActionMetaType {
39 39
     /** DCC Chat Request Sent. */
40 40
     DCC_CHAT_REQUEST_SENT(new String[]{"connection", "client"}, Connection.class, String.class),
41 41
     /** DCC Message from another person. */
42
-    DCC_CHAT_MESSAGE(new String[]{"DCCChatWindow", "Nickname", "Message"}, ChatContainer.class, String.class, String.class),
42
+    DCC_CHAT_MESSAGE(new String[]{"DCCChatWindow", "Nickname", "Message"}, ChatContainer.class,
43
+    String.class, String.class),
43 44
     /** DCC Message to another person. */
44 45
     DCC_CHAT_SELFMESSAGE(new String[]{"DCCChatWindow", "Message"}, ChatContainer.class, String.class),
45 46
     /** DCC Chat Socket Closed. */
@@ -51,15 +52,16 @@ public enum DCCEvents implements ActionMetaType {
51 52
     /** DCC Send Socket Opened. */
52 53
     DCC_SEND_SOCKETOPENED(new String[]{"DCCSendWindow"}, TransferContainer.class),
53 54
     /** DCC Send Data Transfered */
54
-    DCC_SEND_DATATRANSFERED(new String[]{"DCCSendWindow", "Bytes Transfered"}, TransferContainer.class, int.class),
55
+    DCC_SEND_DATATRANSFERED(new String[]{"DCCSendWindow", "Bytes Transfered"},
56
+    TransferContainer.class, int.class),
55 57
     /** DCC Send Request. */
56
-    DCC_SEND_REQUEST(new String[]{"connection", "client", "file"}, Connection.class, String.class, String.class),
58
+    DCC_SEND_REQUEST(new String[]{"connection", "client", "file"}, Connection.class, String.class,
59
+    String.class),
57 60
     /** DCC Send Request Sent. */
58
-    DCC_SEND_REQUEST_SENT(new String[]{"connection", "client", "file"}, Connection.class, String.class, File.class);
59
-
61
+    DCC_SEND_REQUEST_SENT(new String[]{"connection", "client", "file"}, Connection.class,
62
+    String.class, File.class);
60 63
     /** The names of the arguments for this meta type. */
61 64
     private String[] argNames;
62
-
63 65
     /** The classes of the arguments for this meta type. */
64 66
     private Class[] argTypes;
65 67
 

+ 29
- 33
src/com/dmdirc/addons/dcc/io/DCC.java Bestand weergeven

@@ -29,8 +29,8 @@ import java.util.concurrent.Semaphore;
29 29
 import java.util.concurrent.atomic.AtomicBoolean;
30 30
 
31 31
 /**
32
- * This class manages the socket and low-level I/O functionality for all
33
- * types of DCC. Subclasses process the data received by this class.
32
+ * This class manages the socket and low-level I/O functionality for all types of DCC. Subclasses
33
+ * process the data received by this class.
34 34
  */
35 35
 public abstract class DCC implements Runnable {
36 36
 
@@ -47,28 +47,24 @@ public abstract class DCC implements Runnable {
47 47
     /** Are we a listen socket? */
48 48
     protected boolean listen = false;
49 49
     /**
50
-     * The current socket in use if this is a listen socket.
51
-     * This reference may be changed if and only if exactly one permit from the
52
-     * {@link #serverSocketSem} and {@link #serverListeningSem} semaphores is
53
-     * held by the thread doing the modification.
50
+     * The current socket in use if this is a listen socket. This reference may be changed if and
51
+     * only if exactly one permit from the {@link #serverSocketSem} and {@link #serverListeningSem}
52
+     * semaphores is held by the thread doing the modification.
54 53
      */
55 54
     private ServerSocket serverSocket;
56 55
     /**
57
-     * Semaphore to control write access to ServerSocket.
58
-     * If an object acquires a permit from the {@link #serverSocketSem}, then
59
-     * {@link #serverSocket} is <em>guaranteed</em> not to be externally
60
-     * modified until that permit is released, <em>unless</em> the object also
61
-     * acquires a permit from the {@link #serverListeningSem}.
56
+     * Semaphore to control write access to ServerSocket. If an object acquires a permit from the
57
+     * {@link #serverSocketSem}, then {@link #serverSocket} is <em>guaranteed</em> not to be
58
+     * externally modified until that permit is released, <em>unless</em> the object also acquires a
59
+     * permit from the {@link #serverListeningSem}.
62 60
      */
63 61
     private final Semaphore serverSocketSem = new Semaphore(1);
64 62
     /**
65
-     * Semaphore used when we're blocking waiting for connections.
66
-     * If an object acquires a permit from the {@link #serverListeningSem},
67
-     * then it is <em>guaranteed</em> that the {@link #run()} method is blocking
68
-     * waiting for incoming connections. In addition, it is <em>guaranteed</em>
69
-     * that the {@link #run()} method is holding the {@link #serverSocketSem}
70
-     * permit, and it will continue holding that permit until it can reaquire
71
-     * the {@link #serverListeningSem} permit.
63
+     * Semaphore used when we're blocking waiting for connections. If an object acquires a permit
64
+     * from the {@link #serverListeningSem}, then it is <em>guaranteed</em> that the {@link #run()}
65
+     * method is blocking waiting for incoming connections. In addition, it is <em>guaranteed</em>
66
+     * that the {@link #run()} method is holding the {@link #serverSocketSem} permit, and it will
67
+     * continue holding that permit until it can reaquire the {@link #serverListeningSem} permit.
72 68
      */
73 69
     private final Semaphore serverListeningSem = new Semaphore(0);
74 70
 
@@ -108,11 +104,11 @@ public abstract class DCC implements Runnable {
108 104
     }
109 105
 
110 106
     /**
111
-     * Start a listen socket rather than a connect socket, use a port from the
112
-     * given range.
107
+     * Start a listen socket rather than a connect socket, use a port from the given range.
113 108
      *
114 109
      * @param startPort Port to try first
115
-     * @param endPort Last port to try.
110
+     * @param endPort   Last port to try.
111
+     *
116 112
      * @throws IOException If no sockets were available in the given range
117 113
      */
118 114
     public void listen(final int startPort, final int endPort) throws IOException {
@@ -245,19 +241,17 @@ public abstract class DCC implements Runnable {
245 241
     }
246 242
 
247 243
     /**
248
-     * Called periodically to read or write data to this DCC's socket.
249
-     * Implementations should attempt to send or receive one unit of data
250
-     * (for example one block of binary data, or one line of ASCII data) each
251
-     * time this method is called.
244
+     * Called periodically to read or write data to this DCC's socket. Implementations should
245
+     * attempt to send or receive one unit of data (for example one block of binary data, or one
246
+     * line of ASCII data) each time this method is called.
252 247
      * <p>
253
-     * The return value of this method is used to determine whether the DCC
254
-     * has been completed. If the method returns <code>false</code>, the
255
-     * DCC is assumed to have finished (i.e., the socket has closed), and the
256
-     * method will not be called again. A return value of <code>true</code> will
257
-     * cause the method to be recalled.
248
+     * The return value of this method is used to determine whether the DCC has been completed. If
249
+     * the method returns
250
+     * <code>false</code>, the DCC is assumed to have finished (i.e., the socket has closed), and
251
+     * the method will not be called again. A return value of
252
+     * <code>true</code> will cause the method to be recalled.
258 253
      *
259
-     * @return false when socket is closed, true will cause the method to be
260
-     *         called again.
254
+     * @return false when socket is closed, true will cause the method to be called again.
261 255
      */
262 256
     protected abstract boolean handleSocket();
263 257
 
@@ -265,7 +259,7 @@ public abstract class DCC implements Runnable {
265 259
      * Set the address to connect to for this DCC
266 260
      *
267 261
      * @param address Address as an int (Network Byte Order, as specified in the DCC CTCP)
268
-     * @param port Port to connect to
262
+     * @param port    Port to connect to
269 263
      */
270 264
     public void setAddress(final long address, final int port) {
271 265
         this.address = address;
@@ -303,6 +297,7 @@ public abstract class DCC implements Runnable {
303 297
      * Convert the given IP Address to a long
304 298
      *
305 299
      * @param ip Input IP Address
300
+     *
306 301
      * @return ip as a long
307 302
      */
308 303
     public static long ipToLong(final String ip) {
@@ -318,6 +313,7 @@ public abstract class DCC implements Runnable {
318 313
      * Convert the given long to an IP Address
319 314
      *
320 315
      * @param in Input long
316
+     *
321 317
      * @return long as an IP
322 318
      */
323 319
     public static String longToIP(final long in) {

+ 12
- 29
src/com/dmdirc/addons/dcc/io/DCCTransfer.java Bestand weergeven

@@ -51,49 +51,34 @@ public class DCCTransfer extends DCC {
51 51
         SEND, RECEIVE;
52 52
 
53 53
     }
54
-
55 54
     /** The File transfer type for this file. */
56 55
     private TransferType transferType = TransferType.RECEIVE;
57
-
58 56
     /** The handlers for this DCCSend. */
59 57
     private final ListenerList handlers = new ListenerList();
60
-
61 58
     /** Used to send data out the socket. */
62 59
     private DataOutputStream out;
63
-
64 60
     /** Used to read data from the socket. */
65 61
     private DataInputStream in;
66
-
67 62
     /** File we are using. */
68 63
     private File transferFile;
69
-
70 64
     /** Used to write data to the file. */
71 65
     private DataOutputStream fileOut;
72
-
73 66
     /** Used to read data from the file. */
74 67
     private DataInputStream fileIn;
75
-
76 68
     /** Where are we starting from? */
77 69
     private int startpos;
78
-
79 70
     /** How big is this file? */
80 71
     private long size = -1;
81
-
82 72
     /** How much of this file have we read so far? */
83 73
     private long readSize;
84
-
85 74
     /** What is the name of the file? */
86 75
     private String filename = "";
87
-
88 76
     /** What is the token for this send? */
89 77
     private String token = "";
90
-
91 78
     /** Block Size. */
92 79
     private final int blockSize;
93
-
94 80
     /** Is this a turbo dcc? */
95 81
     private boolean turbo = false;
96
-
97 82
     private boolean active = false;
98 83
 
99 84
     /** Creates a new instance of DCCTransfer with a default block size. */
@@ -200,8 +185,7 @@ public class DCCTransfer extends DCC {
200 185
     }
201 186
 
202 187
     /**
203
-     * Set turbo mode on/off.
204
-     * Turbo mode doesn't wait for ack packets. Only relevent when sending.
188
+     * Set turbo mode on/off. Turbo mode doesn't wait for ack packets. Only relevent when sending.
205 189
      *
206 190
      * @param turbo True for turbo dcc, else false
207 191
      */
@@ -210,8 +194,7 @@ public class DCCTransfer extends DCC {
210 194
     }
211 195
 
212 196
     /**
213
-     * Is turbo mode on/off.
214
-     * Turbo mode doesn't wait for ack packets. Only relevent when sending.
197
+     * Is turbo mode on/off. Turbo mode doesn't wait for ack packets. Only relevent when sending.
215 198
      *
216 199
      * @return True for turbo dcc, else false
217 200
      */
@@ -238,8 +221,7 @@ public class DCCTransfer extends DCC {
238 221
     }
239 222
 
240 223
     /**
241
-     * Make a Token for this send.
242
-     * This token will be unique compared to all the other known sends
224
+     * Make a Token for this send. This token will be unique compared to all the other known sends
243 225
      *
244 226
      * @return The Token for this send.
245 227
      */
@@ -256,8 +238,9 @@ public class DCCTransfer extends DCC {
256 238
      * Find a send based on a given token.
257 239
      *
258 240
      * @param token Token to look for. (case sensitive)
259
-     * @return The first DCCTransfer that matches the given token.
260
-     *         null if none match, or token is "" or null.
241
+     *
242
+     * @return The first DCCTransfer that matches the given token. null if none match, or token is
243
+     *         "" or null.
261 244
      */
262 245
     public static DCCTransfer findByToken(final String token) {
263 246
         if (token == null || token.isEmpty()) {
@@ -293,8 +276,8 @@ public class DCCTransfer extends DCC {
293 276
      * Set the starting position of the file
294 277
      *
295 278
      * @param startpos Starting position
296
-     * @return -1 if fileIn is null or if dcc receive, else the result of
297
-     * fileIn.skipBytes()
279
+     *
280
+     * @return -1 if fileIn is null or if dcc receive, else the result of fileIn.skipBytes()
298 281
      */
299 282
     public int setFileStart(final int startpos) {
300 283
         this.startpos = startpos;
@@ -400,8 +383,8 @@ public class DCCTransfer extends DCC {
400 383
     /**
401 384
      * Handle the socket as a RECEIVE.
402 385
      *
403
-     * @return false when socket is closed (or should be closed), true will
404
-     * cause the method to be called again.
386
+     * @return false when socket is closed (or should be closed), true will cause the method to be
387
+     *         called again.
405 388
      */
406 389
     protected boolean handleReceive() {
407 390
         try {
@@ -445,8 +428,8 @@ public class DCCTransfer extends DCC {
445 428
     /**
446 429
      * Handle the socket as a SEND.
447 430
      *
448
-     * @return false when socket is closed (or should be closed), true will
449
-     * cause the method to be called again.
431
+     * @return false when socket is closed (or should be closed), true will cause the method to be
432
+     *         called again.
450 433
      */
451 434
     protected boolean handleSend() {
452 435
         try {

+ 3
- 6
src/com/dmdirc/addons/dcc/kde/KDialogProcess.java Bestand weergeven

@@ -35,16 +35,12 @@ public class KDialogProcess {
35 35
 
36 36
     /** Is kdialog in /bin? */
37 37
     private static final boolean IS_BIN = new File("/bin/kdialog").exists();
38
-
39 38
     /** Does KDialog exist? */
40 39
     private static final boolean HAS_KDIALOG = IS_BIN || new File("/usr/bin/kdialog").exists();
41
-
42 40
     /** Stream for the stdout stream for this process. */
43 41
     private final StreamReader stdOutputStream;
44
-
45 42
     /** Stream for the stderr stream for this process. */
46 43
     private final StreamReader stdErrorStream;
47
-
48 44
     /** The actual process for this process. */
49 45
     private final Process process;
50 46
 
@@ -52,6 +48,7 @@ public class KDialogProcess {
52 48
      * Execute kdialog with the Parameters in params.
53 49
      *
54 50
      * @param params Parameters to pass to kdialog
51
+     *
55 52
      * @throws IOException if an I/O error occurs
56 53
      */
57 54
     public KDialogProcess(final String[] params) throws IOException {
@@ -104,8 +101,8 @@ public class KDialogProcess {
104 101
     /**
105 102
      * Wait for the process to finish.
106 103
      *
107
-     * @throws InterruptedException if the current thread is interrupted by
108
-     * another thread while it is waiting
104
+     * @throws InterruptedException if the current thread is interrupted by another thread while it
105
+     *                              is waiting
109 106
      */
110 107
     public void waitFor() throws InterruptedException {
111 108
         process.waitFor();

+ 49
- 41
src/com/dmdirc/addons/dcc/kde/KFileChooser.java Bestand weergeven

@@ -35,34 +35,26 @@ import java.util.List;
35 35
 import javax.swing.JFileChooser;
36 36
 
37 37
 /**
38
- * JFileChooser that uses KDialog to show the actual chooser.
39
- * This is quite hacky, and not guarenteed to behave identically to JFileChooser,
40
- * altho it tries to be as close as possible.
41
- * Almost a drop in replacement for JFileChooser, replace:
42
- *    new JFileChooser();
43
- * with:
44
- *    KFileChooser.getFileChooser();
38
+ * JFileChooser that uses KDialog to show the actual chooser. This is quite hacky, and not
39
+ * guarenteed to behave identically to JFileChooser, altho it tries to be as close as possible.
40
+ * Almost a drop in replacement for JFileChooser, replace: new JFileChooser(); with:
41
+ * KFileChooser.getFileChooser();
45 42
  *
46
- * There are obviously some differences:
47
- * - File filters must be set using setKDEFileFilter() not using FileFilter objects.
48
- * - FileSystemView's are ignored
49
- * - showOpenDialog and showSaveDialog shell kdialog, so only options available
50
- *   in kdialog work.
51
- * - getFileChooser() will return a JFileChooser object unless the DCC plugin's
52
- *   config option "general.useKFileChooser" is set to "true" (defaults to false)
53
- *   and kdialog is in either /usr/bin or /bin
54
- * - Selection mode FILES_AND_DIRECTORIES can not be used
43
+ * There are obviously some differences: - File filters must be set using setKDEFileFilter() not
44
+ * using FileFilter objects. - FileSystemView's are ignored - showOpenDialog and showSaveDialog
45
+ * shell kdialog, so only options available in kdialog work. - getFileChooser() will return a
46
+ * JFileChooser object unless the DCC plugin's config option "general.useKFileChooser" is set to
47
+ * "true" (defaults to false) and kdialog is in either /usr/bin or /bin - Selection mode
48
+ * FILES_AND_DIRECTORIES can not be used
55 49
  */
56 50
 public class KFileChooser extends JFileChooser {
57 51
 
58 52
     /**
59
-     * A version number for this class.
60
-     * It should be changed whenever the class structure is changed (or anything
61
-     * else that would prevent serialized objects being unserialized with the new
53
+     * A version number for this class. It should be changed whenever the class structure is changed
54
+     * (or anything else that would prevent serialized objects being unserialized with the new
62 55
      * class).
63 56
      */
64 57
     private static final long serialVersionUID = 200806141;
65
-
66 58
     /** The plugin that this file chooser is for. */
67 59
     private final DCCManager plugin;
68 60
     /** Used to read settings from. */
@@ -83,10 +75,11 @@ public class KFileChooser extends JFileChooser {
83 75
     /**
84 76
      * Constructs a FileChooser using the given File as the path.
85 77
      *
86
-     * @param plugin The plugin that owns this KFileChooser
78
+     * @param plugin           The plugin that owns this KFileChooser
87 79
      * @param currentDirectory Directory to use as the base directory
88 80
      */
89
-    private KFileChooser(final AggregateConfigProvider config, final DCCManager plugin, final File currentDirectory) {
81
+    private KFileChooser(final AggregateConfigProvider config, final DCCManager plugin,
82
+            final File currentDirectory) {
90 83
         super(currentDirectory);
91 84
 
92 85
         this.plugin = plugin;
@@ -96,10 +89,11 @@ public class KFileChooser extends JFileChooser {
96 89
     /**
97 90
      * Constructs a FileChooser using the given path.
98 91
      *
99
-     * @param plugin The plugin that owns this KFileChooser
92
+     * @param plugin               The plugin that owns this KFileChooser
100 93
      * @param currentDirectoryPath Directory to use as the base directory
101 94
      */
102
-    private KFileChooser(final AggregateConfigProvider config, final DCCManager plugin, final String currentDirectoryPath) {
95
+    private KFileChooser(final AggregateConfigProvider config, final DCCManager plugin,
96
+            final String currentDirectoryPath) {
103 97
         super(currentDirectoryPath);
104 98
 
105 99
         this.plugin = plugin;
@@ -111,11 +105,13 @@ public class KFileChooser extends JFileChooser {
111 105
      *
112 106
      * @param config Config manager
113 107
      * @param plugin The DCC Plugin that is requesting a chooser
114
-     * @return return true if getFileChooser() will return a KFileChooser not a
115
-     *         JFileChooser
108
+     *
109
+     * @return return true if getFileChooser() will return a KFileChooser not a JFileChooser
116 110
      */
117
-    public static boolean useKFileChooser(final AggregateConfigProvider config, final DCCManager plugin) {
118
-        return KDialogProcess.hasKDialog() && config.getOptionBool(plugin.getDomain(), "general.useKFileChooser");
111
+    public static boolean useKFileChooser(final AggregateConfigProvider config,
112
+            final DCCManager plugin) {
113
+        return KDialogProcess.hasKDialog() && config.getOptionBool(plugin.getDomain(),
114
+                "general.useKFileChooser");
119 115
     }
120 116
 
121 117
     /**
@@ -123,34 +119,43 @@ public class KFileChooser extends JFileChooser {
123 119
      *
124 120
      * @param config Config provider used to retrieve settings
125 121
      * @param plugin The DCC Plugin that is requesting a chooser
122
+     *
126 123
      * @return The relevant FileChooser
127 124
      */
128
-    public static JFileChooser getFileChooser(final AggregateConfigProvider config, final DCCManager plugin) {
129
-        return useKFileChooser(config, plugin) ? new KFileChooser(config, plugin) : new JFileChooser();
125
+    public static JFileChooser getFileChooser(final AggregateConfigProvider config,
126
+            final DCCManager plugin) {
127
+        return useKFileChooser(config, plugin) ? new KFileChooser(config, plugin)
128
+                : new JFileChooser();
130 129
     }
131 130
 
132 131
     /**
133 132
      * Constructs a FileChooser using the given File as the path.
134 133
      *
135
-     * @param config Config provider used to retrieve settings
136
-     * @param plugin The DCC Plugin that is requesting a chooser
134
+     * @param config           Config provider used to retrieve settings
135
+     * @param plugin           The DCC Plugin that is requesting a chooser
137 136
      * @param currentDirectory Directory to use as the base directory
137
+     *
138 138
      * @return The relevant FileChooser
139 139
      */
140
-    public static JFileChooser getFileChooser(final AggregateConfigProvider config, final DCCManager plugin, final File currentDirectory) {
141
-        return useKFileChooser(config, plugin) ? new KFileChooser(config, plugin, currentDirectory) : new JFileChooser(currentDirectory);
140
+    public static JFileChooser getFileChooser(final AggregateConfigProvider config,
141
+            final DCCManager plugin, final File currentDirectory) {
142
+        return useKFileChooser(config, plugin) ? new KFileChooser(config, plugin, currentDirectory)
143
+                : new JFileChooser(currentDirectory);
142 144
     }
143 145
 
144 146
     /**
145 147
      * Constructs a FileChooser using the given path.
146 148
      *
147
-     * @param config Config provider used to retrieve settings
148
-     * @param plugin The DCC Plugin that is requesting a chooser
149
+     * @param config               Config provider used to retrieve settings
150
+     * @param plugin               The DCC Plugin that is requesting a chooser
149 151
      * @param currentDirectoryPath Directory to use as the base directory
152
+     *
150 153
      * @return The relevant FileChooser
151 154
      */
152
-    public static JFileChooser getFileChooser(final AggregateConfigProvider config, final DCCManager plugin, final String currentDirectoryPath) {
153
-        return useKFileChooser(config, plugin) ? new KFileChooser(config, plugin, currentDirectoryPath) : new JFileChooser(currentDirectoryPath);
155
+    public static JFileChooser getFileChooser(final AggregateConfigProvider config,
156
+            final DCCManager plugin, final String currentDirectoryPath) {
157
+        return useKFileChooser(config, plugin) ? new KFileChooser(config, plugin,
158
+                currentDirectoryPath) : new JFileChooser(currentDirectoryPath);
154 159
     }
155 160
 
156 161
     /** {@inheritDoc} */
@@ -177,9 +182,11 @@ public class KFileChooser extends JFileChooser {
177 182
             params.add("--getopenfilename");
178 183
         }
179 184
 
180
-        if (getSelectedFile() != null && getFileSelectionMode() != DIRECTORIES_ONLY && !getSelectedFile().getPath().isEmpty()) {
185
+        if (getSelectedFile() != null && getFileSelectionMode() != DIRECTORIES_ONLY
186
+                && !getSelectedFile().getPath().isEmpty()) {
181 187
             if (getSelectedFile().getPath().charAt(0) != '/') {
182
-                params.add(getCurrentDirectory().getPath() + File.separator + getSelectedFile().getPath());
188
+                params.add(getCurrentDirectory().getPath() + File.separator + getSelectedFile().
189
+                        getPath());
183 190
             } else {
184 191
                 params.add(getSelectedFile().getPath());
185 192
             }
@@ -228,7 +235,8 @@ public class KFileChooser extends JFileChooser {
228 235
         params.add("--getsavefilename");
229 236
         if (getSelectedFile() != null && !getSelectedFile().getPath().isEmpty()) {
230 237
             if (getSelectedFile().getPath().charAt(0) != '/') {
231
-                params.add(getCurrentDirectory().getPath() + File.separator + getSelectedFile().getPath());
238
+                params.add(getCurrentDirectory().getPath() + File.separator + getSelectedFile().
239
+                        getPath());
232 240
             } else {
233 241
                 params.add(getSelectedFile().getPath());
234 242
             }

+ 2
- 2
src/com/dmdirc/addons/dcc/ui/PlaceholderPanel.java Bestand weergeven

@@ -40,8 +40,7 @@ public class PlaceholderPanel extends JPanel implements SwingFrameComponent {
40 40
     private static final long serialVersionUID = 1L;
41 41
 
42 42
     /**
43
-     * Creates a new placeholder window for the specified UI controller and
44
-     * owner.
43
+     * Creates a new placeholder window for the specified UI controller and owner.
45 44
      */
46 45
     public PlaceholderPanel() {
47 46
         super(new MigLayout("fill, alignx center, aligny center"));
@@ -49,4 +48,5 @@ public class PlaceholderPanel extends JPanel implements SwingFrameComponent {
49 48
                 "This is a placeholder window to group DCCs together."
50 49
                 + "\n\nClosing this window will close all the active DCCs"));
51 50
     }
51
+
52 52
 }

+ 5
- 8
src/com/dmdirc/addons/dcc/ui/TransferPanel.java Bestand weergeven

@@ -152,12 +152,12 @@ public class TransferPanel extends JPanel implements ActionListener,
152 152
                 try {
153 153
                     Desktop.getDesktop().open(file.getParentFile());
154 154
                 } catch (IllegalArgumentException ex1) {
155
-                    Logger.userError(ErrorLevel.LOW, "Unable to open folder: " +
156
-                            file.getParentFile(), ex1);
155
+                    Logger.userError(ErrorLevel.LOW, "Unable to open folder: " + file.
156
+                            getParentFile(), ex1);
157 157
                     openButton.setEnabled(false);
158 158
                 } catch (IOException ex1) {
159
-                    Logger.userError(ErrorLevel.LOW, "No associated handler " +
160
-                            "to open file or directory.", ex1);
159
+                    Logger.userError(ErrorLevel.LOW, "No associated handler "
160
+                            + "to open file or directory.", ex1);
161 161
                     openButton.setEnabled(false);
162 162
                 }
163 163
             }
@@ -176,7 +176,6 @@ public class TransferPanel extends JPanel implements ActionListener,
176 176
     @Override
177 177
     public void socketClosed(final DCCTransfer dcc) {
178 178
         UIUtilities.invokeLater(new Runnable() {
179
-
180 179
             /** {@inheritDoc} */
181 180
             @Override
182 181
             public void run() {
@@ -205,13 +204,11 @@ public class TransferPanel extends JPanel implements ActionListener,
205 204
     @Override
206 205
     public void socketOpened(final DCCTransfer dcc) {
207 206
         UIUtilities.invokeLater(new Runnable() {
208
-
209 207
             /** {@inheritDoc} */
210 208
             @Override
211 209
             public void run() {
212 210
                 status.setText("Status: Socket Opened");
213 211
             }
214
-
215 212
         });
216 213
     }
217 214
 
@@ -219,7 +216,6 @@ public class TransferPanel extends JPanel implements ActionListener,
219 216
     @Override
220 217
     public void dataTransfered(final DCCTransfer dcc, final int bytes) {
221 218
         UIUtilities.invokeLater(new Runnable() {
222
-
223 219
             /** {@inheritDoc} */
224 220
             @Override
225 221
             public void run() {
@@ -258,6 +254,7 @@ public class TransferPanel extends JPanel implements ActionListener,
258 254
      * Get the duration in seconds as a string.
259 255
      *
260 256
      * @param secondsInput to get duration for
257
+     *
261 258
      * @return Duration as a string
262 259
      */
263 260
     private String duration(final long secondsInput) {

+ 2
- 0
src/com/dmdirc/addons/dcop/DcopPlugin.java Bestand weergeven

@@ -51,6 +51,7 @@ public final class DcopPlugin extends BaseCommandPlugin {
51 51
      * Retrieves the result from executing the specified command.
52 52
      *
53 53
      * @param command The command to be executed
54
+     *
54 55
      * @return The output of the specified command
55 56
      */
56 57
     @Exported
@@ -82,4 +83,5 @@ public final class DcopPlugin extends BaseCommandPlugin {
82 83
 
83 84
         return result;
84 85
     }
86
+
85 87
 }

+ 12
- 14
src/com/dmdirc/addons/debug/Debug.java Bestand weergeven

@@ -53,17 +53,15 @@ public class Debug extends Command implements IntelligentCommand {
53 53
     public static final CommandInfo INFO = new BaseCommandInfo("debug",
54 54
             "debug <command> [args] - facilitates debugging of DMDirc",
55 55
             CommandType.TYPE_GLOBAL);
56
-
57 56
     /** The command controller to use to lookup command information. */
58 57
     private final CommandController controller;
59
-
60 58
     /** List of registered debug commands. */
61 59
     private final Map<String, DebugCommand> commands;
62 60
 
63 61
     /**
64 62
      * Creates a new debug command.
65 63
      *
66
-     * @param controller The command controller to use to lookup command information.
64
+     * @param controller  The command controller to use to lookup command information.
67 65
      * @param subcommands The subcommands to be loaded.
68 66
      */
69 67
     @Inject
@@ -106,23 +104,23 @@ public class Debug extends Command implements IntelligentCommand {
106 104
     /**
107 105
      * Sends a line, if appropriate, to the specified target.
108 106
      *
109
-     * @param target The command window to send the line to
107
+     * @param target   The command window to send the line to
110 108
      * @param isSilent Whether this command is being silenced or not
111
-     * @param type The type of message to send
112
-     * @param args The arguments of the message
109
+     * @param type     The type of message to send
110
+     * @param args     The arguments of the message
113 111
      */
114 112
     public void proxySendLine(final FrameContainer target,
115
-            final boolean isSilent, final String type, final Object ... args) {
113
+            final boolean isSilent, final String type, final Object... args) {
116 114
         sendLine(target, isSilent, type, args);
117 115
     }
118 116
 
119 117
     /**
120 118
      * Sends a usage line, if appropriate, to the specified target.
121 119
      *
122
-     * @param target The command window to send the line to
120
+     * @param target   The command window to send the line to
123 121
      * @param isSilent Whether this command is being silenced or not
124
-     * @param name The name of the command that's raising the error
125
-     * @param args The arguments that the command accepts or expects
122
+     * @param name     The name of the command that's raising the error
123
+     * @param args     The arguments that the command accepts or expects
126 124
      */
127 125
     public void proxyShowUsage(final FrameContainer target,
128 126
             final boolean isSilent, final String name, final String args) {
@@ -130,12 +128,12 @@ public class Debug extends Command implements IntelligentCommand {
130 128
     }
131 129
 
132 130
     /**
133
-     * Formats the specified data into a table suitable for output in the
134
-     * textpane. It is expected that each String[] in data has the same number
135
-     * of elements as the headers array.
131
+     * Formats the specified data into a table suitable for output in the textpane. It is expected
132
+     * that each String[] in data has the same number of elements as the headers array.
136 133
      *
137 134
      * @param headers The headers of the table.
138
-     * @param data The contents of the table.
135
+     * @param data    The contents of the table.
136
+     *
139 137
      * @return A string containing an ASCII table
140 138
      */
141 139
     public String proxyDoTable(final String[] headers, final String[][] data) {

+ 22
- 23
src/com/dmdirc/addons/debug/DebugCommand.java Bestand weergeven

@@ -36,10 +36,8 @@ public abstract class DebugCommand {
36 36
 
37 37
     /** The format name used for command output. */
38 38
     public static final String FORMAT_OUTPUT = "commandOutput";
39
-
40 39
     /** The format name used for command errors. */
41 40
     public static final String FORMAT_ERROR = "commandError";
42
-
43 41
     /** Parent debug command. */
44 42
     private final Provider<Debug> commandProvider;
45 43
 
@@ -62,14 +60,14 @@ public abstract class DebugCommand {
62 60
     /**
63 61
      * Returns a string representing the help message for this command.
64 62
      * <p>
65
-     * The help text should generally be one line, and must start with
66
-     * the name of the command. It should then summarise the arguments of
67
-     * that command, using <code>&lt;angled&gt;</code> brackets for required
68
-     * arguments, and <code>[square]</code> brackets for optional arguments.
69
-     * Where multiple possibilities exist, they are typically separated by a
70
-     * pipe (<code>|</code>), for example: <code>command [--arg1|--arg2]</code>.
71
-     * The usage summary should then be followed by a dash and a brief
72
-     * summary of the purpose of the command.
63
+     * The help text should generally be one line, and must start with the name of the command. It
64
+     * should then summarise the arguments of that command, using
65
+     * <code>&lt;angled&gt;</code> brackets for required arguments, and
66
+     * <code>[square]</code> brackets for optional arguments. Where multiple possibilities exist,
67
+     * they are typically separated by a pipe (
68
+     * <code>|</code>), for example:
69
+     * <code>command [--arg1|--arg2]</code>. The usage summary should then be followed by a dash and
70
+     * a brief summary of the purpose of the command.
73 71
      * <p>
74 72
      * A typical help message would look similar to:
75 73
      * <p>
@@ -82,8 +80,8 @@ public abstract class DebugCommand {
82 80
     /**
83 81
      * Executes this command.
84 82
      *
85
-     * @param origin The container which received the command
86
-     * @param args Arguments passed to this command
83
+     * @param origin  The container which received the command
84
+     * @param args    Arguments passed to this command
87 85
      * @param context The context the command was executed in
88 86
      */
89 87
     public abstract void execute(final FrameContainer origin,
@@ -92,23 +90,23 @@ public abstract class DebugCommand {
92 90
     /**
93 91
      * Sends a line, if appropriate, to the specified target.
94 92
      *
95
-     * @param target The command window to send the line to
93
+     * @param target   The command window to send the line to
96 94
      * @param isSilent Whether this command is being silenced or not
97
-     * @param type The type of message to send
98
-     * @param args The arguments of the message
95
+     * @param type     The type of message to send
96
+     * @param args     The arguments of the message
99 97
      */
100 98
     public void sendLine(final FrameContainer target,
101
-            final boolean isSilent, final String type, final Object ... args) {
99
+            final boolean isSilent, final String type, final Object... args) {
102 100
         commandProvider.get().proxySendLine(target, isSilent, type, args);
103 101
     }
104 102
 
105 103
     /**
106 104
      * Sends a usage line, if appropriate, to the specified target.
107 105
      *
108
-     * @param target The command window to send the line to
106
+     * @param target   The command window to send the line to
109 107
      * @param isSilent Whether this command is being silenced or not
110
-     * @param name The name of the command that's raising the error
111
-     * @param args The arguments that the command accepts or expects
108
+     * @param name     The name of the command that's raising the error
109
+     * @param args     The arguments that the command accepts or expects
112 110
      */
113 111
     public void showUsage(final FrameContainer target,
114 112
             final boolean isSilent, final String name, final String args) {
@@ -116,15 +114,16 @@ public abstract class DebugCommand {
116 114
     }
117 115
 
118 116
     /**
119
-     * Formats the specified data into a table suitable for output in the
120
-     * textpane. It is expected that each String[] in data has the same number
121
-     * of elements as the headers array.
117
+     * Formats the specified data into a table suitable for output in the textpane. It is expected
118
+     * that each String[] in data has the same number of elements as the headers array.
122 119
      *
123 120
      * @param headers The headers of the table.
124
-     * @param data The contents of the table.
121
+     * @param data    The contents of the table.
122
+     *
125 123
      * @return A string containing an ASCII table
126 124
      */
127 125
     public String doTable(final String[] headers, final String[][] data) {
128 126
         return commandProvider.get().proxyDoTable(headers, data);
129 127
     }
128
+
130 129
 }

+ 57
- 19
src/com/dmdirc/addons/debug/DebugModule.java Bestand weergeven

@@ -53,60 +53,98 @@ import dagger.Provides;
53 53
 public class DebugModule {
54 54
 
55 55
     @Provides(type = Provides.Type.SET)
56
-    public DebugCommand getCommand(final Benchmark command) { return command; }
56
+    public DebugCommand getCommand(final Benchmark command) {
57
+        return command;
58
+    }
57 59
 
58 60
     @Provides(type = Provides.Type.SET)
59
-    public DebugCommand getCommand(final ColourSpam command) { return command; }
61
+    public DebugCommand getCommand(final ColourSpam command) {
62
+        return command;
63
+    }
60 64
 
61 65
     @Provides(type = Provides.Type.SET)
62
-    public DebugCommand getCommand(final ConfigInfo command) { return command; }
66
+    public DebugCommand getCommand(final ConfigInfo command) {
67
+        return command;
68
+    }
63 69
 
64 70
     @Provides(type = Provides.Type.SET)
65
-    public DebugCommand getCommand(final FakeError command) { return command; }
71
+    public DebugCommand getCommand(final FakeError command) {
72
+        return command;
73
+    }
66 74
 
67 75
     @Provides(type = Provides.Type.SET)
68
-    public DebugCommand getCommand(final FakeUpdates command) { return command; }
76
+    public DebugCommand getCommand(final FakeUpdates command) {
77
+        return command;
78
+    }
69 79
 
70 80
     @Provides(type = Provides.Type.SET)
71
-    public DebugCommand getCommand(final FirstRun command) { return command; }
81
+    public DebugCommand getCommand(final FirstRun command) {
82
+        return command;
83
+    }
72 84
 
73 85
     @Provides(type = Provides.Type.SET)
74
-    public DebugCommand getCommand(final ForceUpdate command) { return command; }
86
+    public DebugCommand getCommand(final ForceUpdate command) {
87
+        return command;
88
+    }
75 89
 
76 90
     @Provides(type = Provides.Type.SET)
77
-    public DebugCommand getCommand(final GlobalConfigInfo command) { return command; }
91
+    public DebugCommand getCommand(final GlobalConfigInfo command) {
92
+        return command;
93
+    }
78 94
 
79 95
     @Provides(type = Provides.Type.SET)
80
-    public DebugCommand getCommand(final Identities command) { return command; }
96
+    public DebugCommand getCommand(final Identities command) {
97
+        return command;
98
+    }
81 99
 
82 100
     @Provides(type = Provides.Type.SET)
83
-    public DebugCommand getCommand(final MemInfo command) { return command; }
101
+    public DebugCommand getCommand(final MemInfo command) {
102
+        return command;
103
+    }
84 104
 
85 105
     @Provides(type = Provides.Type.SET)
86
-    public DebugCommand getCommand(final Notify command) { return command; }
106
+    public DebugCommand getCommand(final Notify command) {
107
+        return command;
108
+    }
87 109
 
88 110
     @Provides(type = Provides.Type.SET)
89
-    public DebugCommand getCommand(final RunGC command) { return command; }
111
+    public DebugCommand getCommand(final RunGC command) {
112
+        return command;
113
+    }
90 114
 
91 115
     @Provides(type = Provides.Type.SET)
92
-    public DebugCommand getCommand(final ServerInfo command) { return command; }
116
+    public DebugCommand getCommand(final ServerInfo command) {
117
+        return command;
118
+    }
93 119
 
94 120
     @Provides(type = Provides.Type.SET)
95
-    public DebugCommand getCommand(final ServerState command) { return command; }
121
+    public DebugCommand getCommand(final ServerState command) {
122
+        return command;
123
+    }
96 124
 
97 125
     @Provides(type = Provides.Type.SET)
98
-    public DebugCommand getCommand(final Services command) { return command; }
126
+    public DebugCommand getCommand(final Services command) {
127
+        return command;
128
+    }
99 129
 
100 130
     @Provides(type = Provides.Type.SET)
101
-    public DebugCommand getCommand(final ShowRaw command) { return command; }
131
+    public DebugCommand getCommand(final ShowRaw command) {
132
+        return command;
133
+    }
102 134
 
103 135
     @Provides(type = Provides.Type.SET)
104
-    public DebugCommand getCommand(final StatusbarMessage command) { return command; }
136
+    public DebugCommand getCommand(final StatusbarMessage command) {
137
+        return command;
138
+    }
105 139
 
106 140
     @Provides(type = Provides.Type.SET)
107
-    public DebugCommand getCommand(final Threads command) { return command; }
141
+    public DebugCommand getCommand(final Threads command) {
142
+        return command;
143
+    }
108 144
 
109 145
     @Provides(type = Provides.Type.SET)
110
-    public DebugCommand getCommand(final Time command) { return command; }
146
+    public DebugCommand getCommand(final Time command) {
147
+        return command;
148
+    }
111 149
 
112 150
 }

+ 3
- 2
src/com/dmdirc/addons/debug/commands/Benchmark.java Bestand weergeven

@@ -32,8 +32,8 @@ import javax.inject.Inject;
32 32
 import javax.inject.Provider;
33 33
 
34 34
 /**
35
- * Textpane speed benchmark, outputs a large volume of text and times the amount
36
- * of time it takes the textpane to draw this.
35
+ * Textpane speed benchmark, outputs a large volume of text and times the amount of time it takes
36
+ * the textpane to draw this.
37 37
  */
38 38
 public class Benchmark extends DebugCommand {
39 39
 
@@ -83,4 +83,5 @@ public class Benchmark extends DebugCommand {
83 83
                     + " nanoseconds.");
84 84
         }
85 85
     }
86
+
86 87
 }

+ 1
- 0
src/com/dmdirc/addons/debug/commands/FakeError.java Bestand weergeven

@@ -19,6 +19,7 @@
19 19
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 20
  * SOFTWARE.
21 21
  */
22
+
22 23
 package com.dmdirc.addons.debug.commands;
23 24
 
24 25
 import com.dmdirc.FrameContainer;

+ 11
- 6
src/com/dmdirc/addons/debug/commands/FakeUpdates.java Bestand weergeven

@@ -60,7 +60,7 @@ public class FakeUpdates extends DebugCommand {
60 60
      * Creates a new instance of the command.
61 61
      *
62 62
      * @param commandProvider The provider to use to access the main debug command.
63
-     * @param updateManager The update manager to add fake updates to.
63
+     * @param updateManager   The update manager to add fake updates to.
64 64
      */
65 65
     @Inject
66 66
     public FakeUpdates(
@@ -112,6 +112,7 @@ public class FakeUpdates extends DebugCommand {
112 112
 
113 113
             return res;
114 114
         }
115
+
115 116
     }
116 117
 
117 118
     /**
@@ -142,8 +143,10 @@ public class FakeUpdates extends DebugCommand {
142 143
             super(FakeUpdateCheckResult.class);
143 144
         }
144 145
 
145
-        protected void fireRetrievalProgressChanged(final UpdateComponent component, final double progress) {
146
-            listeners.getCallable(UpdateRetrievalListener.class).retrievalProgressChanged(component, progress);
146
+        protected void fireRetrievalProgressChanged(final UpdateComponent component,
147
+                final double progress) {
148
+            listeners.getCallable(UpdateRetrievalListener.class).retrievalProgressChanged(component,
149
+                    progress);
147 150
         }
148 151
 
149 152
         protected void fireRetrievalFailed(final UpdateComponent component) {
@@ -204,7 +207,7 @@ public class FakeUpdates extends DebugCommand {
204 207
          * Creates a new fake retrieval result.
205 208
          *
206 209
          * @param checkResult The check result that was retrieved
207
-         * @param success Whether the result is successful or not
210
+         * @param success     Whether the result is successful or not
208 211
          */
209 212
         public FakeRetrievalResult(final UpdateCheckResult checkResult,
210 213
                 final boolean success) {
@@ -236,8 +239,10 @@ public class FakeUpdates extends DebugCommand {
236 239
             listeners.getCallable(UpdateInstallationListener.class).installFailed(component);
237 240
         }
238 241
 
239
-        protected void fireInstallProgressChanged(final UpdateComponent component, final double progress) {
240
-            listeners.getCallable(UpdateInstallationListener.class).installProgressChanged(component, progress);
242
+        protected void fireInstallProgressChanged(final UpdateComponent component,
243
+                final double progress) {
244
+            listeners.getCallable(UpdateInstallationListener.class).
245
+                    installProgressChanged(component, progress);
241 246
         }
242 247
 
243 248
         @Override

+ 1
- 1
src/com/dmdirc/addons/debug/commands/FirstRun.java Bestand weergeven

@@ -46,7 +46,7 @@ public class FirstRun extends DebugCommand {
46 46
      * Creates a new instance of the command.
47 47
      *
48 48
      * @param commandProvider The provider to use to access the main debug command.
49
-     * @param pluginManager The plugin manager to use to hackily poke the Swing UI.
49
+     * @param pluginManager   The plugin manager to use to hackily poke the Swing UI.
50 50
      */
51 51
     @Inject
52 52
     public FirstRun(final Provider<Debug> commandProvider, final PluginManager pluginManager) {

+ 3
- 3
src/com/dmdirc/addons/debug/commands/ForceUpdate.java Bestand weergeven

@@ -52,10 +52,10 @@ public class ForceUpdate extends DebugCommand {
52 52
     /**
53 53
      * Creates a new instance of the command.
54 54
      *
55
-     * @param commandProvider The provider to use to access the main debug command.
56
-     * @param globalConfig The global config to use to check if updates are enabled.
55
+     * @param commandProvider    The provider to use to access the main debug command.
56
+     * @param globalConfig       The global config to use to check if updates are enabled.
57 57
      * @param identityController The controller to use to read/write settings for the updater.
58
-     * @param updateManager The update manager to use when forcing an update.
58
+     * @param updateManager      The update manager to use when forcing an update.
59 59
      */
60 60
     @Inject
61 61
     public ForceUpdate(

+ 1
- 1
src/com/dmdirc/addons/debug/commands/GlobalConfigInfo.java Bestand weergeven

@@ -46,7 +46,7 @@ public class GlobalConfigInfo extends DebugCommand {
46 46
      * Creates a new instance of the command.
47 47
      *
48 48
      * @param commandProvider The provider to use to access the main debug command.
49
-     * @param globalConfig The global config to retrieve sources for.
49
+     * @param globalConfig    The global config to retrieve sources for.
50 50
      */
51 51
     @Inject
52 52
     public GlobalConfigInfo(

+ 3
- 3
src/com/dmdirc/addons/debug/commands/Identities.java Bestand weergeven

@@ -47,7 +47,7 @@ public class Identities extends DebugCommand {
47 47
      * Creates a new instance of the command.
48 48
      *
49 49
      * @param commandProvider The provider to use to access the main debug command.
50
-     * @param controller The controller to read identities from.
50
+     * @param controller      The controller to read identities from.
51 51
      */
52 52
     @Inject
53 53
     public Identities(final Provider<Debug> commandProvider, final IdentityController controller) {
@@ -86,8 +86,8 @@ public class Identities extends DebugCommand {
86 86
         int i = 0;
87 87
         for (ConfigProvider source : identities) {
88 88
             data[i++] = new String[]{source.getName(),
89
-            source.getTarget().getTypeName(), source.getTarget().getData(),
90
-            String.valueOf(source.getTarget().getOrder())};
89
+                source.getTarget().getTypeName(), source.getTarget().getData(),
90
+                String.valueOf(source.getTarget().getOrder())};
91 91
         }
92 92
 
93 93
         sendLine(origin, args.isSilent(), FORMAT_OUTPUT,

+ 1
- 1
src/com/dmdirc/addons/debug/commands/Services.java Bestand weergeven

@@ -48,7 +48,7 @@ public class Services extends DebugCommand implements IntelligentCommand {
48 48
      * Creates a new instance of the command.
49 49
      *
50 50
      * @param commandProvider The provider to use to access the main debug command.
51
-     * @param serviceManager The service manager to get services from.
51
+     * @param serviceManager  The service manager to get services from.
52 52
      */
53 53
     @Inject
54 54
     public Services(final Provider<Debug> commandProvider, final ServiceManager serviceManager) {

+ 3
- 3
src/com/dmdirc/addons/debug/commands/StatusbarMessage.java Bestand weergeven

@@ -42,16 +42,15 @@ public class StatusbarMessage extends DebugCommand {
42 42
 
43 43
     /** The status bar manager to show messages in. */
44 44
     private final StatusBarManager statusBarManager;
45
-
46 45
     /** The global configuration. */
47 46
     private final AggregateConfigProvider globalConfig;
48 47
 
49 48
     /**
50 49
      * Creates a new instance of the command.
51 50
      *
52
-     * @param commandProvider The provider to use to access the main debug command.
51
+     * @param commandProvider  The provider to use to access the main debug command.
53 52
      * @param statusBarManager The status bar manager to show messages in.
54
-     * @param globalConfig The global configuration to use.
53
+     * @param globalConfig     The global configuration to use.
55 54
      */
56 55
     @Inject
57 56
     public StatusbarMessage(
@@ -83,4 +82,5 @@ public class StatusbarMessage extends DebugCommand {
83 82
         statusBarManager.setMessage(new StatusMessage(null,
84 83
                 "Test: " + args.getArgumentsAsString(), null, 5, globalConfig));
85 84
     }
85
+
86 86
 }

+ 2
- 3
src/com/dmdirc/addons/debug/commands/Time.java Bestand weergeven

@@ -74,7 +74,7 @@ public class Time extends DebugCommand implements IntelligentCommand {
74 74
      *
75 75
      * @param origin The origin of the command
76 76
      * @param window The window to be passed on to the timed command, if any
77
-     * @param args The arguments that were passed to the command
77
+     * @param args   The arguments that were passed to the command
78 78
      */
79 79
     private void doTime(final FrameContainer origin,
80 80
             final CommandArguments args) {
@@ -84,8 +84,7 @@ public class Time extends DebugCommand implements IntelligentCommand {
84 84
         }
85 85
 
86 86
         if (origin instanceof WritableFrameContainer) {
87
-            final WritableFrameContainer container
88
-                    = (WritableFrameContainer) origin;
87
+            final WritableFrameContainer container = (WritableFrameContainer) origin;
89 88
             final long start = System.currentTimeMillis();
90 89
             container.getCommandParser().parseCommand(origin,
91 90
                     args.getArgumentsAsString(0));

+ 5
- 4
src/com/dmdirc/addons/exec/ExecCommand.java Bestand weergeven

@@ -70,10 +70,10 @@ public class ExecCommand extends Command {
70 70
             // (if necessary). Without this /exec "command arg1 arg2 would error.
71 71
             if (commandArray.length == 0) {
72 72
                 sendLine(origin, args.isSilent(), FORMAT_ERROR,
73
-                       "Could not execute: Invalid file name provided");
73
+                        "Could not execute: Invalid file name provided");
74 74
             } else if (!new File(commandArray[0]).exists()) {
75 75
                 sendLine(origin, args.isSilent(), FORMAT_ERROR,
76
-                       "Could not execute: " + commandArray[0] + " does not exist.");
76
+                        "Could not execute: " + commandArray[0] + " does not exist.");
77 77
             } else {
78 78
                 final Process p = Runtime.getRuntime().exec(commandArray);
79 79
                 final List<String> execOutput = args.isSilent()
@@ -81,9 +81,9 @@ public class ExecCommand extends Command {
81 81
                 final List<String> errorOutput = args.isSilent()
82 82
                         ? null : new LinkedList<String>();
83 83
                 final StreamReader inputReader = new StreamReader(
84
-                            p.getInputStream(), execOutput);
84
+                        p.getInputStream(), execOutput);
85 85
                 final StreamReader errorReader = new StreamReader(
86
-                            p.getErrorStream(), errorOutput);
86
+                        p.getErrorStream(), errorOutput);
87 87
 
88 88
                 inputReader.run();
89 89
                 errorReader.run();
@@ -101,4 +101,5 @@ public class ExecCommand extends Command {
101 101
                     + ex.getMessage(), ex);
102 102
         }
103 103
     }
104
+
104 105
 }

+ 1
- 0
src/com/dmdirc/addons/exec/ExecPlugin.java Bestand weergeven

@@ -39,4 +39,5 @@ public class ExecPlugin extends BaseCommandPlugin {
39 39
         super(commandController);
40 40
         registerCommand(new ExecCommand(commandController), ExecCommand.INFO);
41 41
     }
42
+
42 43
 }

+ 7
- 5
src/com/dmdirc/addons/freedesktop_notifications/FDNotifyCommand.java Bestand weergeven

@@ -31,8 +31,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
31 31
 import com.dmdirc.interfaces.CommandController;
32 32
 
33 33
 /**
34
- * The FDNotify Command shows a nice popup on using the FreeDesktop
35
- * VisualNotifications.
34
+ * The FDNotify Command shows a nice popup on using the FreeDesktop VisualNotifications.
36 35
  */
37 36
 public final class FDNotifyCommand extends Command {
38 37
 
@@ -47,16 +46,18 @@ public final class FDNotifyCommand extends Command {
47 46
      * Creates a new instance of FDNotifyCommand.
48 47
      *
49 48
      * @param controller The controller to use for command information.
50
-     * @param myPlugin the plugin creating this command.
49
+     * @param myPlugin   the plugin creating this command.
51 50
      */
52
-    public FDNotifyCommand(final CommandController controller, final FreeDesktopNotificationsPlugin myPlugin) {
51
+    public FDNotifyCommand(final CommandController controller,
52
+            final FreeDesktopNotificationsPlugin myPlugin) {
53 53
         super(controller);
54 54
         this.myPlugin = myPlugin;
55 55
     }
56 56
 
57 57
     /** {@inheritDoc} */
58 58
     @Override
59
-    public void execute(final FrameContainer origin, final CommandArguments args, final CommandContext context) {
59
+    public void execute(final FrameContainer origin, final CommandArguments args,
60
+            final CommandContext context) {
60 61
         new Thread() {
61 62
             /** {@inheritDoc} */
62 63
             @Override
@@ -65,4 +66,5 @@ public final class FDNotifyCommand extends Command {
65 66
             }
66 67
         }.start();
67 68
     }
69
+
68 70
 }

+ 10
- 5
src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java Bestand weergeven

@@ -49,7 +49,8 @@ import org.apache.commons.lang.StringEscapeUtils;
49 49
 /**
50 50
  * This plugin adds freedesktop Style Notifications to dmdirc.
51 51
  */
52
-public class FreeDesktopNotificationsPlugin extends BaseCommandPlugin implements ConfigChangeListener {
52
+public class FreeDesktopNotificationsPlugin extends BaseCommandPlugin implements
53
+        ConfigChangeListener {
53 54
 
54 55
     /** notification timeout. */
55 56
     private int timeout;
@@ -73,9 +74,9 @@ public class FreeDesktopNotificationsPlugin extends BaseCommandPlugin implements
73 74
     /**
74 75
      * Creates a new instance of this plugin.
75 76
      *
76
-     * @param pluginInfo This plugin's plugin info
77
+     * @param pluginInfo         This plugin's plugin info
77 78
      * @param identityController Identity Manager instance
78
-     * @param commandController Command controller to register commands
79
+     * @param commandController  Command controller to register commands
79 80
      */
80 81
     public FreeDesktopNotificationsPlugin(final PluginInfo pluginInfo,
81 82
             final IdentityController identityController,
@@ -91,8 +92,9 @@ public class FreeDesktopNotificationsPlugin extends BaseCommandPlugin implements
91 92
     /**
92 93
      * Used to show a notification using this plugin.
93 94
      *
94
-     * @param title Title of dialog if applicable
95
+     * @param title   Title of dialog if applicable
95 96
      * @param message Message to show
97
+     *
96 98
      * @return True if the notification was shown.
97 99
      */
98 100
     @Exported
@@ -141,6 +143,7 @@ public class FreeDesktopNotificationsPlugin extends BaseCommandPlugin implements
141 143
      * Prepare the string for sending to dbus.
142 144
      *
143 145
      * @param input Input string
146
+     *
144 147
      * @return Input string after being processed according to config settings.
145 148
      */
146 149
     public String prepareString(final String input) {
@@ -173,7 +176,8 @@ public class FreeDesktopNotificationsPlugin extends BaseCommandPlugin implements
173 176
             filesHelper.extractResoucesEndingWith(".py");
174 177
             filesHelper.extractResoucesEndingWith(".png");
175 178
         } catch (IOException ex) {
176
-            Logger.userError(ErrorLevel.MEDIUM, "Unable to extract files for Free desktop notifications: " + ex.getMessage(), ex);
179
+            Logger.userError(ErrorLevel.MEDIUM,
180
+                    "Unable to extract files for Free desktop notifications: " + ex.getMessage(), ex);
177 181
         }
178 182
         super.onLoad();
179 183
     }
@@ -238,4 +242,5 @@ public class FreeDesktopNotificationsPlugin extends BaseCommandPlugin implements
238 242
     public void configChanged(final String domain, final String key) {
239 243
         setCachedSettings();
240 244
     }
245
+
241 246
 }

+ 24
- 18
src/com/dmdirc/addons/identd/IdentClient.java Bestand weergeven

@@ -42,25 +42,21 @@ public class IdentClient implements Runnable {
42 42
 
43 43
     /** The IdentdServer that owns this Client. */
44 44
     private final IdentdServer myServer;
45
-
46 45
     /** The Socket that we are in charge of. */
47 46
     private final Socket mySocket;
48
-
49 47
     /** The Thread in use for this client. */
50 48
     private volatile Thread myThread;
51
-
52 49
     /** The plugin that owns us. */
53 50
     private final IdentdPlugin myPlugin;
54
-
55 51
     /** Server manager. */
56 52
     private final ServerManager serverManager;
57 53
 
58 54
     /**
59 55
      * Create the IdentClient.
60 56
      *
61
-     * @param server The server that owns this
62
-     * @param socket The socket we are handing
63
-     * @param plugin Parent plugin
57
+     * @param server        The server that owns this
58
+     * @param socket        The socket we are handing
59
+     * @param plugin        Parent plugin
64 60
      * @param serverManager Server manager to retrieve servers from
65 61
      */
66 62
     public IdentClient(final IdentdServer server, final Socket socket,
@@ -107,11 +103,12 @@ public class IdentClient implements Runnable {
107 103
     }
108 104
 
109 105
     /**
110
-     * Get the ident response for a given line.
111
-     * Complies with rfc1413 (http://www.faqs.org/rfcs/rfc1413.html)
106
+     * Get the ident response for a given line. Complies with rfc1413
107
+     * (http://www.faqs.org/rfcs/rfc1413.html)
112 108
      *
113
-     * @param input Line to generate response for
109
+     * @param input  Line to generate response for
114 110
      * @param config The config manager to use for settings
111
+     *
115 112
      * @return the ident response for the given line
116 113
      */
117 114
     protected String getIdentResponse(final String input, final AggregateConfigProvider config) {
@@ -126,7 +123,8 @@ public class IdentClient implements Runnable {
126 123
             myPort = Integer.parseInt(bits[0].trim());
127 124
             theirPort = Integer.parseInt(bits[1].trim());
128 125
         } catch (NumberFormatException e) {
129
-            return String.format("%s , %s : ERROR : X-INVALID-INPUT", escapeString(bits[0]), escapeString(bits[1]));
126
+            return String.format("%s , %s : ERROR : X-INVALID-INPUT", escapeString(bits[0]),
127
+                    escapeString(bits[1]));
130 128
         }
131 129
 
132 130
         if (myPort > 65535 || myPort < 1 || theirPort > 65535 || theirPort < 1) {
@@ -134,7 +132,8 @@ public class IdentClient implements Runnable {
134 132
         }
135 133
 
136 134
         final Connection connection = getConnectionByPort(myPort);
137
-        if (!config.getOptionBool(myPlugin.getDomain(), "advanced.alwaysOn") && (connection == null || config.getOptionBool(myPlugin.getDomain(), "advanced.isNoUser"))) {
135
+        if (!config.getOptionBool(myPlugin.getDomain(), "advanced.alwaysOn") && (connection == null
136
+                || config.getOptionBool(myPlugin.getDomain(), "advanced.isNoUser"))) {
138 137
             return String.format("%d , %d : ERROR : NO-USER", myPort, theirPort);
139 138
         }
140 139
 
@@ -147,7 +146,8 @@ public class IdentClient implements Runnable {
147 146
         final String username;
148 147
 
149 148
         final String customSystem = config.getOption(myPlugin.getDomain(), "advanced.customSystem");
150
-        if (config.getOptionBool(myPlugin.getDomain(), "advanced.useCustomSystem") && customSystem != null && customSystem.length() > 0 && customSystem.length() < 513) {
149
+        if (config.getOptionBool(myPlugin.getDomain(), "advanced.useCustomSystem") && customSystem
150
+                != null && customSystem.length() > 0 && customSystem.length() < 513) {
151 151
             os = customSystem;
152 152
         } else {
153 153
             // Tad excessive maybe, but complete!
@@ -173,23 +173,28 @@ public class IdentClient implements Runnable {
173 173
         }
174 174
 
175 175
         final String customName = config.getOption(myPlugin.getDomain(), "general.customName");
176
-        if (config.getOptionBool(myPlugin.getDomain(), "general.useCustomName") && customName != null && customName.length() > 0 && customName.length() < 513) {
176
+        if (config.getOptionBool(myPlugin.getDomain(), "general.useCustomName") && customName
177
+                != null && customName.length() > 0 && customName.length() < 513) {
177 178
             username = customName;
178
-        } else if (connection != null && config.getOptionBool(myPlugin.getDomain(), "general.useNickname")) {
179
+        } else if (connection != null && config.getOptionBool(myPlugin.getDomain(),
180
+                "general.useNickname")) {
179 181
             username = connection.getParser().getLocalClient().getNickname();
180
-        } else if (connection != null && config.getOptionBool(myPlugin.getDomain(), "general.useUsername")) {
182
+        } else if (connection != null && config.getOptionBool(myPlugin.getDomain(),
183
+                "general.useUsername")) {
181 184
             username = connection.getParser().getLocalClient().getUsername();
182 185
         } else {
183 186
             username = System.getProperty("user.name");
184 187
         }
185 188
 
186
-        return String.format("%d , %d : USERID : %s : %s", myPort, theirPort, escapeString(os), escapeString(username));
189
+        return String.format("%d , %d : USERID : %s : %s", myPort, theirPort, escapeString(os),
190
+                escapeString(username));
187 191
     }
188 192
 
189 193
     /**
190 194
      * Escape special chars.
191 195
      *
192 196
      * @param str String to escape
197
+     *
193 198
      * @return Escaped string.
194 199
      */
195 200
     public static String escapeString(final String str) {
@@ -200,6 +205,7 @@ public class IdentClient implements Runnable {
200 205
      * Unescape special chars.
201 206
      *
202 207
      * @param str String to escape
208
+     *
203 209
      * @return Escaped string.
204 210
      */
205 211
     public static String unescapeString(final String str) {
@@ -224,6 +230,7 @@ public class IdentClient implements Runnable {
224 230
      * Retrieves the server that is bound to the specified local port.
225 231
      *
226 232
      * @param port Port to check for
233
+     *
227 234
      * @return The server instance listening on the given port
228 235
      */
229 236
     protected Connection getConnectionByPort(final int port) {
@@ -236,4 +243,3 @@ public class IdentClient implements Runnable {
236 243
     }
237 244
 
238 245
 }
239
-

+ 38
- 38
src/com/dmdirc/addons/identd/IdentdPlugin.java Bestand weergeven

@@ -63,10 +63,10 @@ public class IdentdPlugin extends BasePlugin implements ActionListener {
63 63
     /**
64 64
      * Creates a new instance of this plugin.
65 65
      *
66
-     * @param pluginInfo This plugin's plugin info
67
-     * @param actionController The action controller to register listeners with
66
+     * @param pluginInfo         This plugin's plugin info
67
+     * @param actionController   The action controller to register listeners with
68 68
      * @param identityController Identity manager to get settings from
69
-     * @param serverManager Server manager to retrieve servers from
69
+     * @param serverManager      Server manager to retrieve servers from
70 70
      */
71 71
     public IdentdPlugin(final PluginInfo pluginInfo,
72 72
             final ActionController actionController,
@@ -114,8 +114,8 @@ public class IdentdPlugin extends BasePlugin implements ActionListener {
114 114
     /**
115 115
      * Process an event of the specified type.
116 116
      *
117
-     * @param type The type of the event to process
118
-     * @param format Format of messages that are about to be sent. (May be null)
117
+     * @param type      The type of the event to process
118
+     * @param format    Format of messages that are about to be sent. (May be null)
119 119
      * @param arguments The arguments for the event
120 120
      */
121 121
     @Override
@@ -146,31 +146,31 @@ public class IdentdPlugin extends BasePlugin implements ActionListener {
146 146
     public void showConfig(final PreferencesDialogModel manager) {
147 147
         final PreferencesCategory general = new PluginPreferencesCategory(
148 148
                 pluginInfo, "Identd",
149
-                "General Identd Plugin config ('Lower' options take priority " +
150
-                "over those above them)");
149
+                "General Identd Plugin config ('Lower' options take priority "
150
+                + "over those above them)");
151 151
         final PreferencesCategory advanced = new PluginPreferencesCategory(
152 152
                 pluginInfo, "Advanced",
153
-                "Advanced Identd Plugin config - Only edit these if you need " +
154
-                "to/know what you are doing. Editing these could prevent " +
155
-                "access to some servers. ('Lower' options take priority over " +
156
-                "those above them)");
153
+                "Advanced Identd Plugin config - Only edit these if you need "
154
+                + "to/know what you are doing. Editing these could prevent "
155
+                + "access to some servers. ('Lower' options take priority over "
156
+                + "those above them)");
157 157
 
158 158
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
159
-                getDomain(), "general.useUsername", "Use connection " +
160
-                "username rather than system username", "If this is enabled," +
161
-                " the username for the connection will be used rather than " +
162
-                "'" + System.getProperty("user.name") + "'",
159
+                getDomain(), "general.useUsername", "Use connection "
160
+                + "username rather than system username", "If this is enabled,"
161
+                + " the username for the connection will be used rather than " + "'" + System.
162
+                getProperty("user.name") + "'",
163 163
                 manager.getConfigManager(), manager.getIdentity()));
164 164
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
165
-                getDomain(), "general.useNickname", "Use connection " +
166
-                "nickname rather than system username", "If this is enabled, " +
167
-                "the nickname for the connection will be used rather than " +
168
-                "'" + System.getProperty("user.name") + "'",
165
+                getDomain(), "general.useNickname", "Use connection "
166
+                + "nickname rather than system username", "If this is enabled, "
167
+                + "the nickname for the connection will be used rather than " + "'" + System.
168
+                getProperty("user.name") + "'",
169 169
                 manager.getConfigManager(), manager.getIdentity()));
170 170
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
171
-                getDomain(), "general.useCustomName", "Use custom name" +
172
-                " all the time", "If this is enabled, the name specified below" +
173
-                " will be used all the time", manager.getConfigManager(),
171
+                getDomain(), "general.useCustomName", "Use custom name" + " all the time",
172
+                "If this is enabled, the name specified below" + " will be used all the time",
173
+                manager.getConfigManager(),
174 174
                 manager.getIdentity()));
175 175
         general.addSetting(new PreferencesSetting(PreferencesType.TEXT,
176 176
                 getDomain(), "general.customName", "Custom Name to use",
@@ -178,36 +178,36 @@ public class IdentdPlugin extends BasePlugin implements ActionListener {
178 178
                 manager.getConfigManager(), manager.getIdentity()));
179 179
 
180 180
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
181
-                getDomain(), "advanced.alwaysOn", "Always have ident " +
182
-                "port open", "By default the identd only runs when there are " +
183
-                "active connection attempts. This overrides that.",
181
+                getDomain(), "advanced.alwaysOn", "Always have ident " + "port open",
182
+                "By default the identd only runs when there are "
183
+                + "active connection attempts. This overrides that.",
184 184
                 manager.getConfigManager(), manager.getIdentity()));
185 185
         advanced.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
186 186
                 new PortValidator(), getDomain(), "advanced.port",
187
-                "What port should the identd listen on", "Default port is 113," +
188
-                " this is probably useless if changed unless you port forward" +
189
-                " ident to a different port", manager.getConfigManager(),
187
+                "What port should the identd listen on", "Default port is 113,"
188
+                + " this is probably useless if changed unless you port forward"
189
+                + " ident to a different port", manager.getConfigManager(),
190 190
                 manager.getIdentity()));
191 191
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
192 192
                 getDomain(), "advanced.useCustomSystem", "Use custom OS",
193
-                "By default the plugin uses 'UNIX' or 'WIN32' as the system " +
194
-                "type, this can be overriden by enabling this.",
193
+                "By default the plugin uses 'UNIX' or 'WIN32' as the system "
194
+                + "type, this can be overriden by enabling this.",
195 195
                 manager.getConfigManager(), manager.getIdentity()));
196 196
         advanced.addSetting(new PreferencesSetting(PreferencesType.TEXT,
197 197
                 getDomain(), "advanced.customSystem", "Custom OS to use",
198 198
                 "The custom system to use when 'Use Custom System' is enabled",
199 199
                 manager.getConfigManager(), manager.getIdentity()));
200 200
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
201
-                getDomain(), "advanced.isHiddenUser", "Respond to ident" +
202
-                " requests with HIDDEN-USER error", "By default the plugin will" +
203
-                " give a USERID response, this can force an 'ERROR :" +
204
-                " HIDDEN-USER' response instead.", manager.getConfigManager(),
201
+                getDomain(), "advanced.isHiddenUser", "Respond to ident"
202
+                + " requests with HIDDEN-USER error", "By default the plugin will"
203
+                + " give a USERID response, this can force an 'ERROR :"
204
+                + " HIDDEN-USER' response instead.", manager.getConfigManager(),
205 205
                 manager.getIdentity()));
206 206
         advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
207
-                getDomain(), "advanced.isNoUser", "Respond to ident" +
208
-                " requests with NO-USER error", "By default the plugin will" +
209
-                " give a USERID response, this can force an 'ERROR : NO-USER'" +
210
-                " response instead. (Overrides HIDDEN-USER)",
207
+                getDomain(), "advanced.isNoUser", "Respond to ident"
208
+                + " requests with NO-USER error", "By default the plugin will"
209
+                + " give a USERID response, this can force an 'ERROR : NO-USER'"
210
+                + " response instead. (Overrides HIDDEN-USER)",
211 211
                 manager.getConfigManager(), manager.getIdentity()));
212 212
 
213 213
         manager.getCategory("Plugins").addSubCategory(general);

+ 6
- 9
src/com/dmdirc/addons/identd/IdentdServer.java Bestand weergeven

@@ -39,26 +39,21 @@ public final class IdentdServer implements Runnable {
39 39
 
40 40
     /** The Thread in use for this server */
41 41
     private volatile Thread myThread = null;
42
-
43 42
     /** The current socket in use for this server */
44 43
     private ServerSocket serverSocket;
45
-
46 44
     /** Arraylist of all the clients we have */
47 45
     private final List<IdentClient> clientList = new ArrayList<>();
48
-
49 46
     /** The plugin that owns us. */
50 47
     private final IdentdPlugin myPlugin;
51
-
52 48
     /** Server manager. */
53 49
     private final ServerManager serverManager;
54
-
55 50
     /** Have we failed to start this server previously? */
56 51
     private boolean failed = false;
57 52
 
58 53
     /**
59 54
      * Create the IdentdServer.
60 55
      *
61
-     * @param plugin Parent ident plugin
56
+     * @param plugin        Parent ident plugin
62 57
      * @param serverManager Server manager to iterate over servers
63 58
      */
64 59
     public IdentdServer(final IdentdPlugin plugin, final ServerManager serverManager) {
@@ -76,7 +71,8 @@ public final class IdentdServer implements Runnable {
76 71
         while (myThread == thisThread) {
77 72
             try {
78 73
                 final Socket clientSocket = serverSocket.accept();
79
-                final IdentClient client = new IdentClient(this, clientSocket, myPlugin, serverManager);
74
+                final IdentClient client = new IdentClient(this, clientSocket, myPlugin,
75
+                        serverManager);
80 76
                 client.start();
81 77
                 addClient(client);
82 78
             } catch (IOException e) {
@@ -135,7 +131,9 @@ public final class IdentdServer implements Runnable {
135 131
                 myThread = new Thread(this);
136 132
                 myThread.start();
137 133
             } catch (IOException e) {
138
-                Logger.userError(ErrorLevel.HIGH, "Unable to start identd server: " + e.getMessage());
134
+                Logger.
135
+                        userError(ErrorLevel.HIGH, "Unable to start identd server: " + e.
136
+                        getMessage());
139 137
                 if (e.getMessage().equals("Permission denied")) {
140 138
                     failed = true;
141 139
                 }
@@ -168,4 +166,3 @@ public final class IdentdServer implements Runnable {
168 166
     }
169 167
 
170 168
 }
171
-

+ 7
- 5
src/com/dmdirc/addons/lagdisplay/LagDisplayPanel.java Bestand weergeven

@@ -19,6 +19,7 @@
19 19
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 20
  * SOFTWARE.
21 21
  */
22
+
22 23
 package com.dmdirc.addons.lagdisplay;
23 24
 
24 25
 import com.dmdirc.addons.ui_swing.components.statusbar.StatusbarPopupPanel;
@@ -29,16 +30,16 @@ import javax.inject.Singleton;
29 30
 import javax.swing.JLabel;
30 31
 
31 32
 /**
32
- * Shows the user's lag in the status bar, and reveals details of all servers
33
- * when the user hovers over it.
33
+ * Shows the user's lag in the status bar, and reveals details of all servers when the user hovers
34
+ * over it.
34 35
  */
35 36
 @Singleton
36 37
 public class LagDisplayPanel extends StatusbarPopupPanel<JLabel> {
37 38
 
38 39
     /**
39
-     * A version number for this class. It should be changed whenever the class
40
-     * structure is changed (or anything else that would prevent serialized
41
-     * objects being unserialized with the new class).
40
+     * A version number for this class. It should be changed whenever the class structure is changed
41
+     * (or anything else that would prevent serialized objects being unserialized with the new
42
+     * class).
42 43
      */
43 44
     private static final long serialVersionUID = 2;
44 45
     /** Factory of dialogs. */
@@ -60,4 +61,5 @@ public class LagDisplayPanel extends StatusbarPopupPanel<JLabel> {
60 61
     protected StatusbarPopupWindow getWindow() {
61 62
         return dialogFactory.getServerInfoDialog(this);
62 63
     }
64
+
63 65
 }

+ 18
- 13
src/com/dmdirc/addons/lagdisplay/LagDisplayPlugin.java Bestand weergeven

@@ -127,10 +127,11 @@ public final class LagDisplayPlugin extends BasePlugin implements
127 127
     }
128 128
 
129 129
     /**
130
-     * Retrieves the history of the specified server. If there is no history,
131
-     * a new list is added to the history map and returned.
130
+     * Retrieves the history of the specified server. If there is no history, a new list is added to
131
+     * the history map and returned.
132 132
      *
133 133
      * @param connection The connection whose history is being requested
134
+     *
134 135
      * @return The history for the specified server
135 136
      */
136 137
     protected RollingList<Long> getHistory(final Connection connection) {
@@ -141,8 +142,8 @@ public final class LagDisplayPlugin extends BasePlugin implements
141 142
     }
142 143
 
143 144
     /**
144
-     * Determines if the {@link ServerInfoDialog} should show a graph of the
145
-     * ping time for the current server.
145
+     * Determines if the {@link ServerInfoDialog} should show a graph of the ping time for the
146
+     * current server.
146 147
      *
147 148
      * @return True if a graph should be shown, false otherwise
148 149
      */
@@ -151,8 +152,7 @@ public final class LagDisplayPlugin extends BasePlugin implements
151 152
     }
152 153
 
153 154
     /**
154
-     * Determines if the {@link PingHistoryPanel} should show labels on
155
-     * selected points.
155
+     * Determines if the {@link PingHistoryPanel} should show labels on selected points.
156 156
      *
157 157
      * @return True if labels should be shown, false otherwise
158 158
      */
@@ -225,7 +225,8 @@ public final class LagDisplayPlugin extends BasePlugin implements
225 225
 
226 226
             panel.refreshDialog();
227 227
         } else if (useAlternate && type.equals(CoreActionType.SERVER_PINGSENT)) {
228
-            ((Connection) arguments[0]).getParser().sendRawMessage("LAGCHECK_" + new Date().getTime());
228
+            ((Connection) arguments[0]).getParser().sendRawMessage("LAGCHECK_" + new Date().
229
+                    getTime());
229 230
         } else if (useAlternate && type.equals(CoreActionType.SERVER_NUMERIC)
230 231
                 && ((Integer) arguments[1]) == 421
231 232
                 && ((String[]) arguments[2])[3].startsWith("LAGCHECK_")) {
@@ -256,6 +257,7 @@ public final class LagDisplayPlugin extends BasePlugin implements
256 257
      * Retrieves the ping time for the specified connection.
257 258
      *
258 259
      * @param connection The connection whose ping time is being requested
260
+     *
259 261
      * @return A String representation of the current lag, or "Unknown"
260 262
      */
261 263
     public String getTime(final Connection connection) {
@@ -264,7 +266,9 @@ public final class LagDisplayPlugin extends BasePlugin implements
264 266
 
265 267
     /**
266 268
      * Formats the specified time so it's a nice size to display in the label.
269
+     *
267 270
      * @param object An uncast Long representing the time to be formatted
271
+     *
268 272
      * @return Formatted time string
269 273
      */
270 274
     protected String formatTime(final Object object) {
@@ -288,16 +292,16 @@ public final class LagDisplayPlugin extends BasePlugin implements
288 292
                 + "lag which bypasses bouncers or proxies that may reply?",
289 293
                 manager.getConfigManager(), manager.getIdentity()));
290 294
         cat.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
291
-                getDomain(), "graph", "Show graph", "Show a graph of ping times " +
292
-                "for the current server in the information popup?",
295
+                getDomain(), "graph", "Show graph", "Show a graph of ping times "
296
+                + "for the current server in the information popup?",
293 297
                 manager.getConfigManager(), manager.getIdentity()));
294 298
         cat.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
295
-                getDomain(), "labels", "Show labels", "Show labels on selected " +
296
-                "points on the ping graph?",
299
+                getDomain(), "labels", "Show labels", "Show labels on selected "
300
+                + "points on the ping graph?",
297 301
                 manager.getConfigManager(), manager.getIdentity()));
298 302
         cat.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
299
-                getDomain(), "history", "Graph points", "Number of data points " +
300
-                "to plot on the graph, if enabled.",
303
+                getDomain(), "history", "Graph points", "Number of data points "
304
+                + "to plot on the graph, if enabled.",
301 305
                 manager.getConfigManager(), manager.getIdentity()));
302 306
         manager.getCategory("Plugins").addSubCategory(cat);
303 307
     }
@@ -307,4 +311,5 @@ public final class LagDisplayPlugin extends BasePlugin implements
307 311
     public void configChanged(final String domain, final String key) {
308 312
         readConfig();
309 313
     }
314
+
310 315
 }

+ 4
- 7
src/com/dmdirc/addons/lagdisplay/PingHistoryPanel.java Bestand weergeven

@@ -42,25 +42,22 @@ import javax.swing.JPanel;
42 42
 public class PingHistoryPanel extends JPanel {
43 43
 
44 44
     /**
45
-     * A version number for this class. It should be changed whenever the class
46
-     * structure is changed (or anything else that would prevent serialized
47
-     * objects being unserialized with the new class).
45
+     * A version number for this class. It should be changed whenever the class structure is changed
46
+     * (or anything else that would prevent serialized objects being unserialized with the new
47
+     * class).
48 48
      */
49 49
     private static final long serialVersionUID = 1;
50
-
51 50
     /** The plugin that this panel is for. */
52 51
     protected final LagDisplayPlugin plugin;
53
-
54 52
     /** The history that we're graphing. */
55 53
     protected final RollingList<Long> history;
56
-
57 54
     /** The maximum ping value. */
58 55
     protected long maximum = 0L;
59 56
 
60 57
     /**
61 58
      * Creates a new history panel for the specified plugin.
62 59
      *
63
-     * @param plugin The plugin that owns this panel
60
+     * @param plugin    The plugin that owns this panel
64 61
      * @param mainFrame Swing main frame
65 62
      */
66 63
     public PingHistoryPanel(final LagDisplayPlugin plugin,

+ 6
- 8
src/com/dmdirc/addons/lagdisplay/ServerInfoDialog.java Bestand weergeven

@@ -44,12 +44,11 @@ import javax.swing.JSeparator;
44 44
 public class ServerInfoDialog extends StatusbarPopupWindow {
45 45
 
46 46
     /**
47
-     * A version number for this class. It should be changed whenever the class
48
-     * structure is changed (or anything else that would prevent serialized
49
-     * objects being unserialized with the new class).
47
+     * A version number for this class. It should be changed whenever the class structure is changed
48
+     * (or anything else that would prevent serialized objects being unserialized with the new
49
+     * class).
50 50
      */
51 51
     private static final long serialVersionUID = 3;
52
-
53 52
     /** The lag display plugin. */
54 53
     protected final LagDisplayPlugin plugin;
55 54
     /** Swing main frame. */
@@ -60,9 +59,9 @@ public class ServerInfoDialog extends StatusbarPopupWindow {
60 59
     /**
61 60
      * Creates a new ServerInfoDialog.
62 61
      *
63
-     * @param plugin The {@link LagDisplayPlugin} we're using for info
64
-     * @param parent The {@link JPanel} to use for positioning
65
-     * @param mainFrame The frame that will own this dialog.
62
+     * @param plugin        The {@link LagDisplayPlugin} we're using for info
63
+     * @param parent        The {@link JPanel} to use for positioning
64
+     * @param mainFrame     The frame that will own this dialog.
66 65
      * @param serverManager The manager to use to iterate servers.
67 66
      */
68 67
     public ServerInfoDialog(
@@ -100,5 +99,4 @@ public class ServerInfoDialog extends StatusbarPopupWindow {
100 99
         }
101 100
     }
102 101
 
103
-
104 102
 }

+ 4
- 4
src/com/dmdirc/addons/logging/HistoryWindow.java Bestand weergeven

@@ -38,11 +38,11 @@ public class HistoryWindow extends FrameContainer {
38 38
     /**
39 39
      * Creates a new HistoryWindow.
40 40
      *
41
-     * @param title The title of the window
42
-     * @param reader The reader to use to get the history
43
-     * @param parent The window this history window was opened from
41
+     * @param title      The title of the window
42
+     * @param reader     The reader to use to get the history
43
+     * @param parent     The window this history window was opened from
44 44
      * @param urlBuilder The URL builder to use when finding icons.
45
-     * @param numLines The number of lines to show
45
+     * @param numLines   The number of lines to show
46 46
      */
47 47
     public HistoryWindow(
48 48
             final String title,

+ 14
- 8
src/com/dmdirc/addons/logging/LoggingCommand.java Bestand weergeven

@@ -50,7 +50,7 @@ public class LoggingCommand extends Command implements IntelligentCommand {
50 50
      * Creates a new instance of this command.
51 51
      *
52 52
      * @param controller The controller to use for command information.
53
-     * @param plugin The plugin providing logging services.
53
+     * @param plugin     The plugin providing logging services.
54 54
      */
55 55
     public LoggingCommand(final CommandController controller, final LoggingPlugin plugin) {
56 56
         super(controller);
@@ -64,17 +64,23 @@ public class LoggingCommand extends Command implements IntelligentCommand {
64 64
         if (args.getArguments().length > 0) {
65 65
             if (args.getArguments()[0].equalsIgnoreCase("history")) {
66 66
                 if (!plugin.showHistory(origin)) {
67
-                    sendLine(origin, args.isSilent(), FORMAT_ERROR, "Unable to open history for this window.");
67
+                    sendLine(origin, args.isSilent(), FORMAT_ERROR,
68
+                            "Unable to open history for this window.");
68 69
                 }
69 70
             } else if (args.getArguments()[0].equalsIgnoreCase("help")) {
70
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, LOGGING + " reload           - Reload the logging plugin.");
71
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, LOGGING + " history          - Open the history of this window, if available.");
72
-                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, LOGGING + " help             - Show this help.");
71
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, LOGGING
72
+                        + " reload           - Reload the logging plugin.");
73
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, LOGGING
74
+                        + " history          - Open the history of this window, if available.");
75
+                sendLine(origin, args.isSilent(), FORMAT_OUTPUT, LOGGING
76
+                        + " help             - Show this help.");
73 77
             } else {
74
-                sendLine(origin, args.isSilent(), FORMAT_ERROR, "Unknown command '" + args.getArguments()[0] + "'. Use " + LOGGING + " help for a list of commands.");
78
+                sendLine(origin, args.isSilent(), FORMAT_ERROR, "Unknown command '" + args.
79
+                        getArguments()[0] + "'. Use " + LOGGING + " help for a list of commands.");
75 80
             }
76 81
         } else {
77
-            sendLine(origin, args.isSilent(), FORMAT_ERROR, "Use " + LOGGING + " help for a list of commands.");
82
+            sendLine(origin, args.isSilent(), FORMAT_ERROR, "Use " + LOGGING
83
+                    + " help for a list of commands.");
78 84
         }
79 85
     }
80 86
 
@@ -91,5 +97,5 @@ public class LoggingCommand extends Command implements IntelligentCommand {
91 97
         }
92 98
         return res;
93 99
     }
94
-}
95 100
 
101
+}

+ 108
- 73
src/com/dmdirc/addons/logging/LoggingPlugin.java Bestand weergeven

@@ -89,17 +89,14 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
89 89
     private boolean autobackbuffer;
90 90
     private boolean backbufferTimestamp;
91 91
     private boolean usedate;
92
-
93 92
     /** Cached string settings. */
94 93
     private String timestamp;
95 94
     private String usedateformat;
96 95
     private String logDirectory;
97 96
     private String colour;
98
-
99 97
     /** Cached int settings. */
100 98
     private int historyLines;
101 99
     private int backbufferLines;
102
-
103 100
     /** This plugin's plugin info. */
104 101
     private final PluginInfo pluginInfo;
105 102
     /** The action controller to use. */
@@ -112,14 +109,11 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
112 109
     private final IdentityController identityController;
113 110
     /** The manager to add history windows to. */
114 111
     private final WindowManager windowManager;
115
-
116 112
     /** Timer used to close idle files. */
117 113
     protected Timer idleFileTimer;
118
-
119 114
     /** Map of open files. */
120
-    protected final Map<String, OpenFile> openFiles
121
-            = Collections.synchronizedMap(new HashMap<String, OpenFile>());
122
-
115
+    protected final Map<String, OpenFile> openFiles = Collections.synchronizedMap(
116
+            new HashMap<String, OpenFile>());
123 117
     /** Date format used for "File Opened At" log. */
124 118
     final DateFormat openedAtFormat = new SimpleDateFormat("EEEE MMMM dd, yyyy - HH:mm:ss");
125 119
     private final URLBuilder urlBuilder;
@@ -127,12 +121,12 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
127 121
     /**
128 122
      * Creates a new instance of this plugin.
129 123
      *
130
-     * @param pluginInfo This plugin's plugin info
131
-     * @param actionController The action controller to register listeners with
124
+     * @param pluginInfo         This plugin's plugin info
125
+     * @param actionController   The action controller to register listeners with
132 126
      * @param identityController The Identity Manager that controls the current config
133
-     * @param commandController Command controller to register commands
134
-     * @param windowManager The manager to add history windows to.
135
-     * @param urlBuilder The URL builder to use when finding icons.
127
+     * @param commandController  Command controller to register commands
128
+     * @param windowManager      The manager to add history windows to.
129
+     * @param urlBuilder         The URL builder to use when finding icons.
136 130
      */
137 131
     public LoggingPlugin(final PluginInfo pluginInfo,
138 132
             final ActionController actionController,
@@ -157,7 +151,8 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
157 151
     @Override
158 152
     public void domainUpdated() {
159 153
         identity.setOption(getDomain(), "general.directory",
160
-                identityController.getConfigurationDirectory() + "logs" + System.getProperty("file.separator"));
154
+                identityController.getConfigurationDirectory() + "logs" + System.getProperty(
155
+                "file.separator"));
161 156
     }
162 157
 
163 158
     /**
@@ -170,7 +165,8 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
170 165
         final File dir = new File(logDirectory);
171 166
         if (dir.exists()) {
172 167
             if (!dir.isDirectory()) {
173
-                Logger.userError(ErrorLevel.LOW, "Unable to create logging dir (file exists instead)");
168
+                Logger.userError(ErrorLevel.LOW,
169
+                        "Unable to create logging dir (file exists instead)");
174 170
             }
175 171
         } else {
176 172
             if (!dir.mkdirs()) {
@@ -205,13 +201,11 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
205 201
         // Close idle files every hour.
206 202
         idleFileTimer = new Timer("LoggingPlugin Timer");
207 203
         idleFileTimer.schedule(new TimerTask() {
208
-
209 204
             /** {@inheritDoc} */
210 205
             @Override
211 206
             public void run() {
212 207
                 timerTask();
213 208
             }
214
-
215 209
         }, 3600000);
216 210
         super.onLoad();
217 211
     }
@@ -266,7 +260,8 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
266 260
         final PreferencesCategory backbuffer = new PluginPreferencesCategory(
267 261
                 pluginInfo, "Back Buffer", "Options related to the automatic backbuffer");
268 262
         final PreferencesCategory advanced = new PluginPreferencesCategory(
269
-                pluginInfo, "Advanced", "Advanced configuration for Logging plugin. You shouldn't need to edit this unless you know what you are doing.");
263
+                pluginInfo, "Advanced",
264
+                "Advanced configuration for Logging plugin. You shouldn't need to edit this unless you know what you are doing.");
270 265
 
271 266
         general.addSetting(new PreferencesSetting(PreferencesType.DIRECTORY,
272 267
                 getDomain(), "general.directory", "Directory",
@@ -337,14 +332,16 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
337 332
     /**
338 333
      * Log a query-related event.
339 334
      *
340
-     * @param type The type of the event to process
341
-     * @param format Format of messages that are about to be sent. (May be null)
335
+     * @param type      The type of the event to process
336
+     * @param format    Format of messages that are about to be sent. (May be null)
342 337
      * @param arguments The arguments for the event
343 338
      */
344
-    protected void handleQueryEvent(final CoreActionType type, final StringBuffer format, final Object... arguments) {
339
+    protected void handleQueryEvent(final CoreActionType type, final StringBuffer format,
340
+            final Object... arguments) {
345 341
         final Query query = (Query) arguments[0];
346 342
         if (query.getConnection() == null) {
347
-            Logger.appError(ErrorLevel.MEDIUM, "Query object has no server (" + type.toString() + ")", new Exception("Query object has no server (" + type.toString() + ")"));
343
+            Logger.appError(ErrorLevel.MEDIUM, "Query object has no server (" + type.toString()
344
+                    + ")", new Exception("Query object has no server (" + type.toString() + ")"));
348 345
             return;
349 346
         }
350 347
 
@@ -385,13 +382,17 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
385 382
             case QUERY_SELF_MESSAGE:
386 383
             case QUERY_ACTION:
387 384
             case QUERY_SELF_ACTION:
388
-                final boolean isME = (type == CoreActionType.QUERY_SELF_MESSAGE || type == CoreActionType.QUERY_SELF_ACTION);
385
+                final boolean isME = (type == CoreActionType.QUERY_SELF_MESSAGE || type
386
+                        == CoreActionType.QUERY_SELF_ACTION);
389 387
                 final String overrideNick = isME ? getDisplayName(parser.getLocalClient()) : "";
390 388
 
391
-                if (type == CoreActionType.QUERY_MESSAGE || type == CoreActionType.QUERY_SELF_MESSAGE) {
392
-                    appendLine(filename, "<%s> %s", getDisplayName(client, overrideNick), arguments[2]);
389
+                if (type == CoreActionType.QUERY_MESSAGE || type
390
+                        == CoreActionType.QUERY_SELF_MESSAGE) {
391
+                    appendLine(filename, "<%s> %s", getDisplayName(client, overrideNick),
392
+                            arguments[2]);
393 393
                 } else {
394
-                    appendLine(filename, "* %s %s", getDisplayName(client, overrideNick), arguments[2]);
394
+                    appendLine(filename, "* %s %s", getDisplayName(client, overrideNick),
395
+                            arguments[2]);
395 396
                 }
396 397
                 break;
397 398
         }
@@ -400,19 +401,23 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
400 401
     /**
401 402
      * Log a channel-related event.
402 403
      *
403
-     * @param type The type of the event to process
404
-     * @param format Format of messages that are about to be sent. (May be null)
404
+     * @param type      The type of the event to process
405
+     * @param format    Format of messages that are about to be sent. (May be null)
405 406
      * @param arguments The arguments for the event
406 407
      */
407
-    protected void handleChannelEvent(final CoreActionType type, final StringBuffer format, final Object... arguments) {
408
+    protected void handleChannelEvent(final CoreActionType type, final StringBuffer format,
409
+            final Object... arguments) {
408 410
         final Channel chan = ((Channel) arguments[0]);
409 411
         final ChannelInfo channel = chan.getChannelInfo();
410 412
         final String filename = getLogFile(channel);
411 413
 
412
-        final ChannelClientInfo channelClient = (arguments.length > 1 && arguments[1] instanceof ChannelClientInfo) ? (ChannelClientInfo) arguments[1] : null;
414
+        final ChannelClientInfo channelClient = (arguments.length > 1
415
+                && arguments[1] instanceof ChannelClientInfo) ? (ChannelClientInfo) arguments[1]
416
+                : null;
413 417
         final ClientInfo client = channelClient == null ? null : channelClient.getClient();
414 418
 
415
-        final String message = (arguments.length > 2 && arguments[2] instanceof String) ? (String) arguments[2] : null;
419
+        final String message = (arguments.length > 2 && arguments[2] instanceof String)
420
+                ? (String) arguments[2] : null;
416 421
 
417 422
         switch (type) {
418 423
             case CHANNEL_OPENED:
@@ -434,7 +439,8 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
434 439
             case CHANNEL_SELF_MESSAGE:
435 440
             case CHANNEL_ACTION:
436 441
             case CHANNEL_SELF_ACTION:
437
-                if (type == CoreActionType.CHANNEL_MESSAGE || type == CoreActionType.CHANNEL_SELF_MESSAGE) {
442
+                if (type == CoreActionType.CHANNEL_MESSAGE || type
443
+                        == CoreActionType.CHANNEL_SELF_MESSAGE) {
438 444
                     appendLine(filename, "<%s> %s", getDisplayName(client), message);
439 445
                 } else {
440 446
                     appendLine(filename, "* %s %s", getDisplayName(client), message);
@@ -446,26 +452,34 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
446 452
                 final DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
447 453
 
448 454
                 appendLine(filename, "*** Topic is: %s", channel.getTopic());
449
-                appendLine(filename, "*** Set at: %s on %s by %s", timeFormat.format(1000 * channel.getTopicTime()), dateFormat.format(1000 * channel.getTopicTime()), channel.getTopicSetter());
455
+                appendLine(filename, "*** Set at: %s on %s by %s", timeFormat.format(1000 * channel.
456
+                        getTopicTime()), dateFormat.format(1000 * channel.getTopicTime()), channel.
457
+                        getTopicSetter());
450 458
                 break;
451 459
             case CHANNEL_TOPICCHANGE:
452
-                appendLine(filename, "*** %s Changed the topic to: %s", getDisplayName(channelClient), message);
460
+                appendLine(filename, "*** %s Changed the topic to: %s",
461
+                        getDisplayName(channelClient), message);
453 462
                 break;
454 463
             case CHANNEL_JOIN:
455
-                appendLine(filename, "*** %s (%s) joined the channel", getDisplayName(channelClient), client.toString());
464
+                appendLine(filename, "*** %s (%s) joined the channel", getDisplayName(channelClient),
465
+                        client.toString());
456 466
                 break;
457 467
             case CHANNEL_PART:
458 468
                 if (message.isEmpty()) {
459
-                    appendLine(filename, "*** %s (%s) left the channel", getDisplayName(channelClient), client.toString());
469
+                    appendLine(filename, "*** %s (%s) left the channel", getDisplayName(
470
+                            channelClient), client.toString());
460 471
                 } else {
461
-                    appendLine(filename, "*** %s (%s) left the channel (%s)", getDisplayName(channelClient), client.toString(), message);
472
+                    appendLine(filename, "*** %s (%s) left the channel (%s)", getDisplayName(
473
+                            channelClient), client.toString(), message);
462 474
                 }
463 475
                 break;
464 476
             case CHANNEL_QUIT:
465 477
                 if (message.isEmpty()) {
466
-                    appendLine(filename, "*** %s (%s) Quit IRC", getDisplayName(channelClient), client.toString());
478
+                    appendLine(filename, "*** %s (%s) Quit IRC", getDisplayName(channelClient),
479
+                            client.toString());
467 480
                 } else {
468
-                    appendLine(filename, "*** %s (%s) Quit IRC (%s)", getDisplayName(channelClient), client.toString(), message);
481
+                    appendLine(filename, "*** %s (%s) Quit IRC (%s)", getDisplayName(channelClient),
482
+                            client.toString(), message);
469 483
                 }
470 484
                 break;
471 485
             case CHANNEL_KICK:
@@ -473,19 +487,23 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
473 487
                 final ChannelClientInfo kickedClient = (ChannelClientInfo) arguments[2];
474 488
 
475 489
                 if (kickReason.isEmpty()) {
476
-                    appendLine(filename, "*** %s was kicked by %s", getDisplayName(kickedClient), getDisplayName(channelClient));
490
+                    appendLine(filename, "*** %s was kicked by %s", getDisplayName(kickedClient),
491
+                            getDisplayName(channelClient));
477 492
                 } else {
478
-                    appendLine(filename, "*** %s was kicked by %s (%s)", getDisplayName(kickedClient), getDisplayName(channelClient), kickReason);
493
+                    appendLine(filename, "*** %s was kicked by %s (%s)",
494
+                            getDisplayName(kickedClient), getDisplayName(channelClient), kickReason);
479 495
                 }
480 496
                 break;
481 497
             case CHANNEL_NICKCHANGE:
482
-                appendLine(filename, "*** %s is now %s", getDisplayName(channelClient, message), getDisplayName(channelClient));
498
+                appendLine(filename, "*** %s is now %s", getDisplayName(channelClient, message),
499
+                        getDisplayName(channelClient));
483 500
                 break;
484 501
             case CHANNEL_MODECHANGE:
485 502
                 if (channelClient.getClient().getNickname().isEmpty()) {
486 503
                     appendLine(filename, "*** Channel modes are: %s", message);
487 504
                 } else {
488
-                    appendLine(filename, "*** %s set modes: %s", getDisplayName(channelClient), message);
505
+                    appendLine(filename, "*** %s set modes: %s", getDisplayName(channelClient),
506
+                            message);
489 507
                 }
490 508
                 break;
491 509
         }
@@ -494,12 +512,13 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
494 512
     /**
495 513
      * Process an event of the specified type.
496 514
      *
497
-     * @param type The type of the event to process
498
-     * @param format Format of messages that are about to be sent. (May be null)
515
+     * @param type      The type of the event to process
516
+     * @param format    Format of messages that are about to be sent. (May be null)
499 517
      * @param arguments The arguments for the event
500 518
      */
501 519
     @Override
502
-    public void processEvent(final ActionType type, final StringBuffer format, final Object... arguments) {
520
+    public void processEvent(final ActionType type, final StringBuffer format,
521
+            final Object... arguments) {
503 522
         if (type instanceof CoreActionType) {
504 523
             final CoreActionType thisType = (CoreActionType) type;
505 524
 
@@ -543,7 +562,7 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
543 562
     /**
544 563
      * Add a backbuffer to a frame.
545 564
      *
546
-     * @param frame The frame to add the backbuffer lines to
565
+     * @param frame    The frame to add the backbuffer lines to
547 566
      * @param filename File to get backbuffer from
548 567
      */
549 568
     protected void showBackBuffer(final FrameContainer frame, final String filename) {
@@ -565,19 +584,21 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
565 584
                     frame.addLine(getColouredString(colour, lines.pop()), backbufferTimestamp);
566 585
                 }
567 586
                 file.close();
568
-                frame.addLine(getColouredString(colour, "--- End of backbuffer\n"), backbufferTimestamp);
587
+                frame.addLine(getColouredString(colour, "--- End of backbuffer\n"),
588
+                        backbufferTimestamp);
569 589
             } catch (IOException | SecurityException e) {
570
-                Logger.userError(ErrorLevel.LOW, "Unable to show backbuffer (Filename: " + filename + "): " + e.getMessage());
590
+                Logger.userError(ErrorLevel.LOW, "Unable to show backbuffer (Filename: " + filename
591
+                        + "): " + e.getMessage());
571 592
             }
572 593
         }
573 594
     }
574 595
 
575 596
     /**
576
-     * Get a coloured String.
577
-     * If colour is invalid, IRC Colour 14 will be used.
597
+     * Get a coloured String. If colour is invalid, IRC Colour 14 will be used.
578 598
      *
579 599
      * @param colour The colour the string should be (IRC Colour or 6-digit hex colour)
580
-     * @param line the line to colour
600
+     * @param line   the line to colour
601
+     *
581 602
      * @return The given line with the appropriate irc codes appended/prepended to colour it.
582 603
      */
583 604
     protected static String getColouredString(final String colour, final String line) {
@@ -611,8 +632,9 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
611 632
      * Add a line to a file.
612 633
      *
613 634
      * @param filename Name of file to write to
614
-     * @param format Format of line to add. (NewLine will be added Automatically)
615
-     * @param args Arguments for format
635
+     * @param format   Format of line to add. (NewLine will be added Automatically)
636
+     * @param args     Arguments for format
637
+     *
616 638
      * @return true on success, else false.
617 639
      */
618 640
     protected boolean appendLine(final String filename, final String format, final Object... args) {
@@ -623,7 +645,8 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
623 645
      * Add a line to a file.
624 646
      *
625 647
      * @param filename Name of file to write to
626
-     * @param line Line to add. (NewLine will be added Automatically)
648
+     * @param line     Line to add. (NewLine will be added Automatically)
649
+     *
627 650
      * @return true on success, else false.
628 651
      */
629 652
     protected boolean appendLine(final String filename, final String line) {
@@ -639,7 +662,8 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
639 662
                 final DateFormat dateFormat = new SimpleDateFormat("[dd/MM/yyyy HH:mm:ss]");
640 663
                 dateString = dateFormat.format(new Date()).trim();
641 664
 
642
-                Logger.userError(ErrorLevel.LOW, "Dateformat String '" + timestamp + "' is invalid. For more information: http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html");
665
+                Logger.userError(ErrorLevel.LOW, "Dateformat String '" + timestamp
666
+                        + "' is invalid. For more information: http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html");
643 667
             }
644 668
             finalLine.append(dateString);
645 669
             finalLine.append(' ');
@@ -669,9 +693,8 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
669 693
             /*
670 694
              * Do Nothing
671 695
              *
672
-             * Makes no sense to keep adding errors to the logger when we can't
673
-             * write to the file, as chances are it will happen on every incomming
674
-             * line.
696
+             * Makes no sense to keep adding errors to the logger when we can't write to the file,
697
+             * as chances are it will happen on every incomming line.
675 698
              */
676 699
         }
677 700
         return false;
@@ -681,6 +704,7 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
681 704
      * Get the name of the log file for a specific object.
682 705
      *
683 706
      * @param obj Object to get name for
707
+     *
684 708
      * @return the name of the log file to use for this object.
685 709
      */
686 710
     protected String getLogFile(final Object obj) {
@@ -722,7 +746,8 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
722 746
                 directory.append(File.separatorChar);
723 747
             }
724 748
 
725
-            if (!new File(directory.toString()).exists() && !(new File(directory.toString())).mkdirs()) {
749
+            if (!new File(directory.toString()).exists() && !(new File(directory.toString())).
750
+                    mkdirs()) {
726 751
                 Logger.userError(ErrorLevel.LOW, "Unable to create date dirs");
727 752
             }
728 753
         }
@@ -737,15 +762,15 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
737 762
     }
738 763
 
739 764
     /**
740
-     * This function adds the networkName to the log file.
741
-     * It first tries to create a directory for each network, if that fails
742
-     * it will prepend the networkName to the filename instead.
765
+     * This function adds the networkName to the log file. It first tries to create a directory for
766
+     * each network, if that fails it will prepend the networkName to the filename instead.
743 767
      *
744
-     * @param directory Current directory name
745
-     * @param file Current file name
768
+     * @param directory   Current directory name
769
+     * @param file        Current file name
746 770
      * @param networkName Name of network
747 771
      */
748
-    protected void addNetworkDir(final StringBuffer directory, final StringBuffer file, final String networkName) {
772
+    protected void addNetworkDir(final StringBuffer directory, final StringBuffer file,
773
+            final String networkName) {
749 774
         if (!networkfolders) {
750 775
             return;
751 776
         }
@@ -755,9 +780,11 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
755 780
         boolean prependNetwork = false;
756 781
 
757 782
         // Check dir exists
758
-        final File dir = new File(directory.toString() + network + System.getProperty("file.separator"));
783
+        final File dir = new File(directory.toString() + network + System.getProperty(
784
+                "file.separator"));
759 785
         if (dir.exists() && !dir.isDirectory()) {
760
-            Logger.userError(ErrorLevel.LOW, "Unable to create networkfolders dir (file exists instead)");
786
+            Logger.userError(ErrorLevel.LOW,
787
+                    "Unable to create networkfolders dir (file exists instead)");
761 788
             // Prepend network name to file instead.
762 789
             prependNetwork = true;
763 790
         } else if (!dir.exists() && !dir.mkdirs()) {
@@ -778,6 +805,7 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
778 805
      * Sanitise a string to be used as a filename.
779 806
      *
780 807
      * @param name String to sanitise
808
+     *
781 809
      * @return Sanitised version of name that can be used as a filename.
782 810
      */
783 811
     protected static String sanitise(final String name) {
@@ -789,6 +817,7 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
789 817
      * Get the md5 hash of a string.
790 818
      *
791 819
      * @param string String to hash
820
+     *
792 821
      * @return md5 hash of given string
793 822
      */
794 823
     protected static String md5(final String string) {
@@ -805,6 +834,7 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
805 834
      * Get name to display for client.
806 835
      *
807 836
      * @param client The client to get the display name for
837
+     *
808 838
      * @return name to display
809 839
      */
810 840
     protected String getDisplayName(final ClientInfo client) {
@@ -814,8 +844,9 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
814 844
     /**
815 845
      * Get name to display for client.
816 846
      *
817
-     * @param client The client to get the display name for
847
+     * @param client       The client to get the display name for
818 848
      * @param overrideNick Nickname to display instead of real nickname
849
+     *
819 850
      * @return name to display
820 851
      */
821 852
     protected String getDisplayName(final ClientInfo client, final String overrideNick) {
@@ -830,6 +861,7 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
830 861
      * Get name to display for channelClient (Taking into account the channelmodeprefix setting).
831 862
      *
832 863
      * @param channelClient The client to get the display name for
864
+     *
833 865
      * @return name to display
834 866
      */
835 867
     protected String getDisplayName(final ChannelClientInfo channelClient) {
@@ -840,16 +872,19 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
840 872
      * Get name to display for channelClient (Taking into account the channelmodeprefix setting).
841 873
      *
842 874
      * @param channelClient The client to get the display name for
843
-     * @param overrideNick Nickname to display instead of real nickname
875
+     * @param overrideNick  Nickname to display instead of real nickname
876
+     *
844 877
      * @return name to display
845 878
      */
846 879
     protected String getDisplayName(final ChannelClientInfo channelClient, final String overrideNick) {
847 880
         if (channelClient == null) {
848 881
             return (overrideNick.isEmpty()) ? "Unknown Client" : overrideNick;
849 882
         } else if (overrideNick.isEmpty()) {
850
-            return channelmodeprefix ? channelClient.toString() : channelClient.getClient().getNickname();
883
+            return channelmodeprefix ? channelClient.toString() : channelClient.getClient().
884
+                    getNickname();
851 885
         } else {
852
-            return channelmodeprefix ? channelClient.getImportantModePrefix() + overrideNick : overrideNick;
886
+            return channelmodeprefix ? channelClient.getImportantModePrefix() + overrideNick
887
+                    : overrideNick;
853 888
         }
854 889
     }
855 890
 
@@ -857,6 +892,7 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
857 892
      * Shows the history window for the specified target, if available.
858 893
      *
859 894
      * @param target The window whose history we're trying to open
895
+     *
860 896
      * @return True if the history is available, false otherwise
861 897
      */
862 898
     protected boolean showHistory(final FrameContainer target) {
@@ -919,7 +955,6 @@ public class LoggingPlugin extends BaseCommandPlugin implements ActionListener,
919 955
 
920 956
         /** Last used time. */
921 957
         public long lastUsedTime = System.currentTimeMillis();
922
-
923 958
         /** Open file's writer. */
924 959
         public BufferedWriter writer = null;
925 960
 

+ 8
- 6
src/com/dmdirc/addons/mediasource_dbus/DBusMediaSource.java Bestand weergeven

@@ -45,8 +45,7 @@ public class DBusMediaSource extends BasePlugin implements MediaSourceManager {
45 45
     /** The sources used by this media source. */
46 46
     private List<MediaSource> sources;
47 47
     /** A map of discovered mpris sources. */
48
-    private final Map<String, MediaSource> mprisSources
49
-            = new HashMap<>();
48
+    private final Map<String, MediaSource> mprisSources = new HashMap<>();
50 49
     /** The path to qdbus. */
51 50
     private String qdbus;
52 51
 
@@ -93,13 +92,14 @@ public class DBusMediaSource extends BasePlugin implements MediaSourceManager {
93 92
      * Performs a dbus call.
94 93
      *
95 94
      * @param service The name of the service
96
-     * @param iface The name of the interface
97
-     * @param method The name of the method
98
-     * @param args Any arguments to the method
95
+     * @param iface   The name of the interface
96
+     * @param method  The name of the method
97
+     * @param args    Any arguments to the method
98
+     *
99 99
      * @return A list of output (one entry per line)
100 100
      */
101 101
     public List<String> doDBusCall(final String service, final String iface,
102
-            final String method, final String ... args) {
102
+            final String method, final String... args) {
103 103
         final String[] exeArgs = new String[4 + args.length];
104 104
         exeArgs[0] = qdbus;
105 105
         exeArgs[1] = service;
@@ -115,6 +115,7 @@ public class DBusMediaSource extends BasePlugin implements MediaSourceManager {
115 115
      * Executes the specified command and arguments and returns the results.
116 116
      *
117 117
      * @param args The command/arguments to be executed
118
+     *
118 119
      * @return The output of the specified command
119 120
      */
120 121
     protected static List<String> getInfo(final String[] args) {
@@ -150,6 +151,7 @@ public class DBusMediaSource extends BasePlugin implements MediaSourceManager {
150 151
      * Parses a dbus dictionary into a {@link Map}.
151 152
      *
152 153
      * @param lines The lines to be parsed as a dictionary
154
+     *
153 155
      * @return A map corresponding to the specified dictionary
154 156
      */
155 157
     protected static Map<String, String> parseDictionary(

+ 9
- 5
src/com/dmdirc/addons/mediasource_dbus/MPRISSource.java Bestand weergeven

@@ -47,7 +47,7 @@ public class MPRISSource implements MediaSource {
47 47
     /**
48 48
      * Creates a new MPRIS source for the specified service name.
49 49
      *
50
-     * @param source The manager which owns this source
50
+     * @param source  The manager which owns this source
51 51
      * @param service The service name of the MRPIS service
52 52
      */
53 53
     public MPRISSource(final DBusMediaSource source, final String service) {
@@ -64,10 +64,11 @@ public class MPRISSource implements MediaSource {
64 64
     }
65 65
 
66 66
     /**
67
-     * Get the first line of the output for a dbus call to the given function
68
-     * against this service in the /org/mpris/MediaPlayer2 obejct.
67
+     * Get the first line of the output for a dbus call to the given function against this service
68
+     * in the /org/mpris/MediaPlayer2 obejct.
69 69
      *
70 70
      * @param function Function to get data for.
71
+     *
71 72
      * @return First line of output.
72 73
      */
73 74
     protected String getFirstValue(final String function) {
@@ -107,10 +108,11 @@ public class MPRISSource implements MediaSource {
107 108
     }
108 109
 
109 110
     /**
110
-     * Utility method to return the value of the specified key if it exists,
111
-     * or "Unknown" if it doesn't.
111
+     * Utility method to return the value of the specified key if it exists, or "Unknown" if it
112
+     * doesn't.
112 113
      *
113 114
      * @param key The key to be retrieved
115
+     *
114 116
      * @return The value of the specified key or "Unknown".
115 117
      */
116 118
     protected String getData(final String key) {
@@ -203,6 +205,7 @@ public class MPRISSource implements MediaSource {
203 205
      * Get the duration in seconds as a string.
204 206
      *
205 207
      * @param seconds Input to get duration for
208
+     *
206 209
      * @return Duration as a string
207 210
      */
208 211
     private String duration(final long secondsInput) {
@@ -233,4 +236,5 @@ public class MPRISSource implements MediaSource {
233 236
 
234 237
         return result.toString();
235 238
     }
239
+
236 240
 }

+ 2
- 1
src/com/dmdirc/addons/mediasource_dcop/DcopMediaSourcePlugin.java Bestand weergeven

@@ -40,7 +40,6 @@ public class DcopMediaSourcePlugin extends BasePlugin
40 40
 
41 41
     /** Media sources. */
42 42
     private final List<MediaSource> sources;
43
-
44 43
     /** This plugins plugin manager. */
45 44
     private final PluginManager pluginManager;
46 45
 
@@ -62,6 +61,7 @@ public class DcopMediaSourcePlugin extends BasePlugin
62 61
      * Get DCOP Result
63 62
      *
64 63
      * @param query Query to try
64
+     *
65 65
      * @return The result of the dcop query, line-by-line
66 66
      */
67 67
     @SuppressWarnings("unchecked")
@@ -79,4 +79,5 @@ public class DcopMediaSourcePlugin extends BasePlugin
79 79
     public List<MediaSource> getSources() {
80 80
         return Collections.unmodifiableList(sources);
81 81
     }
82
+
82 83
 }

+ 1
- 1
src/com/dmdirc/addons/mediasource_dcop/NoatunSource.java Bestand weergeven

@@ -112,7 +112,7 @@ public class NoatunSource implements MediaSource {
112 112
     @Override
113 113
     public String getTime() {
114 114
         return duration(Integer.parseInt(myPlugin.getDcopResult(
115
-                "dcop noatun Noatun position").get(0)) /1000);
115
+                "dcop noatun Noatun position").get(0)) / 1000);
116 116
     }
117 117
 
118 118
     /** {@inheritDoc} */

+ 1
- 2
src/com/dmdirc/addons/mediasource_linux_title/TitleMediaSource.java Bestand weergeven

@@ -39,7 +39,6 @@ public class TitleMediaSource implements MediaSource {
39 39
 
40 40
     /** The command to use to get the title. */
41 41
     private final String command;
42
-
43 42
     /** The name of the player we're retrieving. */
44 43
     private final String name;
45 44
 
@@ -47,7 +46,7 @@ public class TitleMediaSource implements MediaSource {
47 46
      * Creates a new title media source.
48 47
      *
49 48
      * @param command The command to be executed
50
-     * @param name The name of the media source
49
+     * @param name    The name of the media source
51 50
      */
52 51
     public TitleMediaSource(final String command, final String name) {
53 52
         this.command = command;

+ 7
- 7
src/com/dmdirc/addons/mediasource_linux_title/TitleMediaSourcePlugin.java Bestand weergeven

@@ -30,8 +30,8 @@ import java.util.ArrayList;
30 30
 import java.util.List;
31 31
 
32 32
 /**
33
- * A media source plugin which provides two {@link TitleMediaSource}s, one for
34
- * the Last.fm linux client and one for Spotify (running under Wine).
33
+ * A media source plugin which provides two {@link TitleMediaSource}s, one for the Last.fm linux
34
+ * client and one for Spotify (running under Wine).
35 35
  */
36 36
 public class TitleMediaSourcePlugin extends BasePlugin implements MediaSourceManager {
37 37
 
@@ -42,12 +42,12 @@ public class TitleMediaSourcePlugin extends BasePlugin implements MediaSourceMan
42 42
     @Override
43 43
     public void onLoad() {
44 44
         sources = new ArrayList<>(2);
45
-        sources.add(new TitleMediaSource("grep -E '\\(\"last\\.?fm\" \"Last\\.?fm\"\\)'" +
46
-                    "| grep -vE '(\"Last.fm " +
47
-                    "Options\"|\"Diagnostics\"|\"last\\.?fm\"|\"Share\"|\\(has no " +
48
-                    "name\\)):' | sed -r 's/^[^\"]*?\"(.*)\": \\(\"last\\.?fm.*$/\\1/g'", "Last.fm"));
45
+        sources.add(new TitleMediaSource("grep -E '\\(\"last\\.?fm\" \"Last\\.?fm\"\\)'"
46
+                + "| grep -vE '(\"Last.fm "
47
+                + "Options\"|\"Diagnostics\"|\"last\\.?fm\"|\"Share\"|\\(has no "
48
+                + "name\\)):' | sed -r 's/^[^\"]*?\"(.*)\": \\(\"last\\.?fm.*$/\\1/g'", "Last.fm"));
49 49
         sources.add(new TitleMediaSource("grep '\": (\"spotify.exe' | cut -d '\"' -f 2 | "
50
-                    + "cut -d '-' -f 2- | sed -r 's/^\\s+|\\s+$//g' | sed -r 's/-/–/g'", "Spotify"));
50
+                + "cut -d '-' -f 2- | sed -r 's/^\\s+|\\s+$//g' | sed -r 's/-/–/g'", "Spotify"));
51 51
     }
52 52
 
53 53
     /** {@inheritDoc} */

+ 6
- 6
src/com/dmdirc/addons/mediasource_mplayer/MplayerMediaSourcePlugin.java Bestand weergeven

@@ -33,8 +33,8 @@ import java.util.ArrayList;
33 33
 import java.util.List;
34 34
 
35 35
 /**
36
- * Provides a media source for mplayer which uses lsof to hackily see what
37
- * mplayer is currently accessing.
36
+ * Provides a media source for mplayer which uses lsof to hackily see what mplayer is currently
37
+ * accessing.
38 38
  */
39 39
 public class MplayerMediaSourcePlugin extends BasePlugin implements MediaSource {
40 40
 
@@ -110,10 +110,10 @@ public class MplayerMediaSourcePlugin extends BasePlugin implements MediaSource
110 110
 
111 111
         try {
112 112
             final String[] command = new String[]{"/bin/bash", "-c",
113
-                    "/usr/bin/lsof -c gmplayer |" +
114
-                    " grep -Ev '/dev|/lib|/var|/usr|/SYS|DIR|/tmp|pipe|socket|" +
115
-                    "\\.xession|fontconfig' | tail -n 1 | sed -r 's/ +/ /g' |" +
116
-                    " cut -d ' ' -f 9- | sed -r 's/^.*\\/(.*?)$/\\1/'"};
113
+                "/usr/bin/lsof -c gmplayer |"
114
+                + " grep -Ev '/dev|/lib|/var|/usr|/SYS|DIR|/tmp|pipe|socket|"
115
+                + "\\.xession|fontconfig' | tail -n 1 | sed -r 's/ +/ /g' |"
116
+                + " cut -d ' ' -f 9- | sed -r 's/^.*\\/(.*?)$/\\1/'"};
117 117
             process = Runtime.getRuntime().exec(command);
118 118
 
119 119
             reader = new InputStreamReader(process.getInputStream());

+ 3
- 5
src/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePlugin.java Bestand weergeven

@@ -88,8 +88,7 @@ public class VlcMediaSourcePlugin extends BasePlugin implements MediaSource {
88 88
     /** {@inheritDoc} */
89 89
     @Override
90 90
     public String getArtist() {
91
-        return information.containsKey("artist") ? information.get("artist") :
92
-                getFallbackArtist();
91
+        return information.containsKey("artist") ? information.get("artist") : getFallbackArtist();
93 92
     }
94 93
 
95 94
     /**
@@ -262,10 +261,9 @@ public class VlcMediaSourcePlugin extends BasePlugin implements MediaSource {
262 261
     }
263 262
 
264 263
     /**
265
-     * Parses the information from the two pages obtained from VLC's web
266
-     * interface.
264
+     * Parses the information from the two pages obtained from VLC's web interface.
267 265
      *
268
-     * @param res The first page of VLC info (/old/info.html)
266
+     * @param res  The first page of VLC info (/old/info.html)
269 267
      * @param res2 The second page of VLC info (/old/)
270 268
      */
271 269
     protected void parseInformation(final List<String> res,

+ 9
- 8
src/com/dmdirc/addons/mediasource_windows/DllSource.java Bestand weergeven

@@ -34,17 +34,15 @@ public class DllSource implements MediaSource {
34 34
 
35 35
     /** Player name */
36 36
     private final String playerName;
37
-
38 37
     /** Use getArtistTitle */
39 38
     private final boolean useArtistTitle;
40
-
41 39
     /** Parent Plugin. */
42 40
     final WindowsMediaSourcePlugin parent;
43 41
 
44 42
     /**
45 43
      * Instantiates the media source.
46 44
      *
47
-     * @param parent The plugin that owns this DllSource
45
+     * @param parent     The plugin that owns this DllSource
48 46
      * @param playerName Name of Player and DLL
49 47
      */
50 48
     public DllSource(final WindowsMediaSourcePlugin parent, final String playerName) {
@@ -54,12 +52,13 @@ public class DllSource implements MediaSource {
54 52
     /**
55 53
      * Instantiates the media source.
56 54
      *
57
-     * @param parent The plugin that owns this DllSource
58
-     * @param playerName Name of Player and DLL
59
-     * @param useArtistTitle True if getArtistTitle should be parsed rather than
60
-     *                       using getArtist() and getTitle()
55
+     * @param parent         The plugin that owns this DllSource
56
+     * @param playerName     Name of Player and DLL
57
+     * @param useArtistTitle True if getArtistTitle should be parsed rather than using getArtist()
58
+     *                       and getTitle()
61 59
      */
62
-    public DllSource(final WindowsMediaSourcePlugin parent, final String playerName, final boolean useArtistTitle) {
60
+    public DllSource(final WindowsMediaSourcePlugin parent, final String playerName,
61
+            final boolean useArtistTitle) {
63 62
         this.playerName = playerName;
64 63
         this.useArtistTitle = useArtistTitle;
65 64
         this.parent = parent;
@@ -75,6 +74,7 @@ public class DllSource implements MediaSource {
75 74
      * Get the "goodoutput" from GetMediaInfo for the given command
76 75
      *
77 76
      * @param command Command to run
77
+     *
78 78
      * @return "Good" Output
79 79
      */
80 80
     private String getOutput(final String command) {
@@ -133,6 +133,7 @@ public class DllSource implements MediaSource {
133 133
      * Get the duration in seconds as a string.
134 134
      *
135 135
      * @param secondsInput to get duration for
136
+     *
136 137
      * @return Duration as a string
137 138
      */
138 139
     private String duration(final long secondsInput) {

+ 1
- 2
src/com/dmdirc/addons/mediasource_windows/MediaInfoOutput.java Bestand weergeven

@@ -29,7 +29,6 @@ public class MediaInfoOutput {
29 29
 
30 30
     /** Exit Code from GetMediaInfo.exe */
31 31
     private final int exitCode;
32
-
33 32
     /** Output from GetMediaInfo.exe */
34 33
     private final String output;
35 34
 
@@ -37,7 +36,7 @@ public class MediaInfoOutput {
37 36
      * Create a MediaInfoOutput
38 37
      *
39 38
      * @param exitCode Exit code from GetMediaInfo.exe
40
-     * @param output Output from GetMediaInfo.exe
39
+     * @param output   Output from GetMediaInfo.exe
41 40
      */
42 41
     public MediaInfoOutput(final int exitCode, final String output) {
43 42
         this.exitCode = exitCode;

+ 4
- 1
src/com/dmdirc/addons/mediasource_windows/WindowsMediaSourcePlugin.java Bestand weergeven

@@ -70,6 +70,7 @@ public class WindowsMediaSourcePlugin extends BasePlugin
70 70
      *
71 71
      * @param player Player to ask about
72 72
      * @param method Method to call
73
+     *
73 74
      * @return a MediaInfoOutput with the results
74 75
      */
75 76
     protected MediaInfoOutput getOutput(final String player, final String method) {
@@ -101,7 +102,9 @@ public class WindowsMediaSourcePlugin extends BasePlugin
101 102
             filesHelper.extractResoucesEndingWith(".dll");
102 103
             filesHelper.extractResoucesEndingWith(".exe");
103 104
         } catch (IOException ex) {
104
-            Logger.userError(ErrorLevel.MEDIUM, "Unable to extract files for windows media source: " + ex.getMessage(), ex);
105
+            Logger.userError(ErrorLevel.MEDIUM, "Unable to extract files for windows media source: "
106
+                    + ex.getMessage(), ex);
105 107
         }
106 108
     }
109
+
107 110
 }

+ 5
- 5
src/com/dmdirc/addons/nickcolours/ColourRenderer.java Bestand weergeven

@@ -38,12 +38,11 @@ import javax.swing.table.DefaultTableCellRenderer;
38 38
 public class ColourRenderer extends DefaultTableCellRenderer {
39 39
 
40 40
     /**
41
-     * A version number for this class. It should be changed whenever the class
42
-     * structure is changed (or anything else that would prevent serialized
43
-     * objects being unserialized with the new class).
41
+     * A version number for this class. It should be changed whenever the class structure is changed
42
+     * (or anything else that would prevent serialized objects being unserialized with the new
43
+     * class).
44 44
      */
45 45
     private static final long serialVersionUID = 1;
46
-
47 46
     /** The colour manager to use to parse colours. */
48 47
     private final ColourManager colourManager;
49 48
 
@@ -65,7 +64,8 @@ public class ColourRenderer extends DefaultTableCellRenderer {
65 64
             final boolean hasFocus, final int row, final int column) {
66 65
         Color colour = null;
67 66
         if (value != null && !((String) value).isEmpty()) {
68
-            colour = UIUtilities.convertColour(colourManager.getColourFromString((String) value, null));
67
+            colour = UIUtilities.convertColour(colourManager.getColourFromString((String) value,
68
+                    null));
69 69
         }
70 70
 
71 71
         setHorizontalAlignment(CENTER);

+ 16
- 16
src/com/dmdirc/addons/nickcolours/NickColourInputDialog.java Bestand weergeven

@@ -45,9 +45,9 @@ public class NickColourInputDialog extends StandardDialog
45 45
         implements ActionListener {
46 46
 
47 47
     /**
48
-     * A version number for this class. It should be changed whenever the class
49
-     * structure is changed (or anything else that would prevent serialized
50
-     * objects being unserialized with the new class).
48
+     * A version number for this class. It should be changed whenever the class structure is changed
49
+     * (or anything else that would prevent serialized objects being unserialized with the new
50
+     * class).
51 51
      */
52 52
     private static final long serialVersionUID = 1;
53 53
     /** Whether or not this is a new entry (as opposed to editing an old one). */
@@ -68,15 +68,15 @@ public class NickColourInputDialog extends StandardDialog
68 68
     /**
69 69
      * Creates a new instance of NickColourInputDialog.
70 70
      *
71
-     * @param owner The window that owns this dialog.
71
+     * @param owner         The window that owns this dialog.
72 72
      * @param colourManager The colour manager to use to retrieve colours.
73
-     * @param iconManager The icon manager to use for the dialog icon.
74
-     * @param panel The panel that's opening this dialog
75
-     * @param row The row of the table we're editing
76
-     * @param nickname The nickname that's currently set
77
-     * @param network The network that's currently set
78
-     * @param textcolour The text colour that's currently set
79
-     * @param nickcolour The nicklist colour that's currently set
73
+     * @param iconManager   The icon manager to use for the dialog icon.
74
+     * @param panel         The panel that's opening this dialog
75
+     * @param row           The row of the table we're editing
76
+     * @param nickname      The nickname that's currently set
77
+     * @param network       The network that's currently set
78
+     * @param textcolour    The text colour that's currently set
79
+     * @param nickcolour    The nicklist colour that's currently set
80 80
      */
81 81
     public NickColourInputDialog(
82 82
             final MainFrame owner,
@@ -103,10 +103,10 @@ public class NickColourInputDialog extends StandardDialog
103 103
     /**
104 104
      * Creates a new instance of NickColourInputDialog.
105 105
      *
106
-     * @param owner The window that owns this dialog.
106
+     * @param owner         The window that owns this dialog.
107 107
      * @param colourManager The colour manager to use to retrieve colours.
108
-     * @param iconManager The icon manager to use for the dialog icon.
109
-     * @param panel The panel that's opening this dialog
108
+     * @param iconManager   The icon manager to use for the dialog icon.
109
+     * @param panel         The panel that's opening this dialog
110 110
      */
111 111
     public NickColourInputDialog(
112 112
             final MainFrame owner,
@@ -121,8 +121,8 @@ public class NickColourInputDialog extends StandardDialog
121 121
     /**
122 122
      * Initialises the components.
123 123
      *
124
-     * @param defaultNickname The default value for the nickname text field
125
-     * @param defaultNetwork The default value for the network text field
124
+     * @param defaultNickname   The default value for the nickname text field
125
+     * @param defaultNetwork    The default value for the network text field
126 126
      * @param defaultTextColour The default value for the text colour option
127 127
      * @param defaultNickColour The default value for the nick colour option
128 128
      */

+ 17
- 15
src/com/dmdirc/addons/nickcolours/NickColourManager.java Bestand weergeven

@@ -19,6 +19,7 @@
19 19
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 20
  * SOFTWARE.
21 21
  */
22
+
22 23
 package com.dmdirc.addons.nickcolours;
23 24
 
24 25
 import com.dmdirc.Channel;
@@ -122,7 +123,7 @@ public class NickColourManager implements ActionListener, ConfigChangeListener {
122 123
      * Colours the specified client according to the user's config.
123 124
      *
124 125
      * @param network The network to use for the colouring
125
-     * @param client The client to be coloured
126
+     * @param client  The client to be coloured
126 127
      */
127 128
     private void colourClient(final String network,
128 129
             final ChannelClientInfo client) {
@@ -169,7 +170,7 @@ public class NickColourManager implements ActionListener, ConfigChangeListener {
169 170
     /**
170 171
      * Puts the specified colour into the given map. The keys are determined by config settings.
171 172
      *
172
-     * @param map The map to use
173
+     * @param map        The map to use
173 174
      * @param textColour Text colour to be inserted
174 175
      * @param nickColour Nick colour to be inserted
175 176
      */
@@ -188,6 +189,7 @@ public class NickColourManager implements ActionListener, ConfigChangeListener {
188 189
      * Retrieves a pseudo-random colour for the specified nickname.
189 190
      *
190 191
      * @param nick The nickname of the client whose colour we're determining
192
+     *
191 193
      * @return Colour of the specified nickname
192 194
      */
193 195
     private Colour getColour(final String nick) {
@@ -237,6 +239,7 @@ public class NickColourManager implements ActionListener, ConfigChangeListener {
237 239
      * should be used for it.
238 240
      *
239 241
      * @param key The config key to look up
242
+     *
240 243
      * @return The colours specified by the given key
241 244
      */
242 245
     private String[] getParts(final String key) {
@@ -267,7 +270,6 @@ public class NickColourManager implements ActionListener, ConfigChangeListener {
267 270
         ActionManager.getActionManager().unregisterListener(this);
268 271
     }
269 272
 
270
-
271 273
     /**
272 274
      * Shows the prefs configuration page for this plugin.
273 275
      *
@@ -280,15 +282,14 @@ public class NickColourManager implements ActionListener, ConfigChangeListener {
280 282
         final PreferencesCategory colours = new PluginPreferencesCategory(
281 283
                 pluginInfo, "Colours",
282 284
                 "Set colours for specific nicknames.", UIUtilities.invokeAndWait(
283
-                        new Callable<NickColourPanel>() {
284
-
285
-                            /** {@inheritDoc} */
286
-                            @Override
287
-                            public NickColourPanel call() {
288
-                                return new NickColourPanel(mainFrame, iconManager,
289
-                                        NickColourManager.this, colourManager, userConfig);
290
-                            }
291
-                        }));
285
+                new Callable<NickColourPanel>() {
286
+            /** {@inheritDoc} */
287
+            @Override
288
+            public NickColourPanel call() {
289
+                return new NickColourPanel(mainFrame, iconManager,
290
+                        NickColourManager.this, colourManager, userConfig);
291
+            }
292
+        }));
292 293
 
293 294
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
294 295
                 "ui", "shownickcoloursintext", "Show colours in text area",
@@ -315,9 +316,9 @@ public class NickColourManager implements ActionListener, ConfigChangeListener {
315 316
                 "Always use the same colour for our own nickname?",
316 317
                 manager.getConfigManager(), manager.getIdentity()));
317 318
         general.addSetting(new PreferencesSetting(PreferencesType.COLOUR, domain,
318
-                        "owncolour", "Colour to use for own nick",
319
-                        "Colour used for our own nickname, if above setting is "
320
-                        + "enabled.", manager.getConfigManager(), manager.getIdentity()));
319
+                "owncolour", "Colour to use for own nick",
320
+                "Colour used for our own nickname, if above setting is "
321
+                + "enabled.", manager.getConfigManager(), manager.getIdentity()));
321 322
 
322 323
         general.addSubCategory(colours);
323 324
         manager.getCategory("Plugins").addSubCategory(general);
@@ -351,4 +352,5 @@ public class NickColourManager implements ActionListener, ConfigChangeListener {
351 352
     public String getDomain() {
352 353
         return domain;
353 354
     }
355
+
354 356
 }

+ 3
- 2
src/com/dmdirc/addons/nickcolours/NickColourModule.java Bestand weergeven

@@ -33,7 +33,7 @@ import dagger.Provides;
33 33
 /**
34 34
  * DI module for the nick colour plugin.
35 35
  */
36
-@Module(injects={NickColourManager.class}, addsTo = SwingModule.class)
36
+@Module(injects = {NickColourManager.class}, addsTo = SwingModule.class)
37 37
 public class NickColourModule {
38 38
 
39 39
     /** The domain for plugin settings. */
@@ -42,7 +42,8 @@ public class NickColourModule {
42 42
     private final PluginInfo pluginInfo;
43 43
 
44 44
     @Qualifier
45
-    public static @interface NickColourSettingsDomain {}
45
+    public static @interface NickColourSettingsDomain {
46
+    }
46 47
 
47 48
     public NickColourModule(final PluginInfo pluginInfo, final String domain) {
48 49
         this.pluginInfo = pluginInfo;

+ 7
- 8
src/com/dmdirc/addons/nickcolours/NickColourPanel.java Bestand weergeven

@@ -55,7 +55,6 @@ public class NickColourPanel extends JPanel implements ActionListener,
55 55
     private static final long serialVersionUID = 1;
56 56
     /** The table headings. */
57 57
     private static final String[] HEADERS = {"Network", "Nickname", "Text colour", "Nicklist colour"};
58
-
59 58
     /** The table used for displaying the options. */
60 59
     private final JTable table;
61 60
     /** The plugin we're associated with. */
@@ -76,11 +75,11 @@ public class NickColourPanel extends JPanel implements ActionListener,
76 75
     /**
77 76
      * Creates a new instance of NickColourPanel.
78 77
      *
79
-     * @param mainFrame Main frame to parent dialogs on
80
-     * @param iconManager Icon manager to load icons from
81
-     * @param plugin The plugin that owns this panel
78
+     * @param mainFrame     Main frame to parent dialogs on
79
+     * @param iconManager   Icon manager to load icons from
80
+     * @param plugin        The plugin that owns this panel
82 81
      * @param colourManager The colour manager to use to parse colours.
83
-     * @param userSettings The provider to write user settings to.
82
+     * @param userSettings  The provider to write user settings to.
84 83
      */
85 84
     public NickColourPanel(
86 85
             final MainFrame mainFrame, final IconManager iconManager, final NickColourManager plugin,
@@ -94,7 +93,6 @@ public class NickColourPanel extends JPanel implements ActionListener,
94 93
         final Object[][] data = plugin.getData();
95 94
 
96 95
         table = new JTable(new DefaultTableModel(data, HEADERS)) {
97
-
98 96
             /** A version number for this class. */
99 97
             private static final long serialVersionUID = 1;
100 98
             /** The colour renderer we're using for colour cells. */
@@ -199,8 +197,8 @@ public class NickColourPanel extends JPanel implements ActionListener,
199 197
     /**
200 198
      * Adds a row to the table.
201 199
      *
202
-     * @param network The network setting
203
-     * @param nickname The nickname setting
200
+     * @param network    The network setting
201
+     * @param nickname   The nickname setting
204 202
      * @param textcolour The textpane colour setting
205 203
      * @param nickcolour The nick list colour setting
206 204
      */
@@ -253,4 +251,5 @@ public class NickColourPanel extends JPanel implements ActionListener,
253 251
         editButton.setEnabled(enable);
254 252
         deleteButton.setEnabled(enable);
255 253
     }
254
+
256 255
 }

+ 1
- 3
src/com/dmdirc/addons/nickcolours/NickColourPlugin.java Bestand weergeven

@@ -28,7 +28,6 @@ import com.dmdirc.plugins.implementations.BasePlugin;
28 28
 
29 29
 import dagger.ObjectGraph;
30 30
 
31
-
32 31
 /**
33 32
  * Adds support for nick colours throughout the client.
34 33
  */
@@ -38,7 +37,6 @@ public class NickColourPlugin extends BasePlugin {
38 37
     private NickColourManager nickColourManager;
39 38
 
40 39
     public NickColourPlugin() {
41
-
42 40
     }
43 41
 
44 42
     @Override
@@ -50,7 +48,7 @@ public class NickColourPlugin extends BasePlugin {
50 48
     }
51 49
 
52 50
     @Override
53
-        public void onLoad() {
51
+    public void onLoad() {
54 52
         super.onLoad();
55 53
         nickColourManager.onLoad();
56 54
     }

+ 6
- 10
src/com/dmdirc/addons/nma/NotifyMyAndroidClient.java Bestand weergeven

@@ -39,15 +39,12 @@ import org.slf4j.LoggerFactory;
39 39
 public class NotifyMyAndroidClient {
40 40
 
41 41
     private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(NotifyMyAndroidClient.class);
42
-
43 42
     /** The base URL for the NMA API. */
44 43
     private static final String BASE_URL = "https://www.notifymyandroid.com";
45 44
     /** The method to call to send a notification. */
46 45
     private static final String NOTIFY_PATH = "/publicapi/notify";
47
-
48 46
     /** The API keys to deliver to. */
49 47
     private final Collection<String> apiKeys;
50
-
51 48
     /** The application to report ourselves as. */
52 49
     private final String application;
53 50
 
@@ -57,22 +54,21 @@ public class NotifyMyAndroidClient {
57 54
     }
58 55
 
59 56
     /**
60
-     * Creates a new instance of {@link NotifyMyAndroidClient} with a single
61
-     * API key.
57
+     * Creates a new instance of {@link NotifyMyAndroidClient} with a single API key.
62 58
      *
63
-     * @param apiKey The API key to use when connecting to NMA
59
+     * @param apiKey      The API key to use when connecting to NMA
64 60
      * @param application The application string to report to NMA.
65 61
      */
66 62
     public NotifyMyAndroidClient(final String apiKey, final String application) {
67
-        this(Arrays.asList(new String[] { apiKey }), application);
63
+        this(Arrays.asList(new String[]{apiKey}), application);
68 64
     }
69 65
 
70 66
     /**
71
-     * Sends a notification to NotifyMyAndroid. At present return status and
72
-     * text is ignored.
67
+     * Sends a notification to NotifyMyAndroid. At present return status and text is ignored.
73 68
      *
74
-     * @param event The name of the event to send (max 1,000 chars).
69
+     * @param event       The name of the event to send (max 1,000 chars).
75 70
      * @param description The description of the event (max 10,000 chars).
71
+     *
76 72
      * @throws IOException If the NMA service couldn't be reached
77 73
      */
78 74
     public void notify(final String event, final String description) throws IOException {

+ 5
- 6
src/com/dmdirc/addons/nma/NotifyMyAndroidCommand.java Bestand weergeven

@@ -39,15 +39,14 @@ import org.slf4j.LoggerFactory;
39 39
  */
40 40
 public class NotifyMyAndroidCommand extends Command {
41 41
 
42
-    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(NotifyMyAndroidCommand.class);
43
-
42
+    private static final org.slf4j.Logger LOG = LoggerFactory.
43
+            getLogger(NotifyMyAndroidCommand.class);
44 44
     /** A command info object for this command. */
45 45
     public static final BaseCommandInfo INFO = new BaseCommandInfo(
46 46
             "notifymyandroid",
47 47
             "notifymyandroid <title> -- <body>"
48
-                + " - Sends notification to NotifyMyAndroid",
48
+            + " - Sends notification to NotifyMyAndroid",
49 49
             CommandType.TYPE_GLOBAL);
50
-
51 50
     /** The configuration domain to retrieve settings from. */
52 51
     private String configDomain;
53 52
 
@@ -81,7 +80,6 @@ public class NotifyMyAndroidCommand extends Command {
81 80
                 origin.getConfigManager().getOption(configDomain, "application"));
82 81
 
83 82
         new Thread(new Runnable() {
84
-
85 83
             @Override
86 84
             public void run() {
87 85
                 try {
@@ -89,7 +87,8 @@ public class NotifyMyAndroidCommand extends Command {
89 87
                     sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Notification sent");
90 88
                 } catch (IOException ex) {
91 89
                     LOG.info("Exception when trying to notify NMA", ex);
92
-                    sendLine(origin, args.isSilent(), FORMAT_ERROR, "Unable to send: " + ex.getMessage());
90
+                    sendLine(origin, args.isSilent(), FORMAT_ERROR, "Unable to send: " + ex.
91
+                            getMessage());
93 92
                 }
94 93
             }
95 94
         }, "NMA Thread").start();

+ 1
- 2
src/com/dmdirc/addons/nma/NotifyMyAndroidPlugin.java Bestand weergeven

@@ -38,14 +38,13 @@ public class NotifyMyAndroidPlugin extends BaseCommandPlugin {
38 38
 
39 39
     /** The command to register. */
40 40
     private final NotifyMyAndroidCommand command;
41
-
42 41
     /** Our info object. */
43 42
     private final PluginInfo pluginInfo;
44 43
 
45 44
     /**
46 45
      * Creates a new instance of the {@link NotifyMyAndroidPlugin}.
47 46
      *
48
-     * @param pluginInfo The plugin info object for this plugin.
47
+     * @param pluginInfo        The plugin info object for this plugin.
49 48
      * @param commandController Command controller to register commands
50 49
      */
51 50
     public NotifyMyAndroidPlugin(final PluginInfo pluginInfo,

+ 6
- 5
src/com/dmdirc/addons/notifications/NotificationCommand.java Bestand weergeven

@@ -37,8 +37,8 @@ import com.dmdirc.ui.input.AdditionalTabTargets;
37 37
 import java.util.List;
38 38
 
39 39
 /**
40
- * Notification command, delegating notification to one of the registered
41
- * notification commands as preferred by the end user.
40
+ * Notification command, delegating notification to one of the registered notification commands as
41
+ * preferred by the end user.
42 42
  */
43 43
 public class NotificationCommand extends Command implements
44 44
         IntelligentCommand {
@@ -47,7 +47,7 @@ public class NotificationCommand extends Command implements
47 47
     public static final BaseCommandInfo INFO = new BaseCommandInfo(
48 48
             "notification",
49 49
             "notification [--methods|--method <method>] text - "
50
-                + "Notifies you of the text",
50
+            + "Notifies you of the text",
51 51
             CommandType.TYPE_GLOBAL);
52 52
     /** The plugin that's using this command. */
53 53
     private final NotificationsPlugin parent;
@@ -56,7 +56,7 @@ public class NotificationCommand extends Command implements
56 56
      * Creates a new instance of this notification command.
57 57
      *
58 58
      * @param controller The controller to use for command information.
59
-     * @param parent The plugin that's instantiating this command
59
+     * @param parent     The plugin that's instantiating this command
60 60
      */
61 61
     public NotificationCommand(final CommandController controller, final NotificationsPlugin parent) {
62 62
         super(controller);
@@ -100,7 +100,7 @@ public class NotificationCommand extends Command implements
100 100
     /**
101 101
      * Outputs a list of methods for the notifcation command.
102 102
      *
103
-     * @param origin The input window where the command was entered
103
+     * @param origin   The input window where the command was entered
104 104
      * @param isSilent Whether this command is being silenced
105 105
      */
106 106
     private void doMethodList(final FrameContainer origin,
@@ -142,4 +142,5 @@ public class NotificationCommand extends Command implements
142 142
         }
143 143
         return res;
144 144
     }
145
+
145 146
 }

+ 5
- 4
src/com/dmdirc/addons/notifications/NotificationConfig.java Bestand weergeven

@@ -44,9 +44,9 @@ import net.miginfocom.swing.MigLayout;
44 44
 public class NotificationConfig extends JPanel implements PreferencesInterface {
45 45
 
46 46
     /**
47
-     * A version number for this class. It should be changed whenever the class
48
-     * structure is changed (or anything else that would prevent serialized
49
-     * objects being unserialized with the new class).
47
+     * A version number for this class. It should be changed whenever the class structure is changed
48
+     * (or anything else that would prevent serialized objects being unserialized with the new
49
+     * class).
50 50
      */
51 51
     private static final long serialVersionUID = 1;
52 52
     /** Notification method order list. */
@@ -59,7 +59,7 @@ public class NotificationConfig extends JPanel implements PreferencesInterface {
59 59
     /**
60 60
      * Creates a new instance of NotificationConfig panel.
61 61
      *
62
-     * @param plugin The plugin that owns this panel
62
+     * @param plugin  The plugin that owns this panel
63 63
      * @param methods A list of methods to be used in the panel
64 64
      */
65 65
     public NotificationConfig(final NotificationsPlugin plugin,
@@ -131,4 +131,5 @@ public class NotificationConfig extends JPanel implements PreferencesInterface {
131 131
     public void save() {
132 132
         plugin.saveSettings(getMethods());
133 133
     }
134
+
134 135
 }

+ 15
- 13
src/com/dmdirc/addons/notifications/NotificationsPlugin.java Bestand weergeven

@@ -19,6 +19,7 @@
19 19
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 20
  * SOFTWARE.
21 21
  */
22
+
22 23
 package com.dmdirc.addons.notifications;
23 24
 
24 25
 import com.dmdirc.actions.ActionManager;
@@ -39,8 +40,7 @@ import java.util.List;
39 40
 import java.util.concurrent.Callable;
40 41
 
41 42
 /**
42
- * Notification Manager plugin, aggregates notification sources exposing them
43
- * via a single command.
43
+ * Notification Manager plugin, aggregates notification sources exposing them via a single command.
44 44
  */
45 45
 public class NotificationsPlugin extends BaseCommandPlugin implements ActionListener {
46 46
 
@@ -56,8 +56,8 @@ public class NotificationsPlugin extends BaseCommandPlugin implements ActionList
56 56
     /**
57 57
      * Creates a new instance of this plugin.
58 58
      *
59
-     * @param pluginInfo This plugin's plugin info
60
-     * @param commandController Command controller to register commands
59
+     * @param pluginInfo         This plugin's plugin info
60
+     * @param commandController  Command controller to register commands
61 61
      * @param identityController The controller to read and write settings with.
62 62
      */
63 63
     public NotificationsPlugin(
@@ -100,7 +100,6 @@ public class NotificationsPlugin extends BaseCommandPlugin implements ActionList
100 100
     public void showConfig(final PreferencesDialogModel manager) {
101 101
         final NotificationConfig configPanel = UIUtilities.invokeAndWait(
102 102
                 new Callable<NotificationConfig>() {
103
-
104 103
             /** {@inheritDoc} */
105 104
             @Override
106 105
             public NotificationConfig call() {
@@ -118,7 +117,8 @@ public class NotificationsPlugin extends BaseCommandPlugin implements ActionList
118 117
     /** Loads the plugins settings. */
119 118
     private void loadSettings() {
120 119
         if (identityController.getGlobalConfiguration().hasOptionString(getDomain(), "methodOrder")) {
121
-            order = identityController.getGlobalConfiguration().getOptionList(getDomain(), "methodOrder");
120
+            order = identityController.getGlobalConfiguration().getOptionList(getDomain(),
121
+                    "methodOrder");
122 122
         } else {
123 123
             order = new ArrayList<>();
124 124
         }
@@ -136,8 +136,8 @@ public class NotificationsPlugin extends BaseCommandPlugin implements ActionList
136 136
     }
137 137
 
138 138
     /**
139
-     * Checks to see if a plugin implements the notification method interface
140
-     * and if it does, adds the method to our list.
139
+     * Checks to see if a plugin implements the notification method interface and if it does, adds
140
+     * the method to our list.
141 141
      *
142 142
      * @param target The plugin to be tested
143 143
      */
@@ -149,8 +149,8 @@ public class NotificationsPlugin extends BaseCommandPlugin implements ActionList
149 149
     }
150 150
 
151 151
     /**
152
-     * Checks to see if the specified notification method needs to be added to
153
-     * our order list, and adds it if neccessary.
152
+     * Checks to see if the specified notification method needs to be added to our order list, and
153
+     * adds it if neccessary.
154 154
      *
155 155
      * @param source The notification method to be tested
156 156
      */
@@ -161,8 +161,8 @@ public class NotificationsPlugin extends BaseCommandPlugin implements ActionList
161 161
     }
162 162
 
163 163
     /**
164
-     * Checks to see if a plugin implements the notification method interface
165
-     * and if it does, removes the method from our list.
164
+     * Checks to see if a plugin implements the notification method interface and if it does,
165
+     * removes the method from our list.
166 166
      *
167 167
      * @param target The plugin to be tested
168 168
      */
@@ -174,6 +174,7 @@ public class NotificationsPlugin extends BaseCommandPlugin implements ActionList
174 174
      * Retrieves a method based on its name.
175 175
      *
176 176
      * @param name The name to search for
177
+     *
177 178
      * @return The method with the specified name or null if none were found.
178 179
      */
179 180
     public PluginInfo getMethod(final String name) {
@@ -215,7 +216,7 @@ public class NotificationsPlugin extends BaseCommandPlugin implements ActionList
215 216
         for (String method : order) {
216 217
             if (methods.contains(method)) {
217 218
                 return pluginInfo.getMetaData().getManager().getPluginInfoByName(
218
-                    method);
219
+                        method);
219 220
             }
220 221
         }
221 222
         return null;
@@ -231,4 +232,5 @@ public class NotificationsPlugin extends BaseCommandPlugin implements ActionList
231 232
         identityController.getUserSettings()
232 233
                 .setOption(getDomain(), "methodOrder", order);
233 234
     }
235
+
234 236
 }

+ 8
- 10
src/com/dmdirc/addons/nowplaying/ConfigPanel.java Bestand weergeven

@@ -58,9 +58,9 @@ public class ConfigPanel extends JPanel implements PreferencesInterface,
58 58
         KeyListener {
59 59
 
60 60
     /**
61
-     * A version number for this class. It should be changed whenever the class
62
-     * structure is changed (or anything else that would prevent serialized
63
-     * objects being unserialized with the new class).
61
+     * A version number for this class. It should be changed whenever the class structure is changed
62
+     * (or anything else that would prevent serialized objects being unserialized with the new
63
+     * class).
64 64
      */
65 65
     private static final long serialVersionUID = 1;
66 66
     /** Media source order list. */
@@ -84,8 +84,8 @@ public class ConfigPanel extends JPanel implements PreferencesInterface,
84 84
      * Creates a new instance of ConfigPanel.
85 85
      *
86 86
      * @param identityController The controller to read/write settings with.
87
-     * @param plugin The plugin that owns this panel
88
-     * @param sources A list of sources to be used in the panel
87
+     * @param plugin             The plugin that owns this panel
88
+     * @param sources            A list of sources to be used in the panel
89 89
      */
90 90
     public ConfigPanel(
91 91
             final IdentityController identityController,
@@ -147,8 +147,8 @@ public class ConfigPanel extends JPanel implements PreferencesInterface,
147 147
         previewPanel = panel;
148 148
 
149 149
         add(new NowPlayingSubsitutionPanel(Arrays.asList(new String[]{"app",
150
-                    "title", "artist", "album", "bitrate", "format", "length",
151
-                    "time", "state"})), "growx");
150
+            "title", "artist", "album", "bitrate", "format", "length",
151
+            "time", "state"})), "growx");
152 152
         schedulePreviewUpdate();
153 153
     }
154 154
 
@@ -166,7 +166,6 @@ public class ConfigPanel extends JPanel implements PreferencesInterface,
166 166
 
167 167
         final String text = plugin.doSubstitution(
168 168
                 UIUtilities.invokeAndWait(new Callable<String>() {
169
-
170 169
             /** {@inheritDoc} */
171 170
             @Override
172 171
             public String call() {
@@ -174,7 +173,6 @@ public class ConfigPanel extends JPanel implements PreferencesInterface,
174 173
             }
175 174
         }), source);
176 175
         SwingUtilities.invokeLater(new Runnable() {
177
-
178 176
             /** {@inheritDoc} */
179 177
             @Override
180 178
             public void run() {
@@ -251,7 +249,6 @@ public class ConfigPanel extends JPanel implements PreferencesInterface,
251 249
 
252 250
         updateTimer = new Timer("Nowplaying config timer");
253 251
         updateTimer.schedule(new TimerTask() {
254
-
255 252
             /** {@inheritDoc} */
256 253
             @Override
257 254
             public void run() {
@@ -323,6 +320,7 @@ public class ConfigPanel extends JPanel implements PreferencesInterface,
323 320
         public String getBitrate() {
324 321
             return "128";
325 322
         }
323
+
326 324
     }
327 325
 
328 326
 }

+ 4
- 2
src/com/dmdirc/addons/nowplaying/MediaSource.java Bestand weergeven

@@ -23,16 +23,18 @@
23 23
 package com.dmdirc.addons.nowplaying;
24 24
 
25 25
 /**
26
- * The media source describes one source of "now playing" information
27
- * (i.e., one method of getting information from one media player).
26
+ * The media source describes one source of "now playing" information (i.e., one method of getting
27
+ * information from one media player).
28 28
  *
29 29
  * @author chris
30 30
  */
31 31
 public interface MediaSource {
32
+
32 33
     /**
33 34
      * Get the state of this media source
34 35
      *
35 36
      * @return State for this media source.
37
+     *
36 38
      * @since 0.6.3m1
37 39
      */
38 40
     MediaSourceState getState();

+ 7
- 8
src/com/dmdirc/addons/nowplaying/MediaSourceComparator.java Bestand weergeven

@@ -34,18 +34,17 @@ import java.util.List;
34 34
 public class MediaSourceComparator implements Comparator<MediaSource>, Serializable {
35 35
 
36 36
     /**
37
-     * A version number for this class. It should be changed whenever the class
38
-     * structure is changed (or anything else that would prevent serialized
39
-     * objects being unserialized with the new class).
37
+     * A version number for this class. It should be changed whenever the class structure is changed
38
+     * (or anything else that would prevent serialized objects being unserialized with the new
39
+     * class).
40 40
      */
41 41
     private static final long serialVersionUID = 1;
42
-
43 42
     /** The order that the sources should be checked. */
44 43
     private final List<String> order;
45 44
 
46 45
     /**
47
-     * Creates a new instance of MediaSourceComparator.
48
-     * NB: The order list may be altered during comparisons.
46
+     * Creates a new instance of MediaSourceComparator. NB: The order list may be altered during
47
+     * comparisons.
49 48
      *
50 49
      * @param order An ordered list of media source names
51 50
      */
@@ -60,8 +59,8 @@ public class MediaSourceComparator implements Comparator<MediaSource>, Serializa
60 59
     }
61 60
 
62 61
     /**
63
-     * Retrieves the position of the source within the order list.
64
-     * If the source is not present it is appended to the list.
62
+     * Retrieves the position of the source within the order list. If the source is not present it
63
+     * is appended to the list.
65 64
      *
66 65
      * @param source The media source to be tested
67 66
      */

+ 2
- 2
src/com/dmdirc/addons/nowplaying/MediaSourceManager.java Bestand weergeven

@@ -25,8 +25,8 @@ package com.dmdirc.addons.nowplaying;
25 25
 import java.util.List;
26 26
 
27 27
 /**
28
- * The media source manager is a standard interface for an object that controls
29
- * one or more media sources.
28
+ * The media source manager is a standard interface for an object that controls one or more media
29
+ * sources.
30 30
  *
31 31
  * @author chris
32 32
  */

+ 15
- 14
src/com/dmdirc/addons/nowplaying/MediaSourceState.java Bestand weergeven

@@ -29,35 +29,36 @@ package com.dmdirc.addons.nowplaying;
29 29
  * @since 0.6.3m1
30 30
  */
31 31
 public enum MediaSourceState {
32
+
32 33
     /** Media Source is closed. */
33
-    CLOSED ("Closed"),
34
+    CLOSED("Closed"),
34 35
     /** Media Source is stopped. */
35
-    STOPPED ("Stopped"),
36
+    STOPPED("Stopped"),
36 37
     /** Media Source is paused. */
37
-    PAUSED ("Paused"),
38
+    PAUSED("Paused"),
38 39
     /** Media Source is playing. */
39
-    PLAYING ("Playing"),
40
+    PLAYING("Playing"),
40 41
     /** Media Source is giving an unknown state. */
41
-    NOTKNOWN ("Unknown");
42
-
42
+    NOTKNOWN("Unknown");
43 43
     /** Nice name for this state. */
44 44
     final String niceName;
45 45
 
46 46
     /**
47
-    * Create a new MediaSourceState
48
-    *
49
-    * @param niceName Nice name for this state.
50
-    */
47
+     * Create a new MediaSourceState
48
+     *
49
+     * @param niceName Nice name for this state.
50
+     */
51 51
     MediaSourceState(final String niceName) {
52 52
         this.niceName = niceName;
53 53
     }
54 54
 
55 55
     /**
56
-    * Get the nice name for this state.
57
-    *
58
-    * @return This state's nice name
59
-    */
56
+     * Get the nice name for this state.
57
+     *
58
+     * @return This state's nice name
59
+     */
60 60
     public String getNiceName() {
61 61
         return niceName;
62 62
     }
63
+
63 64
 }

+ 13
- 11
src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java Bestand weergeven

@@ -40,15 +40,14 @@ import java.util.Arrays;
40 40
 import java.util.List;
41 41
 
42 42
 /**
43
- * The now playing command retrieves the currently playing song from a
44
- * variety of media players.
43
+ * The now playing command retrieves the currently playing song from a variety of media players.
45 44
  */
46 45
 public class NowPlayingCommand extends Command implements IntelligentCommand {
47 46
 
48 47
     /** A command info object for this command. */
49 48
     public static final BaseCommandInfo INFO = new BaseCommandInfo("nowplaying",
50
-            "nowplaying [--sources|--source <source>] [format] - " +
51
-                "tells the channel the song you're currently playing",
49
+            "nowplaying [--sources|--source <source>] [format] - "
50
+            + "tells the channel the song you're currently playing",
52 51
             CommandType.TYPE_CHAT);
53 52
     /** The plugin that's using this command. */
54 53
     private final NowPlayingPlugin parent;
@@ -58,8 +57,8 @@ public class NowPlayingCommand extends Command implements IntelligentCommand {
58 57
     /**
59 58
      * Creates a new instance of this command.
60 59
      *
61
-     * @param controller The controller to use for command information.
62
-     * @param parent The plugin that owns this command.
60
+     * @param controller         The controller to use for command information.
61
+     * @param parent             The plugin that owns this command.
63 62
      * @param identityController The controller to use to read/write settings.
64 63
      */
65 64
     public NowPlayingCommand(
@@ -105,7 +104,8 @@ public class NowPlayingCommand extends Command implements IntelligentCommand {
105 104
                         getInformation(parent.getBestSource(), args.
106 105
                         getArgumentsAsString(0)));
107 106
             } else {
108
-                sendLine(origin, args.isSilent(), FORMAT_ERROR, "No running media sources available.");
107
+                sendLine(origin, args.isSilent(), FORMAT_ERROR,
108
+                        "No running media sources available.");
109 109
             }
110 110
         }
111 111
     }
@@ -113,9 +113,9 @@ public class NowPlayingCommand extends Command implements IntelligentCommand {
113 113
     /**
114 114
      * Outputs a list of sources for the nowplaying command.
115 115
      *
116
-     * @param origin The input window where the command was entered
116
+     * @param origin   The input window where the command was entered
117 117
      * @param isSilent Whether this command is being silenced
118
-     * @param format Format to be passed to getInformation
118
+     * @param format   Format to be passed to getInformation
119 119
      */
120 120
     private void doSourceList(final FrameContainer origin, final boolean isSilent,
121 121
             final String format) {
@@ -153,6 +153,7 @@ public class NowPlayingCommand extends Command implements IntelligentCommand {
153 153
      * @param format Format to use
154 154
      *
155 155
      * @return Formatted information string
156
+     *
156 157
      * @since 0.6.3
157 158
      */
158 159
     private String getInformation(final MediaSource source, final String format) {
@@ -169,7 +170,7 @@ public class NowPlayingCommand extends Command implements IntelligentCommand {
169 170
     public AdditionalTabTargets getSuggestions(final int arg,
170 171
             final IntelligentCommandContext context) {
171 172
 
172
-        final List<String> subsList = Arrays.asList(new String[] {
173
+        final List<String> subsList = Arrays.asList(new String[]{
173 174
             "$artist", "$title", "$album", "$app", "$bitrate", "$format",
174 175
             "$length", "$state", "$time"
175 176
         });
@@ -196,11 +197,12 @@ public class NowPlayingCommand extends Command implements IntelligentCommand {
196 197
             res.addAll(subsList);
197 198
             return res;
198 199
         } else {
199
-            final AdditionalTabTargets res =  TabCompleter
200
+            final AdditionalTabTargets res = TabCompleter
200 201
                     .getIntelligentResults(arg, context, context
201 202
                     .getPreviousArgs().get(0).equalsIgnoreCase("--sources") ? 1 : 0);
202 203
             res.addAll(subsList);
203 204
             return res;
204 205
         }
205 206
     }
207
+
206 208
 }

+ 37
- 34
src/com/dmdirc/addons/nowplaying/NowPlayingPlugin.java Bestand weergeven

@@ -42,10 +42,9 @@ import java.util.List;
42 42
 import java.util.concurrent.Callable;
43 43
 
44 44
 /**
45
- * Plugin that allows users to advertise what they're currently playing or
46
- * listening to.
45
+ * Plugin that allows users to advertise what they're currently playing or listening to.
47 46
  */
48
-public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListener  {
47
+public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListener {
49 48
 
50 49
     /** The sources that we know of. */
51 50
     private final List<MediaSource> sources = new ArrayList<>();
@@ -63,9 +62,9 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
63 62
     /**
64 63
      * Creates a new instance of this plugin.
65 64
      *
66
-     * @param pluginInfo This plugin's plugin info
67
-     * @param actionController The action controller to register listeners with
68
-     * @param commandController Command controller to register commands
65
+     * @param pluginInfo         This plugin's plugin info
66
+     * @param actionController   The action controller to register listeners with
67
+     * @param commandController  Command controller to register commands
69 68
      * @param identityController The identity controller to use.
70 69
      */
71 70
     public NowPlayingPlugin(final PluginInfo pluginInfo,
@@ -78,7 +77,8 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
78 77
         this.actionController = actionController;
79 78
         this.identityController = identityController;
80 79
 
81
-        registerCommand(new NowPlayingCommand(commandController, this, identityController), NowPlayingCommand.INFO);
80
+        registerCommand(new NowPlayingCommand(commandController, this, identityController),
81
+                NowPlayingCommand.INFO);
82 82
     }
83 83
 
84 84
     /** {@inheritDoc} */
@@ -115,7 +115,6 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
115 115
     public void showConfig(final PreferencesDialogModel manager) {
116 116
         final ConfigPanel configPanel = UIUtilities.invokeAndWait(
117 117
                 new Callable<ConfigPanel>() {
118
-
119 118
             @Override
120 119
             public ConfigPanel call() {
121 120
                 return new ConfigPanel(identityController, NowPlayingPlugin.this, order);
@@ -141,7 +140,8 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
141 140
     /** Loads the plugins settings. */
142 141
     private void loadSettings() {
143 142
         if (identityController.getGlobalConfiguration().hasOptionString(getDomain(), "sourceOrder")) {
144
-            order = identityController.getGlobalConfiguration().getOptionList(getDomain(), "sourceOrder");
143
+            order = identityController.getGlobalConfiguration().getOptionList(getDomain(),
144
+                    "sourceOrder");
145 145
         } else {
146 146
             order = new ArrayList<>();
147 147
         }
@@ -159,8 +159,8 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
159 159
     }
160 160
 
161 161
     /**
162
-     * Checks to see if a plugin implements one of the Media Source interfaces
163
-     * and if it does, adds the source(s) to our list.
162
+     * Checks to see if a plugin implements one of the Media Source interfaces and if it does, adds
163
+     * the source(s) to our list.
164 164
      *
165 165
      * @param target The plugin to be tested
166 166
      */
@@ -183,8 +183,8 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
183 183
     }
184 184
 
185 185
     /**
186
-     * Checks to see if the specified media source needs to be added to our
187
-     * order list, and adds it if neccessary.
186
+     * Checks to see if the specified media source needs to be added to our order list, and adds it
187
+     * if neccessary.
188 188
      *
189 189
      * @param source The media source to be tested
190 190
      */
@@ -195,8 +195,8 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
195 195
     }
196 196
 
197 197
     /**
198
-     * Checks to see if a plugin implements one of the Media Source interfaces
199
-     * and if it does, removes the source(s) from our list.
198
+     * Checks to see if a plugin implements one of the Media Source interfaces and if it does,
199
+     * removes the source(s) from our list.
200 200
      *
201 201
      * @param target The plugin to be tested
202 202
      */
@@ -227,11 +227,10 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
227 227
     }
228 228
 
229 229
     /**
230
-     * Retrieves the "best" source to use for displaying media information.
231
-     * The best source is defined as the earliest in the list that is running
232
-     * and not paused, or, if no such source exists, the earliest in the list
233
-     * that is running and paused. If neither condition is satisified returns
234
-     * null.
230
+     * Retrieves the "best" source to use for displaying media information. The best source is
231
+     * defined as the earliest in the list that is running and not paused, or, if no such source
232
+     * exists, the earliest in the list that is running and paused. If neither condition is
233
+     * satisified returns null.
235 234
      *
236 235
      * @return The best source to use for media info
237 236
      */
@@ -255,11 +254,12 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
255 254
     }
256 255
 
257 256
     /**
258
-     * Substitutes the keywords in the specified format with the values with
259
-     * values from the specified source.
257
+     * Substitutes the keywords in the specified format with the values with values from the
258
+     * specified source.
260 259
      *
261 260
      * @param format The format to be substituted
262 261
      * @param source The source whose values should be used
262
+     *
263 263
      * @return The substituted string
264 264
      */
265 265
     public String doSubstitution(final String format, final MediaSource source) {
@@ -274,24 +274,25 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
274 274
         final String state = source.getState().getNiceName();
275 275
 
276 276
         return format.replace("$artist", sanitise(artist))
277
-                     .replace("$title", sanitise(title))
278
-                     .replace("$album", sanitise(album))
279
-                     .replace("$app", sanitise(app))
280
-                     .replace("$bitrate", sanitise(bitrate))
281
-                     .replace("$format", sanitise(filetype))
282
-                     .replace("$length", sanitise(length))
283
-                     .replace("$state", sanitise(state))
284
-                     .replace("$time", sanitise(time));
277
+                .replace("$title", sanitise(title))
278
+                .replace("$album", sanitise(album))
279
+                .replace("$app", sanitise(app))
280
+                .replace("$bitrate", sanitise(bitrate))
281
+                .replace("$format", sanitise(filetype))
282
+                .replace("$length", sanitise(length))
283
+                .replace("$state", sanitise(state))
284
+                .replace("$time", sanitise(time));
285 285
     }
286 286
 
287 287
     /**
288
-     * Sanitises the specified String so that it may be used as the replacement
289
-     * in a call to String.replaceAll. Namely, at present, this method returns
290
-     * an empty String if it is passed a null value; otherwise the input is
291
-     * returned as-is.
288
+     * Sanitises the specified String so that it may be used as the replacement in a call to
289
+     * String.replaceAll. Namely, at present, this method returns an empty String if it is passed a
290
+     * null value; otherwise the input is returned as-is.
292 291
      *
293 292
      * @param input The string to be sanitised
293
+     *
294 294
      * @return A sanitised version of the String
295
+     *
295 296
      * @since 0.6.3
296 297
      */
297 298
     protected static String sanitise(final String input) {
@@ -302,6 +303,7 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
302 303
      * Retrieves a source based on its name.
303 304
      *
304 305
      * @param name The name to search for
306
+     *
305 307
      * @return The source with the specified name or null if none were found.
306 308
      */
307 309
     public MediaSource getSource(final String name) {
@@ -328,4 +330,5 @@ public class NowPlayingPlugin extends BaseCommandPlugin implements ActionListene
328 330
 
329 331
         return res;
330 332
     }
333
+
331 334
 }

+ 8
- 6
src/com/dmdirc/addons/nowplaying/NowPlayingSubsitutionPanel.java Bestand weergeven

@@ -37,9 +37,9 @@ import javax.swing.SwingUtilities;
37 37
 public class NowPlayingSubsitutionPanel extends SubstitutionsPanel<List<String>> {
38 38
 
39 39
     /**
40
-     * A version number for this class. It should be changed whenever the class
41
-     * structure is changed (or anything else that would prevent serialized
42
-     * objects being unserialized with the new class).
40
+     * A version number for this class. It should be changed whenever the class structure is changed
41
+     * (or anything else that would prevent serialized objects being unserialized with the new
42
+     * class).
43 43
      */
44 44
     private static final long serialVersionUID = 1;
45 45
 
@@ -47,7 +47,8 @@ public class NowPlayingSubsitutionPanel extends SubstitutionsPanel<List<String>>
47 47
      * Instantiates a new now playing subsitutiuons panel.
48 48
      */
49 49
     public NowPlayingSubsitutionPanel() {
50
-        super("Substitutions may be used as part of the output format", SubstitutionsPanel.Alignment.HORIZONTAL, null);
50
+        super("Substitutions may be used as part of the output format",
51
+                SubstitutionsPanel.Alignment.HORIZONTAL, null);
51 52
     }
52 53
 
53 54
     /**
@@ -56,14 +57,14 @@ public class NowPlayingSubsitutionPanel extends SubstitutionsPanel<List<String>>
56 57
      * @param subs list of substitutions.
57 58
      */
58 59
     public NowPlayingSubsitutionPanel(final List<String> subs) {
59
-        super("Substitutions may be used as part of the output format", SubstitutionsPanel.Alignment.HORIZONTAL, subs);
60
+        super("Substitutions may be used as part of the output format",
61
+                SubstitutionsPanel.Alignment.HORIZONTAL, subs);
60 62
     }
61 63
 
62 64
     /** {@inheritDoc} */
63 65
     @Override
64 66
     public void setType(final List<String> type) {
65 67
         SwingUtilities.invokeLater(new Runnable() {
66
-
67 68
             /** {@inheritDoc} */
68 69
             @Override
69 70
             public void run() {
@@ -80,4 +81,5 @@ public class NowPlayingSubsitutionPanel extends SubstitutionsPanel<List<String>>
80 81
             }
81 82
         });
82 83
     }
84
+
83 85
 }

+ 0
- 0
src/com/dmdirc/addons/osd/OsdCommand.java Bestand weergeven


Some files were not shown because too many files changed in this diff

Laden…
Annuleren
Opslaan