Browse Source

Fix line endings / trailing spaces

Change-Id: Id0a4aa086f7fb9bac776ec4c877aa8628175c0bc
Reviewed-on: http://gerrit.dmdirc.com/1921
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.7rc1
Chris Smith 13 years ago
parent
commit
f5fff70ef4
100 changed files with 662 additions and 662 deletions
  1. 2
    2
      src/com/dmdirc/addons/calc/CalcCommand.java
  2. 1
    1
      src/com/dmdirc/addons/calc/CalcPlugin.java
  3. 1
    1
      src/com/dmdirc/addons/calc/TokenType.java
  4. 1
    1
      src/com/dmdirc/addons/calc/TreeToken.java
  5. 10
    10
      src/com/dmdirc/addons/dcc/DCCPlugin.java
  6. 1
    1
      src/com/dmdirc/addons/dcc/io/DCCTransfer.java
  7. 1
    1
      src/com/dmdirc/addons/dcc/ui/PlaceholderWindow.java
  8. 2
    2
      src/com/dmdirc/addons/dcc/ui/TransferWindow.java
  9. 7
    7
      src/com/dmdirc/addons/dcop/DcopCommand.java
  10. 11
    11
      src/com/dmdirc/addons/dcop/DcopPlugin.java
  11. 7
    7
      src/com/dmdirc/addons/dns/DNSCommand.java
  12. 11
    11
      src/com/dmdirc/addons/dns/DNSPlugin.java
  13. 5
    5
      src/com/dmdirc/addons/freedesktop_notifications/FDNotifyCommand.java
  14. 13
    13
      src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java
  15. 174
    174
      src/com/dmdirc/addons/identd/IdentdPlugin.java
  16. 1
    1
      src/com/dmdirc/addons/lagdisplay/LagDisplayPanel.java
  17. 13
    13
      src/com/dmdirc/addons/lagdisplay/LagDisplayPlugin.java
  18. 3
    3
      src/com/dmdirc/addons/lagdisplay/PingHistoryPanel.java
  19. 1
    1
      src/com/dmdirc/addons/logging/package-info.java
  20. 1
    1
      src/com/dmdirc/addons/mediasource_dbus/BansheeSource.java
  21. 11
    11
      src/com/dmdirc/addons/mediasource_dcop/AmarokSource.java
  22. 6
    6
      src/com/dmdirc/addons/mediasource_dcop/DcopMediaSourcePlugin.java
  23. 9
    9
      src/com/dmdirc/addons/mediasource_dcop/KaffeineSource.java
  24. 10
    10
      src/com/dmdirc/addons/mediasource_dcop/NoatunSource.java
  25. 7
    7
      src/com/dmdirc/addons/mediasource_linux_title/TitleMediaSource.java
  26. 9
    9
      src/com/dmdirc/addons/mediasource_mplayer/MplayerMediaSourcePlugin.java
  27. 1
    1
      src/com/dmdirc/addons/notifications/NotificationsPlugin.java
  28. 10
    10
      src/com/dmdirc/addons/nowplaying/MediaSource.java
  29. 6
    6
      src/com/dmdirc/addons/nowplaying/MediaSourceComparator.java
  30. 4
    4
      src/com/dmdirc/addons/nowplaying/MediaSourceManager.java
  31. 4
    4
      src/com/dmdirc/addons/nowplaying/NowPlayingSubsitutionPanel.java
  32. 1
    1
      src/com/dmdirc/addons/osd/OsdManager.java
  33. 14
    14
      src/com/dmdirc/addons/osd/OsdPlugin.java
  34. 1
    1
      src/com/dmdirc/addons/parser_twitter/Twitter.java
  35. 1
    1
      src/com/dmdirc/addons/parser_twitter/api/TwitterStatus.java
  36. 4
    4
      src/com/dmdirc/addons/parser_twitter/api/TwitterUser.java
  37. 2
    2
      src/com/dmdirc/addons/parser_twitter/api/XMLResponse.java
  38. 5
    5
      src/com/dmdirc/addons/parser_xmpp/XmppFakeChannel.java
  39. 2
    2
      src/com/dmdirc/addons/parser_xmpp/XmppPlugin.java
  40. 4
    4
      src/com/dmdirc/addons/parserdebug/DebugPlugin.java
  41. 5
    5
      src/com/dmdirc/addons/parserdebug/ParserDebugCommand.java
  42. 2
    2
      src/com/dmdirc/addons/redirect/FakeWriteableFrameContainer.java
  43. 8
    8
      src/com/dmdirc/addons/redirect/RedirectPlugin.java
  44. 15
    15
      src/com/dmdirc/addons/scriptplugin/ScriptCommand.java
  45. 13
    13
      src/com/dmdirc/addons/scriptplugin/ScriptEngineWrapper.java
  46. 3
    3
      src/com/dmdirc/addons/serverlists/ServerGroup.java
  47. 3
    3
      src/com/dmdirc/addons/systray/PopupCommand.java
  48. 12
    12
      src/com/dmdirc/addons/tabcompletion_bash/BashStyle.java
  49. 3
    3
      src/com/dmdirc/addons/tabcompletion_bash/BashStylePlugin.java
  50. 7
    7
      src/com/dmdirc/addons/tabcompletion_mirc/MircStyle.java
  51. 2
    2
      src/com/dmdirc/addons/tabcompletion_mirc/MircStylePlugin.java
  52. 5
    5
      src/com/dmdirc/addons/time/TimeActionMetaType.java
  53. 6
    6
      src/com/dmdirc/addons/time/TimeActionType.java
  54. 2
    2
      src/com/dmdirc/addons/ui_dummy/DummyChannelWindow.java
  55. 4
    4
      src/com/dmdirc/addons/ui_dummy/DummyInputHandler.java
  56. 2
    2
      src/com/dmdirc/addons/ui_dummy/DummyStatusBar.java
  57. 4
    4
      src/com/dmdirc/addons/ui_swing/BackgroundOption.java
  58. 1
    1
      src/com/dmdirc/addons/ui_swing/MainFrame.java
  59. 1
    1
      src/com/dmdirc/addons/ui_swing/SwingWindowFactory.java
  60. 3
    3
      src/com/dmdirc/addons/ui_swing/SwingWindowListener.java
  61. 1
    1
      src/com/dmdirc/addons/ui_swing/components/PackingTable.java
  62. 1
    1
      src/com/dmdirc/addons/ui_swing/components/SortedListModel.java
  63. 1
    1
      src/com/dmdirc/addons/ui_swing/components/URLProtocolPanel.java
  64. 6
    6
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonFilter.java
  65. 2
    2
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfo.java
  66. 1
    1
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfoCellEditor.java
  67. 4
    4
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfoCellRenderer.java
  68. 5
    5
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonSorter.java
  69. 4
    4
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonTable.java
  70. 1
    1
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonType.java
  71. 2
    2
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/DataLoaderWorker.java
  72. 5
    5
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/DownloaderWindow.java
  73. 3
    3
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/InstallerWindow.java
  74. 12
    12
      src/com/dmdirc/addons/ui_swing/components/colours/ColourChooser.java
  75. 13
    13
      src/com/dmdirc/addons/ui_swing/components/colours/ColourPickerDialog.java
  76. 24
    24
      src/com/dmdirc/addons/ui_swing/components/colours/ColourPickerPanel.java
  77. 13
    13
      src/com/dmdirc/addons/ui_swing/components/colours/OptionalColourChooser.java
  78. 1
    1
      src/com/dmdirc/addons/ui_swing/components/durationeditor/DurationDisplay.java
  79. 4
    4
      src/com/dmdirc/addons/ui_swing/components/durationeditor/DurationListener.java
  80. 1
    1
      src/com/dmdirc/addons/ui_swing/components/expandingsettings/CurrentOptionsPanel.java
  81. 1
    1
      src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java
  82. 1
    1
      src/com/dmdirc/addons/ui_swing/components/frames/InputTextFrame.java
  83. 2
    2
      src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java
  84. 8
    8
      src/com/dmdirc/addons/ui_swing/components/inputfields/TextAreaInputField.java
  85. 7
    7
      src/com/dmdirc/addons/ui_swing/components/renderers/ActionComparisonCellRenderer.java
  86. 8
    8
      src/com/dmdirc/addons/ui_swing/components/renderers/ActionConditionCellRenderer.java
  87. 6
    6
      src/com/dmdirc/addons/ui_swing/components/renderers/ActionTypeRenderer.java
  88. 5
    5
      src/com/dmdirc/addons/ui_swing/components/renderers/ActionTypeTableCellRenderer.java
  89. 5
    5
      src/com/dmdirc/addons/ui_swing/components/renderers/AddOptionCellRenderer.java
  90. 4
    4
      src/com/dmdirc/addons/ui_swing/components/renderers/ArrayCellRenderer.java
  91. 3
    3
      src/com/dmdirc/addons/ui_swing/components/renderers/CertificateChainEntryCellRenderer.java
  92. 8
    8
      src/com/dmdirc/addons/ui_swing/components/renderers/DateCellRenderer.java
  93. 3
    3
      src/com/dmdirc/addons/ui_swing/components/renderers/ErrorLevelIconCellRenderer.java
  94. 7
    7
      src/com/dmdirc/addons/ui_swing/components/renderers/ExtendedListModeCellRenderer.java
  95. 1
    1
      src/com/dmdirc/addons/ui_swing/components/renderers/FontListCellRenderer.java
  96. 2
    2
      src/com/dmdirc/addons/ui_swing/components/renderers/ListModeCellRenderer.java
  97. 3
    3
      src/com/dmdirc/addons/ui_swing/components/renderers/TopicCellRenderer.java
  98. 1
    1
      src/com/dmdirc/addons/ui_swing/components/renderers/URIHandlerCellRenderer.java
  99. 5
    5
      src/com/dmdirc/addons/ui_swing/components/renderers/UpdateComponentTableCellRenderer.java
  100. 0
    0
      src/com/dmdirc/addons/ui_swing/components/renderers/UpdateStatusTableCellRenderer.java

+ 2
- 2
src/com/dmdirc/addons/calc/CalcCommand.java View File

59
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
59
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT,
60
                     (showexpr ? input + " = " : "") + result);
60
                     (showexpr ? input + " = " : "") + result);
61
         } catch (ParseException ex) {
61
         } catch (ParseException ex) {
62
-            sendLine(origin, args.isSilent(), FORMAT_ERROR, 
62
+            sendLine(origin, args.isSilent(), FORMAT_ERROR,
63
                     "Unable to parse expression: " + ex.getMessage());
63
                     "Unable to parse expression: " + ex.getMessage());
64
         } catch (ArithmeticException ex) {
64
         } catch (ArithmeticException ex) {
65
-            sendLine(origin, args.isSilent(), FORMAT_ERROR, 
65
+            sendLine(origin, args.isSilent(), FORMAT_ERROR,
66
                     "Unable to calculate expression: " + ex.getMessage());
66
                     "Unable to calculate expression: " + ex.getMessage());
67
         }
67
         }
68
     }
68
     }

+ 1
- 1
src/com/dmdirc/addons/calc/CalcPlugin.java View File

27
 
27
 
28
 /**
28
 /**
29
  * A plugin which parses and evaluates various mathematical expressions.
29
  * A plugin which parses and evaluates various mathematical expressions.
30
- * 
30
+ *
31
  * @author chris
31
  * @author chris
32
  */
32
  */
33
 public class CalcPlugin extends Plugin {
33
 public class CalcPlugin extends Plugin {

+ 1
- 1
src/com/dmdirc/addons/calc/TokenType.java View File

30
 /**
30
 /**
31
  * Describes the different types of possible token, their arities, precedence,
31
  * Describes the different types of possible token, their arities, precedence,
32
  * and the types of token that may follow them.
32
  * and the types of token that may follow them.
33
- * 
33
+ *
34
  * @author chris
34
  * @author chris
35
  */
35
  */
36
 public enum TokenType {
36
 public enum TokenType {

+ 1
- 1
src/com/dmdirc/addons/calc/TreeToken.java View File

27
 
27
 
28
 /**
28
 /**
29
  * Describes a tree of {@link Token}s.
29
  * Describes a tree of {@link Token}s.
30
- * 
30
+ *
31
  * @author chris
31
  * @author chris
32
  */
32
  */
33
 public class TreeToken {
33
 public class TreeToken {

+ 10
- 10
src/com/dmdirc/addons/dcc/DCCPlugin.java View File

107
      * @param reverse Is this a reverse dcc?
107
      * @param reverse Is this a reverse dcc?
108
      * @param token Token used in reverse dcc.
108
      * @param token Token used in reverse dcc.
109
      */
109
      */
110
-    public void saveFile(final String nickname, final DCCTransfer send, 
110
+    public void saveFile(final String nickname, final DCCTransfer send,
111
             final Parser parser, final boolean reverse, final String token) {
111
             final Parser parser, final boolean reverse, final String token) {
112
         // New thread to ask the user where to save in to stop us locking the UI
112
         // New thread to ask the user where to save in to stop us locking the UI
113
         new Thread(new Runnable() {
113
         new Thread(new Runnable() {
145
                                         + jc.getSelectedFile().length() + " "
145
                                         + jc.getSelectedFile().length() + " "
146
                                         + token);
146
                                         + token);
147
                             } else {
147
                             } else {
148
-                                parser.sendCTCP(nickname, "DCC", "RESUME " 
148
+                                parser.sendCTCP(nickname, "DCC", "RESUME "
149
                                         + send.getShortFileName() + " 0 "
149
                                         + send.getShortFileName() + " 0 "
150
                                         + jc.getSelectedFile().length());
150
                                         + jc.getSelectedFile().length());
151
                             }
151
                             }
152
                         } else {
152
                         } else {
153
                             if (listen(send)) {
153
                             if (listen(send)) {
154
-                                parser.sendCTCP(nickname, "DCC", "SEND " 
154
+                                parser.sendCTCP(nickname, "DCC", "SEND "
155
                                         + send.getShortFileName() + " "
155
                                         + send.getShortFileName() + " "
156
                                         + DCC.ipToLong(getListenIP(parser))
156
                                         + DCC.ipToLong(getListenIP(parser))
157
                                         + " " + send.getPort() + " "
157
                                         + " " + send.getPort() + " "
163
                                 + nickname, nickname, null);
163
                                 + nickname, nickname, null);
164
                         if (resume) {
164
                         if (resume) {
165
                             parser.sendCTCP(nickname, "DCC", "RESUME "
165
                             parser.sendCTCP(nickname, "DCC", "RESUME "
166
-                                    + send.getShortFileName() + " " 
166
+                                    + send.getShortFileName() + " "
167
                                     + send.getPort() + " "
167
                                     + send.getPort() + " "
168
                                     + jc.getSelectedFile().length());
168
                                     + jc.getSelectedFile().length());
169
                         } else {
169
                         } else {
190
     private boolean handleExists(final DCCTransfer send, final JFileChooser jc,
190
     private boolean handleExists(final DCCTransfer send, final JFileChooser jc,
191
             final String nickname, final Parser parser, final boolean reverse,
191
             final String nickname, final Parser parser, final boolean reverse,
192
             final String token) {
192
             final String token) {
193
-        if (jc.getSelectedFile().exists() && send.getFileSize() > -1 
193
+        if (jc.getSelectedFile().exists() && send.getFileSize() > -1
194
                 && send.getFileSize() <= jc.getSelectedFile().length()) {
194
                 && send.getFileSize() <= jc.getSelectedFile().length()) {
195
             if (IdentityManager.getGlobalConfig().getOptionBool(getDomain(),
195
             if (IdentityManager.getGlobalConfig().getOptionBool(getDomain(),
196
                     "receive.autoaccept")) {
196
                     "receive.autoaccept")) {
301
      * @param dontAsk Don't ask any questions, assume yes.
301
      * @param dontAsk Don't ask any questions, assume yes.
302
      * @param arguments The arguments for the event
302
      * @param arguments The arguments for the event
303
      */
303
      */
304
-    public void handleProcessEvent(final ActionType type, 
304
+    public void handleProcessEvent(final ActionType type,
305
             final StringBuffer format, final boolean dontAsk,
305
             final StringBuffer format, final boolean dontAsk,
306
             final Object... arguments) {
306
             final Object... arguments) {
307
         if (IdentityManager.getGlobalConfig().getOptionBool(getDomain(),
307
         if (IdentityManager.getGlobalConfig().getOptionBool(getDomain(),
542
                 final Parser parser = ((Server) arguments[0]).getParser();
542
                 final Parser parser = ((Server) arguments[0]).getParser();
543
                 final String nick = ((ClientInfo) arguments[1]).getNickname();
543
                 final String nick = ((ClientInfo) arguments[1]).getNickname();
544
                 if (ctcpData[0].equalsIgnoreCase("resume")) {
544
                 if (ctcpData[0].equalsIgnoreCase("resume")) {
545
-                    parser.sendCTCP(nick, "DCC", "ACCEPT "+ ((quoted) ? "\"" 
545
+                    parser.sendCTCP(nick, "DCC", "ACCEPT "+ ((quoted) ? "\""
546
                             + filename + "\"" : filename) + " " + port + " "
546
                             + filename + "\"" : filename) + " " + port + " "
547
                             + send.setFileStart(position) + token);
547
                             + send.setFileStart(position) + token);
548
                 } else {
548
                 } else {
551
                         // Reverse dcc
551
                         // Reverse dcc
552
                         if (listen(send)) {
552
                         if (listen(send)) {
553
                             if (send.getToken().isEmpty()) {
553
                             if (send.getToken().isEmpty()) {
554
-                                parser.sendCTCP(nick, "DCC", "SEND " 
554
+                                parser.sendCTCP(nick, "DCC", "SEND "
555
                                         + ((quoted) ? "\"" + filename
555
                                         + ((quoted) ? "\"" + filename
556
-                                        + "\"" : filename) + " " 
556
+                                        + "\"" : filename) + " "
557
                                         + DCC.ipToLong(send.getHost())
557
                                         + DCC.ipToLong(send.getHost())
558
                                         + " " + send.getPort()
558
                                         + " " + send.getPort()
559
                                         + " " + send.getFileSize());
559
                                         + " " + send.getFileSize());
560
                             } else {
560
                             } else {
561
                                 parser.sendCTCP(nick, "DCC", "SEND "
561
                                 parser.sendCTCP(nick, "DCC", "SEND "
562
                                         + ((quoted) ? "\"" + filename
562
                                         + ((quoted) ? "\"" + filename
563
-                                        + "\"" : filename) 
563
+                                        + "\"" : filename)
564
                                         + " " + DCC.ipToLong(send.getHost())
564
                                         + " " + DCC.ipToLong(send.getHost())
565
                                         + " " + send.getPort()
565
                                         + " " + send.getPort()
566
                                         + " " + send.getFileSize() + " "
566
                                         + " " + send.getFileSize() + " "

+ 1
- 1
src/com/dmdirc/addons/dcc/io/DCCTransfer.java View File

372
         }
372
         }
373
         out = null;
373
         out = null;
374
         in = null;
374
         in = null;
375
-        
375
+
376
         for (DCCTransferHandler handler : handlers.get(DCCTransferHandler.class)) {
376
         for (DCCTransferHandler handler : handlers.get(DCCTransferHandler.class)) {
377
             handler.socketClosed(this);
377
             handler.socketClosed(this);
378
         }
378
         }

+ 1
- 1
src/com/dmdirc/addons/dcc/ui/PlaceholderWindow.java View File

29
 /**
29
 /**
30
  * A virtually empty window which serves as a top-level placeholder for other
30
  * A virtually empty window which serves as a top-level placeholder for other
31
  * DCC windows.
31
  * DCC windows.
32
- * 
32
+ *
33
  * @author chris
33
  * @author chris
34
  * @since 0.6.4
34
  * @since 0.6.4
35
  */
35
  */

+ 2
- 2
src/com/dmdirc/addons/dcc/ui/TransferWindow.java View File

90
      */
90
      */
91
     public TransferWindow(final SwingController controller, final FrameContainer owner) {
91
     public TransferWindow(final SwingController controller, final FrameContainer owner) {
92
         super(controller, owner);
92
         super(controller, owner);
93
-        
93
+
94
         final TransferContainer container = (TransferContainer) owner;
94
         final TransferContainer container = (TransferContainer) owner;
95
         dcc = container.getDCC();
95
         dcc = container.getDCC();
96
 
96
 
190
                     if (container.shouldShowOpenButton()) {
190
                     if (container.shouldShowOpenButton()) {
191
                         openButton.setVisible(true);
191
                         openButton.setVisible(true);
192
                     }
192
                     }
193
-                    
193
+
194
                     progress.setValue(100);
194
                     progress.setValue(100);
195
                     button.setText("Close Window");
195
                     button.setText("Close Window");
196
                 } else {
196
                 } else {

+ 7
- 7
src/com/dmdirc/addons/dcop/DcopCommand.java View File

36
  * @author chris
36
  * @author chris
37
  */
37
  */
38
 public final class DcopCommand extends Command implements CommandInfo {
38
 public final class DcopCommand extends Command implements CommandInfo {
39
-    
39
+
40
     /**
40
     /**
41
      * Creates a new instance of DcopCommand.
41
      * Creates a new instance of DcopCommand.
42
      */
42
      */
52
             showUsage(origin, args.isSilent(), "dcop", "<app> <object> <function>");
52
             showUsage(origin, args.isSilent(), "dcop", "<app> <object> <function>");
53
             return;
53
             return;
54
         }
54
         }
55
-        
55
+
56
         final List<String> res = DcopPlugin.getDcopResult("dcop " + args.getArgumentsAsString());
56
         final List<String> res = DcopPlugin.getDcopResult("dcop " + args.getArgumentsAsString());
57
         for (String line : res) {
57
         for (String line : res) {
58
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT, line);
58
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT, line);
59
         }
59
         }
60
     }
60
     }
61
-    
62
-    
61
+
62
+
63
     /** {@inheritDoc} */
63
     /** {@inheritDoc} */
64
     @Override
64
     @Override
65
     public String getName() {
65
     public String getName() {
66
         return "dcop";
66
         return "dcop";
67
     }
67
     }
68
-    
68
+
69
     /** {@inheritDoc} */
69
     /** {@inheritDoc} */
70
     @Override
70
     @Override
71
     public boolean showInHelp() {
71
     public boolean showInHelp() {
77
     public CommandType getType() {
77
     public CommandType getType() {
78
         return CommandType.TYPE_SERVER;
78
         return CommandType.TYPE_SERVER;
79
     }
79
     }
80
-    
80
+
81
     /** {@inheritDoc} */
81
     /** {@inheritDoc} */
82
     @Override
82
     @Override
83
     public String getHelp() {
83
     public String getHelp() {
84
         return "dcop <app> <object> <function> - retrieves information from a DCOP aplication";
84
         return "dcop <app> <object> <function> - retrieves information from a DCOP aplication";
85
     }
85
     }
86
-    
86
+
87
 }
87
 }

+ 11
- 11
src/com/dmdirc/addons/dcop/DcopPlugin.java View File

33
 
33
 
34
 /**
34
 /**
35
  * Allows the user to execute dcop commands (and read the results).
35
  * Allows the user to execute dcop commands (and read the results).
36
- * 
36
+ *
37
  * @author chris
37
  * @author chris
38
  */
38
  */
39
 public final class DcopPlugin extends Plugin {
39
 public final class DcopPlugin extends Plugin {
40
     /** The DcopCommand we created */
40
     /** The DcopCommand we created */
41
     private DcopCommand command = null;
41
     private DcopCommand command = null;
42
-    
42
+
43
     /** Creates a new instance of DcopPlugin. */
43
     /** Creates a new instance of DcopPlugin. */
44
     public DcopPlugin() {
44
     public DcopPlugin() {
45
         super();
45
         super();
46
     }
46
     }
47
-    
47
+
48
     /**
48
     /**
49
      * Retrieves the result from executing the specified command.
49
      * Retrieves the result from executing the specified command.
50
      *
50
      *
57
         InputStreamReader reader;
57
         InputStreamReader reader;
58
         BufferedReader input;
58
         BufferedReader input;
59
         Process process;
59
         Process process;
60
-        
60
+
61
         try {
61
         try {
62
             process = Runtime.getRuntime().exec(command);
62
             process = Runtime.getRuntime().exec(command);
63
-            
63
+
64
             reader = new InputStreamReader(process.getInputStream());
64
             reader = new InputStreamReader(process.getInputStream());
65
             input = new BufferedReader(reader);
65
             input = new BufferedReader(reader);
66
-            
66
+
67
             String line = "";
67
             String line = "";
68
-            
68
+
69
             while ((line = input.readLine()) != null) {
69
             while ((line = input.readLine()) != null) {
70
                 result.add(line);
70
                 result.add(line);
71
             }
71
             }
72
-            
72
+
73
             reader.close();
73
             reader.close();
74
             input.close();
74
             input.close();
75
             process.destroy();
75
             process.destroy();
76
         } catch (IOException ex) {
76
         } catch (IOException ex) {
77
             // Do nothing
77
             // Do nothing
78
         }
78
         }
79
-        
79
+
80
         return result;
80
         return result;
81
     }
81
     }
82
-    
82
+
83
     /** {@inheritDoc} */
83
     /** {@inheritDoc} */
84
     @Override
84
     @Override
85
     public void onLoad() {
85
     public void onLoad() {
86
         command = new DcopCommand();
86
         command = new DcopCommand();
87
         CommandManager.registerCommand(command);
87
         CommandManager.registerCommand(command);
88
     }
88
     }
89
-    
89
+
90
     /** {@inheritDoc} */
90
     /** {@inheritDoc} */
91
     @Override
91
     @Override
92
     public void onUnload() {
92
     public void onUnload() {

+ 7
- 7
src/com/dmdirc/addons/dns/DNSCommand.java View File

36
  * Performs DNS lookups for nicknames, hostnames or IPs.
36
  * Performs DNS lookups for nicknames, hostnames or IPs.
37
  */
37
  */
38
 public final class DNSCommand extends Command implements CommandInfo {
38
 public final class DNSCommand extends Command implements CommandInfo {
39
-    
39
+
40
     /** Creates a new instance of DNSCommand. */
40
     /** Creates a new instance of DNSCommand. */
41
     public DNSCommand() {
41
     public DNSCommand() {
42
         super();
42
         super();
43
     }
43
     }
44
-    
44
+
45
     /** {@inheritDoc} */
45
     /** {@inheritDoc} */
46
     @Override
46
     @Override
47
     public void execute(final FrameContainer origin,
47
     public void execute(final FrameContainer origin,
50
             showUsage(origin, args.isSilent(), "dns", "<IP|hostname>");
50
             showUsage(origin, args.isSilent(), "dns", "<IP|hostname>");
51
             return;
51
             return;
52
         }
52
         }
53
-        
53
+
54
         sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Resolving: " + args.getArguments()[0]);
54
         sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Resolving: " + args.getArguments()[0]);
55
         new Timer("DNS Command Timer").schedule(new TimerTask() {
55
         new Timer("DNS Command Timer").schedule(new TimerTask() {
56
             /** {@inheritDoc} */
56
             /** {@inheritDoc} */
68
             }
68
             }
69
         }, 0);
69
         }, 0);
70
     }
70
     }
71
-    
71
+
72
     /** {@inheritDoc} */
72
     /** {@inheritDoc} */
73
     @Override
73
     @Override
74
     public String getName() {
74
     public String getName() {
75
         return "dns";
75
         return "dns";
76
     }
76
     }
77
-    
77
+
78
     /** {@inheritDoc} */
78
     /** {@inheritDoc} */
79
     @Override
79
     @Override
80
     public boolean showInHelp() {
80
     public boolean showInHelp() {
86
     public CommandType getType() {
86
     public CommandType getType() {
87
         return CommandType.TYPE_GLOBAL;
87
         return CommandType.TYPE_GLOBAL;
88
     }
88
     }
89
-    
89
+
90
     /** {@inheritDoc} */
90
     /** {@inheritDoc} */
91
     @Override
91
     @Override
92
     public String getHelp() {
92
     public String getHelp() {
93
         return "dns <IP|hostname> - Performs DNS lookup of the specified ip/hostname/nickname";
93
         return "dns <IP|hostname> - Performs DNS lookup of the specified ip/hostname/nickname";
94
     }
94
     }
95
-    
95
+
96
 }
96
 }

+ 11
- 11
src/com/dmdirc/addons/dns/DNSPlugin.java View File

35
  * DNS plugin.
35
  * DNS plugin.
36
  */
36
  */
37
 public final class DNSPlugin extends Plugin {
37
 public final class DNSPlugin extends Plugin {
38
-    
38
+
39
     /** The DNSCommand we've registered. */
39
     /** The DNSCommand we've registered. */
40
     private DNSCommand command;
40
     private DNSCommand command;
41
-    
41
+
42
     /** Creates a new instance of DNSPlugin. */
42
     /** Creates a new instance of DNSPlugin. */
43
     public DNSPlugin() {
43
     public DNSPlugin() {
44
         super();
44
         super();
45
     }
45
     }
46
-    
46
+
47
     /** {@inheritDoc} */
47
     /** {@inheritDoc} */
48
     @Override
48
     @Override
49
     public void onLoad() {
49
     public void onLoad() {
50
         command = new DNSCommand();
50
         command = new DNSCommand();
51
         CommandManager.registerCommand(command);
51
         CommandManager.registerCommand(command);
52
     }
52
     }
53
-    
53
+
54
     /** {@inheritDoc} */
54
     /** {@inheritDoc} */
55
     @Override
55
     @Override
56
     public void onUnload() {
56
     public void onUnload() {
57
         CommandManager.unregisterCommand(command);
57
         CommandManager.unregisterCommand(command);
58
     }
58
     }
59
-    
59
+
60
     /**
60
     /**
61
      * Returns the IP(s) for a hostname.
61
      * Returns the IP(s) for a hostname.
62
      *
62
      *
66
      */
66
      */
67
     public static String getIPs(final String hostname) {
67
     public static String getIPs(final String hostname) {
68
         List<String> results = new ArrayList<String>();
68
         List<String> results = new ArrayList<String>();
69
-        
69
+
70
         try {
70
         try {
71
             final InetAddress[] ips = InetAddress.getAllByName(hostname);
71
             final InetAddress[] ips = InetAddress.getAllByName(hostname);
72
-            
72
+
73
             for (InetAddress ip : ips) {
73
             for (InetAddress ip : ips) {
74
                 results.add(ip.getHostAddress());
74
                 results.add(ip.getHostAddress());
75
             }
75
             }
76
-            
76
+
77
         } catch (UnknownHostException ex) {
77
         } catch (UnknownHostException ex) {
78
             results = new ArrayList<String>();
78
             results = new ArrayList<String>();
79
         }
79
         }
80
-        
80
+
81
         return results.toString();
81
         return results.toString();
82
     }
82
     }
83
-    
83
+
84
     /**
84
     /**
85
      * Returns the hostname for an ip.
85
      * Returns the hostname for an ip.
86
      *
86
      *
95
             return "";
95
             return "";
96
         }
96
         }
97
     }
97
     }
98
-    
98
+
99
 }
99
 }

+ 5
- 5
src/com/dmdirc/addons/freedesktop_notifications/FDNotifyCommand.java View File

38
 public final class FDNotifyCommand extends Command implements CommandInfo {
38
 public final class FDNotifyCommand extends Command implements CommandInfo {
39
     /** Plugin that owns this command. */
39
     /** Plugin that owns this command. */
40
     final FreeDesktopNotificationsPlugin myPlugin;
40
     final FreeDesktopNotificationsPlugin myPlugin;
41
-    
41
+
42
     /**
42
     /**
43
      * Creates a new instance of FDNotifyCommand.
43
      * Creates a new instance of FDNotifyCommand.
44
      *
44
      *
60
             }
60
             }
61
         }.start();
61
         }.start();
62
     }
62
     }
63
-    
64
-    
63
+
64
+
65
     /** {@inheritDoc} */
65
     /** {@inheritDoc} */
66
     @Override
66
     @Override
67
     public String getName() {
67
     public String getName() {
68
         return "fdnotify";
68
         return "fdnotify";
69
     }
69
     }
70
-    
70
+
71
     /** {@inheritDoc} */
71
     /** {@inheritDoc} */
72
     @Override
72
     @Override
73
     public boolean showInHelp() {
73
     public boolean showInHelp() {
79
     public CommandType getType() {
79
     public CommandType getType() {
80
         return CommandType.TYPE_GLOBAL;
80
         return CommandType.TYPE_GLOBAL;
81
     }
81
     }
82
-    
82
+
83
     /** {@inheritDoc} */
83
     /** {@inheritDoc} */
84
     @Override
84
     @Override
85
     public String getHelp() {
85
     public String getHelp() {

+ 13
- 13
src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java View File

60
     private boolean strictescape;
60
     private boolean strictescape;
61
     /** Strip codes. */
61
     /** Strip codes. */
62
     private boolean stripcodes;
62
     private boolean stripcodes;
63
-    
63
+
64
     /**
64
     /**
65
      * Creates a new instance of the FreeDesktopNotifications Plugin.
65
      * Creates a new instance of the FreeDesktopNotifications Plugin.
66
      */
66
      */
77
      */
77
      */
78
     public boolean showNotification(final String title, final String message) {
78
     public boolean showNotification(final String title, final String message) {
79
         if (getFilesDir() == null) { return false; }
79
         if (getFilesDir() == null) { return false; }
80
-        
80
+
81
         final ArrayList<String> args = new ArrayList<String>();
81
         final ArrayList<String> args = new ArrayList<String>();
82
-        
82
+
83
         args.add("/usr/bin/env");
83
         args.add("/usr/bin/env");
84
         args.add("python");
84
         args.add("python");
85
         args.add(getFilesDirString() + "notify.py");
85
         args.add(getFilesDirString() + "notify.py");
97
             args.add("Notification from DMDirc");
97
             args.add("Notification from DMDirc");
98
         }
98
         }
99
         args.add(prepareString(message));
99
         args.add(prepareString(message));
100
-        
100
+
101
         try {
101
         try {
102
             final Process myProcess = Runtime.getRuntime().exec(args.toArray(new String[]{}));
102
             final Process myProcess = Runtime.getRuntime().exec(args.toArray(new String[]{}));
103
             final StringBuffer data = new StringBuffer();
103
             final StringBuffer data = new StringBuffer();
108
         } catch (SecurityException e) {
108
         } catch (SecurityException e) {
109
         } catch (IOException e) {
109
         } catch (IOException e) {
110
         }
110
         }
111
-        
111
+
112
         return false;
112
         return false;
113
     }
113
     }
114
-    
114
+
115
     /**
115
     /**
116
      * Prepare the string for sending to dbus.
116
      * Prepare the string for sending to dbus.
117
      *
117
      *
130
                 output = output.replace(">", "&gt;");
130
                 output = output.replace(">", "&gt;");
131
             }
131
             }
132
         }
132
         }
133
-        
133
+
134
         return output;
134
         return output;
135
     }
135
     }
136
 
136
 
147
 
147
 
148
         // Extract required Files
148
         // Extract required Files
149
         final PluginInfo pi = PluginManager.getPluginManager().getPluginInfoByName("freedesktop_notifications");
149
         final PluginInfo pi = PluginManager.getPluginManager().getPluginInfoByName("freedesktop_notifications");
150
-        
150
+
151
         // This shouldn't actually happen, but check to make sure.
151
         // This shouldn't actually happen, but check to make sure.
152
         if (pi != null) {
152
         if (pi != null) {
153
             // Now get the RM
153
             // Now get the RM
154
             try {
154
             try {
155
                 final ResourceManager res = pi.getResourceManager();
155
                 final ResourceManager res = pi.getResourceManager();
156
-                
156
+
157
                 // Extract the files needed
157
                 // Extract the files needed
158
                 try {
158
                 try {
159
                     res.extractResoucesEndingWith(getFilesDir(), ".py");
159
                     res.extractResoucesEndingWith(getFilesDir(), ".py");
175
         CommandManager.unregisterCommand(command);
175
         CommandManager.unregisterCommand(command);
176
         IdentityManager.getGlobalConfig().removeListener(this);
176
         IdentityManager.getGlobalConfig().removeListener(this);
177
     }
177
     }
178
-    
178
+
179
     /** {@inheritDoc} */
179
     /** {@inheritDoc} */
180
     @Override
180
     @Override
181
     public void domainUpdated() {
181
     public void domainUpdated() {
182
         IdentityManager.getAddonIdentity().setOption(getDomain(), "general.icon", getFilesDirString() + "icon.png");
182
         IdentityManager.getAddonIdentity().setOption(getDomain(), "general.icon", getFilesDirString() + "icon.png");
183
     }
183
     }
184
-    
184
+
185
     /** {@inheritDoc} */
185
     /** {@inheritDoc} */
186
     @Override
186
     @Override
187
     public void showConfig(final PreferencesDialogModel manager) {
187
     public void showConfig(final PreferencesDialogModel manager) {
188
         final PreferencesCategory general = new PluginPreferencesCategory(getPluginInfo(), "FreeDesktop Notifications", "General configuration for FreeDesktop Notifications plugin.");
188
         final PreferencesCategory general = new PluginPreferencesCategory(getPluginInfo(), "FreeDesktop Notifications", "General configuration for FreeDesktop Notifications plugin.");
189
-        
189
+
190
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER, getDomain(), "general.timeout", "Timeout", "Length of time in seconds before the notification popup closes."));
190
         general.addSetting(new PreferencesSetting(PreferencesType.INTEGER, getDomain(), "general.timeout", "Timeout", "Length of time in seconds before the notification popup closes."));
191
         general.addSetting(new PreferencesSetting(PreferencesType.FILE, getDomain(), "general.icon", "icon", "Path to icon to use on the notification."));
191
         general.addSetting(new PreferencesSetting(PreferencesType.FILE, getDomain(), "general.icon", "icon", "Path to icon to use on the notification."));
192
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.escapehtml", "Escape HTML", "Some Implementations randomly parse HTML, escape it before showing?"));
192
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.escapehtml", "Escape HTML", "Some Implementations randomly parse HTML, escape it before showing?"));
193
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.strictescape", "Strict Escape HTML", "Strictly escape HTML or just the basic characters? (&, < and >)"));
193
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.strictescape", "Strict Escape HTML", "Strictly escape HTML or just the basic characters? (&, < and >)"));
194
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.stripcodes", "Strip Control Codes", "Strip IRC Control codes from messages?"));
194
         general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN, getDomain(), "advanced.stripcodes", "Strip Control Codes", "Strip IRC Control codes from messages?"));
195
-        
195
+
196
         manager.getCategory("Plugins").addSubCategory(general);
196
         manager.getCategory("Plugins").addSubCategory(general);
197
     }
197
     }
198
 
198
 

+ 174
- 174
src/com/dmdirc/addons/identd/IdentdPlugin.java View File

1
-/*
2
- * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.addons.identd;
24
-
25
-import com.dmdirc.Server;
26
-import com.dmdirc.actions.ActionManager;
27
-import com.dmdirc.actions.CoreActionType;
28
-import com.dmdirc.actions.interfaces.ActionType;
29
-import com.dmdirc.config.IdentityManager;
30
-import com.dmdirc.config.prefs.PluginPreferencesCategory;
31
-import com.dmdirc.config.prefs.PreferencesCategory;
32
-import com.dmdirc.config.prefs.PreferencesDialogModel;
33
-import com.dmdirc.config.prefs.PreferencesSetting;
34
-import com.dmdirc.config.prefs.PreferencesType;
35
-import com.dmdirc.util.validators.PortValidator;
36
-import com.dmdirc.interfaces.ActionListener;
37
-import com.dmdirc.plugins.Plugin;
38
-
39
-import java.util.ArrayList;
40
-import java.util.List;
41
-
42
-/**
43
- * The Identd plugin answers ident requests from IRC servers.
44
- */
45
-public class IdentdPlugin extends Plugin implements ActionListener {
46
-
47
-    /** Array list to store all the servers in that need ident replies. */
48
-    private final List<Server> servers = new ArrayList<Server>();
49
-
50
-    /** The IdentdServer that we use. */
51
-    private IdentdServer myServer;
52
-
53
-    /**
54
-     * Called when the plugin is loaded.
55
-     */
56
-    @Override
57
-    public void onLoad() {
58
-        // Add action hooks
59
-        ActionManager.getActionManager().registerListener(this,
60
-                CoreActionType.SERVER_CONNECTED,
61
-                CoreActionType.SERVER_CONNECTING,
62
-                CoreActionType.SERVER_CONNECTERROR);
63
-
64
-        myServer = new IdentdServer(this);
65
-        if (IdentityManager.getGlobalConfig().getOptionBool(getDomain(),
66
-                "advanced.alwaysOn")) {
67
-            myServer.startServer();
68
-        }
69
-    }
70
-
71
-    /**
72
-     * Called when this plugin is unloaded.
73
-     */
74
-    @Override
75
-    public void onUnload() {
76
-        myServer.stopServer();
77
-        servers.clear();
78
-        ActionManager.getActionManager().unregisterListener(this);
79
-    }
80
-
81
-    /**
82
-     * Process an event of the specified type.
83
-     *
84
-     * @param type The type of the event to process
85
-     * @param format Format of messages that are about to be sent. (May be null)
86
-     * @param arguments The arguments for the event
87
-     */
88
-    @Override
89
-    public void processEvent(final ActionType type, final StringBuffer format,
90
-            final Object... arguments) {
91
-        if (type == CoreActionType.SERVER_CONNECTING) {
92
-            synchronized (servers) {
93
-                if (servers.isEmpty()) {
94
-                    myServer.startServer();
95
-                }
96
-                servers.add((Server) arguments[0]);
97
-            }
98
-        } else if (type == CoreActionType.SERVER_CONNECTED
99
-                || type == CoreActionType.SERVER_CONNECTERROR) {
100
-            synchronized (servers) {
101
-                servers.remove(arguments[0]);
102
-
103
-                if (servers.isEmpty() && !IdentityManager.getGlobalConfig()
104
-                        .getOptionBool(getDomain(), "advanced.alwaysOn")) {
105
-                    myServer.stopServer();
106
-                }
107
-            }
108
-        }
109
-    }
110
-
111
-    /** {@inheritDoc} */
112
-    @Override
113
-    public void showConfig(final PreferencesDialogModel manager) {
114
-        final PreferencesCategory general = new PluginPreferencesCategory(
115
-                getPluginInfo(), "Identd",
116
-                "General Identd Plugin config ('Lower' options take priority " +
117
-                "over those above them)");
118
-        final PreferencesCategory advanced = new PluginPreferencesCategory(
119
-                getPluginInfo(), "Advanced",
120
-                "Advanced Identd Plugin config - Only edit these if you need " +
121
-                "to/know what you are doing. Editing these could prevent " +
122
-                "access to some servers. ('Lower' options take priority over " +
123
-                "those above them)");
124
-
125
-        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
126
-                getDomain(), "general.useUsername", "Use connection " +
127
-                "username rather than system username", "If this is enabled," +
128
-                " the username for the connection will be used rather than " +
129
-                "'" + System.getProperty("user.name") + "'"));
130
-        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
131
-                getDomain(), "general.useNickname", "Use connection " +
132
-                "nickname rather than system username", "If this is enabled, " +
133
-                "the nickname for the connection will be used rather than " +
134
-                "'" + System.getProperty("user.name") + "'"));
135
-        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
136
-                getDomain(), "general.useCustomName", "Use custom name" +
137
-                " all the time", "If this is enabled, the name specified below" +
138
-                " will be used all the time"));
139
-        general.addSetting(new PreferencesSetting(PreferencesType.TEXT,
140
-                getDomain(), "general.customName", "Custom Name to use",
141
-                "The custom name to use when 'Use Custom Name' is enabled"));
142
-
143
-        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
144
-                getDomain(), "advanced.alwaysOn", "Always have ident " +
145
-                "port open", "By default the identd only runs when there are " +
146
-                "active connection attempts. This overrides that."));
147
-        advanced.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
148
-                new PortValidator(), getDomain(), "advanced.port",
149
-                "What port should the identd listen on", "Default port is 113," +
150
-                " this is probably useless if changed unless you port forward" +
151
-                " ident to a different port"));
152
-        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
153
-                getDomain(), "advanced.useCustomSystem", "Use custom OS",
154
-                "By default the plugin uses 'UNIX' or 'WIN32' as the system " +
155
-                "type, this can be overriden by enabling this."));
156
-        advanced.addSetting(new PreferencesSetting(PreferencesType.TEXT,
157
-                getDomain(), "advanced.customSystem", "Custom OS to use",
158
-                "The custom system to use when 'Use Custom System' is enabled"));
159
-        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
160
-                getDomain(), "advanced.isHiddenUser", "Respond to ident" +
161
-                " requests with HIDDEN-USER error", "By default the plugin will" +
162
-                " give a USERID response, this can force an 'ERROR :" +
163
-                " HIDDEN-USER' response instead."));
164
-        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
165
-                getDomain(), "advanced.isNoUser", "Respond to ident" +
166
-                " requests with NO-USER error", "By default the plugin will" +
167
-                " give a USERID response, this can force an 'ERROR : NO-USER'" +
168
-                " response instead. (Overrides HIDDEN-USER)"));
169
-
170
-        manager.getCategory("Plugins").addSubCategory(general);
171
-        general.addSubCategory(advanced);
172
-    }
173
-
174
-}
1
+/*
2
+ * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.addons.identd;
24
+
25
+import com.dmdirc.Server;
26
+import com.dmdirc.actions.ActionManager;
27
+import com.dmdirc.actions.CoreActionType;
28
+import com.dmdirc.actions.interfaces.ActionType;
29
+import com.dmdirc.config.IdentityManager;
30
+import com.dmdirc.config.prefs.PluginPreferencesCategory;
31
+import com.dmdirc.config.prefs.PreferencesCategory;
32
+import com.dmdirc.config.prefs.PreferencesDialogModel;
33
+import com.dmdirc.config.prefs.PreferencesSetting;
34
+import com.dmdirc.config.prefs.PreferencesType;
35
+import com.dmdirc.util.validators.PortValidator;
36
+import com.dmdirc.interfaces.ActionListener;
37
+import com.dmdirc.plugins.Plugin;
38
+
39
+import java.util.ArrayList;
40
+import java.util.List;
41
+
42
+/**
43
+ * The Identd plugin answers ident requests from IRC servers.
44
+ */
45
+public class IdentdPlugin extends Plugin implements ActionListener {
46
+
47
+    /** Array list to store all the servers in that need ident replies. */
48
+    private final List<Server> servers = new ArrayList<Server>();
49
+
50
+    /** The IdentdServer that we use. */
51
+    private IdentdServer myServer;
52
+
53
+    /**
54
+     * Called when the plugin is loaded.
55
+     */
56
+    @Override
57
+    public void onLoad() {
58
+        // Add action hooks
59
+        ActionManager.getActionManager().registerListener(this,
60
+                CoreActionType.SERVER_CONNECTED,
61
+                CoreActionType.SERVER_CONNECTING,
62
+                CoreActionType.SERVER_CONNECTERROR);
63
+
64
+        myServer = new IdentdServer(this);
65
+        if (IdentityManager.getGlobalConfig().getOptionBool(getDomain(),
66
+                "advanced.alwaysOn")) {
67
+            myServer.startServer();
68
+        }
69
+    }
70
+
71
+    /**
72
+     * Called when this plugin is unloaded.
73
+     */
74
+    @Override
75
+    public void onUnload() {
76
+        myServer.stopServer();
77
+        servers.clear();
78
+        ActionManager.getActionManager().unregisterListener(this);
79
+    }
80
+
81
+    /**
82
+     * Process an event of the specified type.
83
+     *
84
+     * @param type The type of the event to process
85
+     * @param format Format of messages that are about to be sent. (May be null)
86
+     * @param arguments The arguments for the event
87
+     */
88
+    @Override
89
+    public void processEvent(final ActionType type, final StringBuffer format,
90
+            final Object... arguments) {
91
+        if (type == CoreActionType.SERVER_CONNECTING) {
92
+            synchronized (servers) {
93
+                if (servers.isEmpty()) {
94
+                    myServer.startServer();
95
+                }
96
+                servers.add((Server) arguments[0]);
97
+            }
98
+        } else if (type == CoreActionType.SERVER_CONNECTED
99
+                || type == CoreActionType.SERVER_CONNECTERROR) {
100
+            synchronized (servers) {
101
+                servers.remove(arguments[0]);
102
+
103
+                if (servers.isEmpty() && !IdentityManager.getGlobalConfig()
104
+                        .getOptionBool(getDomain(), "advanced.alwaysOn")) {
105
+                    myServer.stopServer();
106
+                }
107
+            }
108
+        }
109
+    }
110
+
111
+    /** {@inheritDoc} */
112
+    @Override
113
+    public void showConfig(final PreferencesDialogModel manager) {
114
+        final PreferencesCategory general = new PluginPreferencesCategory(
115
+                getPluginInfo(), "Identd",
116
+                "General Identd Plugin config ('Lower' options take priority " +
117
+                "over those above them)");
118
+        final PreferencesCategory advanced = new PluginPreferencesCategory(
119
+                getPluginInfo(), "Advanced",
120
+                "Advanced Identd Plugin config - Only edit these if you need " +
121
+                "to/know what you are doing. Editing these could prevent " +
122
+                "access to some servers. ('Lower' options take priority over " +
123
+                "those above them)");
124
+
125
+        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
126
+                getDomain(), "general.useUsername", "Use connection " +
127
+                "username rather than system username", "If this is enabled," +
128
+                " the username for the connection will be used rather than " +
129
+                "'" + System.getProperty("user.name") + "'"));
130
+        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
131
+                getDomain(), "general.useNickname", "Use connection " +
132
+                "nickname rather than system username", "If this is enabled, " +
133
+                "the nickname for the connection will be used rather than " +
134
+                "'" + System.getProperty("user.name") + "'"));
135
+        general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
136
+                getDomain(), "general.useCustomName", "Use custom name" +
137
+                " all the time", "If this is enabled, the name specified below" +
138
+                " will be used all the time"));
139
+        general.addSetting(new PreferencesSetting(PreferencesType.TEXT,
140
+                getDomain(), "general.customName", "Custom Name to use",
141
+                "The custom name to use when 'Use Custom Name' is enabled"));
142
+
143
+        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
144
+                getDomain(), "advanced.alwaysOn", "Always have ident " +
145
+                "port open", "By default the identd only runs when there are " +
146
+                "active connection attempts. This overrides that."));
147
+        advanced.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
148
+                new PortValidator(), getDomain(), "advanced.port",
149
+                "What port should the identd listen on", "Default port is 113," +
150
+                " this is probably useless if changed unless you port forward" +
151
+                " ident to a different port"));
152
+        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
153
+                getDomain(), "advanced.useCustomSystem", "Use custom OS",
154
+                "By default the plugin uses 'UNIX' or 'WIN32' as the system " +
155
+                "type, this can be overriden by enabling this."));
156
+        advanced.addSetting(new PreferencesSetting(PreferencesType.TEXT,
157
+                getDomain(), "advanced.customSystem", "Custom OS to use",
158
+                "The custom system to use when 'Use Custom System' is enabled"));
159
+        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
160
+                getDomain(), "advanced.isHiddenUser", "Respond to ident" +
161
+                " requests with HIDDEN-USER error", "By default the plugin will" +
162
+                " give a USERID response, this can force an 'ERROR :" +
163
+                " HIDDEN-USER' response instead."));
164
+        advanced.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
165
+                getDomain(), "advanced.isNoUser", "Respond to ident" +
166
+                " requests with NO-USER error", "By default the plugin will" +
167
+                " give a USERID response, this can force an 'ERROR : NO-USER'" +
168
+                " response instead. (Overrides HIDDEN-USER)"));
169
+
170
+        manager.getCategory("Plugins").addSubCategory(general);
171
+        general.addSubCategory(advanced);
172
+    }
173
+
174
+}

+ 1
- 1
src/com/dmdirc/addons/lagdisplay/LagDisplayPanel.java View File

48
      */
48
      */
49
     public LagDisplayPanel(final LagDisplayPlugin plugin) {
49
     public LagDisplayPanel(final LagDisplayPlugin plugin) {
50
         super(new JLabel());
50
         super(new JLabel());
51
-        
51
+
52
         this.plugin = plugin;
52
         this.plugin = plugin;
53
     }
53
     }
54
 
54
 

+ 13
- 13
src/com/dmdirc/addons/lagdisplay/LagDisplayPlugin.java View File

53
  * @author chris
53
  * @author chris
54
  */
54
  */
55
 public final class LagDisplayPlugin extends Plugin implements ActionListener, ConfigChangeListener {
55
 public final class LagDisplayPlugin extends Plugin implements ActionListener, ConfigChangeListener {
56
-    
56
+
57
     /** The panel we use in the status bar. */
57
     /** The panel we use in the status bar. */
58
     private final LagDisplayPanel panel = new LagDisplayPanel(this);
58
     private final LagDisplayPanel panel = new LagDisplayPanel(this);
59
-    
59
+
60
     /** A cache of ping times. */
60
     /** A cache of ping times. */
61
     private final Map<Server, String> pings = new WeakHashMap<Server, String>();
61
     private final Map<Server, String> pings = new WeakHashMap<Server, String>();
62
 
62
 
72
 
72
 
73
     /** The length of history to keep per-server. */
73
     /** The length of history to keep per-server. */
74
     private int historySize = 100;
74
     private int historySize = 100;
75
-    
75
+
76
     /** Creates a new instance of LagDisplayPlugin. */
76
     /** Creates a new instance of LagDisplayPlugin. */
77
     public LagDisplayPlugin() {
77
     public LagDisplayPlugin() {
78
         super();
78
         super();
79
     }
79
     }
80
-    
80
+
81
     /** {@inheritDoc} */
81
     /** {@inheritDoc} */
82
     @Override
82
     @Override
83
     public void onLoad() {
83
     public void onLoad() {
87
         IdentityManager.getGlobalConfig().addChangeListener(getDomain(), this);
87
         IdentityManager.getGlobalConfig().addChangeListener(getDomain(), this);
88
 
88
 
89
         readConfig();
89
         readConfig();
90
-        
90
+
91
         ActionManager.getActionManager().registerListener(this,
91
         ActionManager.getActionManager().registerListener(this,
92
                 CoreActionType.SERVER_GOTPING, CoreActionType.SERVER_NOPING,
92
                 CoreActionType.SERVER_GOTPING, CoreActionType.SERVER_NOPING,
93
                 CoreActionType.CLIENT_FRAME_CHANGED,
93
                 CoreActionType.CLIENT_FRAME_CHANGED,
94
-                CoreActionType.SERVER_DISCONNECTED, 
94
+                CoreActionType.SERVER_DISCONNECTED,
95
                 CoreActionType.SERVER_PINGSENT, CoreActionType.SERVER_NUMERIC);
95
                 CoreActionType.SERVER_PINGSENT, CoreActionType.SERVER_NUMERIC);
96
     }
96
     }
97
 
97
 
108
     /**
108
     /**
109
      * Retrieves the history of the specified server. If there is no history,
109
      * Retrieves the history of the specified server. If there is no history,
110
      * a new list is added to the history map and returned.
110
      * a new list is added to the history map and returned.
111
-     * 
111
+     *
112
      * @param server The server whose history is being requested
112
      * @param server The server whose history is being requested
113
      * @return The history for the specified server
113
      * @return The history for the specified server
114
      */
114
      */
123
     /**
123
     /**
124
      * Determines if the {@link ServerInfoDialog} should show a graph of the
124
      * Determines if the {@link ServerInfoDialog} should show a graph of the
125
      * ping time for the current server.
125
      * ping time for the current server.
126
-     * 
126
+     *
127
      * @return True if a graph should be shown, false otherwise
127
      * @return True if a graph should be shown, false otherwise
128
      */
128
      */
129
     public boolean shouldShowGraph() {
129
     public boolean shouldShowGraph() {
139
     public boolean shouldShowLabels() {
139
     public boolean shouldShowLabels() {
140
         return showLabels;
140
         return showLabels;
141
     }
141
     }
142
-    
142
+
143
     /** {@inheritDoc} */
143
     /** {@inheritDoc} */
144
     @Override
144
     @Override
145
     public void onUnload() {
145
     public void onUnload() {
147
                 .getPluginInfoByName("ui_swing").getPlugin())
147
                 .getPluginInfoByName("ui_swing").getPlugin())
148
                 .getSwingStatusBar().removeComponent(panel);
148
                 .getSwingStatusBar().removeComponent(panel);
149
         IdentityManager.getConfigIdentity().removeListener(this);
149
         IdentityManager.getConfigIdentity().removeListener(this);
150
-        
150
+
151
         ActionManager.getActionManager().unregisterListener(this);
151
         ActionManager.getActionManager().unregisterListener(this);
152
     }
152
     }
153
-    
153
+
154
     /** {@inheritDoc} */
154
     /** {@inheritDoc} */
155
     @Override
155
     @Override
156
     public void processEvent(final ActionType type, final StringBuffer format,
156
     public void processEvent(final ActionType type, final StringBuffer format,
247
     public String getTime(final Server server) {
247
     public String getTime(final Server server) {
248
         return pings.get(server) == null ? "Unknown" : pings.get(server);
248
         return pings.get(server) == null ? "Unknown" : pings.get(server);
249
     }
249
     }
250
-    
250
+
251
     /**
251
     /**
252
      * Formats the specified time so it's a nice size to display in the label.
252
      * Formats the specified time so it's a nice size to display in the label.
253
      * @param object An uncast Long representing the time to be formatted
253
      * @param object An uncast Long representing the time to be formatted
255
      */
255
      */
256
     protected String formatTime(final Object object) {
256
     protected String formatTime(final Object object) {
257
         final Long time = (Long) object;
257
         final Long time = (Long) object;
258
-        
258
+
259
         if (time >= 10000) {
259
         if (time >= 10000) {
260
             return Math.round(time / 1000.0) + "s";
260
             return Math.round(time / 1000.0) + "s";
261
         } else {
261
         } else {

+ 3
- 3
src/com/dmdirc/addons/lagdisplay/PingHistoryPanel.java View File

69
         setMinimumSize(new Dimension(50, 100));
69
         setMinimumSize(new Dimension(50, 100));
70
         setMaximumSize(new Dimension(Integer.MAX_VALUE, 100));
70
         setMaximumSize(new Dimension(Integer.MAX_VALUE, 100));
71
         setOpaque(false);
71
         setOpaque(false);
72
-        
72
+
73
         this.plugin = plugin;
73
         this.plugin = plugin;
74
         this.history = plugin.getHistory(WindowManager.getActiveServer());
74
         this.history = plugin.getHistory(WindowManager.getActiveServer());
75
 
75
 
82
     @Override
82
     @Override
83
     public void paint(final Graphics g) {
83
     public void paint(final Graphics g) {
84
         super.paint(g);
84
         super.paint(g);
85
-        
85
+
86
         g.setColor(Color.DARK_GRAY);
86
         g.setColor(Color.DARK_GRAY);
87
         g.drawLine(2, 1, 2, getHeight() - 1);
87
         g.drawLine(2, 1, 2, getHeight() - 1);
88
         g.drawLine(1, getHeight() - 2, getWidth() - 1, getHeight() - 2);
88
         g.drawLine(1, getHeight() - 2, getWidth() - 1, getHeight() - 2);
103
 
103
 
104
         for (int i = 0; i < list.size(); i++) {
104
         for (int i = 0; i < list.size(); i++) {
105
             final Long value = list.get(i);
105
             final Long value = list.get(i);
106
-           
106
+
107
             float x = lastX == -1 ? 2 : lastX + pixelsperpointX;
107
             float x = lastX == -1 ? 2 : lastX + pixelsperpointX;
108
             float y = getHeight() - 5 - value * pixelsperpointY;
108
             float y = getHeight() - 5 - value * pixelsperpointY;
109
 
109
 

+ 1
- 1
src/com/dmdirc/addons/logging/package-info.java View File

21
  */
21
  */
22
 
22
 
23
 /**
23
 /**
24
- * Adds logging functionality to the client. 
24
+ * Adds logging functionality to the client.
25
  */
25
  */
26
 package com.dmdirc.addons.logging;
26
 package com.dmdirc.addons.logging;

+ 1
- 1
src/com/dmdirc/addons/mediasource_dbus/BansheeSource.java View File

59
     @Override
59
     @Override
60
     public MediaSourceState getState() {
60
     public MediaSourceState getState() {
61
         final List<String> res = source.doDBusCall(SERVICE, IFACE, STATE);
61
         final List<String> res = source.doDBusCall(SERVICE, IFACE, STATE);
62
-        
62
+
63
         if (res.isEmpty()) {
63
         if (res.isEmpty()) {
64
             trackInfo = null;
64
             trackInfo = null;
65
             return MediaSourceState.CLOSED;
65
             return MediaSourceState.CLOSED;

+ 11
- 11
src/com/dmdirc/addons/mediasource_dcop/AmarokSource.java View File

33
  * @author chris
33
  * @author chris
34
  */
34
  */
35
 public class AmarokSource implements MediaSource {
35
 public class AmarokSource implements MediaSource {
36
-    
36
+
37
     /** Instantiates the media source. */
37
     /** Instantiates the media source. */
38
     public AmarokSource() {
38
     public AmarokSource() {
39
         //Do nothing
39
         //Do nothing
40
     }
40
     }
41
-    
41
+
42
     /** {@inheritDoc} */
42
     /** {@inheritDoc} */
43
     @Override
43
     @Override
44
     public MediaSourceState getState() {
44
     public MediaSourceState getState() {
64
             }
64
             }
65
         }
65
         }
66
     }
66
     }
67
-    
67
+
68
     /** {@inheritDoc} */
68
     /** {@inheritDoc} */
69
     @Override
69
     @Override
70
     public String getAppName() {
70
     public String getAppName() {
71
         return "Amarok";
71
         return "Amarok";
72
     }
72
     }
73
-    
73
+
74
     /** {@inheritDoc} */
74
     /** {@inheritDoc} */
75
     @Override
75
     @Override
76
     public String getArtist() {
76
     public String getArtist() {
77
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player artist").get(0);
77
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player artist").get(0);
78
     }
78
     }
79
-    
79
+
80
     /** {@inheritDoc} */
80
     /** {@inheritDoc} */
81
     @Override
81
     @Override
82
     public String getTitle() {
82
     public String getTitle() {
83
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player title").get(0);
83
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player title").get(0);
84
     }
84
     }
85
-    
85
+
86
     /** {@inheritDoc} */
86
     /** {@inheritDoc} */
87
     @Override
87
     @Override
88
     public String getAlbum() {
88
     public String getAlbum() {
89
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player album").get(0);
89
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player album").get(0);
90
     }
90
     }
91
-    
91
+
92
     /** {@inheritDoc} */
92
     /** {@inheritDoc} */
93
     @Override
93
     @Override
94
     public String getLength() {
94
     public String getLength() {
95
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player totalTime").get(0);
95
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player totalTime").get(0);
96
     }
96
     }
97
-    
97
+
98
     /** {@inheritDoc} */
98
     /** {@inheritDoc} */
99
     @Override
99
     @Override
100
     public String getTime() {
100
     public String getTime() {
101
         return DcopMediaSourcePlugin.getDcopResult(
101
         return DcopMediaSourcePlugin.getDcopResult(
102
                 "dcop amarok player currentTime").get(0);
102
                 "dcop amarok player currentTime").get(0);
103
     }
103
     }
104
-    
104
+
105
     /** {@inheritDoc} */
105
     /** {@inheritDoc} */
106
     @Override
106
     @Override
107
     public String getFormat() {
107
     public String getFormat() {
108
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player type").get(0);
108
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player type").get(0);
109
     }
109
     }
110
-    
110
+
111
     /** {@inheritDoc} */
111
     /** {@inheritDoc} */
112
     @Override
112
     @Override
113
     public String getBitrate() {
113
     public String getBitrate() {
114
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player bitrate").get(0);
114
         return DcopMediaSourcePlugin.getDcopResult("dcop amarok player bitrate").get(0);
115
     }
115
     }
116
-    
116
+
117
 }
117
 }

+ 6
- 6
src/com/dmdirc/addons/mediasource_dcop/DcopMediaSourcePlugin.java View File

36
  */
36
  */
37
 public class DcopMediaSourcePlugin extends Plugin
37
 public class DcopMediaSourcePlugin extends Plugin
38
         implements MediaSourceManager {
38
         implements MediaSourceManager {
39
-    
39
+
40
     /** Media sources. */
40
     /** Media sources. */
41
     private final List<MediaSource> sources;
41
     private final List<MediaSource> sources;
42
-    
42
+
43
     /**
43
     /**
44
      * Creates a new instance of DcopMediaSourcePlugin.
44
      * Creates a new instance of DcopMediaSourcePlugin.
45
      */
45
      */
50
         sources.add(new KaffeineSource());
50
         sources.add(new KaffeineSource());
51
         sources.add(new NoatunSource());
51
         sources.add(new NoatunSource());
52
     }
52
     }
53
-    
53
+
54
     /**
54
     /**
55
      * Get DCOP Result
55
      * Get DCOP Result
56
      *
56
      *
66
             return new ArrayList<String>();
66
             return new ArrayList<String>();
67
         }
67
         }
68
     }
68
     }
69
-    
69
+
70
     /** {@inheritDoc} */
70
     /** {@inheritDoc} */
71
     @Override
71
     @Override
72
     public List<MediaSource> getSources() {
72
     public List<MediaSource> getSources() {
73
         return sources;
73
         return sources;
74
     }
74
     }
75
-    
75
+
76
     /** {@inheritDoc} */
76
     /** {@inheritDoc} */
77
     @Override
77
     @Override
78
     public void onLoad() {
78
     public void onLoad() {
79
         // Nothing to do
79
         // Nothing to do
80
     }
80
     }
81
-    
81
+
82
     /** {@inheritDoc} */
82
     /** {@inheritDoc} */
83
     @Override
83
     @Override
84
     public void onUnload() {
84
     public void onUnload() {

+ 9
- 9
src/com/dmdirc/addons/mediasource_dcop/KaffeineSource.java View File

33
  * @author chris
33
  * @author chris
34
  */
34
  */
35
 public class KaffeineSource implements MediaSource {
35
 public class KaffeineSource implements MediaSource {
36
-    
36
+
37
     /** Instantiates the media source. */
37
     /** Instantiates the media source. */
38
     public KaffeineSource() {
38
     public KaffeineSource() {
39
         //Do nothing
39
         //Do nothing
40
     }
40
     }
41
-    
41
+
42
     /** {@inheritDoc} */
42
     /** {@inheritDoc} */
43
     @Override
43
     @Override
44
     public MediaSourceState getState() {
44
     public MediaSourceState getState() {
54
             return MediaSourceState.CLOSED;
54
             return MediaSourceState.CLOSED;
55
         }
55
         }
56
     }
56
     }
57
-    
57
+
58
     /** {@inheritDoc} */
58
     /** {@inheritDoc} */
59
     @Override
59
     @Override
60
     public String getAppName() {
60
     public String getAppName() {
61
         return "Kaffeine";
61
         return "Kaffeine";
62
     }
62
     }
63
-    
63
+
64
     /** {@inheritDoc} */
64
     /** {@inheritDoc} */
65
     @Override
65
     @Override
66
     public String getArtist() {
66
     public String getArtist() {
107
     public String getBitrate() {
107
     public String getBitrate() {
108
         return null;
108
         return null;
109
     }
109
     }
110
-    
110
+
111
     /**
111
     /**
112
      * Get the duration in seconds as a string.
112
      * Get the duration in seconds as a string.
113
      *
113
      *
120
         final long hours = secondsInput / 3600;
120
         final long hours = secondsInput / 3600;
121
         final long minutes = secondsInput / 60 % 60;
121
         final long minutes = secondsInput / 60 % 60;
122
         final long seconds = secondsInput % 60;
122
         final long seconds = secondsInput % 60;
123
-        
123
+
124
         if (hours > 0) {
124
         if (hours > 0) {
125
             if (hours < 10) {
125
             if (hours < 10) {
126
                 result.append('0');
126
                 result.append('0');
132
         if (minutes < 10) {
132
         if (minutes < 10) {
133
             result.append('0');
133
             result.append('0');
134
         }
134
         }
135
-        
135
+
136
         result.append(minutes).append(":");
136
         result.append(minutes).append(":");
137
 
137
 
138
         if (seconds < 10) {
138
         if (seconds < 10) {
140
         }
140
         }
141
 
141
 
142
         result.append(seconds);
142
         result.append(seconds);
143
-        
143
+
144
         return result.toString();
144
         return result.toString();
145
     }
145
     }
146
-    
146
+
147
 }
147
 }

+ 10
- 10
src/com/dmdirc/addons/mediasource_dcop/NoatunSource.java View File

33
  * @author chris
33
  * @author chris
34
  */
34
  */
35
 public class NoatunSource implements MediaSource {
35
 public class NoatunSource implements MediaSource {
36
-    
36
+
37
     /** Instantiates the media source. */
37
     /** Instantiates the media source. */
38
     public NoatunSource() {
38
     public NoatunSource() {
39
         //Do nothing
39
         //Do nothing
40
     }
40
     }
41
-    
41
+
42
     /** {@inheritDoc} */
42
     /** {@inheritDoc} */
43
     @Override
43
     @Override
44
     public MediaSourceState getState() {
44
     public MediaSourceState getState() {
64
             }
64
             }
65
         }
65
         }
66
     }
66
     }
67
-    
67
+
68
     /** {@inheritDoc} */
68
     /** {@inheritDoc} */
69
     @Override
69
     @Override
70
     public String getAppName() {
70
     public String getAppName() {
71
         return "Noatun";
71
         return "Noatun";
72
     }
72
     }
73
-    
73
+
74
     /** {@inheritDoc} */
74
     /** {@inheritDoc} */
75
     @Override
75
     @Override
76
     public String getArtist() {
76
     public String getArtist() {
124
     public String getBitrate() {
124
     public String getBitrate() {
125
         return null;
125
         return null;
126
     }
126
     }
127
-    
127
+
128
     /**
128
     /**
129
      * Get the duration in seconds as a string.
129
      * Get the duration in seconds as a string.
130
      *
130
      *
137
         final long hours = secondsInput / 3600;
137
         final long hours = secondsInput / 3600;
138
         final long minutes = secondsInput / 60 % 60;
138
         final long minutes = secondsInput / 60 % 60;
139
         final long seconds = secondsInput % 60;
139
         final long seconds = secondsInput % 60;
140
-        
141
-        if (hours > 0) { 
140
+
141
+        if (hours > 0) {
142
             result.append(hours).append(":");
142
             result.append(hours).append(":");
143
         }
143
         }
144
-        
144
+
145
         result.append(minutes).append(":");
145
         result.append(minutes).append(":");
146
         result.append(seconds).append(":");
146
         result.append(seconds).append(":");
147
-        
147
+
148
         return result.toString();
148
         return result.toString();
149
     }
149
     }
150
-    
150
+
151
 }
151
 }

+ 7
- 7
src/com/dmdirc/addons/mediasource_linux_title/TitleMediaSource.java View File

82
     @Override
82
     @Override
83
     public String getTitle() {
83
     public String getTitle() {
84
         final String[] info = getInfo().split("–", 2);
84
         final String[] info = getInfo().split("–", 2);
85
-        
85
+
86
         if (info.length >= 2) {
86
         if (info.length >= 2) {
87
             return info[1].trim();
87
             return info[1].trim();
88
         } else {
88
         } else {
119
     public String getBitrate() {
119
     public String getBitrate() {
120
         return "";
120
         return "";
121
     }
121
     }
122
-    
122
+
123
     private String getInfo() {
123
     private String getInfo() {
124
         InputStreamReader reader = null;
124
         InputStreamReader reader = null;
125
         BufferedReader input = null;
125
         BufferedReader input = null;
126
         Process process;
126
         Process process;
127
-        
127
+
128
         try {
128
         try {
129
             final String[] args = new String[]{
129
             final String[] args = new String[]{
130
                 "/bin/bash", "-c", "xwininfo -root -tree | " + command
130
                 "/bin/bash", "-c", "xwininfo -root -tree | " + command
131
             };
131
             };
132
 
132
 
133
             process = Runtime.getRuntime().exec(args);
133
             process = Runtime.getRuntime().exec(args);
134
-            
134
+
135
             reader = new InputStreamReader(process.getInputStream());
135
             reader = new InputStreamReader(process.getInputStream());
136
             input = new BufferedReader(reader);
136
             input = new BufferedReader(reader);
137
-            
137
+
138
             String line = "";
138
             String line = "";
139
-            
139
+
140
             while ((line = input.readLine()) != null) {
140
             while ((line = input.readLine()) != null) {
141
                 return line;
141
                 return line;
142
             }
142
             }
147
             StreamUtil.close(reader);
147
             StreamUtil.close(reader);
148
             StreamUtil.close(input);
148
             StreamUtil.close(input);
149
         }
149
         }
150
-        
150
+
151
         return "";
151
         return "";
152
     }
152
     }
153
 
153
 

+ 9
- 9
src/com/dmdirc/addons/mediasource_mplayer/MplayerMediaSourcePlugin.java View File

39
  * @author chris
39
  * @author chris
40
  */
40
  */
41
 public class MplayerMediaSourcePlugin extends Plugin implements MediaSource {
41
 public class MplayerMediaSourcePlugin extends Plugin implements MediaSource {
42
-       
42
+
43
     /**
43
     /**
44
      * Creates a new instance of MplayerMediaSourcePlugin.
44
      * Creates a new instance of MplayerMediaSourcePlugin.
45
      */
45
      */
46
     public MplayerMediaSourcePlugin() {
46
     public MplayerMediaSourcePlugin() {
47
         super();
47
         super();
48
     }
48
     }
49
-    
49
+
50
     /** {@inheritDoc} */
50
     /** {@inheritDoc} */
51
     @Override
51
     @Override
52
     public void onLoad() {
52
     public void onLoad() {
53
         // Nothing to do
53
         // Nothing to do
54
     }
54
     }
55
-    
55
+
56
     /** {@inheritDoc} */
56
     /** {@inheritDoc} */
57
     @Override
57
     @Override
58
     public void onUnload() {
58
     public void onUnload() {
128
         InputStreamReader reader;
128
         InputStreamReader reader;
129
         BufferedReader input;
129
         BufferedReader input;
130
         Process process;
130
         Process process;
131
-        
131
+
132
         try {
132
         try {
133
             final String[] command = new String[]{"/bin/bash", "-c",
133
             final String[] command = new String[]{"/bin/bash", "-c",
134
                     "/usr/bin/lsof -c gmplayer |" +
134
                     "/usr/bin/lsof -c gmplayer |" +
136
                     "\\.xession|fontconfig' | tail -n 1 | sed -r 's/ +/ /g' |" +
136
                     "\\.xession|fontconfig' | tail -n 1 | sed -r 's/ +/ /g' |" +
137
                     " cut -d ' ' -f 9- | sed -r 's/^.*\\/(.*?)$/\\1/'"};
137
                     " cut -d ' ' -f 9- | sed -r 's/^.*\\/(.*?)$/\\1/'"};
138
             process = Runtime.getRuntime().exec(command);
138
             process = Runtime.getRuntime().exec(command);
139
-            
139
+
140
             reader = new InputStreamReader(process.getInputStream());
140
             reader = new InputStreamReader(process.getInputStream());
141
             input = new BufferedReader(reader);
141
             input = new BufferedReader(reader);
142
-            
142
+
143
             String line = "";
143
             String line = "";
144
-            
144
+
145
             while ((line = input.readLine()) != null) {
145
             while ((line = input.readLine()) != null) {
146
                 result.add(line);
146
                 result.add(line);
147
             }
147
             }
148
-            
148
+
149
             reader.close();
149
             reader.close();
150
             input.close();
150
             input.close();
151
             process.destroy();
151
             process.destroy();
152
         } catch (IOException ex) {
152
         } catch (IOException ex) {
153
             ex.printStackTrace();
153
             ex.printStackTrace();
154
         }
154
         }
155
-        
155
+
156
         return result;
156
         return result;
157
     }
157
     }
158
 
158
 

+ 1
- 1
src/com/dmdirc/addons/notifications/NotificationsPlugin.java View File

64
     public void onLoad() {
64
     public void onLoad() {
65
         methods.clear();
65
         methods.clear();
66
         loadSettings();
66
         loadSettings();
67
-        ActionManager.getActionManager().registerListener(this, 
67
+        ActionManager.getActionManager().registerListener(this,
68
                 CoreActionType.PLUGIN_LOADED, CoreActionType.PLUGIN_UNLOADED);
68
                 CoreActionType.PLUGIN_LOADED, CoreActionType.PLUGIN_UNLOADED);
69
         for (PluginInfo target : PluginManager.getPluginManager()
69
         for (PluginInfo target : PluginManager.getPluginManager()
70
                 .getPluginInfos()) {
70
                 .getPluginInfos()) {

+ 10
- 10
src/com/dmdirc/addons/nowplaying/MediaSource.java View File

25
 /**
25
 /**
26
  * The media source describes one source of "now playing" information
26
  * The media source describes one source of "now playing" information
27
  * (i.e., one method of getting information from one media player).
27
  * (i.e., one method of getting information from one media player).
28
- * 
28
+ *
29
  * @author chris
29
  * @author chris
30
  */
30
  */
31
 public interface MediaSource {
31
 public interface MediaSource {
36
      * @since 0.6.3m1
36
      * @since 0.6.3m1
37
      */
37
      */
38
     MediaSourceState getState();
38
     MediaSourceState getState();
39
-    
39
+
40
     /**
40
     /**
41
      * Retrieves the name of the application that this source is for.
41
      * Retrieves the name of the application that this source is for.
42
-     * 
42
+     *
43
      * @return This source's application name
43
      * @return This source's application name
44
      */
44
      */
45
     String getAppName();
45
     String getAppName();
46
-    
46
+
47
     /**
47
     /**
48
      * Retrieves the artist of the curently loaded track.
48
      * Retrieves the artist of the curently loaded track.
49
      *
49
      *
50
      * @return Current track artist
50
      * @return Current track artist
51
      */
51
      */
52
     String getArtist();
52
     String getArtist();
53
-    
53
+
54
     /**
54
     /**
55
      * Retrieves the title of the currently loaded track.
55
      * Retrieves the title of the currently loaded track.
56
      *
56
      *
57
      * @return Current track title
57
      * @return Current track title
58
      */
58
      */
59
     String getTitle();
59
     String getTitle();
60
-    
60
+
61
     /**
61
     /**
62
      * Retrieves the album of the currently loaded track.
62
      * Retrieves the album of the currently loaded track.
63
      *
63
      *
64
      * @return Current track album
64
      * @return Current track album
65
      */
65
      */
66
     String getAlbum();
66
     String getAlbum();
67
-    
67
+
68
     /**
68
     /**
69
      * Retrieves the length of the currently loaded track ([h:]mm:ss).
69
      * Retrieves the length of the currently loaded track ([h:]mm:ss).
70
      *
70
      *
71
      * @return Current track length
71
      * @return Current track length
72
      */
72
      */
73
     String getLength();
73
     String getLength();
74
-    
74
+
75
     /**
75
     /**
76
      * Retrieves the time of the currently loaded track ([h:]mm:ss).
76
      * Retrieves the time of the currently loaded track ([h:]mm:ss).
77
      *
77
      *
78
      * @return Current track time
78
      * @return Current track time
79
      */
79
      */
80
     String getTime();
80
     String getTime();
81
-    
81
+
82
     /**
82
     /**
83
      * Retrives the format of the currently loaded track.
83
      * Retrives the format of the currently loaded track.
84
      *
84
      *
85
      * @return Current track format
85
      * @return Current track format
86
      */
86
      */
87
     String getFormat();
87
     String getFormat();
88
-    
88
+
89
     /**
89
     /**
90
      * Retrieves the bitrate of the currently loaded track.
90
      * Retrieves the bitrate of the currently loaded track.
91
      *
91
      *

+ 6
- 6
src/com/dmdirc/addons/nowplaying/MediaSourceComparator.java View File

32
  * @author chris
32
  * @author chris
33
  */
33
  */
34
 public class MediaSourceComparator implements Comparator<MediaSource>, Serializable {
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
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
38
      * structure is changed (or anything else that would prevent serialized
39
      * objects being unserialized with the new class).
39
      * objects being unserialized with the new class).
40
      */
40
      */
41
     private static final long serialVersionUID = 1;
41
     private static final long serialVersionUID = 1;
42
-    
42
+
43
     /** The order that the sources should be checked. */
43
     /** The order that the sources should be checked. */
44
     private final List<String> order;
44
     private final List<String> order;
45
-    
45
+
46
     /**
46
     /**
47
      * Creates a new instance of MediaSourceComparator.
47
      * Creates a new instance of MediaSourceComparator.
48
      * NB: The order list may be altered during comparisons.
48
      * NB: The order list may be altered during comparisons.
58
     public int compare(final MediaSource o1, final MediaSource o2) {
58
     public int compare(final MediaSource o1, final MediaSource o2) {
59
         return getPosition(o1) - getPosition(o2);
59
         return getPosition(o1) - getPosition(o2);
60
     }
60
     }
61
-    
61
+
62
     /**
62
     /**
63
      * Retrieves the position of the source within the order list.
63
      * Retrieves the position of the source within the order list.
64
      * If the source is not present it is appended to the list.
64
      * If the source is not present it is appended to the list.
69
         if (!order.contains(source.getAppName())) {
69
         if (!order.contains(source.getAppName())) {
70
             order.add(source.getAppName());
70
             order.add(source.getAppName());
71
         }
71
         }
72
-        
72
+
73
         return order.indexOf(source.getAppName());
73
         return order.indexOf(source.getAppName());
74
     }
74
     }
75
-    
75
+
76
 }
76
 }

+ 4
- 4
src/com/dmdirc/addons/nowplaying/MediaSourceManager.java View File

27
 /**
27
 /**
28
  * The media source manager is a standard interface for an object that controls
28
  * The media source manager is a standard interface for an object that controls
29
  * one or more media sources.
29
  * one or more media sources.
30
- * 
30
+ *
31
  * @author chris
31
  * @author chris
32
  */
32
  */
33
 public interface MediaSourceManager {
33
 public interface MediaSourceManager {
34
-    
34
+
35
     /**
35
     /**
36
      * Retrieves the sources that this manager manages.
36
      * Retrieves the sources that this manager manages.
37
-     * 
37
+     *
38
      * @return A list of sources that this manager manages
38
      * @return A list of sources that this manager manages
39
      */
39
      */
40
     List<MediaSource> getSources();
40
     List<MediaSource> getSources();
41
-    
41
+
42
 }
42
 }

+ 4
- 4
src/com/dmdirc/addons/nowplaying/NowPlayingSubsitutionPanel.java View File

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

+ 1
- 1
src/com/dmdirc/addons/osd/OsdManager.java View File

84
      * <p>
84
      * <p>
85
      * This method needs to be synchronised to ensure that the window list is
85
      * This method needs to be synchronised to ensure that the window list is
86
      * not modified in between the invocation of
86
      * not modified in between the invocation of
87
-     * {@link OsdPolicy#getYPosition(com.dmdirc.addons.osd.OsdManager, int)} 
87
+     * {@link OsdPolicy#getYPosition(com.dmdirc.addons.osd.OsdManager, int)}
88
      * and the point at which the {@link OsdWindow} is added to the windowList.
88
      * and the point at which the {@link OsdWindow} is added to the windowList.
89
      *
89
      *
90
      * @see OsdPolicy#getYPosition(com.dmdirc.addons.osd.OsdManager, int)
90
      * @see OsdPolicy#getYPosition(com.dmdirc.addons.osd.OsdManager, int)

+ 14
- 14
src/com/dmdirc/addons/osd/OsdPlugin.java View File

44
  */
44
  */
45
 public final class OsdPlugin extends Plugin implements CategoryChangeListener,
45
 public final class OsdPlugin extends Plugin implements CategoryChangeListener,
46
         PreferencesInterface, SettingChangeListener {
46
         PreferencesInterface, SettingChangeListener {
47
-    
47
+
48
     /** Config OSD Window. */
48
     /** Config OSD Window. */
49
     private OsdWindow osdWindow;
49
     private OsdWindow osdWindow;
50
-    
50
+
51
     /** OSD Command. */
51
     /** OSD Command. */
52
     private OsdCommand command;
52
     private OsdCommand command;
53
 
53
 
54
     /** The OSD Manager that this plugin is using. */
54
     /** The OSD Manager that this plugin is using. */
55
     private OsdManager osdManager;
55
     private OsdManager osdManager;
56
-    
56
+
57
     /** X-axis position of OSD. */
57
     /** X-axis position of OSD. */
58
     private int x;
58
     private int x;
59
-    
59
+
60
     /** Y-axis potion of OSD. */
60
     /** Y-axis potion of OSD. */
61
     private int y;
61
     private int y;
62
-    
62
+
63
     /** Setting objects with registered change listeners.*/
63
     /** Setting objects with registered change listeners.*/
64
     /**
64
     /**
65
      * Setting objects with registered change listeners.
65
      * Setting objects with registered change listeners.
75
         super();
75
         super();
76
         osdManager = new OsdManager(this);
76
         osdManager = new OsdManager(this);
77
     }
77
     }
78
-    
78
+
79
     /** {@inheritDoc} */
79
     /** {@inheritDoc} */
80
     @Override
80
     @Override
81
     public void onLoad() {
81
     public void onLoad() {
82
         command = new OsdCommand(osdManager);
82
         command = new OsdCommand(osdManager);
83
         CommandManager.registerCommand(command);
83
         CommandManager.registerCommand(command);
84
     }
84
     }
85
-    
85
+
86
     /** {@inheritDoc} */
86
     /** {@inheritDoc} */
87
     @Override
87
     @Override
88
     public void onUnload() {
88
     public void onUnload() {
94
     public void showConfig(final PreferencesDialogModel manager) {
94
     public void showConfig(final PreferencesDialogModel manager) {
95
         x = IdentityManager.getGlobalConfig().getOptionInt(getDomain(), "locationX");
95
         x = IdentityManager.getGlobalConfig().getOptionInt(getDomain(), "locationX");
96
         y = IdentityManager.getGlobalConfig().getOptionInt(getDomain(), "locationY");
96
         y = IdentityManager.getGlobalConfig().getOptionInt(getDomain(), "locationY");
97
-        
97
+
98
         final PreferencesCategory category = new PluginPreferencesCategory(
98
         final PreferencesCategory category = new PluginPreferencesCategory(
99
                 getPluginInfo(), "OSD",
99
                 getPluginInfo(), "OSD",
100
                 "General configuration for OSD plugin.", "category-osd");
100
                 "General configuration for OSD plugin.", "category-osd");
101
-        
101
+
102
         fontSizeSetting = new PreferencesSetting(PreferencesType.INTEGER,
102
         fontSizeSetting = new PreferencesSetting(PreferencesType.INTEGER,
103
                 getDomain(), "fontSize", "Font size", "Changes the font " +
103
                 getDomain(), "fontSize", "Font size", "Changes the font " +
104
                 "size of the OSD").registerChangeListener(this);
104
                 "size of the OSD").registerChangeListener(this);
119
                 new OptionalValidator(new NumericalValidator(1, Integer.MAX_VALUE)),
119
                 new OptionalValidator(new NumericalValidator(1, Integer.MAX_VALUE)),
120
                 getDomain(), "maxWindows", "Maximum open windows", "Maximum number of OSD " +
120
                 getDomain(), "maxWindows", "Maximum open windows", "Maximum number of OSD " +
121
                 "windows that will be displayed at any given time");
121
                 "windows that will be displayed at any given time");
122
-                
122
+
123
         category.addSetting(fontSizeSetting);
123
         category.addSetting(fontSizeSetting);
124
         category.addSetting(backgroundSetting);
124
         category.addSetting(backgroundSetting);
125
         category.addSetting(foregroundSetting);
125
         category.addSetting(foregroundSetting);
126
         category.addSetting(widthSetting);
126
         category.addSetting(widthSetting);
127
         category.addSetting(timeoutSetting);
127
         category.addSetting(timeoutSetting);
128
         category.addSetting(maxWindowsSetting);
128
         category.addSetting(maxWindowsSetting);
129
-        
129
+
130
         final Map<String, String> posOptions = new HashMap<String, String>();
130
         final Map<String, String> posOptions = new HashMap<String, String>();
131
 
131
 
132
         //Populate policy MULTICHOICE
132
         //Populate policy MULTICHOICE
133
         for (OsdPolicy policy : OsdPolicy.values()) {
133
         for (OsdPolicy policy : OsdPolicy.values()) {
134
             posOptions.put(policy.name(), policy.getDescription());
134
             posOptions.put(policy.name(), policy.getDescription());
135
         }
135
         }
136
-        
136
+
137
         category.addSetting(new PreferencesSetting(getDomain(), "newbehaviour",
137
         category.addSetting(new PreferencesSetting(getDomain(), "newbehaviour",
138
                 "New window policy", "What to do when an OSD Window "
138
                 "New window policy", "What to do when an OSD Window "
139
                 + "is opened when there are other, existing windows open", posOptions));
139
                 + "is opened when there are other, existing windows open", posOptions));
157
     public void categoryDeselected(final PreferencesCategory category) {
157
     public void categoryDeselected(final PreferencesCategory category) {
158
         x = osdWindow.getLocationOnScreen().x;
158
         x = osdWindow.getLocationOnScreen().x;
159
         y = osdWindow.getLocationOnScreen().y;
159
         y = osdWindow.getLocationOnScreen().y;
160
-        
160
+
161
         osdWindow.dispose();
161
         osdWindow.dispose();
162
         osdWindow = null;
162
         osdWindow = null;
163
     }
163
     }
177
             // Ignore the request.
177
             // Ignore the request.
178
             return;
178
             return;
179
         }
179
         }
180
-        
180
+
181
         if (setting.equals(fontSizeSetting)) {
181
         if (setting.equals(fontSizeSetting)) {
182
             osdWindow.setFontSize(Integer.parseInt(setting.getValue()));
182
             osdWindow.setFontSize(Integer.parseInt(setting.getValue()));
183
         } else if (setting.equals(backgroundSetting)) {
183
         } else if (setting.equals(backgroundSetting)) {

+ 1
- 1
src/com/dmdirc/addons/parser_twitter/Twitter.java View File

93
     private static final long PRUNE_COUNT = 20;
93
     private static final long PRUNE_COUNT = 20;
94
     /** Maximum age of items to leave in the status cache when pruning. */
94
     /** Maximum age of items to leave in the status cache when pruning. */
95
     private static final long PRUNE_TIME = 3600 * 1000;
95
     private static final long PRUNE_TIME = 3600 * 1000;
96
-    
96
+
97
     /** A map of this parser's implementations of common interfaces. */
97
     /** A map of this parser's implementations of common interfaces. */
98
     protected static final Map<Class<?>, Class<?>> IMPL_MAP = new HashMap<Class<?>, Class<?>>();
98
     protected static final Map<Class<?>, Class<?>> IMPL_MAP = new HashMap<Class<?>, Class<?>>();
99
 
99
 

+ 1
- 1
src/com/dmdirc/addons/parser_twitter/api/TwitterStatus.java View File

253
     /**
253
     /**
254
      * Is this equal to the given Status?
254
      * Is this equal to the given Status?
255
      * @param status
255
      * @param status
256
-     * @return 
256
+     * @return
257
      */
257
      */
258
     @Override
258
     @Override
259
     public boolean equals(final Object status) {
259
     public boolean equals(final Object status) {

+ 4
- 4
src/com/dmdirc/addons/parser_twitter/api/TwitterUser.java View File

71
     /**
71
     /**
72
      * Create a unknown TwitterUser
72
      * Create a unknown TwitterUser
73
      *
73
      *
74
-     * @param api 
74
+     * @param api
75
      * @param screenName Screen name for the user.
75
      * @param screenName Screen name for the user.
76
      */
76
      */
77
     protected TwitterUser(final TwitterAPI api, final String screenName) {
77
     protected TwitterUser(final TwitterAPI api, final String screenName) {
193
 
193
 
194
     /**
194
     /**
195
      * Get the id for this user.
195
      * Get the id for this user.
196
-     * 
196
+     *
197
      * @return this users id.
197
      * @return this users id.
198
      */
198
      */
199
     public long getID() {
199
     public long getID() {
202
 
202
 
203
     /**
203
     /**
204
      * Get the real name for this user.
204
      * Get the real name for this user.
205
-     * 
205
+     *
206
      * @return this users real name.
206
      * @return this users real name.
207
      */
207
      */
208
     public String getRealName() {
208
     public String getRealName() {
211
 
211
 
212
     /**
212
     /**
213
      * Are we following this user?
213
      * Are we following this user?
214
-     * 
214
+     *
215
      * @return True if we are following this user, else false.
215
      * @return True if we are following this user, else false.
216
      */
216
      */
217
     public boolean isFollowing() {
217
     public boolean isFollowing() {

+ 2
- 2
src/com/dmdirc/addons/parser_twitter/api/XMLResponse.java View File

130
 
130
 
131
     /**
131
     /**
132
      * Get the response code from the request.
132
      * Get the response code from the request.
133
-     * 
133
+     *
134
      * @return The response code, or 0 on error.
134
      * @return The response code, or 0 on error.
135
      */
135
      */
136
     public int getResponseCode() {
136
     public int getResponseCode() {
147
     /**
147
     /**
148
      * Checks to see if the response code was 200, the document is not null
148
      * Checks to see if the response code was 200, the document is not null
149
      * and no error element is in the document.
149
      * and no error element is in the document.
150
-     * 
150
+     *
151
      * @return true if the response code was 200, the document is not null
151
      * @return true if the response code was 200, the document is not null
152
      * and no error element is in the document.
152
      * and no error element is in the document.
153
      */
153
      */

+ 5
- 5
src/com/dmdirc/addons/parser_xmpp/XmppFakeChannel.java View File

129
     @Override
129
     @Override
130
     public ChannelClientInfo getChannelClient(final String client, final boolean create) {
130
     public ChannelClientInfo getChannelClient(final String client, final boolean create) {
131
         final String[] parts = getParser().parseHostmask(client);
131
         final String[] parts = getParser().parseHostmask(client);
132
-        
132
+
133
         if (create && getClient(parts[0]) == null) {
133
         if (create && getClient(parts[0]) == null) {
134
             return new XmppChannelClientInfo(this, getParser().getClient(client));
134
             return new XmppChannelClientInfo(this, getParser().getClient(client));
135
         }
135
         }
136
-        
136
+
137
         return getClient(parts[0]);
137
         return getClient(parts[0]);
138
     }
138
     }
139
-    
139
+
140
     /**
140
     /**
141
      * Updates this channel with the specified contacts.
141
      * Updates this channel with the specified contacts.
142
      *
142
      *
146
         for (XmppClientInfo client : clients) {
146
         for (XmppClientInfo client : clients) {
147
             addClient(client.getNickname(), new XmppChannelClientInfo(this, client));
147
             addClient(client.getNickname(), new XmppChannelClientInfo(this, client));
148
         }
148
         }
149
-        
149
+
150
         // TODO: Delete old contacts, don't needlessly create new objects
150
         // TODO: Delete old contacts, don't needlessly create new objects
151
-        
151
+
152
         getParser().getCallbackManager().getCallbackType(ChannelNamesListener.class).call(this);
152
         getParser().getCallbackManager().getCallbackType(ChannelNamesListener.class).call(this);
153
     }
153
     }
154
 
154
 

+ 2
- 2
src/com/dmdirc/addons/parser_xmpp/XmppPlugin.java View File

44
     public void onUnload() {
44
     public void onUnload() {
45
         // Do nothing
45
         // Do nothing
46
     }
46
     }
47
-    
47
+
48
     /**
48
     /**
49
      * Creates a new XMPP parser for the specified client info and address.
49
      * Creates a new XMPP parser for the specified client info and address.
50
      *
50
      *
55
     public Parser getParser(final MyInfo myInfo, final URI address) {
55
     public Parser getParser(final MyInfo myInfo, final URI address) {
56
         return new XmppParser(address);
56
         return new XmppParser(address);
57
     }
57
     }
58
-    
58
+
59
     /**
59
     /**
60
      * Retrieves an object describing the properties of the XMPP protocol.
60
      * Retrieves an object describing the properties of the XMPP protocol.
61
      *
61
      *

+ 4
- 4
src/com/dmdirc/addons/parserdebug/DebugPlugin.java View File

55
      * Creates a new instance of the Debug Plugin.
55
      * Creates a new instance of the Debug Plugin.
56
      */
56
      */
57
     public DebugPlugin() { super(); }
57
     public DebugPlugin() { super(); }
58
-    
58
+
59
     /** {@inheritDoc} */
59
     /** {@inheritDoc} */
60
     @Override
60
     @Override
61
     public void onLoad() {
61
     public void onLoad() {
64
         command = new ParserDebugCommand(this);
64
         command = new ParserDebugCommand(this);
65
         CommandManager.registerCommand(command);
65
         CommandManager.registerCommand(command);
66
     }
66
     }
67
-    
67
+
68
     /** {@inheritDoc} */
68
     /** {@inheritDoc} */
69
     @Override
69
     @Override
70
     public void onUnload() {
70
     public void onUnload() {
82
         }
82
         }
83
         registeredParsers.clear();
83
         registeredParsers.clear();
84
     }
84
     }
85
-    
85
+
86
     /** {@inheritDoc} */
86
     /** {@inheritDoc} */
87
     @Override
87
     @Override
88
     public void onDebugInfo(final Parser parser, final Date date, final int level, final String data) {
88
     public void onDebugInfo(final Parser parser, final Date date, final int level, final String data) {
91
             window.addLine(String.format("[%d] %s%n", level, data), true);
91
             window.addLine(String.format("[%d] %s%n", level, data), true);
92
         }
92
         }
93
     }
93
     }
94
-    
94
+
95
     /** {@inheritDoc} */
95
     /** {@inheritDoc} */
96
     @Override
96
     @Override
97
     public void processEvent(final ActionType type, final StringBuffer format, final Object... arguments) {
97
     public void processEvent(final ActionType type, final StringBuffer format, final Object... arguments) {

+ 5
- 5
src/com/dmdirc/addons/parserdebug/ParserDebugCommand.java View File

52
         super();
52
         super();
53
         myPlugin = plugin;
53
         myPlugin = plugin;
54
     }
54
     }
55
-    
55
+
56
     /** {@inheritDoc} */
56
     /** {@inheritDoc} */
57
     @Override
57
     @Override
58
     public CommandType getType() {
58
     public CommandType getType() {
69
     @Override
69
     @Override
70
     public void execute(final FrameContainer origin, final CommandArguments commandArgs, final CommandContext context) {
70
     public void execute(final FrameContainer origin, final CommandArguments commandArgs, final CommandContext context) {
71
         final boolean isSilent = commandArgs.isSilent();
71
         final boolean isSilent = commandArgs.isSilent();
72
-  
72
+
73
         Parser parser = ((ServerCommandContext) context).getServer().getParser();
73
         Parser parser = ((ServerCommandContext) context).getServer().getParser();
74
-        
74
+
75
         if (parser == null) {
75
         if (parser == null) {
76
             sendLine(origin, isSilent, FORMAT_ERROR, "Unable to get a parser for this window.");
76
             sendLine(origin, isSilent, FORMAT_ERROR, "Unable to get a parser for this window.");
77
             return;
77
             return;
110
      */
110
      */
111
     @Override
111
     @Override
112
     public String getName() { return "parserdebug"; }
112
     public String getName() { return "parserdebug"; }
113
-    
113
+
114
     /**
114
     /**
115
      * Returns whether or not this command should be shown in help messages.
115
      * Returns whether or not this command should be shown in help messages.
116
      *
116
      *
118
      */
118
      */
119
     @Override
119
     @Override
120
     public boolean showInHelp() { return true; }
120
     public boolean showInHelp() { return true; }
121
-    
121
+
122
     /**
122
     /**
123
      * Returns a string representing the help message for this command.
123
      * Returns a string representing the help message for this command.
124
      *
124
      *

+ 2
- 2
src/com/dmdirc/addons/redirect/FakeWriteableFrameContainer.java View File

37
  * chat window instead.
37
  * chat window instead.
38
  */
38
  */
39
 public class FakeWriteableFrameContainer extends WritableFrameContainer {
39
 public class FakeWriteableFrameContainer extends WritableFrameContainer {
40
-    
40
+
41
     /** The target for this window. */
41
     /** The target for this window. */
42
     private final MessageTarget target;
42
     private final MessageTarget target;
43
 
43
 
44
     /**
44
     /**
45
      * Creates a new instance of FakeInputWindow.
45
      * Creates a new instance of FakeInputWindow.
46
-     * 
46
+     *
47
      * @param target The message target that output gets sent to
47
      * @param target The message target that output gets sent to
48
      */
48
      */
49
     public FakeWriteableFrameContainer(final MessageTarget target) {
49
     public FakeWriteableFrameContainer(final MessageTarget target) {

+ 8
- 8
src/com/dmdirc/addons/redirect/RedirectPlugin.java View File

24
 
24
 
25
 import com.dmdirc.commandparser.CommandManager;
25
 import com.dmdirc.commandparser.CommandManager;
26
 import com.dmdirc.plugins.Plugin;
26
 import com.dmdirc.plugins.Plugin;
27
-    
27
+
28
 
28
 
29
 /**
29
 /**
30
  * The redirect plugin allows the suer to redirect the output of commands that
30
  * The redirect plugin allows the suer to redirect the output of commands that
31
  * would normally echo their results locally to a channel or chat window instead.
31
  * would normally echo their results locally to a channel or chat window instead.
32
- * 
32
+ *
33
  * @author chris
33
  * @author chris
34
  */
34
  */
35
 public final class RedirectPlugin extends Plugin {
35
 public final class RedirectPlugin extends Plugin {
36
-    
36
+
37
     private final RedirectCommand command;
37
     private final RedirectCommand command;
38
-    
38
+
39
     /** Creates a new system tray plugin. */
39
     /** Creates a new system tray plugin. */
40
     public RedirectPlugin() {
40
     public RedirectPlugin() {
41
         super();
41
         super();
42
-        
42
+
43
         command = new RedirectCommand();
43
         command = new RedirectCommand();
44
     }
44
     }
45
-    
45
+
46
     /** {@inheritDoc} */
46
     /** {@inheritDoc} */
47
     @Override
47
     @Override
48
     public void onLoad() {
48
     public void onLoad() {
49
         CommandManager.registerCommand(command);
49
         CommandManager.registerCommand(command);
50
     }
50
     }
51
-    
51
+
52
     /** {@inheritDoc}. */
52
     /** {@inheritDoc}. */
53
     @Override
53
     @Override
54
     public void onUnload() {
54
     public void onUnload() {
55
         CommandManager.unregisterCommand(command);
55
         CommandManager.unregisterCommand(command);
56
     }
56
     }
57
-    
57
+
58
 }
58
 }

+ 15
- 15
src/com/dmdirc/addons/scriptplugin/ScriptCommand.java View File

59
         super();
59
         super();
60
         myPlugin = plugin;
60
         myPlugin = plugin;
61
     }
61
     }
62
-        
62
+
63
     /** {@inheritDoc} */
63
     /** {@inheritDoc} */
64
     @Override
64
     @Override
65
     public void execute(final FrameContainer origin,
65
     public void execute(final FrameContainer origin,
66
             final CommandArguments args, final CommandContext context) {
66
             final CommandArguments args, final CommandContext context) {
67
         final String[] sargs = args.getArguments();
67
         final String[] sargs = args.getArguments();
68
-    
68
+
69
         if (sargs.length > 0 && (sargs[0].equalsIgnoreCase("rehash") || sargs[0].equalsIgnoreCase("reload"))) {
69
         if (sargs.length > 0 && (sargs[0].equalsIgnoreCase("rehash") || sargs[0].equalsIgnoreCase("reload"))) {
70
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Reloading scripts");
70
             sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Reloading scripts");
71
             myPlugin.rehash();
71
             myPlugin.rehash();
105
                     sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Result: "+wrapper.getScriptEngine().eval(script));
105
                     sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Result: "+wrapper.getScriptEngine().eval(script));
106
                 } catch (Exception e) {
106
                 } catch (Exception e) {
107
                     sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Exception: "+e+" -> "+e.getMessage());
107
                     sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Exception: "+e+" -> "+e.getMessage());
108
-                    
108
+
109
                     if (IdentityManager.getGlobalConfig().getOptionBool(myPlugin.getDomain(), "eval.showStackTrace")) {
109
                     if (IdentityManager.getGlobalConfig().getOptionBool(myPlugin.getDomain(), "eval.showStackTrace")) {
110
                         try {
110
                         try {
111
                             final Class<?> logger = Class.forName("com.dmdirc.logger.Logger");
111
                             final Class<?> logger = Class.forName("com.dmdirc.logger.Logger");
112
                             if (logger != null) {
112
                             if (logger != null) {
113
                                 final Method exceptionToStringArray = logger.getDeclaredMethod("exceptionToStringArray", new Class[]{Throwable.class});
113
                                 final Method exceptionToStringArray = logger.getDeclaredMethod("exceptionToStringArray", new Class[]{Throwable.class});
114
                                 exceptionToStringArray.setAccessible(true);
114
                                 exceptionToStringArray.setAccessible(true);
115
-                                
115
+
116
                                 final String[] stacktrace = (String[]) exceptionToStringArray.invoke(null, e);
116
                                 final String[] stacktrace = (String[]) exceptionToStringArray.invoke(null, e);
117
                                 for (String line : stacktrace) {
117
                                 for (String line : stacktrace) {
118
                                     sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Stack trace: "+line);
118
                                     sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Stack trace: "+line);
122
                             sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Stack trace: Exception showing stack trace: "+ex+" -> "+ex.getMessage());
122
                             sendLine(origin, args.isSilent(), FORMAT_OUTPUT, "Stack trace: Exception showing stack trace: "+ex+" -> "+ex.getMessage());
123
                         }
123
                         }
124
                     }
124
                     }
125
-                    
125
+
126
                 }
126
                 }
127
             } else {
127
             } else {
128
                 sendLine(origin, args.isSilent(), FORMAT_ERROR, "You must specify some script to eval.");
128
                 sendLine(origin, args.isSilent(), FORMAT_ERROR, "You must specify some script to eval.");
181
     public AdditionalTabTargets getSuggestions(final int arg,
181
     public AdditionalTabTargets getSuggestions(final int arg,
182
             final IntelligentCommandContext context) {
182
             final IntelligentCommandContext context) {
183
         final AdditionalTabTargets res = new AdditionalTabTargets();
183
         final AdditionalTabTargets res = new AdditionalTabTargets();
184
-        
184
+
185
         res.excludeAll();
185
         res.excludeAll();
186
         if (arg == 0) {
186
         if (arg == 0) {
187
             res.add("help");
187
             res.add("help");
203
                 }
203
                 }
204
             }
204
             }
205
         }
205
         }
206
-        
206
+
207
         return res;
207
         return res;
208
     }
208
     }
209
-    
209
+
210
     /**
210
     /**
211
      * Retrieves a list of all installed scripts.
211
      * Retrieves a list of all installed scripts.
212
      * Any file under the main plugin directory (~/.DMDirc/scripts or similar)
212
      * Any file under the main plugin directory (~/.DMDirc/scripts or similar)
216
      */
216
      */
217
     private List<String> getPossibleScripts() {
217
     private List<String> getPossibleScripts() {
218
         final List<String> res = new LinkedList<String>();
218
         final List<String> res = new LinkedList<String>();
219
-        
219
+
220
         final LinkedList<File> dirs = new LinkedList<File>();
220
         final LinkedList<File> dirs = new LinkedList<File>();
221
         dirs.add(new File(myPlugin.getScriptDir()));
221
         dirs.add(new File(myPlugin.getScriptDir()));
222
-        
222
+
223
         while (!dirs.isEmpty()) {
223
         while (!dirs.isEmpty()) {
224
             final File dir = dirs.pop();
224
             final File dir = dirs.pop();
225
             if (dir.isDirectory()) {
225
             if (dir.isDirectory()) {
236
 
236
 
237
     /** {@inheritDoc} */
237
     /** {@inheritDoc} */
238
     @Override
238
     @Override
239
-    public String getName() { 
239
+    public String getName() {
240
         return "script";
240
         return "script";
241
     }
241
     }
242
-    
242
+
243
     /** {@inheritDoc} */
243
     /** {@inheritDoc} */
244
     @Override
244
     @Override
245
-    public boolean showInHelp() { 
245
+    public boolean showInHelp() {
246
         return true;
246
         return true;
247
     }
247
     }
248
 
248
 
251
     public CommandType getType() {
251
     public CommandType getType() {
252
         return CommandType.TYPE_GLOBAL;
252
         return CommandType.TYPE_GLOBAL;
253
     }
253
     }
254
-    
254
+
255
     /** {@inheritDoc} */
255
     /** {@inheritDoc} */
256
     @Override
256
     @Override
257
-    public String getHelp() { 
257
+    public String getHelp() {
258
         return "script - Allows controlling the script plugin";
258
         return "script - Allows controlling the script plugin";
259
     }
259
     }
260
 }
260
 }

+ 13
- 13
src/com/dmdirc/addons/scriptplugin/ScriptEngineWrapper.java View File

45
 
45
 
46
     /** The File this script is from */
46
     /** The File this script is from */
47
     private final File file;
47
     private final File file;
48
-    
48
+
49
     /** Script-Local JS Helper */
49
     /** Script-Local JS Helper */
50
     private JavaScriptHelper localHelper = new JavaScriptHelper();
50
     private JavaScriptHelper localHelper = new JavaScriptHelper();
51
 
51
 
61
     protected ScriptEngineWrapper(final ScriptPlugin plugin, final String filename) throws FileNotFoundException, ScriptException {
61
     protected ScriptEngineWrapper(final ScriptPlugin plugin, final String filename) throws FileNotFoundException, ScriptException {
62
         this.plugin = plugin;
62
         this.plugin = plugin;
63
         file = (filename != null) ? new File(filename) : null;
63
         file = (filename != null) ? new File(filename) : null;
64
-        
64
+
65
         engine = createEngine();
65
         engine = createEngine();
66
-        
66
+
67
         callFunction("onLoad");
67
         callFunction("onLoad");
68
     }
68
     }
69
-    
69
+
70
     /**
70
     /**
71
      * Get a reference to the ScriptEngine.
71
      * Get a reference to the ScriptEngine.
72
      *
72
      *
73
      * @return a reference to the ScriptEngine
73
      * @return a reference to the ScriptEngine
74
      */
74
      */
75
     protected ScriptEngine getScriptEngine() { return engine; }
75
     protected ScriptEngine getScriptEngine() { return engine; }
76
-    
76
+
77
     /**
77
     /**
78
      * Get a reference to the JavaScriptHelper
78
      * Get a reference to the JavaScriptHelper
79
      *
79
      *
80
      * @return a reference to the JavaScriptHelper
80
      * @return a reference to the JavaScriptHelper
81
      */
81
      */
82
     protected JavaScriptHelper getJavaScriptHelper() { return localHelper; }
82
     protected JavaScriptHelper getJavaScriptHelper() { return localHelper; }
83
-    
83
+
84
     /**
84
     /**
85
      * Get the file for this script
85
      * Get the file for this script
86
      *
86
      *
87
      * @return The file for this script
87
      * @return The file for this script
88
      */
88
      */
89
     protected File getFile() { return file; }
89
     protected File getFile() { return file; }
90
-    
90
+
91
     /**
91
     /**
92
      * Create a new engine for this script
92
      * Create a new engine for this script
93
      */
93
      */
102
                 StreamUtil.close(fr);
102
                 StreamUtil.close(fr);
103
             }
103
             }
104
         }
104
         }
105
-        
105
+
106
         result.put("localHelper", localHelper);
106
         result.put("localHelper", localHelper);
107
         result.put("thisEngine", this);
107
         result.put("thisEngine", this);
108
-        
108
+
109
         return result;
109
         return result;
110
     }
110
     }
111
-    
111
+
112
     /**
112
     /**
113
      * Call a function in this script.
113
      * Call a function in this script.
114
      *
114
      *
128
             Logger.userError(ErrorLevel.LOW, "Error calling '"+functionName+"' in '"+file.getPath()+"': "+e.getMessage(), e);
128
             Logger.userError(ErrorLevel.LOW, "Error calling '"+functionName+"' in '"+file.getPath()+"': "+e.getMessage(), e);
129
         }
129
         }
130
     }
130
     }
131
-    
131
+
132
     /**
132
     /**
133
      * Try to reload this script.
133
      * Try to reload this script.
134
      */
134
      */
135
     protected boolean reload() {
135
     protected boolean reload() {
136
         // Tell the current engine that its about to be obliterated.
136
         // Tell the current engine that its about to be obliterated.
137
         callFunction("onPreRehash");
137
         callFunction("onPreRehash");
138
-        
138
+
139
         try {
139
         try {
140
             // Try making a new engine
140
             // Try making a new engine
141
             engine = createEngine();
141
             engine = createEngine();
147
             callFunction("onRehashFailed", e);
147
             callFunction("onRehashFailed", e);
148
             return false;
148
             return false;
149
         }
149
         }
150
-        
150
+
151
         return true;
151
         return true;
152
     }
152
     }
153
 }
153
 }

+ 3
- 3
src/com/dmdirc/addons/serverlists/ServerGroup.java View File

49
 
49
 
50
     /** A set of links relevant to this group (e.g. homepages). */
50
     /** A set of links relevant to this group (e.g. homepages). */
51
     private final Map<String, URI> links = new HashMap<String, URI>();
51
     private final Map<String, URI> links = new HashMap<String, URI>();
52
-    
52
+
53
     /** The items contained within the group. */
53
     /** The items contained within the group. */
54
     private final List<ServerGroupItem> entries = new ArrayList<ServerGroupItem>();
54
     private final List<ServerGroupItem> entries = new ArrayList<ServerGroupItem>();
55
 
55
 
134
 
134
 
135
     /**
135
     /**
136
      * Retrieves the description of this group.
136
      * Retrieves the description of this group.
137
-     * 
137
+     *
138
      * @return This group's description
138
      * @return This group's description
139
      */
139
      */
140
     public String getDescription() {
140
     public String getDescription() {
165
      * Retrieves a map of link titles to {@link URI}s which are associated
165
      * Retrieves a map of link titles to {@link URI}s which are associated
166
      * with this server group. Links will typically include network homepages,
166
      * with this server group. Links will typically include network homepages,
167
      * forums, or support channels.
167
      * forums, or support channels.
168
-     * 
168
+     *
169
      * @return An immutable map of links
169
      * @return An immutable map of links
170
      */
170
      */
171
     public Map<String, URI> getLinks() {
171
     public Map<String, URI> getLinks() {

+ 3
- 3
src/com/dmdirc/addons/systray/PopupCommand.java View File

35
  * @author chris
35
  * @author chris
36
  */
36
  */
37
 public final class PopupCommand extends Command implements CommandInfo {
37
 public final class PopupCommand extends Command implements CommandInfo {
38
-    
38
+
39
     /** The SystrayPlugin that we belong to. */
39
     /** The SystrayPlugin that we belong to. */
40
     private final SystrayPlugin parent;
40
     private final SystrayPlugin parent;
41
-    
41
+
42
     /**
42
     /**
43
      * Creates a new instance of PopupCommand.
43
      * Creates a new instance of PopupCommand.
44
      * @param newParent The plugin that this command belongs to
44
      * @param newParent The plugin that this command belongs to
45
      */
45
      */
46
     public PopupCommand(final SystrayPlugin newParent) {
46
     public PopupCommand(final SystrayPlugin newParent) {
47
         super();
47
         super();
48
-        
48
+
49
         this.parent = newParent;
49
         this.parent = newParent;
50
     }
50
     }
51
 
51
 

+ 12
- 12
src/com/dmdirc/addons/tabcompletion_bash/BashStyle.java View File

32
 import java.awt.Toolkit;
32
 import java.awt.Toolkit;
33
 
33
 
34
 public class BashStyle implements TabCompletionStyle {
34
 public class BashStyle implements TabCompletionStyle {
35
-    
35
+
36
     /** The last position the user tab-completed at. */
36
     /** The last position the user tab-completed at. */
37
     private int lastPosition = -1;
37
     private int lastPosition = -1;
38
-    
38
+
39
     /** The number of times the user has tab-completed the same position. */
39
     /** The number of times the user has tab-completed the same position. */
40
     private int tabCount = 0;
40
     private int tabCount = 0;
41
-    
41
+
42
     /** The last word that was tab completed. */
42
     /** The last word that was tab completed. */
43
     private String lastWord = "";
43
     private String lastWord = "";
44
 
44
 
58
         this.tabCompleter = completer;
58
         this.tabCompleter = completer;
59
         this.window = window;
59
         this.window = window;
60
     }
60
     }
61
-    
61
+
62
     /** {@inheritDoc} */
62
     /** {@inheritDoc} */
63
     @Override
63
     @Override
64
     public TabCompletionResult getResult(final String original, final int start,
64
     public TabCompletionResult getResult(final String original, final int start,
66
             final AdditionalTabTargets additional) {
66
             final AdditionalTabTargets additional) {
67
         final String word = original.substring(start, end);
67
         final String word = original.substring(start, end);
68
         final TabCompleterResult res = tabCompleter.complete(word, additional);
68
         final TabCompleterResult res = tabCompleter.complete(word, additional);
69
-        
69
+
70
         if (start == lastPosition && word.equals(lastWord)) {
70
         if (start == lastPosition && word.equals(lastWord)) {
71
             tabCount++;
71
             tabCount++;
72
         } else {
72
         } else {
74
             lastWord = word;
74
             lastWord = word;
75
             tabCount = 1;
75
             tabCount = 1;
76
         }
76
         }
77
-        
77
+
78
         if (res.getResultCount() == 0) {
78
         if (res.getResultCount() == 0) {
79
             Toolkit.getDefaultToolkit().beep();
79
             Toolkit.getDefaultToolkit().beep();
80
-            
80
+
81
             return null;
81
             return null;
82
         } else if (res.getResultCount() == 1) {
82
         } else if (res.getResultCount() == 1) {
83
             // One result, just replace it
83
             // One result, just replace it
84
-            
84
+
85
             final String result = res.getResults().get(0);
85
             final String result = res.getResults().get(0);
86
-            
86
+
87
             return new TabCompletionResult(
87
             return new TabCompletionResult(
88
                     original.substring(0, start) + result + original.substring(end),
88
                     original.substring(0, start) + result + original.substring(end),
89
                     start + result.length());
89
                     start + result.length());
90
         } else {
90
         } else {
91
             // Multiple results
91
             // Multiple results
92
-            
92
+
93
             final String sub = res.getBestSubstring();
93
             final String sub = res.getBestSubstring();
94
             if (sub.equalsIgnoreCase(word) && tabCount >= 2) {
94
             if (sub.equalsIgnoreCase(word) && tabCount >= 2) {
95
                 window.getContainer().addLine("tabCompletion", res.toString());
95
                 window.getContainer().addLine("tabCompletion", res.toString());
96
-                
96
+
97
                 return null;
97
                 return null;
98
             } else {
98
             } else {
99
                 return new TabCompletionResult(
99
                 return new TabCompletionResult(
102
             }
102
             }
103
         }
103
         }
104
     }
104
     }
105
-    
105
+
106
 }
106
 }

+ 3
- 3
src/com/dmdirc/addons/tabcompletion_bash/BashStylePlugin.java View File

28
 import com.dmdirc.ui.interfaces.InputWindow;
28
 import com.dmdirc.ui.interfaces.InputWindow;
29
 
29
 
30
 public class BashStylePlugin extends Plugin {
30
 public class BashStylePlugin extends Plugin {
31
-    
31
+
32
     /** {@inheritDoc} */
32
     /** {@inheritDoc} */
33
     @Override
33
     @Override
34
     public void onLoad() {
34
     public void onLoad() {
43
 
43
 
44
     /**
44
     /**
45
      * Retrieves a new instance of the Bash tab completion style.
45
      * Retrieves a new instance of the Bash tab completion style.
46
-     * 
46
+     *
47
      * @param completer The tab completer the instance is for
47
      * @param completer The tab completer the instance is for
48
      * @param window The window the instance is for
48
      * @param window The window the instance is for
49
      * @return A relevant TabCompletionStyle
49
      * @return A relevant TabCompletionStyle
52
             final InputWindow window) {
52
             final InputWindow window) {
53
         return new BashStyle(completer, window);
53
         return new BashStyle(completer, window);
54
     }
54
     }
55
-    
55
+
56
 }
56
 }

+ 7
- 7
src/com/dmdirc/addons/tabcompletion_mirc/MircStyle.java View File

34
 import java.util.Collections;
34
 import java.util.Collections;
35
 
35
 
36
 public class MircStyle implements TabCompletionStyle {
36
 public class MircStyle implements TabCompletionStyle {
37
-    
37
+
38
     /** The last word that was tab completed. */
38
     /** The last word that was tab completed. */
39
     private String lastWord;
39
     private String lastWord;
40
 
40
 
41
     /** The last string we tried to tab complete. */
41
     /** The last string we tried to tab complete. */
42
     private String tabString;
42
     private String tabString;
43
-    
43
+
44
     /** The tab completer that we use. */
44
     /** The tab completer that we use. */
45
     protected final TabCompleter tabCompleter;
45
     protected final TabCompleter tabCompleter;
46
 
46
 
57
         this.tabCompleter = completer;
57
         this.tabCompleter = completer;
58
         this.window = window;
58
         this.window = window;
59
     }
59
     }
60
-    
60
+
61
     /** {@inheritDoc} */
61
     /** {@inheritDoc} */
62
     @Override
62
     @Override
63
     public TabCompletionResult getResult(final String original, final int start,
63
     public TabCompletionResult getResult(final String original, final int start,
64
             final int end, final boolean shiftPressed,
64
             final int end, final boolean shiftPressed,
65
             final AdditionalTabTargets additional) {
65
             final AdditionalTabTargets additional) {
66
-        
66
+
67
         final String word = original.substring(start, end);
67
         final String word = original.substring(start, end);
68
         String target = "";
68
         String target = "";
69
         if (word.equals(lastWord)) {
69
         if (word.equals(lastWord)) {
76
         } else {
76
         } else {
77
             // New tab target
77
             // New tab target
78
             final TabCompleterResult res = tabCompleter.complete(word, additional);
78
             final TabCompleterResult res = tabCompleter.complete(word, additional);
79
-            
79
+
80
             if (res.getResultCount() == 0) {
80
             if (res.getResultCount() == 0) {
81
                 Toolkit.getDefaultToolkit().beep();
81
                 Toolkit.getDefaultToolkit().beep();
82
                 return null;
82
                 return null;
93
                 tabString = word;
93
                 tabString = word;
94
             }
94
             }
95
         }
95
         }
96
-        
96
+
97
         lastWord = target;
97
         lastWord = target;
98
-        
98
+
99
         return new TabCompletionResult(original.substring(0, start) + target
99
         return new TabCompletionResult(original.substring(0, start) + target
100
                 + original.substring(end), start + target.length());
100
                 + original.substring(end), start + target.length());
101
     }
101
     }

+ 2
- 2
src/com/dmdirc/addons/tabcompletion_mirc/MircStylePlugin.java View File

28
 import com.dmdirc.ui.interfaces.InputWindow;
28
 import com.dmdirc.ui.interfaces.InputWindow;
29
 
29
 
30
 public class MircStylePlugin extends Plugin {
30
 public class MircStylePlugin extends Plugin {
31
-    
31
+
32
     /** {@inheritDoc} */
32
     /** {@inheritDoc} */
33
     @Override
33
     @Override
34
     public void onLoad() {
34
     public void onLoad() {
52
             final InputWindow window) {
52
             final InputWindow window) {
53
         return new MircStyle(completer, window);
53
         return new MircStyle(completer, window);
54
     }
54
     }
55
-    
55
+
56
 }
56
 }

+ 5
- 5
src/com/dmdirc/addons/time/TimeActionMetaType.java View File

28
 
28
 
29
 /**
29
 /**
30
  * Encapsulates the meta types used by the various time actions.
30
  * Encapsulates the meta types used by the various time actions.
31
- * 
31
+ *
32
  * @author chris
32
  * @author chris
33
  */
33
  */
34
 public enum TimeActionMetaType implements ActionMetaType {
34
 public enum TimeActionMetaType implements ActionMetaType {
35
-    
35
+
36
     /** Time type. */
36
     /** Time type. */
37
     TIME_TIME {
37
     TIME_TIME {
38
         /** {@inheritDoc} */
38
         /** {@inheritDoc} */
45
         @Override
45
         @Override
46
         public String[] getArgNames() { return new String[]{"Date"}; }
46
         public String[] getArgNames() { return new String[]{"Date"}; }
47
     };
47
     };
48
-        
48
+
49
     /** {@inheritDoc} */
49
     /** {@inheritDoc} */
50
     @Override
50
     @Override
51
     public String getGroup() {
51
     public String getGroup() {
52
         return "Time Events";
52
         return "Time Events";
53
-    }    
54
-    
53
+    }
54
+
55
 }
55
 }

+ 6
- 6
src/com/dmdirc/addons/time/TimeActionType.java View File

30
  * @author chris
30
  * @author chris
31
  */
31
  */
32
 public enum TimeActionType implements ActionType {
32
 public enum TimeActionType implements ActionType {
33
-    
33
+
34
     /** Minute type. */
34
     /** Minute type. */
35
     TIME_MINUTE("Every minute"),
35
     TIME_MINUTE("Every minute"),
36
     /** Hour type. */
36
     /** Hour type. */
37
     TIME_HOUR("Every hour"),
37
     TIME_HOUR("Every hour"),
38
     /** Day type. */
38
     /** Day type. */
39
     TIME_DAY("Every day");
39
     TIME_DAY("Every day");
40
-    
40
+
41
     /** Action type name. */
41
     /** Action type name. */
42
     private final String name;
42
     private final String name;
43
-    
43
+
44
     /**
44
     /**
45
      * Creates a new instance of a TimeActionType.
45
      * Creates a new instance of a TimeActionType.
46
      * @param name The name of the action type
46
      * @param name The name of the action type
48
     TimeActionType(final String name) {
48
     TimeActionType(final String name) {
49
         this.name = name;
49
         this.name = name;
50
     }
50
     }
51
-    
51
+
52
     /** {@inheritDoc} */
52
     /** {@inheritDoc} */
53
     @Override
53
     @Override
54
     public ActionMetaType getType() {
54
     public ActionMetaType getType() {
55
         return TimeActionMetaType.TIME_TIME;
55
         return TimeActionMetaType.TIME_TIME;
56
     }
56
     }
57
-    
57
+
58
     /** {@inheritDoc} */
58
     /** {@inheritDoc} */
59
     @Override
59
     @Override
60
     public String getName() {
60
     public String getName() {
61
         return name;
61
         return name;
62
     }
62
     }
63
-    
63
+
64
 }
64
 }

+ 2
- 2
src/com/dmdirc/addons/ui_dummy/DummyChannelWindow.java View File

29
  */
29
  */
30
 public final class DummyChannelWindow extends DummyInputWindow {
30
 public final class DummyChannelWindow extends DummyInputWindow {
31
 
31
 
32
-    /** 
33
-     * Instantiates a new DummyChannelWindow. 
32
+    /**
33
+     * Instantiates a new DummyChannelWindow.
34
      *
34
      *
35
      * @param parent Parent channel
35
      * @param parent Parent channel
36
      */
36
      */

+ 4
- 4
src/com/dmdirc/addons/ui_dummy/DummyInputHandler.java View File

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

+ 2
- 2
src/com/dmdirc/addons/ui_dummy/DummyStatusBar.java View File

48
      */
48
      */
49
     @Deprecated
49
     @Deprecated
50
     @Override
50
     @Override
51
-    public void setMessage(final String newMessage, 
51
+    public void setMessage(final String newMessage,
52
             final StatusMessageNotifier newNotifier) {
52
             final StatusMessageNotifier newNotifier) {
53
         System.out.println("DummyStatusBar: " + newMessage);
53
         System.out.println("DummyStatusBar: " + newMessage);
54
     }
54
     }
59
      */
59
      */
60
     @Deprecated
60
     @Deprecated
61
     @Override
61
     @Override
62
-    public void setMessage(final String newMessage, 
62
+    public void setMessage(final String newMessage,
63
             final StatusMessageNotifier newNotifier, final int timeout) {
63
             final StatusMessageNotifier newNotifier, final int timeout) {
64
         System.out.println("DummyStatusBar: " + newMessage);
64
         System.out.println("DummyStatusBar: " + newMessage);
65
     }
65
     }

+ 4
- 4
src/com/dmdirc/addons/ui_swing/BackgroundOption.java View File

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

+ 1
- 1
src/com/dmdirc/addons/ui_swing/MainFrame.java View File

235
 
235
 
236
     /**
236
     /**
237
      * Gets the string which should be prefixed to this frame's title.
237
      * Gets the string which should be prefixed to this frame's title.
238
-     * 
238
+     *
239
      * @return This frame's title prefix
239
      * @return This frame's title prefix
240
      */
240
      */
241
     private String getTitlePrefix() {
241
     private String getTitlePrefix() {

+ 1
- 1
src/com/dmdirc/addons/ui_swing/SwingWindowFactory.java View File

42
 
42
 
43
 /**
43
 /**
44
  * Handles creation of windows in the Swing UI.
44
  * Handles creation of windows in the Swing UI.
45
- * 
45
+ *
46
  * @since 0.6.4
46
  * @since 0.6.4
47
  */
47
  */
48
 public class SwingWindowFactory implements FrameListener {
48
 public class SwingWindowFactory implements FrameListener {

+ 3
- 3
src/com/dmdirc/addons/ui_swing/SwingWindowListener.java View File

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

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/PackingTable.java View File

158
         if (!lastColumnFit) {
158
         if (!lastColumnFit) {
159
             checkNumCols--;
159
             checkNumCols--;
160
         }
160
         }
161
-        
161
+
162
         for (int i = 0; i < checkNumCols; i++) { //NOPMD I'm not copying
162
         for (int i = 0; i < checkNumCols; i++) { //NOPMD I'm not copying
163
             widths[i] = getWidth(i);
163
             widths[i] = getWidth(i);
164
             widthsTotal += widths[i];
164
             widthsTotal += widths[i];

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/SortedListModel.java View File

49
      */
49
      */
50
     public SortedListModel(final Comparator<T> comparator) {
50
     public SortedListModel(final Comparator<T> comparator) {
51
         super();
51
         super();
52
-        
52
+
53
         this.comparator = comparator;
53
         this.comparator = comparator;
54
     }
54
     }
55
 
55
 

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/URLProtocolPanel.java View File

251
             final JFileChooser fileChooser = new JFileChooser();
251
             final JFileChooser fileChooser = new JFileChooser();
252
             fileChooser.addChoosableFileFilter(new ExecutableFileFilter());
252
             fileChooser.addChoosableFileFilter(new ExecutableFileFilter());
253
             fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
253
             fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
254
-            if (fileChooser.showDialog(this, "Select") 
254
+            if (fileChooser.showDialog(this, "Select")
255
                     == JFileChooser.APPROVE_OPTION) {
255
                     == JFileChooser.APPROVE_OPTION) {
256
                 commandPath.setText(fileChooser.getSelectedFile().toString());
256
                 commandPath.setText(fileChooser.getSelectedFile().toString());
257
             }
257
             }

+ 6
- 6
src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonFilter.java View File

1
 /*
1
 /*
2
- * 
2
+ *
3
  * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
4
- * 
4
+ *
5
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * Permission is hereby granted, free of charge, to any person obtaining a copy
6
  * of this software and associated documentation files (the "Software"), to deal
6
  * of this software and associated documentation files (the "Software"), to deal
7
  * in the Software without restriction, including without limitation the rights
7
  * in the Software without restriction, including without limitation the rights
8
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
  * copies of the Software, and to permit persons to whom the Software is
9
  * copies of the Software, and to permit persons to whom the Software is
10
  * furnished to do so, subject to the following conditions:
10
  * furnished to do so, subject to the following conditions:
11
- * 
11
+ *
12
  * The above copyright notice and this permission notice shall be included in
12
  * The above copyright notice and this permission notice shall be included in
13
  * all copies or substantial portions of the Software.
13
  * all copies or substantial portions of the Software.
14
- * 
14
+ *
15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45
 
45
 
46
     /**
46
     /**
47
      * Creates a new addon filter.
47
      * Creates a new addon filter.
48
-     * 
48
+     *
49
      * @param verifiedBox
49
      * @param verifiedBox
50
      * @param unverifiedBox
50
      * @param unverifiedBox
51
      * @param installedBox
51
      * @param installedBox
61
             final ButtonModel themesBox, final ButtonModel actionsBox,
61
             final ButtonModel themesBox, final ButtonModel actionsBox,
62
             final JTextField searchBox) {
62
             final JTextField searchBox) {
63
         super();
63
         super();
64
-        
64
+
65
         this.verifiedBox = verifiedBox;
65
         this.verifiedBox = verifiedBox;
66
         this.unverifiedBox = unverifiedBox;
66
         this.unverifiedBox = unverifiedBox;
67
         this.installedBox = installedBox;
67
         this.installedBox = installedBox;

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfo.java View File

206
                 return true;
206
                 return true;
207
             }
207
             }
208
         }
208
         }
209
-        
209
+
210
         return false;
210
         return false;
211
     }
211
     }
212
 
212
 
221
 
221
 
222
     /**
222
     /**
223
      * Returns the download location for this addoninfo, or an empty string.
223
      * Returns the download location for this addoninfo, or an empty string.
224
-     * 
224
+     *
225
      * @return Download location or empty string
225
      * @return Download location or empty string
226
      */
226
      */
227
     @SuppressWarnings("fallthrough")
227
     @SuppressWarnings("fallthrough")

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfoCellEditor.java View File

56
 
56
 
57
             label.setBackground((row & 1) == 1 ? new Color(0xEE, 0xEE, 0xFF)
57
             label.setBackground((row & 1) == 1 ? new Color(0xEE, 0xEE, 0xFF)
58
                     : Color.WHITE);
58
                     : Color.WHITE);
59
-            
59
+
60
             table.setRowHeight(row, label.getPreferredSize().height);
60
             table.setRowHeight(row, label.getPreferredSize().height);
61
 
61
 
62
             return label;
62
             return label;

+ 4
- 4
src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfoCellRenderer.java View File

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

+ 5
- 5
src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonSorter.java View File

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

+ 4
- 4
src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonTable.java View File

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

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonType.java View File

37
     /** {@inheritDoc} */
37
     /** {@inheritDoc} */
38
     @Override
38
     @Override
39
     public String toString() {
39
     public String toString() {
40
-        return super.toString().charAt(5) 
40
+        return super.toString().charAt(5)
41
                 + super.toString().substring(6).toLowerCase().replace('_', ' ');
41
                 + super.toString().substring(6).toLowerCase().replace('_', ' ');
42
     }
42
     }
43
 }
43
 }

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/addonbrowser/DataLoaderWorker.java View File

40
 /**
40
 /**
41
  * Loads the addon data feed into the addon browser.
41
  * Loads the addon data feed into the addon browser.
42
  */
42
  */
43
-public class DataLoaderWorker 
43
+public class DataLoaderWorker
44
         extends LoggingSwingWorker<Collection<Map<String, String>>, Object> {
44
         extends LoggingSwingWorker<Collection<Map<String, String>>, Object> {
45
 
45
 
46
     /** List to load data into. */
46
     /** List to load data into. */
60
     public DataLoaderWorker(final AddonTable table,
60
     public DataLoaderWorker(final AddonTable table,
61
             final BrowserWindow browserWindow, final JScrollPane scrollPane) {
61
             final BrowserWindow browserWindow, final JScrollPane scrollPane) {
62
         super();
62
         super();
63
-        
63
+
64
         this.table = table;
64
         this.table = table;
65
         this.browserWindow = browserWindow;
65
         this.browserWindow = browserWindow;
66
         this.scrollPane = scrollPane;
66
         this.scrollPane = scrollPane;

+ 5
- 5
src/com/dmdirc/addons/ui_swing/components/addonbrowser/DownloaderWindow.java View File

27
  * Simple window to show download progress on addon feed.
27
  * Simple window to show download progress on addon feed.
28
  */
28
  */
29
 public class DownloaderWindow extends JDialog implements Runnable, DownloadListener {
29
 public class DownloaderWindow extends JDialog implements Runnable, DownloadListener {
30
-   
30
+
31
     /**
31
     /**
32
      * A version number for this class. It should be changed whenever the class
32
      * A version number for this class. It should be changed whenever the class
33
      * structure is changed (or anything else that would prevent serialized
33
      * structure is changed (or anything else that would prevent serialized
57
         CoreUIUtils.centreWindow(this);
57
         CoreUIUtils.centreWindow(this);
58
         setIconImage(IconManager.getIconManager().getImage("icon"));
58
         setIconImage(IconManager.getIconManager().getImage("icon"));
59
         setVisible(true);
59
         setVisible(true);
60
-        
60
+
61
         new Thread(this, "Addon downloader thread").start();
61
         new Thread(this, "Addon downloader thread").start();
62
     }
62
     }
63
 
63
 
65
     @Override
65
     @Override
66
     public void run() {
66
     public void run() {
67
         try {
67
         try {
68
-            Downloader.downloadPage("http://addons.dmdirc.com/feed", 
68
+            Downloader.downloadPage("http://addons.dmdirc.com/feed",
69
                     Main.getConfigDir() + File.separator + "addons.feed", this);
69
                     Main.getConfigDir() + File.separator + "addons.feed", this);
70
             UIUtilities.invokeLater(new Runnable() {
70
             UIUtilities.invokeLater(new Runnable() {
71
 
71
 
79
             removeAll();
79
             removeAll();
80
             add(new JLabel("Unable to download feed."));
80
             add(new JLabel("Unable to download feed."));
81
         }
81
         }
82
-        
82
+
83
         dispose();
83
         dispose();
84
     }
84
     }
85
-    
85
+
86
     /** {@inheritDoc} */
86
     /** {@inheritDoc} */
87
     @Override
87
     @Override
88
     public void downloadProgress(final float percent) {
88
     public void downloadProgress(final float percent) {

+ 3
- 3
src/com/dmdirc/addons/ui_swing/components/addonbrowser/InstallerWindow.java View File

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

+ 12
- 12
src/com/dmdirc/addons/ui_swing/components/colours/ColourChooser.java View File

73
     public ColourChooser() {
73
     public ColourChooser() {
74
         this("ffffff", true, true);
74
         this("ffffff", true, true);
75
     }
75
     }
76
-    
77
-    /** 
76
+
77
+    /**
78
      * Creates a new instance of ColourChooser.
78
      * Creates a new instance of ColourChooser.
79
-     * 
79
+     *
80
      * @param window Parent window
80
      * @param window Parent window
81
-     * 
81
+     *
82
      * @since 0.6
82
      * @since 0.6
83
      */
83
      */
84
     public ColourChooser(final Window window) {
84
     public ColourChooser(final Window window) {
85
         this("ffffff", true, true, window);
85
         this("ffffff", true, true, window);
86
     }
86
     }
87
-    
87
+
88
     /**
88
     /**
89
      * Creates a new instance of ColourChooser.
89
      * Creates a new instance of ColourChooser.
90
-     * 
90
+     *
91
      * @param initialColour Snitial colour
91
      * @param initialColour Snitial colour
92
      * @param ircColours Show irc colours
92
      * @param ircColours Show irc colours
93
      * @param hexColours Show hex colours
93
      * @param hexColours Show hex colours
99
 
99
 
100
     /**
100
     /**
101
      * Creates a new instance of ColourChooser.
101
      * Creates a new instance of ColourChooser.
102
-     * 
102
+     *
103
      * @param initialColour initial colour
103
      * @param initialColour initial colour
104
      * @param ircColours show irc colours
104
      * @param ircColours show irc colours
105
      * @param hexColours show hex colours
105
      * @param hexColours show hex colours
106
      * @param window Parent window
106
      * @param window Parent window
107
-     * 
107
+     *
108
      * @since 0.6
108
      * @since 0.6
109
      */
109
      */
110
     public ColourChooser(final String initialColour, final boolean ircColours,
110
     public ColourChooser(final String initialColour, final boolean ircColours,
178
         }
178
         }
179
     }
179
     }
180
 
180
 
181
-    /** 
181
+    /**
182
      * {@inheritDoc}.
182
      * {@inheritDoc}.
183
-     * 
183
+     *
184
      * @param e Action event
184
      * @param e Action event
185
      */
185
      */
186
     @Override
186
     @Override
242
             }
242
             }
243
         }
243
         }
244
     }
244
     }
245
-    
245
+
246
     /**
246
     /**
247
      * Sets the Parent window.
247
      * Sets the Parent window.
248
-     * 
248
+     *
249
      * @param window Parent window
249
      * @param window Parent window
250
      */
250
      */
251
     public void setWindow(final Window window) {
251
     public void setWindow(final Window window) {

+ 13
- 13
src/com/dmdirc/addons/ui_swing/components/colours/ColourPickerDialog.java View File

48
 
48
 
49
     /**
49
     /**
50
      * Creates a new instance of ColourPickerDialog.
50
      * Creates a new instance of ColourPickerDialog.
51
-     * 
52
-     * @since 0.6   
51
+     *
52
+     * @since 0.6
53
      */
53
      */
54
     public ColourPickerDialog() {
54
     public ColourPickerDialog() {
55
         this(true, true);
55
         this(true, true);
57
 
57
 
58
     /**
58
     /**
59
      * Creates a new instance of ColourPickerDialog.
59
      * Creates a new instance of ColourPickerDialog.
60
-     * 
60
+     *
61
      * @param window Parent window
61
      * @param window Parent window
62
-     * 
62
+     *
63
      * @since 0.6
63
      * @since 0.6
64
      */
64
      */
65
     public ColourPickerDialog(final Window window) {
65
     public ColourPickerDialog(final Window window) {
68
 
68
 
69
     /**
69
     /**
70
      * Creates a new instance of ColourPickerDialog.
70
      * Creates a new instance of ColourPickerDialog.
71
-     * 
71
+     *
72
      * @param showIRC show irc colours
72
      * @param showIRC show irc colours
73
      * @param showHex show hex colours
73
      * @param showHex show hex colours
74
      */
74
      */
79
 
79
 
80
     /**
80
     /**
81
      * Creates a new instance of ColourPickerDialog.
81
      * Creates a new instance of ColourPickerDialog.
82
-     * 
82
+     *
83
      * @param showIRC show irc colours
83
      * @param showIRC show irc colours
84
      * @param showHex show hex colours
84
      * @param showHex show hex colours
85
      * @param window Parent window
85
      * @param window Parent window
86
-     * 
86
+     *
87
      * @since 0.6
87
      * @since 0.6
88
      */
88
      */
89
     public ColourPickerDialog(final boolean showIRC, final boolean showHex,
89
     public ColourPickerDialog(final boolean showIRC, final boolean showHex,
100
         setWindow(window);
100
         setWindow(window);
101
     }
101
     }
102
 
102
 
103
-    /** 
104
-     * Creates and shows a new Colour picker dialog. 
103
+    /**
104
+     * Creates and shows a new Colour picker dialog.
105
      * @return Colour picker dialog
105
      * @return Colour picker dialog
106
      */
106
      */
107
     public static ColourPickerDialog showColourPicker() {
107
     public static ColourPickerDialog showColourPicker() {
108
         return showColourPicker(true, true);
108
         return showColourPicker(true, true);
109
     }
109
     }
110
 
110
 
111
-    /** 
112
-     * Creates and shows a new Colour picker dialog. 
111
+    /**
112
+     * Creates and shows a new Colour picker dialog.
113
      * @return Colour picker dialog
113
      * @return Colour picker dialog
114
      * @param showIRC show irc colours
114
      * @param showIRC show irc colours
115
      * @param showHex show hex colours
115
      * @param showHex show hex colours
121
         return cpd;
121
         return cpd;
122
     }
122
     }
123
 
123
 
124
-    /** 
124
+    /**
125
      * Adds an actions listener to this dialog.
125
      * Adds an actions listener to this dialog.
126
      *
126
      *
127
      * @param listener the listener to add
127
      * @param listener the listener to add
132
 
132
 
133
     /**
133
     /**
134
      * Sets the Parent window.
134
      * Sets the Parent window.
135
-     * 
135
+     *
136
      * @param window Parent window
136
      * @param window Parent window
137
      */
137
      */
138
     public void setWindow(final Window window) {
138
     public void setWindow(final Window window) {

+ 24
- 24
src/com/dmdirc/addons/ui_swing/components/colours/ColourPickerPanel.java View File

316
         repaint(previewRect);
316
         repaint(previewRect);
317
     }
317
     }
318
 
318
 
319
-    /** 
319
+    /**
320
      * {@inheritDoc}
320
      * {@inheritDoc}
321
-     * 
322
-     * @param e Mouse event 
321
+     *
322
+     * @param e Mouse event
323
      */
323
      */
324
     @Override
324
     @Override
325
     public void mouseClicked(final MouseEvent e) {
325
     public void mouseClicked(final MouseEvent e) {
326
     // Do nothing
326
     // Do nothing
327
     }
327
     }
328
 
328
 
329
-    /** 
329
+    /**
330
      * {@inheritDoc}
330
      * {@inheritDoc}
331
-     * 
332
-     * @param e Mouse event 
331
+     *
332
+     * @param e Mouse event
333
      */
333
      */
334
     @Override
334
     @Override
335
     public void mousePressed(final MouseEvent e) {
335
     public void mousePressed(final MouseEvent e) {
336
     // Do nothing
336
     // Do nothing
337
     }
337
     }
338
 
338
 
339
-    /** 
339
+    /**
340
      * {@inheritDoc}
340
      * {@inheritDoc}
341
-     * 
342
-     * @param e Mouse event 
341
+     *
342
+     * @param e Mouse event
343
      */
343
      */
344
     @Override
344
     @Override
345
     public void mouseReleased(final MouseEvent e) {
345
     public void mouseReleased(final MouseEvent e) {
369
         }
369
         }
370
     }
370
     }
371
 
371
 
372
-    /** 
372
+    /**
373
      * {@inheritDoc}
373
      * {@inheritDoc}
374
-     * 
375
-     * @param e Mouse event 
374
+     *
375
+     * @param e Mouse event
376
      */
376
      */
377
     @Override
377
     @Override
378
     public void mouseEntered(final MouseEvent e) {
378
     public void mouseEntered(final MouseEvent e) {
379
     // Do nothing
379
     // Do nothing
380
     }
380
     }
381
 
381
 
382
-    /** 
382
+    /**
383
      * {@inheritDoc}
383
      * {@inheritDoc}
384
-     * 
385
-     * @param e Mouse event 
384
+     *
385
+     * @param e Mouse event
386
      */
386
      */
387
     @Override
387
     @Override
388
     public void mouseExited(final MouseEvent e) {
388
     public void mouseExited(final MouseEvent e) {
389
     // Do nothing
389
     // Do nothing
390
     }
390
     }
391
 
391
 
392
-    /** 
392
+    /**
393
      * {@inheritDoc}
393
      * {@inheritDoc}
394
-     * 
395
-     * @param e Mouse event 
394
+     *
395
+     * @param e Mouse event
396
      */
396
      */
397
     @Override
397
     @Override
398
     public void mouseDragged(final MouseEvent e) {
398
     public void mouseDragged(final MouseEvent e) {
399
         mouseMotion(e);
399
         mouseMotion(e);
400
     }
400
     }
401
 
401
 
402
-    /** 
402
+    /**
403
      * {@inheritDoc}
403
      * {@inheritDoc}
404
-     * 
405
-     * @param e Mouse event 
404
+     *
405
+     * @param e Mouse event
406
      */
406
      */
407
     @Override
407
     @Override
408
     public void mouseMoved(final MouseEvent e) {
408
     public void mouseMoved(final MouseEvent e) {
409
         mouseMotion(e);
409
         mouseMotion(e);
410
     }
410
     }
411
 
411
 
412
-    /** 
412
+    /**
413
      * {@inheritDoc}
413
      * {@inheritDoc}
414
-     * 
415
-     * @param e Mouse event 
414
+     *
415
+     * @param e Mouse event
416
      */
416
      */
417
     @Override
417
     @Override
418
     public void mouseWheelMoved(final MouseWheelEvent e) {
418
     public void mouseWheelMoved(final MouseWheelEvent e) {

+ 13
- 13
src/com/dmdirc/addons/ui_swing/components/colours/OptionalColourChooser.java View File

74
     public OptionalColourChooser() {
74
     public OptionalColourChooser() {
75
         this("", false, true, true);
75
         this("", false, true, true);
76
     }
76
     }
77
-    
78
-    /** 
77
+
78
+    /**
79
      * Creates a new instance of ColourChooser.
79
      * Creates a new instance of ColourChooser.
80
-     * 
80
+     *
81
      * @param window Parent window
81
      * @param window Parent window
82
-     * 
82
+     *
83
      * @since 0.6
83
      * @since 0.6
84
      */
84
      */
85
     public OptionalColourChooser(final Window window) {
85
     public OptionalColourChooser(final Window window) {
86
         this("", false, true, true, window);
86
         this("", false, true, true, window);
87
     }
87
     }
88
-    
88
+
89
     /**
89
     /**
90
      * Creates a new instance of ColourChooser.
90
      * Creates a new instance of ColourChooser.
91
-     * 
91
+     *
92
      * @param initialColour Snitial colour
92
      * @param initialColour Snitial colour
93
      * @param initialState Initial state
93
      * @param initialState Initial state
94
      * @param ircColours Show irc colours
94
      * @param ircColours Show irc colours
102
 
102
 
103
     /**
103
     /**
104
      * Creates a new instance of ColourChooser.
104
      * Creates a new instance of ColourChooser.
105
-     * 
105
+     *
106
      * @param initialColour Snitial colour
106
      * @param initialColour Snitial colour
107
      * @param initialState Initial state
107
      * @param initialState Initial state
108
      * @param ircColours Show irc colours
108
      * @param ircColours Show irc colours
109
      * @param hexColours Show hex colours
109
      * @param hexColours Show hex colours
110
      * @param window Parent window
110
      * @param window Parent window
111
-     * 
111
+     *
112
      * @since 0.6
112
      * @since 0.6
113
      */
113
      */
114
     public OptionalColourChooser(final String initialColour,
114
     public OptionalColourChooser(final String initialColour,
188
         }
188
         }
189
     }
189
     }
190
 
190
 
191
-    /** 
191
+    /**
192
      * {@inheritDoc}.
192
      * {@inheritDoc}.
193
-     * 
193
+     *
194
      * @param e Action event
194
      * @param e Action event
195
      */
195
      */
196
     @Override
196
     @Override
213
     /**
213
     /**
214
      * Adds an action listener to this optional colour chooser. Action
214
      * Adds an action listener to this optional colour chooser. Action
215
      * listeners are notified whenever the state changes in some way.
215
      * listeners are notified whenever the state changes in some way.
216
-     * 
216
+     *
217
      * @param l The listener to be added
217
      * @param l The listener to be added
218
      */
218
      */
219
     public void addActionListener(final ActionListener l) {
219
     public void addActionListener(final ActionListener l) {
228
             listener.actionPerformed(new ActionEvent(this, 1, "stuffChanged"));
228
             listener.actionPerformed(new ActionEvent(this, 1, "stuffChanged"));
229
         }
229
         }
230
     }
230
     }
231
-    
231
+
232
     /**
232
     /**
233
      * Sets the Parent window.
233
      * Sets the Parent window.
234
-     * 
234
+     *
235
      * @param window Parent window
235
      * @param window Parent window
236
      */
236
      */
237
     public void setWindow(final Window window) {
237
     public void setWindow(final Window window) {

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/durationeditor/DurationDisplay.java View File

97
      */
97
      */
98
     public DurationDisplay(final Window window, final long duration) {
98
     public DurationDisplay(final Window window, final long duration) {
99
         super();
99
         super();
100
-        
100
+
101
         this.window = window;
101
         this.window = window;
102
         this.duration = (int) (duration / 1000);
102
         this.duration = (int) (duration / 1000);
103
         listeners = new ListenerList();
103
         listeners = new ListenerList();

+ 4
- 4
src/com/dmdirc/addons/ui_swing/components/durationeditor/DurationListener.java View File

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

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/expandingsettings/CurrentOptionsPanel.java View File

100
 
100
 
101
     /**
101
     /**
102
      * Adds an option to the current options pane.
102
      * Adds an option to the current options pane.
103
-     * 
103
+     *
104
      * @param configName config option name
104
      * @param configName config option name
105
      * @param displayName config option display name
105
      * @param displayName config option display name
106
      * @param panel parent panel
106
      * @param panel parent panel

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java View File

96
         ActionManager.getActionManager().registerListener(this,
96
         ActionManager.getActionManager().registerListener(this,
97
                 CoreActionType.CLIENT_CLOSING);
97
                 CoreActionType.CLIENT_CLOSING);
98
 
98
 
99
-        setInputHandler(new SwingInputHandler(getInputField(), 
99
+        setInputHandler(new SwingInputHandler(getInputField(),
100
                 owner.getCommandParser(), this));
100
                 owner.getCommandParser(), this));
101
 
101
 
102
         identity = IdentityManager.getChannelConfig(owner.getServer().
102
         identity = IdentityManager.getChannelConfig(owner.getServer().

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/frames/InputTextFrame.java View File

372
     public void configChanged(final String domain, final String key) {
372
     public void configChanged(final String domain, final String key) {
373
         super.configChanged(domain, key);
373
         super.configChanged(domain, key);
374
 
374
 
375
-        if ("ui".equals(domain) && getContainer().getConfigManager() != null 
375
+        if ("ui".equals(domain) && getContainer().getConfigManager() != null
376
                 && getInputField() != null && !UIUtilities.isGTKUI()) {
376
                 && getInputField() != null && !UIUtilities.isGTKUI()) {
377
             if ("inputbackgroundcolour".equals(key)
377
             if ("inputbackgroundcolour".equals(key)
378
                     || "backgroundcolour".equals(key)) {
378
                     || "backgroundcolour".equals(key)) {

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java View File

77
  */
77
  */
78
 public abstract class TextFrame extends JPanel implements Window,
78
 public abstract class TextFrame extends JPanel implements Window,
79
         ConfigChangeListener, TextPaneListener, FrameCloseListener {
79
         ConfigChangeListener, TextPaneListener, FrameCloseListener {
80
-    
80
+
81
     /**
81
     /**
82
      * A version number for this class. It should be changed whenever the class
82
      * A version number for this class. It should be changed whenever the class
83
      * structure is changed (or anything else that would prevent serialized
83
      * structure is changed (or anything else that would prevent serialized
483
             updateColours();
483
             updateColours();
484
         }
484
         }
485
     }
485
     }
486
-    
486
+
487
     /** {@inheritDoc} */
487
     /** {@inheritDoc} */
488
     @Override
488
     @Override
489
     public void windowClosing(final FrameContainer window) {
489
     public void windowClosing(final FrameContainer window) {

+ 8
- 8
src/com/dmdirc/addons/ui_swing/components/inputfields/TextAreaInputField.java View File

40
  */
40
  */
41
 public class TextAreaInputField extends JTextArea implements InputField,
41
 public class TextAreaInputField extends JTextArea implements InputField,
42
         PropertyChangeListener {
42
         PropertyChangeListener {
43
-    
43
+
44
     /**
44
     /**
45
      * A version number for this class. It should be changed whenever the class
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
46
      * structure is changed (or anything else that would prevent serialized
47
      * objects being unserialized with the new class).
47
      * objects being unserialized with the new class).
48
      */
48
      */
49
     private static final long serialVersionUID = 2;
49
     private static final long serialVersionUID = 2;
50
-    
50
+
51
     /** Colour picker. */
51
     /** Colour picker. */
52
-    protected ColourPickerDialog colourPicker;    
52
+    protected ColourPickerDialog colourPicker;
53
 
53
 
54
     /**
54
     /**
55
      * Creates a new text area with the specified number of rows and columns.
55
      * Creates a new text area with the specified number of rows and columns.
56
-     * 
56
+     *
57
      * @param rows The number of rows to use
57
      * @param rows The number of rows to use
58
      * @param columns The number of columns to use
58
      * @param columns The number of columns to use
59
      */
59
      */
65
 
65
 
66
     /**
66
     /**
67
      * Creates a new text area containing the specified text.
67
      * Creates a new text area containing the specified text.
68
-     * 
68
+     *
69
      * @param text The text to contain initially
69
      * @param text The text to contain initially
70
      */
70
      */
71
     public TextAreaInputField(final String text) {
71
     public TextAreaInputField(final String text) {
73
         KeyboardFocusManager.getCurrentKeyboardFocusManager()
73
         KeyboardFocusManager.getCurrentKeyboardFocusManager()
74
                 .addPropertyChangeListener(this);
74
                 .addPropertyChangeListener(this);
75
     }
75
     }
76
-    
76
+
77
     /** {@inheritDoc} */
77
     /** {@inheritDoc} */
78
     @Override
78
     @Override
79
     public void addActionListener(final ActionListener listener) {
79
     public void addActionListener(final ActionListener listener) {
81
     }
81
     }
82
 
82
 
83
     /** {@inheritDoc} */
83
     /** {@inheritDoc} */
84
-    @Override    
84
+    @Override
85
     public void removeActionListener(final ActionListener listener) {
85
     public void removeActionListener(final ActionListener listener) {
86
         // Ignore request - we don't handle returns for text areas
86
         // Ignore request - we don't handle returns for text areas
87
     }
87
     }
97
                 @Override
97
                 @Override
98
                 public void actionPerformed(final ActionEvent actionEvent) {
98
                 public void actionPerformed(final ActionEvent actionEvent) {
99
                     try {
99
                     try {
100
-                        getDocument().insertString(getCaretPosition(), 
100
+                        getDocument().insertString(getCaretPosition(),
101
                                 actionEvent.getActionCommand(), null);
101
                                 actionEvent.getActionCommand(), null);
102
                     } catch (BadLocationException ex) {
102
                     } catch (BadLocationException ex) {
103
                         //Ignore, wont happen
103
                         //Ignore, wont happen

+ 7
- 7
src/com/dmdirc/addons/ui_swing/components/renderers/ActionComparisonCellRenderer.java View File

33
  * Renders an action comparison in plain english.
33
  * Renders an action comparison in plain english.
34
  */
34
  */
35
 public final class ActionComparisonCellRenderer extends DefaultListCellRenderer {
35
 public final class ActionComparisonCellRenderer extends DefaultListCellRenderer {
36
-    
36
+
37
     /**
37
     /**
38
      * A version number for this class. It should be changed whenever the class
38
      * A version number for this class. It should be changed whenever the class
39
      * structure is changed (or anything else that would prevent serialized
39
      * structure is changed (or anything else that would prevent serialized
40
      * objects being unserialized with the new class).
40
      * objects being unserialized with the new class).
41
      */
41
      */
42
     private static final long serialVersionUID = 1;
42
     private static final long serialVersionUID = 1;
43
-    
43
+
44
     /** Creates a new instance of ActionComparisonCellRenderer. */
44
     /** Creates a new instance of ActionComparisonCellRenderer. */
45
     public ActionComparisonCellRenderer() {
45
     public ActionComparisonCellRenderer() {
46
         super();
46
         super();
47
     }
47
     }
48
-    
48
+
49
     /** {@inheritDoc} */
49
     /** {@inheritDoc} */
50
     @Override
50
     @Override
51
     public Component getListCellRendererComponent(final JList list,
51
     public Component getListCellRendererComponent(final JList list,
52
             final Object value, final int index, final boolean isSelected,
52
             final Object value, final int index, final boolean isSelected,
53
             final boolean cellHasFocus) {
53
             final boolean cellHasFocus) {
54
-        
54
+
55
         super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
55
         super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
56
-        
56
+
57
         if (value == null) {
57
         if (value == null) {
58
             setText("Any");
58
             setText("Any");
59
         } else {
59
         } else {
60
             setText(((ActionComparison) value).getName());
60
             setText(((ActionComparison) value).getName());
61
         }
61
         }
62
-        
62
+
63
         return this;
63
         return this;
64
     }
64
     }
65
-    
65
+
66
 }
66
 }

+ 8
- 8
src/com/dmdirc/addons/ui_swing/components/renderers/ActionConditionCellRenderer.java View File

31
  * Renders an action condition in plain english.
31
  * Renders an action condition in plain english.
32
  */
32
  */
33
 public final class ActionConditionCellRenderer extends DefaultTableCellRenderer {
33
 public final class ActionConditionCellRenderer extends DefaultTableCellRenderer {
34
-    
34
+
35
     /**
35
     /**
36
      * A version number for this class. It should be changed whenever the class
36
      * A version number for this class. It should be changed whenever the class
37
      * structure is changed (or anything else that would prevent serialized
37
      * structure is changed (or anything else that would prevent serialized
38
      * objects being unserialized with the new class).
38
      * objects being unserialized with the new class).
39
      */
39
      */
40
     private static final long serialVersionUID = 2;
40
     private static final long serialVersionUID = 2;
41
-    
41
+
42
     /** Creates a new instance of ActionConditionCellRenderer. */
42
     /** Creates a new instance of ActionConditionCellRenderer. */
43
     public ActionConditionCellRenderer() {
43
     public ActionConditionCellRenderer() {
44
         super();
44
         super();
45
     }
45
     }
46
-    
46
+
47
     /** {@inheritDoc} */
47
     /** {@inheritDoc} */
48
     @Override
48
     @Override
49
     public void setValue(final Object value) {
49
     public void setValue(final Object value) {
51
             setText("Any");
51
             setText("Any");
52
             return;
52
             return;
53
         }
53
         }
54
-        
54
+
55
         final ActionCondition condition = (ActionCondition) value;
55
         final ActionCondition condition = (ActionCondition) value;
56
-        
57
-        if (condition.getComparison() == CoreActionComparison.INT_EQUALS 
58
-                || condition.getComparison() == CoreActionComparison.INT_GREATER 
56
+
57
+        if (condition.getComparison() == CoreActionComparison.INT_EQUALS
58
+                || condition.getComparison() == CoreActionComparison.INT_GREATER
59
                 || condition.getComparison() == CoreActionComparison.INT_LESS) {
59
                 || condition.getComparison() == CoreActionComparison.INT_LESS) {
60
             setText(condition.getComparison().getName() + " " + condition.getTarget());
60
             setText(condition.getComparison().getName() + " " + condition.getTarget());
61
         } else {
61
         } else {
62
             setText(value.toString());
62
             setText(value.toString());
63
         }
63
         }
64
     }
64
     }
65
-    
65
+
66
 }
66
 }

+ 6
- 6
src/com/dmdirc/addons/ui_swing/components/renderers/ActionTypeRenderer.java View File

35
  * Displays actions types and headers in a pretty fashion.
35
  * Displays actions types and headers in a pretty fashion.
36
  */
36
  */
37
 public final class ActionTypeRenderer extends DefaultListCellRenderer {
37
 public final class ActionTypeRenderer extends DefaultListCellRenderer {
38
-    
38
+
39
     /**
39
     /**
40
      * A version number for this class. It should be changed whenever the class
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
41
      * structure is changed (or anything else that would prevent serialized
42
      * objects being unserialized with the new class).
42
      * objects being unserialized with the new class).
43
      */
43
      */
44
     private static final long serialVersionUID = 1;
44
     private static final long serialVersionUID = 1;
45
-    
45
+
46
     /**
46
     /**
47
      * Creates a new instance of ActionTypeRenderer.
47
      * Creates a new instance of ActionTypeRenderer.
48
      */
48
      */
49
     public ActionTypeRenderer() {
49
     public ActionTypeRenderer() {
50
         super();
50
         super();
51
     }
51
     }
52
-    
52
+
53
     /** {@inheritDoc} */
53
     /** {@inheritDoc} */
54
     @Override
54
     @Override
55
     public Component getListCellRendererComponent(final JList list,
55
     public Component getListCellRendererComponent(final JList list,
56
             final Object value, final int index, final boolean isSelected,
56
             final Object value, final int index, final boolean isSelected,
57
             final boolean cellHasFocus) {
57
             final boolean cellHasFocus) {
58
         super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
58
         super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
59
-        
59
+
60
         if (value == null) {
60
         if (value == null) {
61
             setText("");
61
             setText("");
62
         } else if (value instanceof String && !((String) value).isEmpty()) {
62
         } else if (value instanceof String && !((String) value).isEmpty()) {
68
         } else {
68
         } else {
69
             setText(value.toString());
69
             setText(value.toString());
70
         }
70
         }
71
-        
71
+
72
         return this;
72
         return this;
73
     }
73
     }
74
-    
74
+
75
 }
75
 }

+ 5
- 5
src/com/dmdirc/addons/ui_swing/components/renderers/ActionTypeTableCellRenderer.java View File

33
  * Displays actions types and headers in a pretty fashion.
33
  * Displays actions types and headers in a pretty fashion.
34
  */
34
  */
35
 public final class ActionTypeTableCellRenderer extends DefaultTableCellRenderer {
35
 public final class ActionTypeTableCellRenderer extends DefaultTableCellRenderer {
36
-    
36
+
37
     /**
37
     /**
38
      * A version number for this class. It should be changed whenever the class
38
      * A version number for this class. It should be changed whenever the class
39
      * structure is changed (or anything else that would prevent serialized
39
      * structure is changed (or anything else that would prevent serialized
40
      * objects being unserialized with the new class).
40
      * objects being unserialized with the new class).
41
      */
41
      */
42
     private static final long serialVersionUID = 1;
42
     private static final long serialVersionUID = 1;
43
-    
43
+
44
     /**
44
     /**
45
      * Creates a new instance of ActionTypeRenderer.
45
      * Creates a new instance of ActionTypeRenderer.
46
      */
46
      */
47
     public ActionTypeTableCellRenderer() {
47
     public ActionTypeTableCellRenderer() {
48
         super();
48
         super();
49
     }
49
     }
50
-    
50
+
51
     /** {@inheritDoc} */
51
     /** {@inheritDoc} */
52
     @Override
52
     @Override
53
-    public void setValue(final Object value) {        
53
+    public void setValue(final Object value) {
54
         if (value == null) {
54
         if (value == null) {
55
             setText("");
55
             setText("");
56
         } else if (value instanceof String && !((String) value).isEmpty()) {
56
         } else if (value instanceof String && !((String) value).isEmpty()) {
63
             setText(value.toString());
63
             setText(value.toString());
64
         }
64
         }
65
     }
65
     }
66
-    
66
+
67
 }
67
 }

+ 5
- 5
src/com/dmdirc/addons/ui_swing/components/renderers/AddOptionCellRenderer.java View File

35
  * Add option combo box cell renderer.
35
  * Add option combo box cell renderer.
36
  */
36
  */
37
 public final class AddOptionCellRenderer extends DefaultListCellRenderer {
37
 public final class AddOptionCellRenderer extends DefaultListCellRenderer {
38
-    
38
+
39
     /**
39
     /**
40
      * A version number for this class. It should be changed whenever the class
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
41
      * structure is changed (or anything else that would prevent serialized
52
      */
52
      */
53
     public AddOptionCellRenderer(final SettingsPanel settingsPanel) {
53
     public AddOptionCellRenderer(final SettingsPanel settingsPanel) {
54
         super();
54
         super();
55
-        
55
+
56
         this.settingsPanel = settingsPanel;
56
         this.settingsPanel = settingsPanel;
57
     }
57
     }
58
-    
58
+
59
     /** {@inheritDoc} */
59
     /** {@inheritDoc} */
60
     @Override
60
     @Override
61
     public Component getListCellRendererComponent(
61
     public Component getListCellRendererComponent(
63
             final Object value,
63
             final Object value,
64
             final int index,
64
             final int index,
65
             final boolean isSelected,
65
             final boolean isSelected,
66
-            final boolean cellHasFocus) {       
66
+            final boolean cellHasFocus) {
67
         super.getListCellRendererComponent(list, value, index, isSelected,
67
         super.getListCellRendererComponent(list, value, index, isSelected,
68
                 cellHasFocus);
68
                 cellHasFocus);
69
 
69
 
78
         } else {
78
         } else {
79
             setText(setting.getTitle());
79
             setText(setting.getTitle());
80
         }
80
         }
81
-        
81
+
82
         return this;
82
         return this;
83
     }
83
     }
84
 }
84
 }

+ 4
- 4
src/com/dmdirc/addons/ui_swing/components/renderers/ArrayCellRenderer.java View File

30
  * Renders an array as an inline string.
30
  * Renders an array as an inline string.
31
  */
31
  */
32
 public final class ArrayCellRenderer extends DefaultTableCellRenderer {
32
 public final class ArrayCellRenderer extends DefaultTableCellRenderer {
33
-    
33
+
34
     /**
34
     /**
35
      * A version number for this class. It should be changed whenever the class
35
      * A version number for this class. It should be changed whenever the class
36
      * structure is changed (or anything else that would prevent serialized
36
      * structure is changed (or anything else that would prevent serialized
37
      * objects being unserialized with the new class).
37
      * objects being unserialized with the new class).
38
      */
38
      */
39
     private static final long serialVersionUID = 1;
39
     private static final long serialVersionUID = 1;
40
-    
40
+
41
     /** Creates a new instance of ArrayCellRenderer. */
41
     /** Creates a new instance of ArrayCellRenderer. */
42
     public ArrayCellRenderer() {
42
     public ArrayCellRenderer() {
43
         super();
43
         super();
44
     }
44
     }
45
-    
45
+
46
     /** {@inheritDoc} */
46
     /** {@inheritDoc} */
47
     @Override
47
     @Override
48
     public void setValue(final Object value) {
48
     public void setValue(final Object value) {
49
         final String response = Arrays.toString((String[]) value);
49
         final String response = Arrays.toString((String[]) value);
50
         setText(response.substring(1, response.length() - 1));
50
         setText(response.substring(1, response.length() - 1));
51
     }
51
     }
52
-    
52
+
53
 }
53
 }

+ 3
- 3
src/com/dmdirc/addons/ui_swing/components/renderers/CertificateChainEntryCellRenderer.java View File

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

+ 8
- 8
src/com/dmdirc/addons/ui_swing/components/renderers/DateCellRenderer.java View File

30
  * List cell renderer for dates.
30
  * List cell renderer for dates.
31
  */
31
  */
32
 public final class DateCellRenderer extends DefaultTableCellRenderer {
32
 public final class DateCellRenderer extends DefaultTableCellRenderer {
33
-    
33
+
34
     /**
34
     /**
35
      * A version number for this class. It should be changed whenever the class
35
      * A version number for this class. It should be changed whenever the class
36
      * structure is changed (or anything else that would prevent serialized
36
      * structure is changed (or anything else that would prevent serialized
37
      * objects being unserialized with the new class).
37
      * objects being unserialized with the new class).
38
      */
38
      */
39
     private static final long serialVersionUID = 1;
39
     private static final long serialVersionUID = 1;
40
-    
40
+
41
     /** Creates a new instance of DateCellRenderer. */
41
     /** Creates a new instance of DateCellRenderer. */
42
     public DateCellRenderer() {
42
     public DateCellRenderer() {
43
         super();
43
         super();
44
     }
44
     }
45
-    
45
+
46
     /** {@inheritDoc} */
46
     /** {@inheritDoc} */
47
     @Override
47
     @Override
48
     public void setValue(final Object value) {
48
     public void setValue(final Object value) {
49
         setText("" + duration((new Date().getTime() - ((Date) value).getTime()) / 1000));
49
         setText("" + duration((new Date().getTime() - ((Date) value).getTime()) / 1000));
50
     }
50
     }
51
-    
51
+
52
     /**
52
     /**
53
      * Get the duration in seconds as a string.
53
      * Get the duration in seconds as a string.
54
      *
54
      *
61
         final long hours = secondsInput / 3600;
61
         final long hours = secondsInput / 3600;
62
         final long minutes = secondsInput / 60 % 60;
62
         final long minutes = secondsInput / 60 % 60;
63
         //final long seconds = secondsInput % 60;
63
         //final long seconds = secondsInput % 60;
64
-        
65
-        if (hours > 0) { 
64
+
65
+        if (hours > 0) {
66
             result.append(hours).append("h ");
66
             result.append(hours).append("h ");
67
         }
67
         }
68
-        
68
+
69
         result.append(minutes).append("m");
69
         result.append(minutes).append("m");
70
-        
70
+
71
         return result.toString();
71
         return result.toString();
72
     }
72
     }
73
 }
73
 }

+ 3
- 3
src/com/dmdirc/addons/ui_swing/components/renderers/ErrorLevelIconCellRenderer.java View File

31
 
31
 
32
 /** List cell renderer for dates. */
32
 /** List cell renderer for dates. */
33
 public final class ErrorLevelIconCellRenderer extends DefaultTableCellRenderer {
33
 public final class ErrorLevelIconCellRenderer extends DefaultTableCellRenderer {
34
-    
34
+
35
     /**
35
     /**
36
      * A version number for this class. It should be changed whenever the class
36
      * A version number for this class. It should be changed whenever the class
37
      * structure is changed (or anything else that would prevent serialized
37
      * structure is changed (or anything else that would prevent serialized
38
      * objects being unserialized with the new class).
38
      * objects being unserialized with the new class).
39
      */
39
      */
40
     private static final long serialVersionUID = 1;
40
     private static final long serialVersionUID = 1;
41
-    
41
+
42
     /** Creates a new instance of ErrorLevelIconCellRenderer. */
42
     /** Creates a new instance of ErrorLevelIconCellRenderer. */
43
     public ErrorLevelIconCellRenderer() {
43
     public ErrorLevelIconCellRenderer() {
44
         super();
44
         super();
45
     }
45
     }
46
-    
46
+
47
     /** {@inheritDoc} */
47
     /** {@inheritDoc} */
48
     @Override
48
     @Override
49
     public void setValue(final Object value) {
49
     public void setValue(final Object value) {

+ 7
- 7
src/com/dmdirc/addons/ui_swing/components/renderers/ExtendedListModeCellRenderer.java View File

1
 /*
1
 /*
2
  * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
  * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
6
  * in the Software without restriction, including without limitation the rights
6
  * in the Software without restriction, including without limitation the rights
7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
  * copies of the Software, and to permit persons to whom the Software is
8
  * copies of the Software, and to permit persons to whom the Software is
9
  * furnished to do so, subject to the following conditions:
9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11
  * The above copyright notice and this permission notice shall be included in
11
  * The above copyright notice and this permission notice shall be included in
12
  * all copies or substantial portions of the Software.
12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
53
             final Object value, final int index, final boolean isSelected,
53
             final Object value, final int index, final boolean isSelected,
54
             final boolean cellHasFocus) {
54
             final boolean cellHasFocus) {
55
         final ChannelListModeItem listMode = (ChannelListModeItem) value;
55
         final ChannelListModeItem listMode = (ChannelListModeItem) value;
56
-        
56
+
57
         removeAll();
57
         removeAll();
58
         setLayout(new MigLayout("fill, ins 0"));
58
         setLayout(new MigLayout("fill, ins 0"));
59
-        
59
+
60
         if (isSelected) {
60
         if (isSelected) {
61
             setBackground(list.getSelectionBackground());
61
             setBackground(list.getSelectionBackground());
62
         } else {
62
         } else {
63
             setBackground(list.getBackground());
63
             setBackground(list.getBackground());
64
         }
64
         }
65
-        
65
+
66
         add(new JLabel(listMode.getItem()), "split 2, growx, pushx, gapleft 3");
66
         add(new JLabel(listMode.getItem()), "split 2, growx, pushx, gapleft 3");
67
         add(new JLabel(new Date(listMode.getTime() * 1000).toString()),
67
         add(new JLabel(new Date(listMode.getTime() * 1000).toString()),
68
                 "right, wrap, gapright 3");
68
                 "right, wrap, gapright 3");
69
         add(new JLabel(listMode.getOwner()), "growx, pushx, wrap, gapleft 3");
69
         add(new JLabel(listMode.getOwner()), "growx, pushx, wrap, gapleft 3");
70
         add(new JSeparator(), "growx, pushx");
70
         add(new JSeparator(), "growx, pushx");
71
-        
71
+
72
         return this;
72
         return this;
73
     }
73
     }
74
 }
74
 }

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/renderers/FontListCellRenderer.java View File

23
 
23
 
24
 import java.awt.Component;
24
 import java.awt.Component;
25
 import java.awt.Font;
25
 import java.awt.Font;
26
-    
26
+
27
 import javax.swing.DefaultListCellRenderer;
27
 import javax.swing.DefaultListCellRenderer;
28
 import javax.swing.JList;
28
 import javax.swing.JList;
29
 
29
 

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/renderers/ListModeCellRenderer.java View File

50
             final Object value, final int index, final boolean isSelected,
50
             final Object value, final int index, final boolean isSelected,
51
             final boolean cellHasFocus) {
51
             final boolean cellHasFocus) {
52
         super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
52
         super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
53
-        
53
+
54
         if (value == null) {
54
         if (value == null) {
55
             setText("");
55
             setText("");
56
         } else if (value instanceof ChannelListModeItem) {
56
         } else if (value instanceof ChannelListModeItem) {
58
         } else {
58
         } else {
59
             setText(value.toString());
59
             setText(value.toString());
60
         }
60
         }
61
-        
61
+
62
         return this;
62
         return this;
63
     }
63
     }
64
 }
64
 }

+ 3
- 3
src/com/dmdirc/addons/ui_swing/components/renderers/TopicCellRenderer.java View File

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

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/renderers/URIHandlerCellRenderer.java View File

70
         } else {
70
         } else {
71
             handler = "Custom command: " + handler;
71
             handler = "Custom command: " + handler;
72
         }
72
         }
73
-        
73
+
74
         setValue(handler);
74
         setValue(handler);
75
 
75
 
76
         return this;
76
         return this;

+ 5
- 5
src/com/dmdirc/addons/ui_swing/components/renderers/UpdateComponentTableCellRenderer.java View File

1
 /*
1
 /*
2
  * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
  * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
6
  * in the Software without restriction, including without limitation the rights
6
  * in the Software without restriction, including without limitation the rights
7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
  * copies of the Software, and to permit persons to whom the Software is
8
  * copies of the Software, and to permit persons to whom the Software is
9
  * furnished to do so, subject to the following conditions:
9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11
  * The above copyright notice and this permission notice shall be included in
11
  * The above copyright notice and this permission notice shall be included in
12
  * all copies or substantial portions of the Software.
12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
47
             final Object value, final boolean isSelected,
47
             final Object value, final boolean isSelected,
48
             final boolean hasFocus, final int row, final int column) {
48
             final boolean hasFocus, final int row, final int column) {
49
         super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
49
         super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
50
-        
50
+
51
         if (value == null) {
51
         if (value == null) {
52
             setValue("Unknown");
52
             setValue("Unknown");
53
         } else if (value instanceof UpdateComponent) {
53
         } else if (value instanceof UpdateComponent) {
55
         } else {
55
         } else {
56
             setValue(value.toString());
56
             setValue(value.toString());
57
         }
57
         }
58
-        
58
+
59
         return this;
59
         return this;
60
     }
60
     }
61
 }
61
 }

+ 0
- 0
src/com/dmdirc/addons/ui_swing/components/renderers/UpdateStatusTableCellRenderer.java View File


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

Loading…
Cancel
Save