Просмотр исходного кода

Style fixes

Change-Id: Idfb8db25bbc7d0d9ba8f7233f2fa59b4e6c44924
Reviewed-on: http://gerrit.dmdirc.com/1333
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4
Chris Smith 14 лет назад
Родитель
Сommit
430711e424
65 измененных файлов: 923 добавлений и 948 удалений
  1. 1
    2
      src/com/dmdirc/addons/calc/TokenType.java
  2. 35
    35
      src/com/dmdirc/addons/freedesktop_notifications/commons/Entities.java
  3. 2
    2
      src/com/dmdirc/addons/freedesktop_notifications/commons/StringEscapeUtils.java
  4. 2
    2
      src/com/dmdirc/addons/logging/LoggingPlugin.java
  5. 28
    28
      src/com/dmdirc/addons/nickcolours/NickColourInputDialog.java
  6. 1
    1
      src/com/dmdirc/addons/nickcolours/NickColourPlugin.java
  7. 18
    18
      src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java
  8. 36
    36
      src/com/dmdirc/addons/nowplaying/NowPlayingPlugin.java
  9. 35
    35
      src/com/dmdirc/addons/osd/OsdWindow.java
  10. 28
    50
      src/com/dmdirc/addons/parser_twitter/Twitter.java
  11. 1
    1
      src/com/dmdirc/addons/parser_twitter/TwitterChannelClientInfo.java
  12. 1
    1
      src/com/dmdirc/addons/parser_twitter/TwitterChannelInfo.java
  13. 1
    1
      src/com/dmdirc/addons/parser_twitter/TwitterPlugin.java
  14. 6
    6
      src/com/dmdirc/addons/parser_twitter/api/TwitterAPI.java
  15. 1
    1
      src/com/dmdirc/addons/parser_twitter/api/TwitterMessage.java
  16. 1
    1
      src/com/dmdirc/addons/parser_twitter/api/TwitterStatus.java
  17. 4
    4
      src/com/dmdirc/addons/parser_twitter/api/commons/Entities.java
  18. 2
    2
      src/com/dmdirc/addons/parser_twitter/api/commons/StringEscapeUtils.java
  19. 3
    3
      src/com/dmdirc/addons/parserdebug/DebugPlugin.java
  20. 2
    3
      src/com/dmdirc/addons/parserdebug/ParserDebugCommand.java
  21. 8
    8
      src/com/dmdirc/addons/relaybot/RelayBotPlugin.java
  22. 3
    3
      src/com/dmdirc/addons/relaybot/RelayChannelHandler.java
  23. 1
    1
      src/com/dmdirc/addons/relaybot/RelayClientInfo.java
  24. 2
    2
      src/com/dmdirc/addons/scriptplugin/JavaScriptHelper.java
  25. 31
    31
      src/com/dmdirc/addons/scriptplugin/TypedProperties.java
  26. 36
    36
      src/com/dmdirc/addons/systray/SystrayPlugin.java
  27. 25
    25
      src/com/dmdirc/addons/ui_dummy/DummyInputWindow.java
  28. 10
    10
      src/com/dmdirc/addons/ui_dummy/DummyMainWindow.java
  29. 13
    13
      src/com/dmdirc/addons/ui_swing/UIUtilities.java
  30. 22
    22
      src/com/dmdirc/addons/ui_swing/actions/CopyAction.java
  31. 22
    22
      src/com/dmdirc/addons/ui_swing/actions/CutAction.java
  32. 1
    1
      src/com/dmdirc/addons/ui_swing/components/MenuScroller.java
  33. 19
    19
      src/com/dmdirc/addons/ui_swing/components/NicklistListModel.java
  34. 44
    44
      src/com/dmdirc/addons/ui_swing/components/SplitPane.java
  35. 12
    12
      src/com/dmdirc/addons/ui_swing/components/SwingInputField.java
  36. 1
    1
      src/com/dmdirc/addons/ui_swing/components/TopicBar.java
  37. 1
    1
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfo.java
  38. 4
    5
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfoCellEditor.java
  39. 1
    1
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfoCellRenderer.java
  40. 2
    2
      src/com/dmdirc/addons/ui_swing/components/addonbrowser/BrowserWindow.java
  41. 17
    17
      src/com/dmdirc/addons/ui_swing/components/durationeditor/DurationDisplay.java
  42. 27
    27
      src/com/dmdirc/addons/ui_swing/components/expandingsettings/AddOptionPanel.java
  43. 30
    30
      src/com/dmdirc/addons/ui_swing/components/expandingsettings/CurrentOptionsPanel.java
  44. 6
    6
      src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java
  45. 6
    6
      src/com/dmdirc/addons/ui_swing/components/renderers/ActionSubstititionRenderer.java
  46. 13
    13
      src/com/dmdirc/addons/ui_swing/components/renderers/AddonCellRenderer.java
  47. 11
    11
      src/com/dmdirc/addons/ui_swing/components/renderers/ReorderableJListCellRenderer.java
  48. 6
    6
      src/com/dmdirc/addons/ui_swing/components/reorderablelist/ListReorderButtonPanel.java
  49. 35
    35
      src/com/dmdirc/addons/ui_swing/components/reorderablelist/ReorderableJList.java
  50. 22
    22
      src/com/dmdirc/addons/ui_swing/components/substitutions/SubstitutionLabel.java
  51. 13
    13
      src/com/dmdirc/addons/ui_swing/components/substitutions/SubstitutionsPanel.java
  52. 46
    46
      src/com/dmdirc/addons/ui_swing/components/validating/ValidatingJTextField.java
  53. 9
    9
      src/com/dmdirc/addons/ui_swing/dialogs/about/AboutDialog.java
  54. 17
    17
      src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionTypeModel.java
  55. 1
    1
      src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/StringTransferable.java
  56. 1
    1
      src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicHistoryPane.java
  57. 1
    1
      src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicLabel.java
  58. 31
    31
      src/com/dmdirc/addons/ui_swing/dialogs/error/ErrorDetailPanel.java
  59. 2
    2
      src/com/dmdirc/addons/ui_swing/framemanager/buttonbar/ButtonBar.java
  60. 37
    37
      src/com/dmdirc/addons/ui_swing/wizard/StepLayout.java
  61. 7
    7
      src/com/dmdirc/addons/ui_swing/wizard/firstrun/MigrationExtrationStep.java
  62. 12
    12
      src/com/dmdirc/addons/ui_web/Client.java
  63. 37
    37
      src/com/dmdirc/addons/ui_web/uicomponents/WebWindow.java
  64. 30
    30
      test/com/dmdirc/addons/identd/IdentClientTest.java
  65. 40
    40
      test/com/dmdirc/addons/ui_swing/components/reorderablelist/ArrayListTransferHandlerTest.java

+ 1
- 2
src/com/dmdirc/addons/calc/TokenType.java Просмотреть файл

@@ -139,8 +139,7 @@ public enum TokenType {
139 139
             return new Float(Math.pow(token.getChildren().get(0).evaluate().doubleValue(),
140 140
                     token.getChildren().get(1).evaluate().doubleValue()));
141 141
         }
142
-    },
143
-    ;
142
+    };
144 143
 
145 144
     /** The string representation of tokens that may follow this one. */
146 145
     private final String[] strfollows;

+ 35
- 35
src/com/dmdirc/addons/freedesktop_notifications/commons/Entities.java Просмотреть файл

@@ -5,9 +5,9 @@
5 5
  * The ASF licenses this file to You under the Apache License, Version 2.0
6 6
  * (the "License"); you may not use this file except in compliance with
7 7
  * the License.  You may obtain a copy of the License at
8
- * 
8
+ *
9 9
  *      http://www.apache.org/licenses/LICENSE-2.0
10
- * 
10
+ *
11 11
  * Unless required by applicable law or agreed to in writing, software
12 12
  * distributed under the License is distributed on an "AS IS" BASIS,
13 13
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,13 +28,13 @@ import java.util.TreeMap;
28 28
  * <p>
29 29
  * Provides HTML and XML entity utilities.
30 30
  * </p>
31
- * 
31
+ *
32 32
  * @see <a href="http://hotwired.lycos.com/webmonkey/reference/special_characters/">ISO Entities</a>
33 33
  * @see <a href="http://www.w3.org/TR/REC-html32#latin1">HTML 3.2 Character Entities for ISO Latin-1</a>
34 34
  * @see <a href="http://www.w3.org/TR/REC-html40/sgml/entities.html">HTML 4.0 Character entity references</a>
35 35
  * @see <a href="http://www.w3.org/TR/html401/charset.html#h-5.3">HTML 4.01 Character References</a>
36 36
  * @see <a href="http://www.w3.org/TR/html401/charset.html#code-position">HTML 4.01 Code positions</a>
37
- * 
37
+ *
38 38
  * @author <a href="mailto:alex@purpletech.com">Alexander Day Chaffee</a>
39 39
  * @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
40 40
  * @since 2.0
@@ -151,7 +151,7 @@ class Entities {
151 151
 
152 152
     // package scoped for testing
153 153
     static final int ISO8859_1_ARRAY_LENGTH = ISO8859_1_ARRAY.length;
154
-    
154
+
155 155
     static String getISO88591(int i, int j) {
156 156
         return ISO8859_1_ARRAY[i][j];
157 157
     }
@@ -353,10 +353,10 @@ class Entities {
353 353
         // <!-- rsaquo is proposed but not yet ISO standardized -->
354 354
         {"euro", "8364"}, // -- euro sign, U+20AC NEW -->
355 355
     };
356
-    
356
+
357 357
     // package scoped for testing
358 358
     static final int HTML40_ARRAY_LENGTH = HTML40_ARRAY.length;
359
-    
359
+
360 360
     static String getHTML40(int i, int j) {
361 361
         return HTML40_ARRAY[i][j];
362 362
     }
@@ -403,7 +403,7 @@ class Entities {
403 403
      * <p>
404 404
      * Fills the specified entities instance with HTML 40 entities.
405 405
      * </p>
406
-     * 
406
+     *
407 407
      * @param entities
408 408
      *            the instance to be filled.
409 409
      */
@@ -418,7 +418,7 @@ class Entities {
418 418
          * <p>
419 419
          * Add an entry to this entity map.
420 420
          * </p>
421
-         * 
421
+         *
422 422
          * @param name
423 423
          *            the entity name
424 424
          * @param value
@@ -430,7 +430,7 @@ class Entities {
430 430
          * <p>
431 431
          * Returns the name of the entity identified by the specified value.
432 432
          * </p>
433
-         * 
433
+         *
434 434
          * @param value
435 435
          *            the value to locate
436 436
          * @return entity name associated with the specified value
@@ -441,7 +441,7 @@ class Entities {
441 441
          * <p>
442 442
          * Returns the value of the entity identified by the specified name.
443 443
          * </p>
444
-         * 
444
+         *
445 445
          * @param name
446 446
          *            the name to locate
447 447
          * @return entity value associated with the specified name
@@ -458,7 +458,7 @@ class Entities {
458 458
          * {@inheritDoc}
459 459
          */
460 460
         public void add(String name, int value) {
461
-            mapNameToValue.put(name, new Integer(value));
461
+            mapNameToValue.put(name, value);
462 462
             mapValueToName.put(value, name);
463 463
         }
464 464
 
@@ -490,15 +490,15 @@ class Entities {
490 490
          * {@inheritDoc}
491 491
          */
492 492
         public void add(String name, int value) {
493
-            mapNameToValue.put(name, new Integer(value));
494
-            mapValueToName.put(new Integer(value), name);
493
+            mapNameToValue.put(name, value);
494
+            mapValueToName.put(value, name);
495 495
         }
496 496
 
497 497
         /**
498 498
          * {@inheritDoc}
499 499
          */
500 500
         public String name(int value) {
501
-            return mapValueToName.get(new Integer(value));
501
+            return mapValueToName.get(value);
502 502
         }
503 503
 
504 504
         /**
@@ -553,7 +553,7 @@ class Entities {
553 553
          * <p>
554 554
          * Returns the lookup table for this entity map. The lookup table is created if it has not been previously.
555 555
          * </p>
556
-         * 
556
+         *
557 557
          * @return the lookup table
558 558
          */
559 559
         private String[] lookupTable() {
@@ -596,7 +596,7 @@ class Entities {
596 596
         /**
597 597
          * Constructs a new instance of <code>ArrayEntityMap</code> specifying the size by which the array should
598 598
          * grow.
599
-         * 
599
+         *
600 600
          * @param growBy
601 601
          *            array will be initialized to and will grow by this amount
602 602
          */
@@ -618,7 +618,7 @@ class Entities {
618 618
 
619 619
         /**
620 620
          * Verifies the capacity of the entity array, adjusting the size if necessary.
621
-         * 
621
+         *
622 622
          * @param capacity
623 623
          *            size the array should be
624 624
          */
@@ -671,7 +671,7 @@ class Entities {
671 671
         /**
672 672
          * Constructs a new instance of <code>ArrayEntityMap</code> specifying the size by which the underlying array
673 673
          * should grow.
674
-         * 
674
+         *
675 675
          * @param growBy
676 676
          *            array will be initialized to and will grow by this amount
677 677
          */
@@ -682,7 +682,7 @@ class Entities {
682 682
         /**
683 683
          * Performs a binary search of the entity array for the specified key. This method is based on code in
684 684
          * {@link java.util.Arrays}.
685
-         * 
685
+         *
686 686
          * @param key
687 687
          *            the key to be found
688 688
          * @return the index of the entity array matching the specified key
@@ -744,7 +744,7 @@ class Entities {
744 744
      * <p>
745 745
      * Adds entities to this entity.
746 746
      * </p>
747
-     * 
747
+     *
748 748
      * @param entityArray
749 749
      *            array of entities to be added
750 750
      */
@@ -758,7 +758,7 @@ class Entities {
758 758
      * <p>
759 759
      * Add an entity to this entity.
760 760
      * </p>
761
-     * 
761
+     *
762 762
      * @param name
763 763
      *            name of the entity
764 764
      * @param value
@@ -772,7 +772,7 @@ class Entities {
772 772
      * <p>
773 773
      * Returns the name of the entity identified by the specified value.
774 774
      * </p>
775
-     * 
775
+     *
776 776
      * @param value
777 777
      *            the value to locate
778 778
      * @return entity name associated with the specified value
@@ -785,7 +785,7 @@ class Entities {
785 785
      * <p>
786 786
      * Returns the value of the entity identified by the specified name.
787 787
      * </p>
788
-     * 
788
+     *
789 789
      * @param name
790 790
      *            the name to locate
791 791
      * @return entity value associated with the specified name
@@ -798,12 +798,12 @@ class Entities {
798 798
      * <p>
799 799
      * Escapes the characters in a <code>String</code>.
800 800
      * </p>
801
-     * 
801
+     *
802 802
      * <p>
803 803
      * For example, if you have called addEntity(&quot;foo&quot;, 0xA1), escape(&quot;\u00A1&quot;) will return
804 804
      * &quot;&amp;foo;&quot;
805 805
      * </p>
806
-     * 
806
+     *
807 807
      * @param str
808 808
      *            The <code>String</code> to escape.
809 809
      * @return A new escaped <code>String</code>.
@@ -825,7 +825,7 @@ class Entities {
825 825
      * Escapes the characters in the <code>String</code> passed and writes the result to the <code>Writer</code>
826 826
      * passed.
827 827
      * </p>
828
-     * 
828
+     *
829 829
      * @param writer
830 830
      *            The <code>Writer</code> to write the results of the escaping to. Assumed to be a non-null value.
831 831
      * @param str
@@ -833,14 +833,14 @@ class Entities {
833 833
      * @throws IOException
834 834
      *             when <code>Writer</code> passed throws the exception from calls to the {@link Writer#write(int)}
835 835
      *             methods.
836
-     * 
836
+     *
837 837
      * @see #escape(String)
838 838
      * @see Writer
839 839
      */
840 840
     public void escape(Writer writer, String str) throws IOException {
841 841
         int len = str.length();
842 842
         for (int i = 0; i < len; i++) {
843
-            int c = Character.codePointAt(str, i); 
843
+            int c = Character.codePointAt(str, i);
844 844
             String entityName = this.entityName(c);
845 845
             if (entityName == null) {
846 846
                 if (c >= 0x010000 && i < len - 1) {
@@ -848,7 +848,7 @@ class Entities {
848 848
                     writer.write(Integer.toString(c, 10));
849 849
                     writer.write(';');
850 850
                     i++;
851
-                } else if (c > 0x7F) { 
851
+                } else if (c > 0x7F) {
852 852
                     writer.write("&#");
853 853
                     writer.write(Integer.toString(c, 10));
854 854
                     writer.write(';');
@@ -867,12 +867,12 @@ class Entities {
867 867
      * <p>
868 868
      * Unescapes the entities in a <code>String</code>.
869 869
      * </p>
870
-     * 
870
+     *
871 871
      * <p>
872 872
      * For example, if you have called addEntity(&quot;foo&quot;, 0xA1), unescape(&quot;&amp;foo;&quot;) will return
873 873
      * &quot;\u00A1&quot;
874 874
      * </p>
875
-     * 
875
+     *
876 876
      * @param str
877 877
      *            The <code>String</code> to escape.
878 878
      * @return A new escaped <code>String</code>.
@@ -886,7 +886,7 @@ class Entities {
886 886
             try {
887 887
                 this.doUnescape(stringWriter, str, firstAmp);
888 888
             } catch (IOException e) {
889
-                // This should never happen because ALL the StringWriter methods called by #escape(Writer, String) 
889
+                // This should never happen because ALL the StringWriter methods called by #escape(Writer, String)
890 890
                 // do not throw IOExceptions.
891 891
                 throw new UnhandledException(e);
892 892
             }
@@ -909,7 +909,7 @@ class Entities {
909 909
      * Unescapes the escaped entities in the <code>String</code> passed and writes the result to the
910 910
      * <code>Writer</code> passed.
911 911
      * </p>
912
-     * 
912
+     *
913 913
      * @param writer
914 914
      *            The <code>Writer</code> to write the results to; assumed to be non-null.
915 915
      * @param str
@@ -917,7 +917,7 @@ class Entities {
917 917
      * @throws IOException
918 918
      *             when <code>Writer</code> passed throws the exception from calls to the {@link Writer#write(int)}
919 919
      *             methods.
920
-     * 
920
+     *
921 921
      * @see #escape(String)
922 922
      * @see Writer
923 923
      */

+ 2
- 2
src/com/dmdirc/addons/freedesktop_notifications/commons/StringEscapeUtils.java Просмотреть файл

@@ -70,7 +70,7 @@ public class StringEscapeUtils {
70 70
             return null;
71 71
         }
72 72
         try {
73
-            StringWriter writer = new StringWriter((int)(str.length() * 1.5));
73
+            StringWriter writer = new StringWriter((int) (str.length() * 1.5));
74 74
             escapeHtml(writer, str);
75 75
             return writer.toString();
76 76
         } catch (IOException ioe) {
@@ -140,7 +140,7 @@ public class StringEscapeUtils {
140 140
             return null;
141 141
         }
142 142
         try {
143
-            StringWriter writer = new StringWriter((int)(str.length() * 1.5));
143
+            StringWriter writer = new StringWriter((int) (str.length() * 1.5));
144 144
             unescapeHtml(writer, str);
145 145
             return writer.toString();
146 146
         } catch (IOException ioe) {

+ 2
- 2
src/com/dmdirc/addons/logging/LoggingPlugin.java Просмотреть файл

@@ -86,7 +86,7 @@ public class LoggingPlugin extends Plugin implements ActionListener,
86 86
     private int historyLines, backbufferLines;
87 87
 
88 88
     /** Open File */
89
-    protected class OpenFile {
89
+    protected static class OpenFile {
90 90
 
91 91
         /** Last used time. */
92 92
         public long lastUsedTime = System.currentTimeMillis();
@@ -99,7 +99,7 @@ public class LoggingPlugin extends Plugin implements ActionListener,
99 99
          *
100 100
          * @param writer Writer that has file open
101 101
          */
102
-        public OpenFile(final BufferedWriter writer) {
102
+        protected OpenFile(final BufferedWriter writer) {
103 103
             this.writer = writer;
104 104
         }
105 105
 

+ 28
- 28
src/com/dmdirc/addons/nickcolours/NickColourInputDialog.java Просмотреть файл

@@ -42,7 +42,7 @@ import net.miginfocom.swing.MigLayout;
42 42
  */
43 43
 public class NickColourInputDialog extends StandardDialog
44 44
         implements ActionListener {
45
-    
45
+
46 46
     /**
47 47
      * A version number for this class. It should be changed whenever the class
48 48
      * structure is changed (or anything else that would prevent serialized
@@ -63,7 +63,7 @@ public class NickColourInputDialog extends StandardDialog
63 63
     private ColourChooser textColour;
64 64
     /** nicklist colour input. */
65 65
     private ColourChooser nicklistColour;
66
-    
66
+
67 67
     /**
68 68
      * Creates a new instance of NickColourInputDialog.
69 69
      *
@@ -79,20 +79,20 @@ public class NickColourInputDialog extends StandardDialog
79 79
             final String textcolour, final String nickcolour) {
80 80
         super(((SwingController) PluginManager.getPluginManager()
81 81
                 .getPluginInfoByName("ui_swing").getPlugin()).getMainFrame(), false);
82
-        
82
+
83 83
         this.panel = panel;
84 84
         this.row = row;
85
-        
85
+
86 86
         setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
87
-        
87
+
88 88
         initComponents(nickname, network, textcolour, nickcolour);
89 89
         initListeners();
90 90
         layoutComponents();
91
-        
91
+
92 92
         setTitle("Nick colour editor");
93 93
         display();
94 94
     }
95
-    
95
+
96 96
     /**
97 97
      * Creates a new instance of NickColourInputDialog.
98 98
      *
@@ -100,10 +100,10 @@ public class NickColourInputDialog extends StandardDialog
100 100
      */
101 101
     public NickColourInputDialog(final NickColourPanel panel) {
102 102
         this(panel, -1, "", "", "", "");
103
-        
103
+
104 104
         isnew = true;
105 105
     }
106
-    
106
+
107 107
     /**
108 108
      * Initialises the components.
109 109
      *
@@ -114,46 +114,46 @@ public class NickColourInputDialog extends StandardDialog
114 114
      */
115 115
     private void initComponents(final String defaultNickname,
116 116
             final String defaultNetwork, final String defaultTextColour,
117
-            final String defaultNickColour) {        
117
+            final String defaultNickColour) {
118 118
         orderButtons(new JButton(), new JButton());
119
-        
119
+
120 120
         nickname = new JTextField(defaultNickname);
121 121
         network = new JTextField(defaultNetwork);
122 122
         textColour = new ColourChooser(defaultTextColour, true, true);
123 123
         nicklistColour = new ColourChooser(defaultNickColour, true, true);
124 124
     }
125
-    
125
+
126 126
     /** Initialises the listeners. */
127 127
     private void initListeners() {
128 128
         getOkButton().addActionListener(this);
129 129
         getCancelButton().addActionListener(this);
130 130
     }
131
-    
131
+
132 132
     /** Lays out the components. */
133
-    private void layoutComponents() {        
133
+    private void layoutComponents() {
134 134
         setLayout(new MigLayout("wrap 2"));
135
-        
135
+
136 136
         add(new JLabel("Nickname: "));
137 137
         add(nickname, "growx");
138
-        
138
+
139 139
         add(new JLabel("Network: "));
140 140
         add(network, "growx");
141
-        
141
+
142 142
         add(new JLabel("Text colour: "));
143 143
         add(textColour, "growx");
144
-        
144
+
145 145
         add(new JLabel("Nicklist colour: "));
146 146
         add(nicklistColour, "growx");
147
-        
147
+
148 148
         add(getLeftButton(), "right");
149 149
         add(getRightButton(), "right");
150
-        
150
+
151 151
         pack();
152 152
     }
153
-    
154
-    /** 
155
-     * {@inheritDoc} 
156
-     * 
153
+
154
+    /**
155
+     * {@inheritDoc}
156
+     *
157 157
      * @param e Action event
158 158
      */
159 159
     @Override
@@ -163,16 +163,16 @@ public class NickColourInputDialog extends StandardDialog
163 163
         }
164 164
         dispose();
165 165
     }
166
-    
166
+
167 167
     /** Saves settings. */
168
-    public void saveSettings() {        
168
+    public void saveSettings() {
169 169
         if (!isnew) {
170 170
             panel.removeRow(row);
171 171
         }
172
-        
172
+
173 173
         panel.addRow(network.getText().toLowerCase(),
174 174
                 nickname.getText().toLowerCase(),
175 175
                 nickname.getText().toLowerCase(), nicklistColour.getColour());
176 176
     }
177
-    
177
+
178 178
 }

+ 1
- 1
src/com/dmdirc/addons/nickcolours/NickColourPlugin.java Просмотреть файл

@@ -59,7 +59,7 @@ public final class NickColourPlugin extends Plugin implements ActionListener,
59 59
     /** "Random" colours to use to colour nicknames. */
60 60
     private String[] randColours = new String[]{
61 61
         "E90E7F", "8E55E9", "B30E0E", "18B33C",
62
-        "58ADB3", "9E54B3", "B39875", "3176B3",};
62
+        "58ADB3", "9E54B3", "B39875", "3176B3", };
63 63
     private boolean useowncolour;
64 64
     private String owncolour;
65 65
     private boolean userandomcolour;

+ 18
- 18
src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java Просмотреть файл

@@ -44,12 +44,12 @@ import java.util.List;
44 44
  * variety of media players.
45 45
  * @author chris
46 46
  */
47
-public final class NowPlayingCommand extends Command implements 
47
+public final class NowPlayingCommand extends Command implements
48 48
         IntelligentCommand, CommandInfo {
49
-    
49
+
50 50
     /** The plugin that's using this command. */
51 51
     final NowPlayingPlugin parent;
52
-    
52
+
53 53
     /**
54 54
      * Creates a new instance of NowPlayingCommand.
55 55
      *
@@ -57,12 +57,12 @@ public final class NowPlayingCommand extends Command implements
57 57
      */
58 58
     public NowPlayingCommand(final NowPlayingPlugin parent) {
59 59
         super();
60
-        
60
+
61 61
         this.parent = parent;
62
-        
62
+
63 63
         CommandManager.registerCommand(this);
64 64
     }
65
-    
65
+
66 66
     /** {@inheritDoc} */
67 67
     @Override
68 68
     public void execute(final FrameContainer<?> origin,
@@ -76,7 +76,7 @@ public final class NowPlayingCommand extends Command implements
76 76
             if (args.getArguments().length > 1) {
77 77
                 final String sourceName = args.getArguments()[1];
78 78
                 final MediaSource source = parent.getSource(sourceName);
79
-                
79
+
80 80
                 if (source == null) {
81 81
                     sendLine(origin, args.isSilent(), FORMAT_ERROR, "Source not found.");
82 82
                 } else {
@@ -101,7 +101,7 @@ public final class NowPlayingCommand extends Command implements
101 101
             }
102 102
         }
103 103
     }
104
-    
104
+
105 105
     /**
106 106
      * Outputs a list of sources for the nowplaying command.
107 107
      *
@@ -112,17 +112,17 @@ public final class NowPlayingCommand extends Command implements
112 112
     private void doSourceList(final FrameContainer<?> origin, final boolean isSilent,
113 113
             final String format) {
114 114
         final List<MediaSource> sources = parent.getSources();
115
-        
115
+
116 116
         if (sources.isEmpty()) {
117 117
             sendLine(origin, isSilent, FORMAT_ERROR, "No media sources available.");
118 118
         } else {
119 119
             final String[] headers = {"Source", "Status", "Information"};
120 120
             final String[][] data = new String[sources.size()][3];
121 121
             int i = 0;
122
-            
122
+
123 123
             for (MediaSource source : sources) {
124 124
                 data[i][0] = source.getAppName();
125
-                
125
+
126 126
                 if (source.getState() != MediaSourceState.CLOSED) {
127 127
                     data[i][1] = source.getState().getNiceName().toLowerCase();
128 128
                     data[i][2] = getInformation(source, format);
@@ -130,14 +130,14 @@ public final class NowPlayingCommand extends Command implements
130 130
                     data[i][1] = "not running";
131 131
                     data[i][2] = "-";
132 132
                 }
133
-                
133
+
134 134
                 i++;
135 135
             }
136
-            
136
+
137 137
             sendLine(origin, isSilent, FORMAT_OUTPUT, doTable(headers, data));
138 138
         }
139 139
     }
140
-       
140
+
141 141
     /**
142 142
      * Returns a formatted information string from the requested soruce.
143 143
      *
@@ -155,19 +155,19 @@ public final class NowPlayingCommand extends Command implements
155 155
             return parent.doSubstitution(format, source);
156 156
         }
157 157
     }
158
-    
158
+
159 159
     /** {@inheritDoc}. */
160 160
     @Override
161 161
     public String getName() {
162 162
         return "nowplaying";
163 163
     }
164
-    
164
+
165 165
     /** {@inheritDoc}. */
166 166
     @Override
167 167
     public boolean showInHelp() {
168 168
         return true;
169 169
     }
170
-    
170
+
171 171
     /** {@inheritDoc}. */
172 172
     @Override
173 173
     public String getHelp() {
@@ -180,7 +180,7 @@ public final class NowPlayingCommand extends Command implements
180 180
     public CommandType getType() {
181 181
         return CommandType.TYPE_CHAT;
182 182
     }
183
-    
183
+
184 184
     /** {@inheritDoc} */
185 185
     @Override
186 186
     public AdditionalTabTargets getSuggestions(final int arg,

+ 36
- 36
src/com/dmdirc/addons/nowplaying/NowPlayingPlugin.java Просмотреть файл

@@ -44,61 +44,61 @@ import java.util.List;
44 44
 /**
45 45
  * Plugin that allows users to advertise what they're currently playing or
46 46
  * listening to.
47
- * 
47
+ *
48 48
  * @author chris
49 49
  */
50 50
 public class NowPlayingPlugin extends Plugin implements ActionListener  {
51
-    
51
+
52 52
     /** The sources that we know of. */
53 53
     private final List<MediaSource> sources = new ArrayList<MediaSource>();
54 54
 
55 55
     /** The managers that we know of. */
56 56
     private final List<MediaSourceManager> managers = new ArrayList<MediaSourceManager>();
57
-    
57
+
58 58
     /** The now playing command we're registering. */
59 59
     private NowPlayingCommand command;
60
-    
60
+
61 61
     /** The user's preferred order for source usage. */
62 62
     private List<String> order;
63
-    
63
+
64 64
     /**
65 65
      * Creates a new instance of NowPlayingPlugin.
66 66
      */
67 67
     public NowPlayingPlugin() {
68 68
         super();
69 69
     }
70
-    
70
+
71 71
     /** {@inheritDoc} */
72 72
     @Override
73 73
     public void onLoad() {
74 74
         sources.clear();
75 75
         managers.clear();
76
-        
76
+
77 77
         loadSettings();
78
-        
78
+
79 79
         ActionManager.addListener(this, CoreActionType.PLUGIN_LOADED,
80 80
                 CoreActionType.PLUGIN_UNLOADED);
81
-        
81
+
82 82
         for (PluginInfo target : PluginManager.getPluginManager().getPluginInfos()) {
83 83
             if (target.isLoaded()) {
84 84
                 addPlugin(target);
85 85
             }
86 86
         }
87
-        
87
+
88 88
         command = new NowPlayingCommand(this);
89 89
     }
90
-    
90
+
91 91
     /** {@inheritDoc} */
92 92
     @Override
93 93
     public void onUnload() {
94 94
         sources.clear();
95 95
         managers.clear();
96
-        
96
+
97 97
         ActionManager.removeListener(this);
98
-        
98
+
99 99
         CommandManager.unregisterCommand(command);
100 100
     }
101
-    
101
+
102 102
     /** {@inheritDoc} */
103 103
     @Override
104 104
     public void showConfig(final PreferencesManager manager) {
@@ -110,23 +110,23 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
110 110
                 setObject(new ConfigPanel(NowPlayingPlugin.this, order));
111 111
             }
112 112
         });
113
-        
113
+
114 114
         final PreferencesCategory category = new PluginPreferencesCategory(
115 115
                 getPluginInfo(), "Now Playing",
116 116
                 "", "category-nowplaying", configPanel);
117 117
         manager.getCategory("Plugins").addSubCategory(category);
118 118
     }
119
-    
119
+
120 120
     /**
121 121
      * Saves the plugins settings.
122
-     * 
122
+     *
123 123
      * @param newOrder The new order for sources
124 124
      */
125 125
     protected void saveSettings(final List<String> newOrder) {
126 126
         order = newOrder;
127 127
         IdentityManager.getConfigIdentity().setOption(getDomain(), "sourceOrder", order);
128 128
     }
129
-    
129
+
130 130
     /** Loads the plugins settings. */
131 131
     private void loadSettings() {
132 132
         if (IdentityManager.getGlobalConfig().hasOptionString(getDomain(), "sourceOrder")) {
@@ -135,7 +135,7 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
135 135
             order = new ArrayList<String>();
136 136
         }
137 137
     }
138
-    
138
+
139 139
     /** {@inheritDoc} */
140 140
     @Override
141 141
     public void processEvent(final ActionType type, final StringBuffer format,
@@ -146,7 +146,7 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
146 146
             removePlugin((PluginInfo) arguments[0]);
147 147
         }
148 148
     }
149
-    
149
+
150 150
     /**
151 151
      * Checks to see if a plugin implements one of the Media Source interfaces
152 152
      * and if it does, adds the source(s) to our list.
@@ -159,7 +159,7 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
159 159
             sources.add((MediaSource) targetPlugin);
160 160
             addSourceToOrder((MediaSource) targetPlugin);
161 161
         }
162
-        
162
+
163 163
         if (targetPlugin instanceof MediaSourceManager) {
164 164
             managers.add((MediaSourceManager) targetPlugin);
165 165
 
@@ -170,7 +170,7 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
170 170
             }
171 171
         }
172 172
     }
173
-    
173
+
174 174
     /**
175 175
      * Checks to see if the specified media source needs to be added to our
176 176
      * order list, and adds it if neccessary.
@@ -182,7 +182,7 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
182 182
             order.add(source.getAppName());
183 183
         }
184 184
     }
185
-    
185
+
186 186
     /**
187 187
      * Checks to see if a plugin implements one of the Media Source interfaces
188 188
      * and if it does, removes the source(s) from our list.
@@ -194,12 +194,12 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
194 194
         if (targetPlugin instanceof MediaSource) {
195 195
             sources.remove((MediaSource) targetPlugin);
196 196
         }
197
-        
197
+
198 198
         if (targetPlugin instanceof MediaSourceManager) {
199 199
             managers.remove((MediaSourceManager) targetPlugin);
200 200
         }
201 201
     }
202
-    
202
+
203 203
     /**
204 204
      * Determines if there are any valid sources (paused or not).
205 205
      *
@@ -211,10 +211,10 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
211 211
                 return true;
212 212
             }
213 213
         }
214
-        
214
+
215 215
         return false;
216 216
     }
217
-    
217
+
218 218
     /**
219 219
      * Retrieves the "best" source to use for displaying media information.
220 220
      * The best source is defined as the earliest in the list that is running
@@ -227,9 +227,9 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
227 227
     public MediaSource getBestSource() {
228 228
         MediaSource paused = null;
229 229
         final List<MediaSource> possibleSources = getSources();
230
-        
230
+
231 231
         Collections.sort(possibleSources, new MediaSourceComparator(order));
232
-        
232
+
233 233
         for (final MediaSource source : possibleSources) {
234 234
             if (source.getState() != MediaSourceState.CLOSED) {
235 235
                 if (source.getState() == MediaSourceState.PLAYING) {
@@ -239,14 +239,14 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
239 239
                 }
240 240
             }
241 241
         }
242
-        
242
+
243 243
         return paused;
244 244
     }
245
-    
245
+
246 246
     /**
247 247
      * Substitutes the keywords in the specified format with the values with
248 248
      * values from the specified source.
249
-     * 
249
+     *
250 250
      * @param format The format to be substituted
251 251
      * @param source The source whose values should be used
252 252
      * @return The substituted string
@@ -261,7 +261,7 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
261 261
         final String length = source.getLength();
262 262
         final String time = source.getTime();
263 263
         final String state = source.getState().getNiceName();
264
-        
264
+
265 265
         return format.replace("$artist", sanitise(artist))
266 266
                      .replace("$title", sanitise(title))
267 267
                      .replace("$album", sanitise(album))
@@ -286,7 +286,7 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
286 286
     protected static String sanitise(final String input) {
287 287
         return input == null ? "" : input;
288 288
     }
289
-    
289
+
290 290
     /**
291 291
      * Retrieves a source based on its name.
292 292
      *
@@ -299,10 +299,10 @@ public class NowPlayingPlugin extends Plugin implements ActionListener  {
299 299
                 return source;
300 300
             }
301 301
         }
302
-        
302
+
303 303
         return null;
304 304
     }
305
-    
305
+
306 306
     /**
307 307
      * Retrieves all the sources registered with this plugin.
308 308
      *

+ 35
- 35
src/com/dmdirc/addons/osd/OsdWindow.java Просмотреть файл

@@ -52,29 +52,29 @@ import net.miginfocom.swing.MigLayout;
52 52
  */
53 53
 public class OsdWindow extends JDialog implements MouseListener,
54 54
         MouseMotionListener {
55
-    
55
+
56 56
     /**
57 57
      * A version number for this class. It should be changed whenever the class
58 58
      * structure is changed (or anything else that would prevent serialized
59 59
      * objects being unserialized with the new class).
60 60
      */
61 61
     private static final long serialVersionUID = 2;
62
-    
62
+
63 63
     /** The OSD Manager that owns this window. */
64 64
     private final OsdManager osdManager;
65
-    
65
+
66 66
     /** OSD Label. */
67 67
     private final JLabel label;
68
-    
68
+
69 69
     /** OSD Panel. */
70 70
     private final JPanel panel;
71
-    
71
+
72 72
     /** Starting positions of the mouse. */
73 73
     private int startX, startY;
74 74
 
75 75
     /** Desired position. */
76 76
     private volatile int desiredX, desiredY;
77
-    
77
+
78 78
     /** Is this a config instance? */
79 79
     private final boolean config;
80 80
 
@@ -93,7 +93,7 @@ public class OsdWindow extends JDialog implements MouseListener,
93 93
             final int y, final OsdPlugin plugin, final OsdManager osdManager) {
94 94
         super(((SwingController) PluginManager.getPluginManager()
95 95
                 .getPluginInfoByName("ui_swing").getPlugin()).getMainFrame(), false);
96
-        
96
+
97 97
         this.config = config;
98 98
         this.osdManager = osdManager;
99 99
 
@@ -137,7 +137,7 @@ public class OsdWindow extends JDialog implements MouseListener,
137 137
         } else {
138 138
             addMouseListener(this);
139 139
             new Timer("OSD Display Timer").schedule(new TimerTask() {
140
-                
140
+
141 141
                 /** {@inheritDoc} */
142 142
                 @Override
143 143
                 public void run() {
@@ -147,11 +147,11 @@ public class OsdWindow extends JDialog implements MouseListener,
147 147
                     "timeout") * 1000);
148 148
         }
149 149
     }
150
-    
151
-   
152
-    /** 
150
+
151
+
152
+    /**
153 153
      * {@inheritDoc}
154
-     * 
154
+     *
155 155
      * @param e Mouse event
156 156
      */
157 157
     @Override
@@ -160,10 +160,10 @@ public class OsdWindow extends JDialog implements MouseListener,
160 160
             osdManager.closeWindow(this);
161 161
         }
162 162
     }
163
-    
164
-    /** 
163
+
164
+    /**
165 165
      * {@inheritDoc}
166
-     * 
166
+     *
167 167
      * @param e Mouse event
168 168
      */
169 169
     @Override
@@ -173,40 +173,40 @@ public class OsdWindow extends JDialog implements MouseListener,
173 173
             startY = e.getPoint().y;
174 174
         }
175 175
     }
176
-    
177
-    /** 
176
+
177
+    /**
178 178
      * {@inheritDoc}
179
-     * 
179
+     *
180 180
      * @param e Mouse event
181 181
      */
182 182
     @Override
183 183
     public void mouseReleased(final MouseEvent e) {
184 184
         // Do nothing
185 185
     }
186
-    
187
-    /** 
186
+
187
+    /**
188 188
      * {@inheritDoc}
189
-     * 
189
+     *
190 190
      * @param e Mouse event
191 191
      */
192 192
     @Override
193 193
     public void mouseEntered(final MouseEvent e) {
194 194
         // Do nothing
195 195
     }
196
-    
197
-    /** 
196
+
197
+    /**
198 198
      * {@inheritDoc}
199
-     * 
199
+     *
200 200
      * @param e Mouse event
201 201
      */
202 202
     @Override
203 203
     public void mouseExited(final MouseEvent e) {
204 204
         // Do nothing
205 205
     }
206
-    
207
-    /** 
206
+
207
+    /**
208 208
      * {@inheritDoc}
209
-     * 
209
+     *
210 210
      * @param e Mouse event
211 211
      */
212 212
     @Override
@@ -215,20 +215,20 @@ public class OsdWindow extends JDialog implements MouseListener,
215 215
         p.translate(-1 * startX, -1 * startY);
216 216
         setLocation(p);
217 217
     }
218
-    
219
-    /** 
218
+
219
+    /**
220 220
      * {@inheritDoc}
221
-     * 
221
+     *
222 222
      * @param e Mouse event
223 223
      */
224 224
     @Override
225 225
     public void mouseMoved(final MouseEvent e) {
226 226
         // Do nothing
227 227
     }
228
-    
228
+
229 229
     /**
230 230
      * Sets the font size that this OSD uses.
231
-     * 
231
+     *
232 232
      * @param size The new size of the font
233 233
      */
234 234
     public void setFontSize(final int size) {
@@ -237,7 +237,7 @@ public class OsdWindow extends JDialog implements MouseListener,
237 237
 
238 238
     /**
239 239
      * Sets the background colour for this OSD.
240
-     * 
240
+     *
241 241
      * @param colour The background colour to use
242 242
      */
243 243
     public void setBackgroundColour(final String colour) {
@@ -246,7 +246,7 @@ public class OsdWindow extends JDialog implements MouseListener,
246 246
 
247 247
     /**
248 248
      * Sets the foreground colour for this OSD.
249
-     * 
249
+     *
250 250
      * @param colour The foreground colour to use
251 251
      */
252 252
     public void setForegroundColour(final String colour) {
@@ -257,7 +257,7 @@ public class OsdWindow extends JDialog implements MouseListener,
257 257
     @Override
258 258
     public void setVisible(final boolean b) {
259 259
         super.setVisible(b);
260
-        
260
+
261 261
         if (b) {
262 262
             transferFocusBackward();
263 263
         }

+ 28
- 50
src/com/dmdirc/addons/parser_twitter/Twitter.java Просмотреть файл

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -61,7 +61,7 @@ import java.util.Map;
61 61
 
62 62
 /**
63 63
  * Twitter Parser for DMDirc.
64
- * 
64
+ *
65 65
  * @author shane
66 66
  */
67 67
 public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
@@ -104,7 +104,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
104 104
     private TwitterClientInfo myself = null;
105 105
 
106 106
     /** List of currently active twitter parsers. */
107
-    protected static List<Twitter> currentParsers = new ArrayList<Twitter>();
107
+    protected static final List<Twitter> PARSERS = new ArrayList<Twitter>();
108 108
 
109 109
     /** Are we waiting for authentication? */
110 110
     private boolean wantAuth = false;
@@ -152,7 +152,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
152 152
 
153 153
     /**
154 154
      * Create a new Twitter Parser!
155
-     * 
155
+     *
156 156
      * @param myInfo
157 157
      *            The client information to use
158 158
      * @param address
@@ -204,7 +204,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
204 204
     @Override
205 205
     public void disconnect(final String message) {
206 206
         connected = false;
207
-        currentParsers.remove(this);
207
+        PARSERS.remove(this);
208 208
         api = new TwitterAPI("", "", "", false, -1, false);
209 209
 
210 210
         getCallbackManager().getCallbackType(SocketCloseListener.class).call();
@@ -288,7 +288,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
288 288
 
289 289
     /**
290 290
      * Remove a channel from the known channels list.
291
-     * 
291
+     *
292 292
      * @param channel
293 293
      */
294 294
     protected void partChannel(final TwitterChannelInfo channel) {
@@ -343,7 +343,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
343 343
      * Tokenise a line.
344 344
      * splits by " " up to the first " :" everything after this is a single
345 345
      * token
346
-     * 
346
+     *
347 347
      * @param line
348 348
      *            Line to tokenise
349 349
      * @return Array of tokens
@@ -941,7 +941,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
941 941
 
942 942
     /**
943 943
      * Send a notice to the client.
944
-     * 
944
+     *
945 945
      * @param message
946 946
      *            Message to send.
947 947
      */
@@ -952,29 +952,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
952 952
 
953 953
     /**
954 954
      * Send a PM to the client.
955
-     * 
956
-     * @param message
957
-     *            Message to send.
958
-     */
959
-    private void sendPrivateMessage(final String message) {
960
-        sendPrivateMessage(message, myServerName);
961
-    }
962
-
963
-    /**
964
-     * Send a PM to the client.
965
-     * 
966
-     * @param message
967
-     *            Message to send.
968
-     * @param hostname
969
-     *            Who is the message from?
970
-     */
971
-    private void sendPrivateMessage(final String message, final String hostname) {
972
-        sendPrivateMessage(message, hostname, myUsername);
973
-    }
974
-
975
-    /**
976
-     * Send a PM to the client.
977
-     * 
955
+     *
978 956
      * @param message
979 957
      *            Message to send.
980 958
      * @param hostname
@@ -995,7 +973,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
995 973
 
996 974
     /**
997 975
      * Send a message to the given channel.
998
-     * 
976
+     *
999 977
      * @param channel
1000 978
      *            Channel to send message to
1001 979
      * @param message
@@ -1008,7 +986,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1008 986
 
1009 987
     /**
1010 988
      * Send a message to the given channel.
1011
-     * 
989
+     *
1012 990
      * @param channel
1013 991
      *            Channel to send message to
1014 992
      * @param message
@@ -1023,7 +1001,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1023 1001
 
1024 1002
     /**
1025 1003
      * Send a message to the given channel.
1026
-     * 
1004
+     *
1027 1005
      * @param channel
1028 1006
      *            Channel to send message to
1029 1007
      * @param date
@@ -1094,7 +1072,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1094 1072
     /**
1095 1073
      * Check if the given user is known on the channel, and add them if they
1096 1074
      * are not.
1097
-     * 
1075
+     *
1098 1076
      * @param user
1099 1077
      *            User to check
1100 1078
      * @return true if user was already on the channel, false if they were
@@ -1128,7 +1106,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1128 1106
 
1129 1107
     /**
1130 1108
      * Send a Debug Message using the parser debug api.
1131
-     * 
1109
+     *
1132 1110
      * @param code
1133 1111
      *            Debug Code for the message.
1134 1112
      * @param message
@@ -1198,7 +1176,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1198 1176
                 apiVersion, getConfigManager().getOptionBool(
1199 1177
                         myPlugin.getDomain(), "autoAt"));
1200 1178
         api.setSource("DMDirc");
1201
-        currentParsers.add(this);
1179
+        PARSERS.add(this);
1202 1180
         api.addErrorHandler(this);
1203 1181
         api.addRawHandler(this);
1204 1182
         api.setDebug(debugEnabled);
@@ -1557,7 +1535,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1557 1535
 
1558 1536
     /**
1559 1537
      * Reset the state of the parser.
1560
-     * 
1538
+     *
1561 1539
      * @param simpleMyself
1562 1540
      *            Don't check the config when setting myself if true.
1563 1541
      */
@@ -1578,7 +1556,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1578 1556
 
1579 1557
     /**
1580 1558
      * Get the Twitter API Object
1581
-     * 
1559
+     *
1582 1560
      * @return The Twitter API Object
1583 1561
      */
1584 1562
     public TwitterAPI getApi() {
@@ -1605,7 +1583,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1605 1583
 
1606 1584
     /**
1607 1585
      * Set the twitter status.
1608
-     * 
1586
+     *
1609 1587
      * @param message
1610 1588
      *            Status to use.
1611 1589
      * @return True if status was updated, else false.
@@ -1616,7 +1594,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1616 1594
 
1617 1595
     /**
1618 1596
      * Set the twitter status.
1619
-     * 
1597
+     *
1620 1598
      * @param message
1621 1599
      *            Status to use.
1622 1600
      * @param id
@@ -1660,7 +1638,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1660 1638
 
1661 1639
     /**
1662 1640
      * Rename the given client from the given name.
1663
-     * 
1641
+     *
1664 1642
      * @param client
1665 1643
      *            Client to rename
1666 1644
      * @param old
@@ -1681,7 +1659,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1681 1659
 
1682 1660
     /**
1683 1661
      * Make the core think a channel was joined.
1684
-     * 
1662
+     *
1685 1663
      * @param channel
1686 1664
      *            Channel to join.
1687 1665
      */
@@ -1724,7 +1702,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1724 1702
     /**
1725 1703
      * Check if the topic in the given channel has been changed, and if it has
1726 1704
      * fire the callback.
1727
-     * 
1705
+     *
1728 1706
      * @param channel
1729 1707
      *            channel to check.
1730 1708
      * @param status
@@ -1795,7 +1773,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1795 1773
 
1796 1774
     /**
1797 1775
      * This method will send data to the NumericListener and the DataInListener
1798
-     * 
1776
+     *
1799 1777
      * @param numeric
1800 1778
      *            Numeric
1801 1779
      * @param token
@@ -1841,7 +1819,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1841 1819
 
1842 1820
     /**
1843 1821
      * Let the user know twitter failed in some way.
1844
-     * 
1822
+     *
1845 1823
      * @param message
1846 1824
      *            Message to send to the user
1847 1825
      */
@@ -1855,7 +1833,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1855 1833
 
1856 1834
     /**
1857 1835
      * Returns the TwitterPlugin that owns us.
1858
-     * 
1836
+     *
1859 1837
      * @return The TwitterPlugin that owns us.
1860 1838
      */
1861 1839
     public TwitterPlugin getMyPlugin() {
@@ -1878,7 +1856,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1878 1856
 
1879 1857
     /**
1880 1858
      * Get the config manager for this parser instance.
1881
-     * 
1859
+     *
1882 1860
      * @return the ConfigManager for this parser.
1883 1861
      */
1884 1862
     protected ConfigManager getConfigManager() {

+ 1
- 1
src/com/dmdirc/addons/parser_twitter/TwitterChannelClientInfo.java Просмотреть файл

@@ -132,7 +132,7 @@ public class TwitterChannelClientInfo implements ChannelClientInfo {
132 132
     /** {@inheritDoc} */
133 133
     @Override
134 134
     public void kick(final String message) {
135
-        ((Twitter)myClient.getParser()).getApi().delFriend(myClient.getUser().getScreenName());
135
+        ((Twitter) myClient.getParser()).getApi().delFriend(myClient.getUser().getScreenName());
136 136
         myChannel.delChannelClient(this);
137 137
         myClient.delChannelClient(this);
138 138
     }

+ 1
- 1
src/com/dmdirc/addons/parser_twitter/TwitterChannelInfo.java Просмотреть файл

@@ -180,7 +180,7 @@ public class TwitterChannelInfo implements ChannelInfo {
180 180
     public ChannelClientInfo getChannelClient(final String client, final boolean create) {
181 181
         ChannelClientInfo cci = getChannelClient(client);
182 182
         if (create && cci == null) {
183
-            cci = new TwitterChannelClientInfo(this, (TwitterClientInfo)myParser.getClient(client));
183
+            cci = new TwitterChannelClientInfo(this, (TwitterClientInfo) myParser.getClient(client));
184 184
         }
185 185
         return cci;
186 186
     }

+ 1
- 1
src/com/dmdirc/addons/parser_twitter/TwitterPlugin.java Просмотреть файл

@@ -59,7 +59,7 @@ public class TwitterPlugin extends Plugin  {
59 59
     @Override
60 60
     public void onUnload() {
61 61
         unloading = true;
62
-        for (Twitter parser : new ArrayList<Twitter>(Twitter.currentParsers)) {
62
+        for (Twitter parser : new ArrayList<Twitter>(Twitter.PARSERS)) {
63 63
             parser.disconnect("");
64 64
         }
65 65
     }

+ 6
- 6
src/com/dmdirc/addons/parser_twitter/api/TwitterAPI.java Просмотреть файл

@@ -1061,9 +1061,9 @@ public class TwitterAPI {
1061 1061
         synchronized (statusCache) {
1062 1062
             final Map<Long, TwitterStatus> current = new HashMap<Long, TwitterStatus>(statusCache);
1063 1063
 
1064
-            for (Long item : current.keySet()) {
1065
-                if (current.get(item).getTime() < time) {
1066
-                    statusCache.remove(item);
1064
+            for (Map.Entry<Long, TwitterStatus> item : current.entrySet()) {
1065
+                if (item.getValue().getTime() < time) {
1066
+                    statusCache.remove(item.getKey());
1067 1067
                 }
1068 1068
             }
1069 1069
         }
@@ -1243,7 +1243,7 @@ public class TwitterAPI {
1243 1243
             if (doc.isGood()) {
1244 1244
                 final NodeList nodes = doc.getElementsByTagName("id");
1245 1245
                 for (int i = 0; i < nodes.getLength(); i++) {
1246
-                    final Element element = (Element)nodes.item(i);
1246
+                    final Element element = (Element) nodes.item(i);
1247 1247
                     final Long id = parseLong(element.getTextContent(), -1);
1248 1248
                     result.add(id);
1249 1249
 
@@ -1490,9 +1490,9 @@ public class TwitterAPI {
1490 1490
             final String resetTimeString = getElementContents(element, "reset-time-in-seconds", getElementContents(element, "reset_time_in_seconds", "0"));
1491 1491
             resetTime = 1000 * parseLong(resetTimeString, -1);
1492 1492
 
1493
-            return new Long[]{remaining, total, resetTime, (long)usedCalls};
1493
+            return new Long[]{remaining, total, resetTime, (long) usedCalls};
1494 1494
         } else {
1495
-            return new Long[]{0L, 0L, System.currentTimeMillis(), (long)usedCalls};
1495
+            return new Long[]{0L, 0L, System.currentTimeMillis(), (long) usedCalls};
1496 1496
         }
1497 1497
     }
1498 1498
 

+ 1
- 1
src/com/dmdirc/addons/parser_twitter/api/TwitterMessage.java Просмотреть файл

@@ -190,7 +190,7 @@ public class TwitterMessage implements Comparable<TwitterMessage> {
190 190
     @Override
191 191
     public boolean equals(final Object message) {
192 192
         if (message instanceof TwitterMessage) {
193
-            return ((TwitterMessage)message).getID() == this.id;
193
+            return ((TwitterMessage) message).getID() == this.id;
194 194
         } else {
195 195
             return false;
196 196
         }

+ 1
- 1
src/com/dmdirc/addons/parser_twitter/api/TwitterStatus.java Просмотреть файл

@@ -261,7 +261,7 @@ public class TwitterStatus implements Comparable<TwitterStatus> {
261 261
     @Override
262 262
     public boolean equals(final Object status) {
263 263
         if (status instanceof TwitterStatus) {
264
-            return ((TwitterStatus)status).getID() == this.id;
264
+            return ((TwitterStatus) status).getID() == this.id;
265 265
         } else {
266 266
             return false;
267 267
         }

+ 4
- 4
src/com/dmdirc/addons/parser_twitter/api/commons/Entities.java Просмотреть файл

@@ -458,7 +458,7 @@ class Entities {
458 458
          * {@inheritDoc}
459 459
          */
460 460
         public void add(String name, int value) {
461
-            mapNameToValue.put(name, new Integer(value));
461
+            mapNameToValue.put(name, value);
462 462
             mapValueToName.put(value, name);
463 463
         }
464 464
 
@@ -490,15 +490,15 @@ class Entities {
490 490
          * {@inheritDoc}
491 491
          */
492 492
         public void add(String name, int value) {
493
-            mapNameToValue.put(name, new Integer(value));
494
-            mapValueToName.put(new Integer(value), name);
493
+            mapNameToValue.put(name, value);
494
+            mapValueToName.put(value, name);
495 495
         }
496 496
 
497 497
         /**
498 498
          * {@inheritDoc}
499 499
          */
500 500
         public String name(int value) {
501
-            return mapValueToName.get(new Integer(value));
501
+            return mapValueToName.get(value);
502 502
         }
503 503
 
504 504
         /**

+ 2
- 2
src/com/dmdirc/addons/parser_twitter/api/commons/StringEscapeUtils.java Просмотреть файл

@@ -70,7 +70,7 @@ public class StringEscapeUtils {
70 70
             return null;
71 71
         }
72 72
         try {
73
-            StringWriter writer = new StringWriter((int)(str.length() * 1.5));
73
+            StringWriter writer = new StringWriter((int) (str.length() * 1.5));
74 74
             escapeHtml(writer, str);
75 75
             return writer.toString();
76 76
         } catch (IOException ioe) {
@@ -140,7 +140,7 @@ public class StringEscapeUtils {
140 140
             return null;
141 141
         }
142 142
         try {
143
-            StringWriter writer = new StringWriter((int)(str.length() * 1.5));
143
+            StringWriter writer = new StringWriter((int) (str.length() * 1.5));
144 144
             unescapeHtml(writer, str);
145 145
             return writer.toString();
146 146
         } catch (IOException ioe) {

+ 3
- 3
src/com/dmdirc/addons/parserdebug/DebugPlugin.java Просмотреть файл

@@ -47,8 +47,8 @@ public final class DebugPlugin extends Plugin implements DebugInfoListener, Acti
47 47
     private ParserDebugCommand command = null;
48 48
 
49 49
     /** Map of parsers registered. */
50
-    protected final HashMap<Parser,DebugWindow> registeredParsers
51
-            = new HashMap<Parser,DebugWindow>();
50
+    protected final HashMap<Parser, DebugWindow> registeredParsers
51
+            = new HashMap<Parser, DebugWindow>();
52 52
 
53 53
     /**
54 54
      * Creates a new instance of the Debug Plugin.
@@ -93,7 +93,7 @@ public final class DebugPlugin extends Plugin implements DebugInfoListener, Acti
93 93
     @Override
94 94
     public void processEvent(final ActionType type, final StringBuffer format, final Object... arguments) {
95 95
         if (type == CoreActionType.SERVER_DISCONNECTED) {
96
-            final Server thisServer = (Server)arguments[0];
96
+            final Server thisServer = (Server) arguments[0];
97 97
             final Parser parser = thisServer.getParser();
98 98
             if (registeredParsers.containsKey(parser)) {
99 99
                 try {

+ 2
- 3
src/com/dmdirc/addons/parserdebug/ParserDebugCommand.java Просмотреть файл

@@ -70,7 +70,6 @@ public final class ParserDebugCommand extends Command implements CommandInfo {
70 70
      */
71 71
     @Override
72 72
     public void execute(final FrameContainer<?> origin, final CommandArguments commandArgs, final CommandContext context) {
73
-        final String[] args = commandArgs.getArguments();
74 73
         final boolean isSilent = commandArgs.isSilent();
75 74
   
76 75
         Parser parser = ((ServerCommandContext) context).getServer().getParser();
@@ -84,7 +83,7 @@ public final class ParserDebugCommand extends Command implements CommandInfo {
84 83
                 parser.getCallbackManager().delCallback(DebugInfoListener.class, myPlugin);
85 84
                 DebugWindow window = myPlugin.registeredParsers.get(parser);
86 85
                 window.addLine("======================", true);
87
-                window.addLine("No Longer Monitoring: "+parser+" (User Requested)", true);
86
+                window.addLine("No Longer Monitoring: " + parser + " (User Requested)", true);
88 87
                 window.addLine("======================", true);
89 88
                 myPlugin.registeredParsers.remove(parser);
90 89
                 sendLine(origin, isSilent, FORMAT_OUTPUT, "Removing callback ok");
@@ -98,7 +97,7 @@ public final class ParserDebugCommand extends Command implements CommandInfo {
98 97
                 myPlugin.registeredParsers.put(parser, window);
99 98
                 sendLine(origin, isSilent, FORMAT_OUTPUT, "Adding callback ok");
100 99
                 window.addLine("======================", true);
101
-                window.addLine("Started Monitoring: "+parser, true);
100
+                window.addLine("Started Monitoring: " + parser, true);
102 101
                 window.addLine("======================", true);
103 102
             } catch (Exception e) {
104 103
                 sendLine(origin, isSilent, FORMAT_ERROR, "Adding callback failed");

+ 8
- 8
src/com/dmdirc/addons/relaybot/RelayBotPlugin.java Просмотреть файл

@@ -71,7 +71,7 @@ public class RelayBotPlugin extends Plugin implements ActionListener, ConfigChan
71 71
         for (Server server : ServerManager.getServerManager().getServers()) {
72 72
             final Parser parser = server.getParser();
73 73
             if (parser instanceof IRCParser && !(parser.getCallbackManager() instanceof RelayCallbackManager)) {
74
-                new RelayCallbackManager(this, (IRCParser)parser);
74
+                new RelayCallbackManager(this, (IRCParser) parser);
75 75
             }
76 76
             for (String channel : server.getChannels()) {
77 77
                 final Channel chan = server.getChannel(channel);
@@ -113,17 +113,17 @@ public class RelayBotPlugin extends Plugin implements ActionListener, ConfigChan
113 113
     @Override
114 114
     public void processEvent(final ActionType type, final StringBuffer format, final Object... arguments) {
115 115
         if (type == CoreActionType.CHANNEL_OPENED) {
116
-            final Channel chan = (Channel)arguments[0];
116
+            final Channel chan = (Channel) arguments[0];
117 117
             
118 118
             final String channelName = chan.getServer().getParser().getStringConverter().toLowerCase(chan.getName());
119 119
             getHandler(chan);
120 120
         } else if (type == CoreActionType.CHANNEL_CLOSED) {
121
-            final Channel chan = (Channel)arguments[0];
121
+            final Channel chan = (Channel) arguments[0];
122 122
             removeHandler(chan);
123 123
         } else if (type == CoreActionType.CHANNEL_QUIT) {
124
-            final Channel chan = (Channel)arguments[0];
124
+            final Channel chan = (Channel) arguments[0];
125 125
             final Parser parser = chan.getServer().getParser();
126
-            final ChannelClientInfo cci = (ChannelClientInfo)arguments[1];
126
+            final ChannelClientInfo cci = (ChannelClientInfo) arguments[1];
127 127
             final String channelName = parser.getStringConverter().toLowerCase(chan.getName());
128 128
 
129 129
             if (IdentityManager.getGlobalConfig().hasOptionString(getDomain(), channelName)) {
@@ -137,14 +137,14 @@ public class RelayBotPlugin extends Plugin implements ActionListener, ConfigChan
137 137
                 }
138 138
             }
139 139
         } else if (type == CoreActionType.SERVER_CONNECTED) {
140
-            final Server server = (Server)arguments[0];
140
+            final Server server = (Server) arguments[0];
141 141
 
142 142
             final Parser parser = server.getParser();
143 143
             if (parser instanceof IRCParser && !(parser.getCallbackManager() instanceof RelayCallbackManager)) {
144
-                new RelayCallbackManager(this, (IRCParser)parser);
144
+                new RelayCallbackManager(this, (IRCParser) parser);
145 145
             }
146 146
         } else if (type == CoreActionType.SERVER_DISCONNECTED) {
147
-            final Server server = (Server)arguments[0];
147
+            final Server server = (Server) arguments[0];
148 148
 
149 149
             // RelayCallbackManager will revert itself when this happens.
150 150
 

+ 3
- 3
src/com/dmdirc/addons/relaybot/RelayChannelHandler.java Просмотреть файл

@@ -112,7 +112,7 @@ public class RelayChannelHandler implements ChannelMessageListener {
112 112
         synchronized (channelClients) {
113 113
             if (!channelClients.containsKey(storeName)) {
114 114
                 final RelayClientInfo client = new RelayClientInfo(channel.getParser(), nick);
115
-                final IRCChannelClientInfo newChannelClient = new IRCChannelClientInfo((IRCParser)channel.getParser(), client, channel);
115
+                final IRCChannelClientInfo newChannelClient = new IRCChannelClientInfo((IRCParser) channel.getParser(), client, channel);
116 116
                 colourClient(newChannelClient);
117 117
 
118 118
                 channelClients.put(storeName, newChannelClient);
@@ -157,7 +157,7 @@ public class RelayChannelHandler implements ChannelMessageListener {
157 157
         synchronized (channelClients) {
158 158
             channelClients.remove(channelClient.getClient().toString());
159 159
             ((RelayClientInfo) channelClient.getClient()).changeNickname(newNick);
160
-            channelClients.put(storeName,channelClient);
160
+            channelClients.put(storeName, channelClient);
161 161
         }
162 162
     }
163 163
 
@@ -196,7 +196,7 @@ public class RelayChannelHandler implements ChannelMessageListener {
196 196
         final PluginInfo nickColour = PluginManager.getPluginManager().getPluginInfoByName("nickcolour");
197 197
 
198 198
         final boolean fullColour = IdentityManager.getGlobalConfig().getOptionBool(myPlugin.getDomain(), "colourFullName");
199
-        final RelayClientInfo client = (RelayClientInfo)channelClient.getClient();
199
+        final RelayClientInfo client = (RelayClientInfo) channelClient.getClient();
200 200
         final boolean oldValue = client.getShowFullNickname();
201 201
         client.setShowFullNickname(fullColour);
202 202
 

+ 1
- 1
src/com/dmdirc/addons/relaybot/RelayClientInfo.java Просмотреть файл

@@ -41,7 +41,7 @@ public class RelayClientInfo extends IRCClientInfo {
41 41
      * @param host Host of client.
42 42
      */
43 43
     public RelayClientInfo(final Parser parser, final String host) {
44
-        super((IRCParser)parser, host);
44
+        super((IRCParser) parser, host);
45 45
         super.setFake(true);
46 46
     }
47 47
 

+ 2
- 2
src/com/dmdirc/addons/scriptplugin/JavaScriptHelper.java Просмотреть файл

@@ -38,7 +38,7 @@ public class JavaScriptHelper {
38 38
     private static final int VERSION = 2;
39 39
 
40 40
     /** Hashtable for storing stuff. */
41
-    private static final Map<String,Object> SETTINGS = new HashMap<String,Object>();
41
+    private static final Map<String, Object> SETTINGS = new HashMap<String, Object>();
42 42
     
43 43
     /**
44 44
      * Method to set Stuff.
@@ -50,7 +50,7 @@ public class JavaScriptHelper {
50 50
         if (setting.equals("")) { return; }
51 51
         setting = setting.toLowerCase();
52 52
         if (SETTINGS.containsKey(setting)) { SETTINGS.remove(setting); }
53
-        if (value != null) { SETTINGS.put(setting,value); }
53
+        if (value != null) { SETTINGS.put(setting, value); }
54 54
     }
55 55
     
56 56
     /**

+ 31
- 31
src/com/dmdirc/addons/scriptplugin/TypedProperties.java Просмотреть файл

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Shane Mc Cormack
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -30,7 +30,7 @@ import java.util.Properties;
30 30
 
31 31
 /**
32 32
  * Properties file that allows for getting/setting of typed properties
33
- * 
33
+ *
34 34
  * @author Shane 'Dataforce' McCormack
35 35
  */
36 36
 public class TypedProperties extends Properties {
@@ -55,7 +55,7 @@ public class TypedProperties extends Properties {
55 55
 
56 56
     /**
57 57
      * Creates an empty property list with the specified defaults.
58
-     * 
58
+     *
59 59
      * @param defaults
60 60
      *            The Defaults
61 61
      */
@@ -65,7 +65,7 @@ public class TypedProperties extends Properties {
65 65
 
66 66
     /**
67 67
      * Set case sensitivity of this properties file.
68
-     * 
68
+     *
69 69
      * @param value
70 70
      *            True/False for the case sensitivity of this file
71 71
      */
@@ -91,7 +91,7 @@ public class TypedProperties extends Properties {
91 91
      * After loading, setCaseSensitivity(caseSensitive) is called.
92 92
      * If this properties file is ment to be case Insensitive, all non-lowercase
93 93
      * property names will be lowercased.
94
-     * 
94
+     *
95 95
      * @param inStream
96 96
      *            InputStream to load from.
97 97
      * @throws IOException
@@ -108,7 +108,7 @@ public class TypedProperties extends Properties {
108 108
      * After loading, setCaseSensitivity(caseSensitive) is called.
109 109
      * If this properties file is ment to be case Insensitive, all non-lowercase
110 110
      * property names will be lowercased.
111
-     * 
111
+     *
112 112
      * @param reader
113 113
      *            Reader to load from.
114 114
      * @throws IOException
@@ -125,7 +125,7 @@ public class TypedProperties extends Properties {
125 125
      * After loading, setCaseSensitivity(caseSensitive) is called.
126 126
      * If this properties file is ment to be case Insensitive, all non-lowercase
127 127
      * property names will be lowercased.
128
-     * 
128
+     *
129 129
      * @param in
130 130
      *            InputStream to load from.
131 131
      * @throws java.io.IOException
@@ -138,7 +138,7 @@ public class TypedProperties extends Properties {
138 138
 
139 139
     /**
140 140
      * Get a property from the config
141
-     * 
141
+     *
142 142
      * @param key
143 143
      *            key for property
144 144
      * @return the requested property, or null if not defined
@@ -154,7 +154,7 @@ public class TypedProperties extends Properties {
154 154
 
155 155
     /**
156 156
      * Get a property from the config
157
-     * 
157
+     *
158 158
      * @param key
159 159
      *            key for property
160 160
      * @param fallback
@@ -172,7 +172,7 @@ public class TypedProperties extends Properties {
172 172
 
173 173
     /**
174 174
      * Set a property in the config
175
-     * 
175
+     *
176 176
      * @param key
177 177
      *            key for property
178 178
      * @param value
@@ -190,7 +190,7 @@ public class TypedProperties extends Properties {
190 190
 
191 191
     /**
192 192
      * Check if a property exists
193
-     * 
193
+     *
194 194
      * @param key
195 195
      *            key for property
196 196
      * @return True if the property exists, else false
@@ -201,7 +201,7 @@ public class TypedProperties extends Properties {
201 201
 
202 202
     /**
203 203
      * Get a Byte property from the config
204
-     * 
204
+     *
205 205
      * @param key
206 206
      *            key for property
207 207
      * @param fallback
@@ -218,7 +218,7 @@ public class TypedProperties extends Properties {
218 218
 
219 219
     /**
220 220
      * Set a Byte property in the config
221
-     * 
221
+     *
222 222
      * @param key
223 223
      *            key for property
224 224
      * @param value
@@ -230,7 +230,7 @@ public class TypedProperties extends Properties {
230 230
 
231 231
     /**
232 232
      * Get a Short property from the config
233
-     * 
233
+     *
234 234
      * @param key
235 235
      *            key for property
236 236
      * @param fallback
@@ -247,7 +247,7 @@ public class TypedProperties extends Properties {
247 247
 
248 248
     /**
249 249
      * Set a Short property in the config
250
-     * 
250
+     *
251 251
      * @param key
252 252
      *            key for property
253 253
      * @param value
@@ -259,7 +259,7 @@ public class TypedProperties extends Properties {
259 259
 
260 260
     /**
261 261
      * Get an integer property from the config
262
-     * 
262
+     *
263 263
      * @param key
264 264
      *            key for property
265 265
      * @param fallback
@@ -277,7 +277,7 @@ public class TypedProperties extends Properties {
277 277
 
278 278
     /**
279 279
      * Set an integer property in the config
280
-     * 
280
+     *
281 281
      * @param key
282 282
      *            key for property
283 283
      * @param value
@@ -289,7 +289,7 @@ public class TypedProperties extends Properties {
289 289
 
290 290
     /**
291 291
      * Get a Long property from the config
292
-     * 
292
+     *
293 293
      * @param key
294 294
      *            key for property
295 295
      * @param fallback
@@ -306,7 +306,7 @@ public class TypedProperties extends Properties {
306 306
 
307 307
     /**
308 308
      * Set a Long property in the config
309
-     * 
309
+     *
310 310
      * @param key
311 311
      *            key for property
312 312
      * @param value
@@ -318,7 +318,7 @@ public class TypedProperties extends Properties {
318 318
 
319 319
     /**
320 320
      * Get a float property from the config
321
-     * 
321
+     *
322 322
      * @param key
323 323
      *            key for property
324 324
      * @param fallback
@@ -335,7 +335,7 @@ public class TypedProperties extends Properties {
335 335
 
336 336
     /**
337 337
      * Set a float property in the config
338
-     * 
338
+     *
339 339
      * @param key
340 340
      *            key for property
341 341
      * @param value
@@ -347,7 +347,7 @@ public class TypedProperties extends Properties {
347 347
 
348 348
     /**
349 349
      * Get a double property from the config
350
-     * 
350
+     *
351 351
      * @param key
352 352
      *            key for property
353 353
      * @param fallback
@@ -365,7 +365,7 @@ public class TypedProperties extends Properties {
365 365
 
366 366
     /**
367 367
      * Set a double property in the config
368
-     * 
368
+     *
369 369
      * @param key
370 370
      *            key for property
371 371
      * @param value
@@ -377,7 +377,7 @@ public class TypedProperties extends Properties {
377 377
 
378 378
     /**
379 379
      * Get a boolean property from the config
380
-     * 
380
+     *
381 381
      * @param key
382 382
      *            key for property
383 383
      * @param fallback
@@ -391,7 +391,7 @@ public class TypedProperties extends Properties {
391 391
 
392 392
     /**
393 393
      * Set a Boolean property in the config
394
-     * 
394
+     *
395 395
      * @param key
396 396
      *            key for property
397 397
      * @param value
@@ -403,7 +403,7 @@ public class TypedProperties extends Properties {
403 403
 
404 404
     /**
405 405
      * Get a Char property from the config
406
-     * 
406
+     *
407 407
      * @param key
408 408
      *            key for property
409 409
      * @param fallback
@@ -421,7 +421,7 @@ public class TypedProperties extends Properties {
421 421
 
422 422
     /**
423 423
      * Set a Char property in the config
424
-     * 
424
+     *
425 425
      * @param key
426 426
      *            key for property
427 427
      * @param value
@@ -433,7 +433,7 @@ public class TypedProperties extends Properties {
433 433
 
434 434
     /**
435 435
      * Get a List property from the config.
436
-     * 
436
+     *
437 437
      * @param key
438 438
      *            key for property
439 439
      * @param fallback
@@ -457,7 +457,7 @@ public class TypedProperties extends Properties {
457 457
 
458 458
     /**
459 459
      * Set a List property in the config
460
-     * 
460
+     *
461 461
      * @param key
462 462
      *            key for property
463 463
      * @param value

+ 36
- 36
src/com/dmdirc/addons/systray/SystrayPlugin.java Просмотреть файл

@@ -56,32 +56,32 @@ import java.awt.event.MouseListener;
56 56
  */
57 57
 public final class SystrayPlugin extends Plugin implements ActionListener,
58 58
         MouseListener, com.dmdirc.interfaces.ActionListener {
59
-    
59
+
60 60
     /** The command we registered. */
61 61
     private PopupCommand command;
62
-    
62
+
63 63
     /** The tray icon we're currently using. */
64 64
     private final TrayIcon icon;
65
-    
65
+
66 66
     /** Creates a new system tray plugin. */
67 67
     public SystrayPlugin() {
68 68
         super();
69 69
         final MenuItem show = new MenuItem("Show/hide");
70 70
         final MenuItem quit = new MenuItem("Quit");
71
-        
71
+
72 72
         final PopupMenu menu = new PopupMenu();
73 73
         menu.add(show);
74 74
         menu.add(quit);
75
-        
75
+
76 76
         show.addActionListener(this);
77 77
         quit.addActionListener(this);
78
-        
79
-        icon = new TrayIcon(IconManager.getIconManager().getImage("logo"), 
78
+
79
+        icon = new TrayIcon(IconManager.getIconManager().getImage("logo"),
80 80
                 "DMDirc", menu);
81 81
         icon.setImageAutoSize(true);
82 82
         icon.addMouseListener(this);
83 83
     }
84
-    
84
+
85 85
     /**
86 86
      * Sends a notification via the system tray icon.
87 87
      * @param title The title of the notification
@@ -91,7 +91,7 @@ public final class SystrayPlugin extends Plugin implements ActionListener,
91 91
     public void notify(final String title, final String message, final TrayIcon.MessageType type) {
92 92
         icon.displayMessage(title, Styliser.stipControlCodes(message), type);
93 93
     }
94
-    
94
+
95 95
     /**
96 96
      * Sends a notification via the system tray icon.
97 97
      * @param title The title of the notification
@@ -100,10 +100,10 @@ public final class SystrayPlugin extends Plugin implements ActionListener,
100 100
     public void notify(final String title, final String message) {
101 101
         notify(title, message, TrayIcon.MessageType.NONE);
102 102
     }
103
-    
103
+
104 104
     /**
105 105
      * {@inheritDoc}
106
-     * 
106
+     *
107 107
      * @param e Action event
108 108
      */
109 109
     @Override
@@ -114,7 +114,7 @@ public final class SystrayPlugin extends Plugin implements ActionListener,
114 114
             Main.quit();
115 115
         }
116 116
     }
117
-    
117
+
118 118
     /** {@inheritDoc} */
119 119
     @Override
120 120
     public ValidationResponse checkPrerequisites() {
@@ -124,7 +124,7 @@ public final class SystrayPlugin extends Plugin implements ActionListener,
124 124
             return new ValidationResponse("System tray is not supported on this platform.");
125 125
         }
126 126
     }
127
-    
127
+
128 128
     /** {@inheritDoc} */
129 129
     @Override
130 130
     public void onLoad() {
@@ -134,16 +134,16 @@ public final class SystrayPlugin extends Plugin implements ActionListener,
134 134
         } catch (AWTException ex) {
135 135
             // Should probably unload ourself here?
136 136
         }
137
-        
137
+
138 138
         ActionManager.addListener(this, CoreActionType.CLIENT_MINIMISED);
139 139
     }
140
-    
140
+
141 141
     /** {@inheritDoc} */
142 142
     @Override
143 143
     public void onUnload() {
144 144
         SystemTray.getSystemTray().remove(icon);
145 145
         command.unregister();
146
-        
146
+
147 147
         ActionManager.removeListener(this);
148 148
     }
149 149
 
@@ -153,25 +153,25 @@ public final class SystrayPlugin extends Plugin implements ActionListener,
153 153
         final PreferencesCategory category = new PluginPreferencesCategory(
154 154
                 getPluginInfo(), "System Tray",
155 155
                 "General configuration settings");
156
-        
156
+
157 157
         category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
158 158
                 getDomain(), "autominimise", "Auto-hide DMDirc " +
159 159
                 "when minimised", "If this option is enabled, the systray " +
160 160
                 "plugin will hide DMDirc to the system tray whenever DMDirc is" +
161 161
                 " minimised"));
162
-        
162
+
163 163
         manager.getCategory("Plugins").addSubCategory(category);
164 164
     }
165
-    
166
-    /** 
165
+
166
+    /**
167 167
      * {@inheritDoc}
168
-     * 
168
+     *
169 169
      * @param e Mouse event
170 170
      */
171 171
     @Override
172 172
     public void mouseClicked(final MouseEvent e) {
173 173
         if (e.getButton() == MouseEvent.BUTTON1) {
174
-            if (Main.getUI().getMainWindow().isVisible()) {               
174
+            if (Main.getUI().getMainWindow().isVisible()) {
175 175
                 Main.getUI().getMainWindow().setVisible(false);
176 176
             } else {
177 177
                 Main.getUI().getMainWindow().setVisible(true);
@@ -180,47 +180,47 @@ public final class SystrayPlugin extends Plugin implements ActionListener,
180 180
             }
181 181
         }
182 182
     }
183
-    
184
-    /** 
183
+
184
+    /**
185 185
      * {@inheritDoc}
186
-     * 
186
+     *
187 187
      * @param e Mouse event
188 188
      */
189 189
     @Override
190 190
     public void mousePressed(final MouseEvent e) {
191 191
         //Ignore
192 192
     }
193
-    
194
-    /** 
193
+
194
+    /**
195 195
      * {@inheritDoc}
196
-     * 
196
+     *
197 197
      * @param e Mouse event
198 198
      */
199 199
     @Override
200 200
     public void mouseReleased(final MouseEvent e) {
201 201
         //Ignore
202 202
     }
203
-    
204
-    /** 
203
+
204
+    /**
205 205
      * {@inheritDoc}
206
-     * 
206
+     *
207 207
      * @param e Mouse event
208 208
      */
209 209
     @Override
210 210
     public void mouseEntered(final MouseEvent e) {
211 211
         //Ignore
212 212
     }
213
-    
214
-    /** 
213
+
214
+    /**
215 215
      * {@inheritDoc}
216
-     * 
216
+     *
217 217
      * @param e Mouse event
218 218
      */
219 219
     @Override
220 220
     public void mouseExited(final MouseEvent e) {
221 221
         //Ignore
222 222
     }
223
-    
223
+
224 224
     /** {@inheritDoc} */
225 225
     @Override
226 226
     public void processEvent(final ActionType type, final StringBuffer format,
@@ -231,5 +231,5 @@ public final class SystrayPlugin extends Plugin implements ActionListener,
231 231
             Main.getUI().getMainWindow().setVisible(false);
232 232
         }
233 233
     }
234
-    
234
+
235 235
 }

+ 25
- 25
src/com/dmdirc/addons/ui_dummy/DummyInputWindow.java Просмотреть файл

@@ -37,7 +37,7 @@ import java.nio.charset.Charset;
37 37
  * Dummy input window, used for testing.
38 38
  */
39 39
 public class DummyInputWindow implements InputWindow {
40
-    
40
+
41 41
     /** Window title. */
42 42
     private String title;
43 43
     /** Are we visible? */
@@ -48,10 +48,10 @@ public class DummyInputWindow implements InputWindow {
48 48
     private final WritableFrameContainer<? extends InputWindow> container;
49 49
     /** Our command parser. */
50 50
     private final CommandParser commandParser;
51
-    
52
-    /** 
51
+
52
+    /**
53 53
      * Instantiates a new DummyInputWindow.
54
-     * 
54
+     *
55 55
      * @param owner Parent window
56 56
      * @param commandParser Parent command parser
57 57
      */
@@ -60,114 +60,114 @@ public class DummyInputWindow implements InputWindow {
60 60
         this.container = owner;
61 61
         this.commandParser = commandParser;
62 62
     }
63
-    
63
+
64 64
     /** {@inheritDoc} */
65 65
     @Override
66 66
     public CommandParser getCommandParser() {
67 67
         return commandParser;
68 68
     }
69
-    
69
+
70 70
     /** {@inheritDoc} */
71 71
     @Override
72 72
     public InputHandler getInputHandler() {
73 73
         return new DummyInputHandler(new DummyInputField(), null, this);
74 74
     }
75
-    
75
+
76 76
     /** {@inheritDoc} */
77 77
     @Override
78 78
     @Deprecated
79 79
     public void setAwayIndicator(final boolean isAway) {
80 80
         // Do nothing
81 81
     }
82
-    
82
+
83 83
     /** {@inheritDoc} */
84 84
     @Override
85 85
     @Deprecated
86 86
     public void addLine(final String messageType, final Object... args) {
87 87
         getContainer().addLine(messageType, args);
88 88
     }
89
-    
89
+
90 90
     /** {@inheritDoc} */
91 91
     @Override
92 92
     @Deprecated
93 93
     public void addLine(final StringBuffer messageType, final Object... args) {
94 94
         getContainer().addLine(messageType, args);
95 95
     }
96
-    
96
+
97 97
     /** {@inheritDoc} */
98 98
     @Override
99 99
     @Deprecated
100 100
     public void addLine(final String line, final boolean timestamp) {
101 101
         getContainer().addLine(line, timestamp);
102 102
     }
103
-    
103
+
104 104
     /** {@inheritDoc} */
105 105
     @Override
106 106
     @Deprecated
107 107
     public void clear() {
108 108
         throw new UnsupportedOperationException("Not supported yet.");
109 109
     }
110
-    
110
+
111 111
     /** {@inheritDoc} */
112 112
     @Override
113 113
     @Deprecated
114 114
     public ConfigManager getConfigManager() {
115 115
         return IdentityManager.getGlobalConfig();
116 116
     }
117
-    
117
+
118 118
     /** {@inheritDoc} */
119 119
     @Override
120 120
     public WritableFrameContainer<? extends InputWindow> getContainer() {
121 121
         return container;
122 122
     }
123
-    
123
+
124 124
     /** {@inheritDoc} */
125 125
     @Override
126 126
     public boolean isVisible() {
127 127
         return visible;
128 128
     }
129
-    
129
+
130 130
     /** {@inheritDoc} */
131 131
     @Override
132 132
     public void setVisible(final boolean isVisible) {
133 133
         visible = isVisible;
134 134
     }
135
-    
135
+
136 136
     /** {@inheritDoc} */
137 137
     @Override
138 138
     @Deprecated
139 139
     public String getTitle() {
140 140
         return title;
141 141
     }
142
-    
142
+
143 143
     /** {@inheritDoc} */
144 144
     @Override
145 145
     public boolean isMaximum() {
146 146
         return maximised;
147 147
     }
148
-    
149
-    /** 
150
-     * {@inheritDoc} 
151
-     * 
148
+
149
+    /**
150
+     * {@inheritDoc}
151
+     *
152 152
      * @param b maximised or not
153 153
      */
154 154
     public void setMaximum(final boolean b) {
155 155
         maximised = b;
156 156
     }
157
-    
157
+
158 158
     /** {@inheritDoc} */
159 159
     @Override
160 160
     @Deprecated
161 161
     public void setTitle(final String title) {
162 162
         this.title = title;
163 163
     }
164
-    
164
+
165 165
     /** {@inheritDoc} */
166 166
     @Override
167 167
     public void open() {
168 168
         // Do nothing
169 169
     }
170
-    
170
+
171 171
     /** {@inheritDoc} */
172 172
     @Override
173 173
     @Deprecated
@@ -216,5 +216,5 @@ public class DummyInputWindow implements InputWindow {
216 216
     public UIController getController() {
217 217
         return new DummyController();
218 218
     }
219
-    
219
+
220 220
 }

+ 10
- 10
src/com/dmdirc/addons/ui_dummy/DummyMainWindow.java Просмотреть файл

@@ -30,59 +30,59 @@ import javax.swing.ImageIcon;
30 30
  * Dummy main window, used for testing.
31 31
  */
32 32
 public final class DummyMainWindow implements MainWindow {
33
-    
33
+
34 34
     /** Are the windows maximised? */
35 35
     private boolean maximised;
36 36
     /** Are we visible? */
37 37
     private boolean visible = true;
38
-    
38
+
39 39
     /**
40 40
      * Creates a new instance of DummyMainWindow.
41 41
      */
42 42
     public DummyMainWindow() {
43 43
         //Do nothing.
44 44
     }
45
-    
45
+
46 46
     /** {@inheritDoc} */
47 47
     @Override
48 48
     public ImageIcon getIcon() {
49 49
         return null;
50 50
     }
51
-    
51
+
52 52
     /** {@inheritDoc} */
53 53
     @Override
54 54
     public void quit() {
55 55
         // Do nothing
56 56
     }
57
-    
57
+
58 58
     /** {@inheritDoc} */
59 59
     @Override
60 60
     public void setMaximised(final boolean max) {
61 61
         maximised = max;
62 62
     }
63
-    
63
+
64 64
     /** {@inheritDoc} */
65 65
     @Override
66 66
     public boolean getMaximised() {
67 67
         return maximised;
68 68
     }
69
-    
69
+
70 70
     /** {@inheritDoc} */
71 71
     @Override
72 72
     public String getTitlePrefix() {
73 73
         return "DMDirc: Dummy UI: ";
74 74
     }
75
-    
75
+
76 76
     /** {@inheritDoc} */
77 77
     @Override
78 78
     public void setVisible(final boolean visible) {
79 79
         this.visible = visible;
80 80
     }
81
-    
81
+
82 82
     /** {@inheritDoc} */
83 83
     @Override
84 84
     public boolean isVisible() {
85 85
         return visible;
86 86
     }
87
-    
87
+
88 88
 }

+ 13
- 13
src/com/dmdirc/addons/ui_swing/UIUtilities.java Просмотреть файл

@@ -69,7 +69,7 @@ public final class UIUtilities {
69 69
     /**
70 70
      * Adds an undo manager and associated key bindings to the specified text
71 71
      * component.
72
-     * 
72
+     *
73 73
      * @param component component Text component to add an undo manager to
74 74
      */
75 75
     public static void addUndoManager(final JTextComponent component) {
@@ -168,7 +168,7 @@ public final class UIUtilities {
168 168
 
169 169
     /**
170 170
      * Invokes and waits for the specified runnable, executed on the EDT.
171
-     * 
171
+     *
172 172
      * @param runnable Thread to be executed
173 173
      */
174 174
     public static void invokeAndWait(final Runnable runnable) {
@@ -187,7 +187,7 @@ public final class UIUtilities {
187 187
 
188 188
     /**
189 189
      * Invokes and waits for the specified runnable, executed on the EDT.
190
-     * 
190
+     *
191 191
      * @param <T> The return type of the returnable thread
192 192
      * @param returnable Thread to be executed
193 193
      * @return Result from the compelted thread
@@ -210,7 +210,7 @@ public final class UIUtilities {
210 210
 
211 211
     /**
212 212
      * Queues the runnable to be executed on the EDT.
213
-     * 
213
+     *
214 214
      * @param runnable Runnable to be executed.
215 215
      */
216 216
     public static void invokeLater(final Runnable runnable) {
@@ -223,7 +223,7 @@ public final class UIUtilities {
223 223
 
224 224
     /**
225 225
      * Check if we are using one of the Windows Look and Feels
226
-     * 
226
+     *
227 227
      * @return True iff the current LAF is "Windows" or "Windows Classic"
228 228
      */
229 229
     public static boolean isWindowsUI() {
@@ -238,7 +238,7 @@ public final class UIUtilities {
238 238
 
239 239
     /**
240 240
      * Get the value to pass to set Opaque on items being added to a JTabbedPane
241
-     * 
241
+     *
242 242
      * @return True iff the current LAF is not Windows or OS X.
243 243
      * @since 0.6
244 244
      */
@@ -254,7 +254,7 @@ public final class UIUtilities {
254 254
 
255 255
     /**
256 256
      * Get the DOWN_MASK for the command/ctrl key.
257
-     * 
257
+     *
258 258
      * @return on OSX this returns META_DOWN_MASK, else CTRL_DOWN_MASK
259 259
      * @since 0.6
260 260
      */
@@ -264,7 +264,7 @@ public final class UIUtilities {
264 264
 
265 265
     /**
266 266
      * Get the MASK for the command/ctrl key.
267
-     * 
267
+     *
268 268
      * @return on OSX this returns META_MASK, else CTRL_MASK
269 269
      * @since 0.6
270 270
      */
@@ -274,7 +274,7 @@ public final class UIUtilities {
274 274
 
275 275
     /**
276 276
      * Check if the command/ctrl key is pressed down.
277
-     * 
277
+     *
278 278
      * @param e The KeyEvent to check
279 279
      * @return on OSX this returns e.isMetaDown(), else e.isControlDown()
280 280
      * @since 0.6
@@ -285,11 +285,11 @@ public final class UIUtilities {
285 285
 
286 286
     /**
287 287
      * Clips a string if its longer than the specified width.
288
-     * 
288
+     *
289 289
      * @param component Component containing string
290 290
      * @param string String to check
291 291
      * @param avaiableWidth Available Width
292
-     * 
292
+     *
293 293
      * @return String (clipped if required)
294 294
      */
295 295
     public static String clipStringifNeeded(final JComponent component,
@@ -307,11 +307,11 @@ public final class UIUtilities {
307 307
 
308 308
     /**
309 309
      * Clips the passed string .
310
-     * 
310
+     *
311 311
      * @param component Component containing string
312 312
      * @param string String to check
313 313
      * @param avaiableWidth Available Width
314
-     * 
314
+     *
315 315
      * @return String (clipped if required)
316 316
      */
317 317
     public static String clipString(final JComponent component,

+ 22
- 22
src/com/dmdirc/addons/ui_swing/actions/CopyAction.java Просмотреть файл

@@ -31,44 +31,44 @@ import javax.swing.text.JTextComponent;
31 31
 /**
32 32
  * Copy action.
33 33
  */
34
-public final class CopyAction extends AbstractAction { 
35
-    
34
+public final class CopyAction extends AbstractAction {
35
+
36 36
     /**
37 37
      * A version number for this class. It should be changed whenever the class
38 38
      * structure is changed (or anything else that would prevent serialized
39 39
      * objects being unserialized with the new class).
40 40
      */
41 41
     private static final long serialVersionUID = 1;
42
-    
42
+
43 43
     /** Text component to be acted upon. */
44
-    private final JTextComponent comp; 
45
- 
46
-    /** 
44
+    private final JTextComponent comp;
45
+
46
+    /**
47 47
      * Instantiates a new copy action.
48
-     * 
48
+     *
49 49
      * @param comp Component to be acted upon
50 50
      */
51
-    public CopyAction(final JTextComponent comp) { 
52
-        super("Copy"); 
53
-        
54
-        this.comp = comp; 
55
-    } 
56
- 
51
+    public CopyAction(final JTextComponent comp) {
52
+        super("Copy");
53
+
54
+        this.comp = comp;
55
+    }
56
+
57 57
     /**
58 58
      * {@inheritDoc}
59 59
      *
60 60
      * @param e Action event
61 61
      */
62 62
     @Override
63
-    public void actionPerformed(final ActionEvent e) { 
64
-        comp.copy(); 
65
-    } 
66
- 
63
+    public void actionPerformed(final ActionEvent e) {
64
+        comp.copy();
65
+    }
66
+
67 67
     /** {@inheritDoc} */
68 68
     @Override
69
-    public boolean isEnabled() { 
70
-        return comp.isEnabled() 
69
+    public boolean isEnabled() {
70
+        return comp.isEnabled()
71 71
                 && comp.getSelectedText() != null
72
-                && !(comp instanceof JPasswordField); 
73
-    } 
74
-} 
72
+                && !(comp instanceof JPasswordField);
73
+    }
74
+}

+ 22
- 22
src/com/dmdirc/addons/ui_swing/actions/CutAction.java Просмотреть файл

@@ -31,45 +31,45 @@ import javax.swing.text.JTextComponent;
31 31
 /**
32 32
  * Cut action.
33 33
  */
34
-public final class CutAction extends AbstractAction { 
35
-    
34
+public final class CutAction extends AbstractAction {
35
+
36 36
     /**
37 37
      * A version number for this class. It should be changed whenever the class
38 38
      * structure is changed (or anything else that would prevent serialized
39 39
      * objects being unserialized with the new class).
40 40
      */
41 41
     private static final long serialVersionUID = 1;
42
-    
42
+
43 43
     /** Text component to be acted upon. */
44
-    private final JTextComponent comp; 
45
- 
46
-    /** 
44
+    private final JTextComponent comp;
45
+
46
+    /**
47 47
      * Instantiates a new cut action.
48
-     * 
48
+     *
49 49
      * @param comp Component to be acted upon
50 50
      */
51
-    public CutAction(final JTextComponent comp) { 
52
-        super("Cut"); 
53
-        
54
-        this.comp = comp; 
55
-    } 
56
- 
51
+    public CutAction(final JTextComponent comp) {
52
+        super("Cut");
53
+
54
+        this.comp = comp;
55
+    }
56
+
57 57
     /**
58 58
      * {@inheritDoc}
59 59
      *
60 60
      * @param e Action event
61 61
      */
62 62
     @Override
63
-    public void actionPerformed(final ActionEvent e) { 
64
-        comp.cut(); 
65
-    } 
66
- 
63
+    public void actionPerformed(final ActionEvent e) {
64
+        comp.cut();
65
+    }
66
+
67 67
     /** {@inheritDoc} */
68 68
     @Override
69
-    public boolean isEnabled() { 
70
-        return comp.isEditable() 
71
-                && comp.isEnabled() 
69
+    public boolean isEnabled() {
70
+        return comp.isEditable()
71
+                && comp.isEnabled()
72 72
                 && comp.getSelectedText() != null
73
-                && !(comp instanceof JPasswordField); 
73
+                && !(comp instanceof JPasswordField);
74 74
     }
75
-} 
75
+}

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/MenuScroller.java Просмотреть файл

@@ -1,5 +1,5 @@
1 1
 /**
2
- * @(#)MenuScroller.java	1.3.0 05/04/09
2
+ * @(#)MenuScroller.java 1.3.0 05/04/09
3 3
  */
4 4
 package com.dmdirc.addons.ui_swing.components;
5 5
 

+ 19
- 19
src/com/dmdirc/addons/ui_swing/components/NicklistListModel.java Просмотреть файл

@@ -72,13 +72,13 @@ public final class NicklistListModel extends AbstractListModel implements
72 72
         super();
73 73
 
74 74
         this.config = config;
75
-        
75
+
76 76
         sortByMode = config.getOptionBool("nicklist", "sortByMode");
77 77
         sortByCase = config.getOptionBool("nicklist", "sortByCase");
78 78
         config.addChangeListener("nicklist", "sortByMode", this);
79 79
         config.addChangeListener("nicklist", "sortByCase", this);
80 80
         nicknames = Collections.synchronizedList(newNicknames);
81
-        
81
+
82 82
         sort();
83 83
     }
84 84
 
@@ -93,9 +93,9 @@ public final class NicklistListModel extends AbstractListModel implements
93 93
 
94 94
     /**
95 95
      * Returns the element at the specified place in the nicklist.
96
-     * 
96
+     *
97 97
      * @param index index of nick required
98
-     * 
98
+     *
99 99
      * @return nicklist entry requested
100 100
      */
101 101
     @Override
@@ -116,9 +116,9 @@ public final class NicklistListModel extends AbstractListModel implements
116 116
 
117 117
     /**
118 118
      * Replaces the entire nicklist with the arraylist specified.
119
-     * 
119
+     *
120 120
      * @param clients replacement nicklist
121
-     * 
121
+     *
122 122
      * @return boolean success
123 123
      */
124 124
     public boolean replace(final Collection<ChannelClientInfo> clients) {
@@ -133,9 +133,9 @@ public final class NicklistListModel extends AbstractListModel implements
133 133
 
134 134
     /**
135 135
      * Adds the specified client to the nicklist.
136
-     * 
136
+     *
137 137
      * @param client client to add to the nicklist
138
-     * 
138
+     *
139 139
      * @return boolean success
140 140
      */
141 141
     public boolean add(final ChannelClientInfo client) {
@@ -149,38 +149,38 @@ public final class NicklistListModel extends AbstractListModel implements
149 149
 
150 150
     /**
151 151
      * Removes the specified client from the nicklist.
152
-     * 
152
+     *
153 153
      * @param client client to remove
154
-     * 
154
+     *
155 155
      * @return boolean success
156 156
      */
157 157
     public boolean remove(final ChannelClientInfo client) {
158 158
         boolean returnValue;
159
-        
159
+
160 160
         returnValue = nicknames.remove(client);
161 161
         rerender();
162
-        
162
+
163 163
         return returnValue;
164 164
     }
165 165
 
166 166
     /**
167 167
      * Removes the specified index from the nicklist.
168
-     * 
168
+     *
169 169
      * @param index index to remove
170
-     * 
170
+     *
171 171
      * @return ChannelClientInfo client removed
172 172
      */
173 173
     public ChannelClientInfo remove(final int index) {
174 174
         ChannelClientInfo returnValue;
175
-        
175
+
176 176
         returnValue = nicknames.remove(index);
177 177
         rerender();
178
-        
178
+
179 179
         return returnValue;
180 180
     }
181 181
 
182
-    /** 
183
-     * Fires the model changed event forcing the model to re-render. 
182
+    /**
183
+     * Fires the model changed event forcing the model to re-render.
184 184
      */
185 185
     public void rerender() {
186 186
         fireContentsChanged(this, 0, nicknames.size());
@@ -194,7 +194,7 @@ public final class NicklistListModel extends AbstractListModel implements
194 194
         } else if ("sortByCase".equals(key)) {
195 195
             sortByCase = config.getOptionBool("nicklist", "sortByCase");
196 196
         }
197
-        
197
+
198 198
         sort();
199 199
     }
200 200
 }

+ 44
- 44
src/com/dmdirc/addons/ui_swing/components/SplitPane.java Просмотреть файл

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -62,7 +62,7 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
62 62
     }
63 63
 
64 64
     /**
65
-     * Instantiates a new snapping split pane. Defaults to using a horizontal 
65
+     * Instantiates a new snapping split pane. Defaults to using a horizontal
66 66
      * split, two null components and snapping to the left component.
67 67
      */
68 68
     public SplitPane() {
@@ -70,9 +70,9 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
70 70
     }
71 71
 
72 72
     /**
73
-     * Instantiates a new snapping split pane. Defaults to using a horizontal 
73
+     * Instantiates a new snapping split pane. Defaults to using a horizontal
74 74
      * split, two null components and snapping to the left component.
75
-     * 
75
+     *
76 76
      * @param snapDistance Distance to around the preferred size
77 77
      */
78 78
     public SplitPane(final int snapDistance) {
@@ -80,9 +80,9 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
80 80
     }
81 81
 
82 82
     /**
83
-     * Instantiates a new snapping split pane. Defaults to using a horizontal 
83
+     * Instantiates a new snapping split pane. Defaults to using a horizontal
84 84
      * split and two null components.
85
-     * 
85
+     *
86 86
      * @param leftComponentSnap Snap to the preferred size of the left component?
87 87
      */
88 88
     public SplitPane(final boolean leftComponentSnap) {
@@ -90,9 +90,9 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
90 90
     }
91 91
 
92 92
     /**
93
-     * Instantiates a new snapping split pane. Defaults to using a horizontal 
93
+     * Instantiates a new snapping split pane. Defaults to using a horizontal
94 94
      * split and two null components.
95
-     * 
95
+     *
96 96
      * @param leftComponentSnap Snap to the preferred size of the left component?
97 97
      * @param snapDistance Distance to around the preferred size
98 98
      */
@@ -102,11 +102,11 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
102 102
     }
103 103
 
104 104
     /**
105
-     * Instantiates a new snapping split pane. Defaults to using two null 
105
+     * Instantiates a new snapping split pane. Defaults to using two null
106 106
      * components and snapping to the left component.
107
-     * 
108
-     * @param orientation Split pane orientation 
109
-     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or 
107
+     *
108
+     * @param orientation Split pane orientation
109
+     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or
110 110
      * <code>JSplitPane.VERTICAL_SPLIT</code>
111 111
      */
112 112
     public SplitPane(final Orientation orientation) {
@@ -114,11 +114,11 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
114 114
     }
115 115
 
116 116
     /**
117
-     * Instantiates a new snapping split pane. Defaults to using two null 
117
+     * Instantiates a new snapping split pane. Defaults to using two null
118 118
      * components and snapping to the left component.
119
-     * 
120
-     * @param orientation Split pane orientation 
121
-     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or 
119
+     *
120
+     * @param orientation Split pane orientation
121
+     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or
122 122
      * <code>JSplitPane.VERTICAL_SPLIT</code>
123 123
      * @param snapDistance Distance to around the preferred size
124 124
      */
@@ -128,11 +128,11 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
128 128
     }
129 129
 
130 130
     /**
131
-     * Instantiates a new snapping split pane. Defaults to using two null 
131
+     * Instantiates a new snapping split pane. Defaults to using two null
132 132
      * components.
133
-     * 
134
-     * @param orientation Split pane orientation 
135
-     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or 
133
+     *
134
+     * @param orientation Split pane orientation
135
+     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or
136 136
      * <code>JSplitPane.VERTICAL_SPLIT</code>
137 137
      * @param leftComponentSnap Snap to the preferred size of the left component?
138 138
      */
@@ -142,11 +142,11 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
142 142
     }
143 143
 
144 144
     /**
145
-     * Instantiates a new snapping split pane. Defaults to using two null 
145
+     * Instantiates a new snapping split pane. Defaults to using two null
146 146
      * components.
147
-     * 
148
-     * @param orientation Split pane orientation 
149
-     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or 
147
+     *
148
+     * @param orientation Split pane orientation
149
+     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or
150 150
      * <code>JSplitPane.VERTICAL_SPLIT</code>
151 151
      * @param leftComponentSnap Snap to the preferred size of the left component?
152 152
      * @param snapDistance Distance to around the preferred size
@@ -157,11 +157,11 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
157 157
     }
158 158
 
159 159
     /**
160
-     * Instantiates a new snapping split pane. Defaults to using two null 
160
+     * Instantiates a new snapping split pane. Defaults to using two null
161 161
      * components and snapping to the left component.
162
-     * 
163
-     * @param orientation Split pane orientation 
164
-     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or 
162
+     *
163
+     * @param orientation Split pane orientation
164
+     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or
165 165
      * <code>JSplitPane.VERTICAL_SPLIT</code>
166 166
      * @param leftComponent left component
167 167
      * @param rightComponent right component
@@ -172,11 +172,11 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
172 172
     }
173 173
 
174 174
     /**
175
-     * Instantiates a new snapping split pane. Defaults to using two null 
175
+     * Instantiates a new snapping split pane. Defaults to using two null
176 176
      * components and snapping to the left component.
177
-     * 
178
-     * @param orientation Split pane orientation 
179
-     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or 
177
+     *
178
+     * @param orientation Split pane orientation
179
+     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or
180 180
      * <code>JSplitPane.VERTICAL_SPLIT</code>
181 181
      * @param leftComponent left component
182 182
      * @param rightComponent right component
@@ -189,11 +189,11 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
189 189
     }
190 190
 
191 191
     /**
192
-     * Instantiates a new snapping split pane. Defaults to using two null 
192
+     * Instantiates a new snapping split pane. Defaults to using two null
193 193
      * components.
194
-     * 
195
-     * @param orientation Split pane orientation 
196
-     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or 
194
+     *
195
+     * @param orientation Split pane orientation
196
+     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or
197 197
      * <code>JSplitPane.VERTICAL_SPLIT</code>
198 198
      * @param leftComponent left component
199 199
      * @param rightComponent right component
@@ -206,11 +206,11 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
206 206
     }
207 207
 
208 208
     /**
209
-     * Instantiates a new snapping split pane. Defaults to using two null 
209
+     * Instantiates a new snapping split pane. Defaults to using two null
210 210
      * components.
211
-     * 
212
-     * @param orientation Split pane orientation 
213
-     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or 
211
+     *
212
+     * @param orientation Split pane orientation
213
+     * <code>JSplitPane.HORIZONTAL_SPLIT</code> or
214 214
      * <code>JSplitPane.VERTICAL_SPLIT</code>
215 215
      * @param leftComponent left component
216 216
      * @param rightComponent right component
@@ -231,7 +231,7 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
231 231
 
232 232
         setOneTouchExpandable(useOneTouchExpandable);
233 233
         setContinuousLayout(true);
234
-        
234
+
235 235
         getActionMap().setParent(null);
236 236
         getActionMap().clear();
237 237
 
@@ -253,4 +253,4 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
253 253
         });
254 254
     }
255 255
 }
256
-    
256
+

+ 12
- 12
src/com/dmdirc/addons/ui_swing/components/SwingInputField.java Просмотреть файл

@@ -122,7 +122,7 @@ public class SwingInputField extends JComponent implements InputField,
122 122
             }
123 123
         });
124 124
     }
125
-    
125
+
126 126
     /** {@inheritDoc} */
127 127
     @Override
128 128
     public boolean requestFocusInWindow() {
@@ -190,7 +190,7 @@ public class SwingInputField extends JComponent implements InputField,
190 190
 
191 191
     /**
192 192
      * Returns the textfield for this inputfield.
193
-     * 
193
+     *
194 194
      * @return JTextField
195 195
      */
196 196
     public JTextField getTextField() {
@@ -349,7 +349,7 @@ public class SwingInputField extends JComponent implements InputField,
349 349
 
350 350
     /**
351 351
      * Replaces the selection with the specified text.
352
-     * 
352
+     *
353 353
      * @param clipboard Text to replace selection with
354 354
      */
355 355
     public void replaceSelection(final String clipboard) {
@@ -365,7 +365,7 @@ public class SwingInputField extends JComponent implements InputField,
365 365
 
366 366
     /**
367 367
      * Sets the caret colour to the specified coloour.
368
-     * 
368
+     *
369 369
      * @param optionColour Colour for the caret
370 370
      */
371 371
     public void setCaretColor(final Color optionColour) {
@@ -381,7 +381,7 @@ public class SwingInputField extends JComponent implements InputField,
381 381
 
382 382
     /**
383 383
      * Sets the foreground colour to the specified coloour.
384
-     * 
384
+     *
385 385
      * @param optionColour Colour for the caret
386 386
      */
387 387
     @Override
@@ -398,7 +398,7 @@ public class SwingInputField extends JComponent implements InputField,
398 398
 
399 399
     /**
400 400
      * Sets the background colour to the specified coloour.
401
-     * 
401
+     *
402 402
      * @param optionColour Colour for the caret
403 403
      */
404 404
     @Override
@@ -469,9 +469,9 @@ public class SwingInputField extends JComponent implements InputField,
469 469
         });
470 470
     }
471 471
 
472
-    /** 
472
+    /**
473 473
      * {@inheritDoc}
474
-     * 
474
+     *
475 475
      * @param e Key event
476 476
      */
477 477
     @Override
@@ -481,9 +481,9 @@ public class SwingInputField extends JComponent implements InputField,
481 481
         }
482 482
     }
483 483
 
484
-    /** 
484
+    /**
485 485
      * {@inheritDoc}
486
-     * 
486
+     *
487 487
      * @param e Key event
488 488
      */
489 489
     @Override
@@ -493,9 +493,9 @@ public class SwingInputField extends JComponent implements InputField,
493 493
         }
494 494
     }
495 495
 
496
-    /** 
496
+    /**
497 497
      * {@inheritDoc}
498
-     * 
498
+     *
499 499
      * @param e Key event
500 500
      */
501 501
     @Override

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/TopicBar.java Просмотреть файл

@@ -214,7 +214,7 @@ public class TopicBar extends JComponent implements ActionListener,
214 214
                             new String[]{Styliser.CODE_HEXCOLOUR + ColourManager.
215 215
                                 getHex(
216 216
                                 foregroundColour) + channel.getCurrentTopic().
217
-                                getTopic(),},
217
+                                getTopic(), },
218 218
                             as);
219 219
                 }
220 220
                 if (channel.getConfigManager().getOptionBool(controller.

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfo.java Просмотреть файл

@@ -74,7 +74,7 @@ public class AddonInfo {
74 74
             this.screenshot = new ImageIcon(URLBuilder.buildURL(
75 75
                     "http://addons.dmdirc.com/addonimg/" + id));
76 76
             this.screenshot.setImage(this.screenshot.getImage().
77
-                   getScaledInstance(150, 150,Image.SCALE_SMOOTH));
77
+                   getScaledInstance(150, 150, Image.SCALE_SMOOTH));
78 78
         } else {
79 79
             this.screenshot = new ImageIcon(URLBuilder.buildURL(
80 80
                     "dmdirc://com/dmdirc/res/logo.png"));

+ 4
- 5
src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfoCellEditor.java Просмотреть файл

@@ -1,17 +1,16 @@
1 1
 /*
2
- * 
3 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
4
- * 
3
+ *
5 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
6 5
  * of this software and associated documentation files (the "Software"), to deal
7 6
  * in the Software without restriction, including without limitation the rights
8 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 8
  * copies of the Software, and to permit persons to whom the Software is
10 9
  * furnished to do so, subject to the following conditions:
11
- * 
10
+ *
12 11
  * The above copyright notice and this permission notice shall be included in
13 12
  * all copies or substantial portions of the Software.
14
- * 
13
+ *
15 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -54,7 +53,7 @@ public class AddonInfoCellEditor extends AbstractCellEditor implements
54 53
         if (value instanceof AddonInfoLabel) {
55 54
             final AddonInfoLabel label = (AddonInfoLabel) value;
56 55
 
57
-            label.setBackground(row % 2 == 1 ? new Color(0xEE, 0xEE, 0xFF)
56
+            label.setBackground((row & 1) == 1 ? new Color(0xEE, 0xEE, 0xFF)
58 57
                     : Color.WHITE);
59 58
             
60 59
             table.setRowHeight(row, label.getPreferredSize().height);

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/addonbrowser/AddonInfoCellRenderer.java Просмотреть файл

@@ -54,7 +54,7 @@ public class AddonInfoCellRenderer implements TableCellRenderer {
54 54
         if (value instanceof AddonInfoLabel) {
55 55
             final AddonInfoLabel label = (AddonInfoLabel) value;
56 56
 
57
-            final Color colour = row % 2 == 1 ? new Color(0xEE, 0xEE, 0xFF) : Color.WHITE;
57
+            final Color colour = (row & 1) == 1 ? new Color(0xEE, 0xEE, 0xFF) : Color.WHITE;
58 58
             if (!label.getBackground().equals(colour)) {
59 59
                 label.setBackground(colour);
60 60
             }

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/addonbrowser/BrowserWindow.java Просмотреть файл

@@ -48,7 +48,7 @@ import net.miginfocom.swing.MigLayout;
48 48
 
49 49
 /**
50 50
  * The main window that allows users to browse addons.
51
- * 
51
+ *
52 52
  * @author chris
53 53
  */
54 54
 public class BrowserWindow extends JDialog implements ActionListener {
@@ -211,7 +211,7 @@ public class BrowserWindow extends JDialog implements ActionListener {
211 211
 
212 212
         for (Map<String, String> entry : data.getKeyDomains().values()) {
213 213
             final AddonInfo info = new AddonInfo(entry);
214
-            list.getModel().addRow(new Object[]{new AddonInfoLabel(info, this),});
214
+            list.getModel().addRow(new Object[]{new AddonInfoLabel(info, this), });
215 215
         }
216 216
     }
217 217
 

+ 17
- 17
src/com/dmdirc/addons/ui_swing/components/durationeditor/DurationDisplay.java Просмотреть файл

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -66,21 +66,21 @@ public class DurationDisplay extends JPanel implements ActionListener,
66 66
     public DurationDisplay() {
67 67
         this(0);
68 68
     }
69
-    
69
+
70 70
     /**
71 71
      * Instantiates a new duration display.
72
-     * 
72
+     *
73 73
      * @param window Parent window.
74
-     * 
74
+     *
75 75
      * @since 0.6
76 76
      */
77 77
     public DurationDisplay(final Window window) {
78 78
         this(window, 0);
79 79
     }
80
-    
80
+
81 81
     /**
82 82
      * Instantiates a new duration display.
83
-     * 
83
+     *
84 84
      * @param duration Starting duration
85 85
      */
86 86
     public DurationDisplay(final long duration) {
@@ -89,10 +89,10 @@ public class DurationDisplay extends JPanel implements ActionListener,
89 89
 
90 90
     /**
91 91
      * Initialises a new duration display showing the specified millisecond duration.
92
-     * 
92
+     *
93 93
      * @param window Parent window.
94 94
      * @param duration Duration to display in milliseconds
95
-     * 
95
+     *
96 96
      * @since 0.6
97 97
      */
98 98
     public DurationDisplay(final Window window, final long duration) {
@@ -141,9 +141,9 @@ public class DurationDisplay extends JPanel implements ActionListener,
141 141
         add(button, "");
142 142
     }
143 143
 
144
-    /** 
144
+    /**
145 145
      * {@inheritDoc}
146
-     * 
146
+     *
147 147
      * @param e Action event
148 148
      */
149 149
     @Override
@@ -153,7 +153,7 @@ public class DurationDisplay extends JPanel implements ActionListener,
153 153
         editor.addDurationListener(this);
154 154
     }
155 155
 
156
-    /** 
156
+    /**
157 157
      * {@inheritDoc}
158 158
      */
159 159
     @Override
@@ -169,7 +169,7 @@ public class DurationDisplay extends JPanel implements ActionListener,
169 169
 
170 170
     /**
171 171
      * Returns the duration of this display in milliseconds.
172
-     * 
172
+     *
173 173
      * @return Displayed duration in milliseconds
174 174
      */
175 175
     public long getDuration() {
@@ -200,7 +200,7 @@ public class DurationDisplay extends JPanel implements ActionListener,
200 200
 
201 201
     /**
202 202
      * Fires the duration updated method on all listeners.
203
-     * 
203
+     *
204 204
      * @param newDuration New duration
205 205
      */
206 206
     protected void fireDurationListener(final int newDuration) {
@@ -208,10 +208,10 @@ public class DurationDisplay extends JPanel implements ActionListener,
208 208
             listener.durationUpdated(newDuration);
209 209
         }
210 210
     }
211
-    
211
+
212 212
     /**
213 213
      * Sets the Parent window.
214
-     * 
214
+     *
215 215
      * @param window Parent window
216 216
      */
217 217
     public void setWindow(final Window window) {

+ 27
- 27
src/com/dmdirc/addons/ui_swing/components/expandingsettings/AddOptionPanel.java Просмотреть файл

@@ -52,17 +52,17 @@ import net.miginfocom.swing.MigLayout;
52 52
  * Add option panel.
53 53
  */
54 54
 public class AddOptionPanel extends JPanel implements ActionListener {
55
-    
55
+
56 56
     /**
57 57
      * A version number for this class. It should be changed whenever the class
58 58
      * structure is changed (or anything else that would prevent serialized
59 59
      * objects being unserialized with the new class).
60 60
      */
61 61
     private static final long serialVersionUID = 2;
62
-    
62
+
63 63
     /** Parent settings panel. */
64 64
     private final SettingsPanel parent;
65
-    
65
+
66 66
     /** Add options combobox. */
67 67
     private JComboBox addOptionComboBox;
68 68
     /** Add option button. */
@@ -83,7 +83,7 @@ public class AddOptionPanel extends JPanel implements ActionListener {
83 83
     private JComboBox addInputComboBox;
84 84
     /** Add option checkbox. */
85 85
     private JLabel addInputNone;
86
-    
86
+
87 87
     /**
88 88
      * Creates a new instance of AddOptionPanel.
89 89
      *
@@ -91,23 +91,23 @@ public class AddOptionPanel extends JPanel implements ActionListener {
91 91
      */
92 92
     protected AddOptionPanel(final SettingsPanel parent) {
93 93
         super();
94
-        
94
+
95 95
         this.parent = parent;
96
-        
96
+
97 97
         this.setOpaque(UIUtilities.getTabbedPaneOpaque());
98 98
         initComponents();
99 99
         initListeners();
100 100
         setLayout(new MigLayout("ins 0"));
101 101
         layoutComponents();
102 102
     }
103
-    
103
+
104 104
     /** Initialises the components. */
105 105
     private void initComponents() {
106 106
         addOptionComboBox = new JComboBox(new DefaultComboBoxModel());
107 107
         addOptionButton = new JButton("Add");
108
-        
108
+
109 109
         addOptionComboBox.setRenderer(new AddOptionCellRenderer(parent));
110
-        
110
+
111 111
         addInputColourChooser = new ColourChooser();
112 112
         addInputText = new JTextField();
113 113
         addInputCheckbox = new JCheckBox();
@@ -116,13 +116,13 @@ public class AddOptionPanel extends JPanel implements ActionListener {
116 116
         addInputNone = new JLabel("");
117 117
         addInputFontPicker = new FontPicker("Dialog");
118 118
         addInputComboBox = new JComboBox(new DefaultComboBoxModel());
119
-        
119
+
120 120
         addInputCurrent = addInputNone;
121
-        
121
+
122 122
         addOptionComboBox.setEnabled(false);
123 123
         addOptionButton.setEnabled(false);
124 124
     }
125
-    
125
+
126 126
     /** Initialises listeners. */
127 127
     private void initListeners() {
128 128
         //Only fire events on selection not on highlight
@@ -131,7 +131,7 @@ public class AddOptionPanel extends JPanel implements ActionListener {
131 131
         addOptionButton.addActionListener(this);
132 132
 
133 133
         addInputText.getActionMap().put("enter", new AbstractAction() {
134
-            
134
+
135 135
             private static final long serialVersionUID = 2;
136 136
 
137 137
             /** {@inheritDoc} */
@@ -142,20 +142,20 @@ public class AddOptionPanel extends JPanel implements ActionListener {
142 142
         });
143 143
         addInputText.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "enter");
144 144
     }
145
-    
145
+
146 146
     /** Lays out the components. */
147 147
     private void layoutComponents() {
148 148
         setVisible(false);
149
-        
149
+
150 150
         removeAll();
151
-        
151
+
152 152
         add(addOptionComboBox, "left, aligny top");
153 153
         add(addInputCurrent, "growx, pushx, aligny top");
154 154
         add(addOptionButton, "right, aligny top");
155
-        
155
+
156 156
         setVisible(true);
157 157
     }
158
-    
158
+
159 159
     /**
160 160
      * Adds an addable option.
161 161
      *
@@ -173,7 +173,7 @@ public class AddOptionPanel extends JPanel implements ActionListener {
173 173
         addOptionButton.setEnabled(true);
174 174
         addOptionComboBox.setEnabled(true);
175 175
     }
176
-    
176
+
177 177
     /**
178 178
      * Removes an addable option.
179 179
      *
@@ -187,14 +187,14 @@ public class AddOptionPanel extends JPanel implements ActionListener {
187 187
             addOptionButton.setEnabled(false);
188 188
         }
189 189
     }
190
-    
190
+
191 191
     /** Clears the options. */
192 192
     protected void clearOptions() {
193 193
         addOptionComboBox.removeAllItems();
194 194
         addInputCurrent = addInputNone;
195 195
         layoutComponents();
196 196
     }
197
-    
197
+
198 198
     /**
199 199
      * Swaps the input field type to the appropriate type.
200 200
      *
@@ -232,12 +232,12 @@ public class AddOptionPanel extends JPanel implements ActionListener {
232 232
                     break;
233 233
             }
234 234
         }
235
-        
235
+
236 236
         layoutComponents();
237
-        
237
+
238 238
         addOptionComboBox.requestFocusInWindow();
239 239
     }
240
-    
240
+
241 241
     /**
242 242
      * {@inheritDoc}
243 243
      *
@@ -255,7 +255,7 @@ public class AddOptionPanel extends JPanel implements ActionListener {
255 255
         } else if (e.getSource() == addOptionButton) {
256 256
             final OptionType type = parent.getOptionType(
257 257
                     (String) addOptionComboBox.getSelectedItem());
258
-            
258
+
259 259
             switch (type) {
260 260
                 case TEXTFIELD:
261 261
                     parent.addCurrentOption(
@@ -295,9 +295,9 @@ public class AddOptionPanel extends JPanel implements ActionListener {
295 295
                 default:
296 296
                     break;
297 297
             }
298
-            
298
+
299 299
             delOption((String) addOptionComboBox.getSelectedItem());
300 300
         }
301 301
     }
302
-    
302
+
303 303
 }

+ 30
- 30
src/com/dmdirc/addons/ui_swing/components/expandingsettings/CurrentOptionsPanel.java Просмотреть файл

@@ -53,17 +53,17 @@ import net.miginfocom.swing.MigLayout;
53 53
  * Current options panel.
54 54
  */
55 55
 public final class CurrentOptionsPanel extends JPanel implements ActionListener {
56
-    
56
+
57 57
     /**
58 58
      * A version number for this class. It should be changed whenever the class
59 59
      * structure is changed (or anything else that would prevent serialized
60 60
      * objects being unserialized with the new class).
61 61
      */
62 62
     private static final long serialVersionUID = 2;
63
-    
63
+
64 64
     /** Parent settings panel. */
65 65
     private final SettingsPanel parent;
66
-    
66
+
67 67
     /** config option -> text fields. */
68 68
     private Map<String, JTextField> textFields;
69 69
     /** config option -> checkboxes. */
@@ -76,7 +76,7 @@ public final class CurrentOptionsPanel extends JPanel implements ActionListener
76 76
     private Map<String, FontPicker> fonts;
77 77
     /** config option -> comboboxes. */
78 78
     private Map<String, JComboBox> comboboxes;
79
-    
79
+
80 80
     /**
81 81
      * Creates a new instance of CurrentOptionsPanel.
82 82
      *
@@ -84,13 +84,13 @@ public final class CurrentOptionsPanel extends JPanel implements ActionListener
84 84
      */
85 85
     protected CurrentOptionsPanel(final SettingsPanel parent) {
86 86
         super();
87
-        
87
+
88 88
         this.parent = parent;
89
-        
89
+
90 90
         this.setOpaque(UIUtilities.getTabbedPaneOpaque());
91 91
         initComponents();
92 92
     }
93
-    
93
+
94 94
     /** Initialises the components. */
95 95
     private void initComponents() {
96 96
         textFields = new HashMap<String, JTextField>();
@@ -100,7 +100,7 @@ public final class CurrentOptionsPanel extends JPanel implements ActionListener
100 100
         fonts = new HashMap<String, FontPicker>();
101 101
         comboboxes = new HashMap<String, JComboBox>();
102 102
     }
103
-    
103
+
104 104
     /** Clears all the current options. */
105 105
     protected void clearOptions() {
106 106
         textFields.clear();
@@ -111,7 +111,7 @@ public final class CurrentOptionsPanel extends JPanel implements ActionListener
111 111
         comboboxes.clear();
112 112
         populateCurrentSettings();
113 113
     }
114
-    
114
+
115 115
     /**
116 116
      * Adds a current option.
117 117
      *
@@ -149,10 +149,10 @@ public final class CurrentOptionsPanel extends JPanel implements ActionListener
149 149
             default:
150 150
                 throw new IllegalArgumentException("Illegal Type: " + type);
151 151
         }
152
-        
152
+
153 153
         populateCurrentSettings();
154 154
     }
155
-    
155
+
156 156
     /**
157 157
      * Deletes a current option.
158 158
      *
@@ -183,10 +183,10 @@ public final class CurrentOptionsPanel extends JPanel implements ActionListener
183 183
             default:
184 184
                 throw new IllegalArgumentException("Illegal Type: " + type);
185 185
         }
186
-        
186
+
187 187
         populateCurrentSettings();
188 188
     }
189
-    
189
+
190 190
     /**
191 191
      * Retrives an options value.
192 192
      *
@@ -237,7 +237,7 @@ public final class CurrentOptionsPanel extends JPanel implements ActionListener
237 237
         }
238 238
         return returnValue;
239 239
     }
240
-    
240
+
241 241
     /**
242 242
      * Adds an option to the current options pane.
243 243
      * @param configName config option name
@@ -251,44 +251,44 @@ public final class CurrentOptionsPanel extends JPanel implements ActionListener
251 251
         final ImageButton button = new ImageButton(configName,
252 252
                 IconManager.getIconManager().getIcon("close-inactive"),
253 253
                 IconManager.getIconManager().getIcon("close-active"));
254
-        
254
+
255 255
         label.setText(displayName + ": ");
256 256
         label.setLabelFor(component);
257
-        
257
+
258 258
         button.addActionListener(this);
259
-        
259
+
260 260
         panel.add(label);
261 261
         panel.add(component, "growx, pushx");
262 262
         panel.add(button, "wrap");
263 263
     }
264
-    
265
-    
264
+
265
+
266 266
     /** Populates the current settings. */
267 267
     protected void populateCurrentSettings() {
268 268
         setVisible(false);
269
-        
269
+
270 270
         setLayout(new MigLayout("fillx, aligny top"));
271
-        
271
+
272 272
         removeAll();
273
-        
273
+
274 274
         for (Entry<String, JTextField> entry : textFields.entrySet()) {
275 275
             addCurrentOption(entry.getKey(),
276 276
                     parent.getOptionName(entry.getKey()),
277 277
                     this, entry.getValue());
278 278
         }
279
-        
279
+
280 280
         for (Entry<String, JCheckBox> entry : checkBoxes.entrySet()) {
281 281
             addCurrentOption(entry.getKey(),
282 282
                     parent.getOptionName(entry.getKey()),
283 283
                     this, entry.getValue());
284 284
         }
285
-        
285
+
286 286
         for (Entry<String, ColourChooser> entry : colours.entrySet()) {
287 287
             addCurrentOption(entry.getKey(),
288 288
                     parent.getOptionName(entry.getKey()),
289 289
                     this, entry.getValue());
290 290
         }
291
-        
291
+
292 292
         for (Entry<String, JSpinner> entry : spinners.entrySet()) {
293 293
             addCurrentOption(entry.getKey(),
294 294
                     parent.getOptionName(entry.getKey()),
@@ -306,13 +306,13 @@ public final class CurrentOptionsPanel extends JPanel implements ActionListener
306 306
                     parent.getOptionName(entry.getKey()),
307 307
                     this, entry.getValue());
308 308
         }
309
-        
309
+
310 310
         setVisible(true);
311 311
     }
312
-    
313
-    /** 
312
+
313
+    /**
314 314
      * {@inheritDoc}
315
-     * 
315
+     *
316 316
      * @param e Action performed
317 317
      */
318 318
     @Override
@@ -320,5 +320,5 @@ public final class CurrentOptionsPanel extends JPanel implements ActionListener
320 320
         delOption(e.getActionCommand(), parent.getOptionType(e.getActionCommand()));
321 321
         parent.addAddableOption(e.getActionCommand());
322 322
     }
323
-    
323
+
324 324
 }

+ 6
- 6
src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java Просмотреть файл

@@ -83,7 +83,7 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
83 83
     /**
84 84
      * Creates a new instance of ChannelFrame. Sets up callbacks and handlers,
85 85
      * and default options for the form.
86
-     * 
86
+     *
87 87
      * @param owner The Channel object that owns this frame
88 88
      * @param controller Swing controller
89 89
      */
@@ -117,7 +117,7 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
117 117
 
118 118
     /**
119 119
      * Retrieves the command Parser for this command window.
120
-     * 
120
+     *
121 121
      * @return This window's command Parser
122 122
      */
123 123
     @Override
@@ -151,7 +151,7 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
151 151
 
152 152
     /**
153 153
      * Retrieves this channel frame's nicklist component.
154
-     * 
154
+     *
155 155
      * @return This channel's nicklist
156 156
      */
157 157
     public NickList getNickList() {
@@ -160,7 +160,7 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
160 160
 
161 161
     /**
162 162
      * {@inheritDoc}
163
-     * 
163
+     *
164 164
      * @deprecated @deprecated Use {@link #getContainer()}
165 165
      */
166 166
     @Override
@@ -216,7 +216,7 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
216 216
 
217 217
     /**
218 218
      * {@inheritDoc}.
219
-     * 
219
+     *
220 220
      * @param actionEvent Action event
221 221
      */
222 222
     @Override
@@ -241,7 +241,7 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
241 241
     @Override
242 242
     public void configChanged(final String domain, final String key) {
243 243
         super.configChanged(domain, key);
244
-        
244
+
245 245
         if ("channelSplitPanePosition".equals(key)) {
246 246
             final int splitPanePosition = getContainer().getConfigManager()
247 247
                     .getOptionInt("ui", "channelSplitPanePosition");

+ 6
- 6
src/com/dmdirc/addons/ui_swing/components/renderers/ActionSubstititionRenderer.java Просмотреть файл

@@ -34,31 +34,31 @@ import javax.swing.JList;
34 34
  * Displays actions using getName not toString.
35 35
  */
36 36
 public final class ActionSubstititionRenderer extends DefaultListCellRenderer {
37
-    
37
+
38 38
     /**
39 39
      * A version number for this class. It should be changed whenever the class
40 40
      * structure is changed (or anything else that would prevent serialized
41 41
      * objects being unserialized with the new class).
42 42
      */
43 43
     private static final long serialVersionUID = 1;
44
-    
44
+
45 45
     /**
46 46
      * Creates a new instance of ActionSubstititionRenderer.
47 47
      */
48 48
     public ActionSubstititionRenderer() {
49 49
         super();
50 50
     }
51
-    
51
+
52 52
     /** {@inheritDoc} */
53 53
     @Override
54 54
     public Component getListCellRendererComponent(final JList list,
55 55
             final Object value, final int index, final boolean isSelected,
56 56
             final boolean cellHasFocus) {
57 57
         super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
58
-        
58
+
59 59
         setText(((Substitution) value).getValue());
60
-        
60
+
61 61
         return this;
62 62
     }
63
-    
63
+
64 64
 }

+ 13
- 13
src/com/dmdirc/addons/ui_swing/components/renderers/AddonCellRenderer.java Просмотреть файл

@@ -45,34 +45,34 @@ import net.miginfocom.swing.MigLayout;
45 45
  * @author chris
46 46
  */
47 47
 public final class AddonCellRenderer extends JPanel implements ListCellRenderer {
48
-    
48
+
49 49
     /**
50 50
      * A version number for this class. It should be changed whenever the class
51 51
      * structure is changed (or anything else that would prevent serialized
52 52
      * objects being unserialized with the new class).
53 53
      */
54 54
     private static final long serialVersionUID = 1;
55
-    
55
+
56 56
     /** Creates a new instance of AddonCellRenderer. */
57 57
     public AddonCellRenderer() {
58 58
         super();
59 59
     }
60
-    
60
+
61 61
     /** {@inheritDoc} */
62 62
     @Override
63 63
     public Component getListCellRendererComponent(final JList list,
64 64
             final Object value, final int index, final boolean isSelected,
65 65
             final boolean cellHasFocus) {
66
-       
66
+
67 67
         removeAll();
68
-        setLayout(new MigLayout("fill, ins 3 0 0 0"));        
69
-        
68
+        setLayout(new MigLayout("fill, ins 3 0 0 0"));
69
+
70 70
         if (isSelected) {
71 71
             setBackground(list.getSelectionBackground());
72 72
         } else {
73 73
             setBackground(list.getBackground());
74 74
         }
75
-        
75
+
76 76
         Color foreground = Color.BLACK;
77 77
         final JLabel name = new JLabel(), version = new JLabel(),
78 78
                 author = new JLabel(), desc = new JLabel();
@@ -90,17 +90,17 @@ public final class AddonCellRenderer extends JPanel implements ListCellRenderer
90 90
             desc.setText(plugin.getPluginInfo().getDescription());
91 91
         } else if (value instanceof ThemeToggle) {
92 92
             final ThemeToggle theme = (ThemeToggle) value;
93
-            
93
+
94 94
             if (!theme.getState()) {
95 95
                 foreground = Color.GRAY;
96 96
             }
97
-            
97
+
98 98
             name.setText(theme.getTheme().getName());
99 99
             version.setText(theme.getTheme().getVersion());
100 100
             author.setText(theme.getTheme().getAuthor());
101 101
             desc.setText(theme.getTheme().getDescription());
102 102
         }
103
-        
103
+
104 104
         name.setForeground(foreground);
105 105
         name.setFont(name.getFont().deriveFont(Font.BOLD));
106 106
         version.setForeground(foreground);
@@ -108,14 +108,14 @@ public final class AddonCellRenderer extends JPanel implements ListCellRenderer
108 108
         author.setForeground(foreground);
109 109
         desc.setForeground(foreground);
110 110
         desc.setBorder(BorderFactory.createEmptyBorder(SMALL_BORDER, 0, 0, 0));
111
-        
111
+
112 112
         add(name, "gapleft 3");
113 113
         add(version, "pushx");
114 114
         add(author, "wrap, gapright 3");
115 115
         add(desc, "span 3, growx, pushx, wrap, gapleft 3, gapright 3");
116 116
         add(new JSeparator(), "span 3, growx, pushx");
117
-        
117
+
118 118
         return this;
119 119
     }
120
-    
120
+
121 121
 }

+ 11
- 11
src/com/dmdirc/addons/ui_swing/components/renderers/ReorderableJListCellRenderer.java Просмотреть файл

@@ -39,17 +39,17 @@ import net.miginfocom.swing.MigLayout;
39 39
  * Renderer for the reorderable JList, procides visual clues to DnD.
40 40
  */
41 41
 public class ReorderableJListCellRenderer implements ListCellRenderer {
42
-    
42
+
43 43
     /**
44 44
      * A version number for this class. It should be changed whenever the class
45 45
      * structure is changed (or anything else that would prevent serialized
46 46
      * objects being unserialized with the new class).
47 47
      */
48 48
     private static final long serialVersionUID = 1;
49
-    
49
+
50 50
     /** Parent list. */
51 51
     private final ReorderableJList parent;
52
-    
52
+
53 53
     /**
54 54
      * Instantiates a new ReorderableJListCellRenderer.
55 55
      *
@@ -57,10 +57,10 @@ public class ReorderableJListCellRenderer implements ListCellRenderer {
57 57
      */
58 58
     public ReorderableJListCellRenderer(final ReorderableJList parent) {
59 59
         super();
60
-        
60
+
61 61
         this.parent = parent;
62 62
     }
63
-    
63
+
64 64
     /** {@inheritDoc} */
65 65
     @Override
66 66
     public Component getListCellRendererComponent(final JList list,
@@ -69,11 +69,11 @@ public class ReorderableJListCellRenderer implements ListCellRenderer {
69 69
         final JPanel panel = new JPanel();
70 70
         panel.setLayout(new MigLayout("fill, ins 0"));
71 71
         final boolean isTargetCell = value == parent.getTargetCell();
72
-        
72
+
73 73
         final boolean showSelected = isSelected & (parent.getTargetCell() == null);
74
-        
74
+
75 75
         panel.add(new JLabel(value.toString()), "dock center");
76
-        
76
+
77 77
         if (showSelected) {
78 78
             panel.setForeground(UIManager.getColor("List.selectionForeground"));
79 79
             panel.setBackground(UIManager.getColor("List.selectionBackground"));
@@ -86,8 +86,8 @@ public class ReorderableJListCellRenderer implements ListCellRenderer {
86 86
                 panel.setBackground(UIManager.getColor("List.background"));
87 87
             }
88 88
         }
89
-        
90
-        
89
+
90
+
91 91
         if (isTargetCell) {
92 92
             if (parent.getBelowTarget()) {
93 93
                 panel.add(new JSeparator(), "dock south");
@@ -95,7 +95,7 @@ public class ReorderableJListCellRenderer implements ListCellRenderer {
95 95
                 panel.add(new JSeparator(), "dock north");
96 96
             }
97 97
         }
98
-        
98
+
99 99
         return panel;
100 100
     }
101 101
 }

+ 6
- 6
src/com/dmdirc/addons/ui_swing/components/reorderablelist/ListReorderButtonPanel.java Просмотреть файл

@@ -1,17 +1,17 @@
1 1
 /*
2
- * 
2
+ *
3 3
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
4
- * 
4
+ *
5 5
  * Permission is hereby granted, free of charge, to any person obtaining a copy
6 6
  * of this software and associated documentation files (the "Software"), to deal
7 7
  * in the Software without restriction, including without limitation the rights
8 8
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 9
  * copies of the Software, and to permit persons to whom the Software is
10 10
  * furnished to do so, subject to the following conditions:
11
- * 
11
+ *
12 12
  * The above copyright notice and this permission notice shall be included in
13 13
  * all copies or substantial portions of the Software.
14
- * 
14
+ *
15 15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 16
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 17
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -58,7 +58,7 @@ public class ListReorderButtonPanel extends JPanel implements
58 58
 
59 59
     /**
60 60
      * Creates a panel to reoder a jlist.
61
-     * 
61
+     *
62 62
      * @param list JList
63 63
      */
64 64
     public ListReorderButtonPanel(final ReorderableJList list) {
@@ -89,7 +89,7 @@ public class ListReorderButtonPanel extends JPanel implements
89 89
 
90 90
     /**
91 91
      * {@inheritDoc}
92
-     * 
92
+     *
93 93
      * @param e Action event
94 94
      */
95 95
     @Override

+ 35
- 35
src/com/dmdirc/addons/ui_swing/components/reorderablelist/ReorderableJList.java Просмотреть файл

@@ -58,14 +58,14 @@ import javax.swing.ListSelectionModel;
58 58
  */
59 59
 public final class ReorderableJList extends JList implements DragSourceListener,
60 60
         DropTargetListener, DragGestureListener {
61
-    
61
+
62 62
     /**
63 63
      * A version number for this class. It should be changed whenever the class
64 64
      * structure is changed (or anything else that would prevent serialized
65 65
      * objects being unserialized with the new class).
66 66
      */
67 67
     private static final long serialVersionUID = 1;
68
-    
68
+
69 69
     /** Drag source. */
70 70
     private final DragSource dragSource;
71 71
     /** Drag target. */
@@ -78,7 +78,7 @@ public final class ReorderableJList extends JList implements DragSourceListener,
78 78
     private DataFlavor dataFlavor;
79 79
     /** Below drop target. */
80 80
     private boolean belowTarget;
81
-    
81
+
82 82
     /** Instantiate new ReorderableJList. */
83 83
     public ReorderableJList() {
84 84
         this(new DefaultListModel());
@@ -91,18 +91,18 @@ public final class ReorderableJList extends JList implements DragSourceListener,
91 91
      */
92 92
     public ReorderableJList(final DefaultListModel model) {
93 93
         super(model);
94
-        
94
+
95 95
         setCellRenderer(new ReorderableJListCellRenderer(this));
96 96
         setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
97 97
         setTransferHandler(new ArrayListTransferHandler());
98
-        
98
+
99 99
         dragSource = DragSource.getDefaultDragSource();
100 100
         dropTarget = new DropTarget(this, this);
101
-        
101
+
102 102
         dragSource.createDefaultDragGestureRecognizer(this,
103 103
                 DnDConstants.ACTION_MOVE, this);
104 104
         try {
105
-            
105
+
106 106
             dataFlavor = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType
107 107
                     + ";class=java.util.ArrayList");
108 108
         } catch (ClassNotFoundException e) {
@@ -111,14 +111,14 @@ public final class ReorderableJList extends JList implements DragSourceListener,
111 111
             dataFlavor = null;
112 112
         }
113 113
     }
114
-    
114
+
115 115
     /** {@inheritDoc} */
116 116
     @Override
117 117
     public DefaultListModel getModel() {
118 118
         return (DefaultListModel) super.getModel();
119 119
     }
120
-    
121
-    /** 
120
+
121
+    /**
122 122
      * Sets the model for the list.
123 123
      *
124 124
      * @param model Model for the list
@@ -126,7 +126,7 @@ public final class ReorderableJList extends JList implements DragSourceListener,
126 126
     public void setModel(final DefaultListModel model) { //NOPMD stupid
127 127
         super.setModel(model);
128 128
     }
129
-    
129
+
130 130
     /**
131 131
      * Returns the target drop item.
132 132
      *
@@ -135,7 +135,7 @@ public final class ReorderableJList extends JList implements DragSourceListener,
135 135
     public Object getTargetCell() {
136 136
         return dropTargetCell;
137 137
     }
138
-    
138
+
139 139
     /**
140 140
      * Returns whether the target is below the drop cell.
141 141
      *
@@ -144,31 +144,31 @@ public final class ReorderableJList extends JList implements DragSourceListener,
144 144
     public boolean getBelowTarget() {
145 145
         return belowTarget;
146 146
     }
147
-    
147
+
148 148
     /** {@inheritDoc} */
149 149
     @Override
150 150
     public void dragEnter(final DragSourceDragEvent dsde) {
151 151
         //Ignore
152 152
     }
153
-    
153
+
154 154
     /** {@inheritDoc} */
155 155
     @Override
156 156
     public void dragOver(final DragSourceDragEvent dsde) {
157 157
         //Ignore
158 158
     }
159
-    
159
+
160 160
     /** {@inheritDoc} */
161 161
     @Override
162 162
     public void dropActionChanged(final DragSourceDragEvent dsde) {
163 163
         //Ignore
164 164
     }
165
-    
165
+
166 166
     /** {@inheritDoc} */
167 167
     @Override
168 168
     public void dragExit(final DragSourceEvent dse) {
169 169
         //Ignore
170 170
     }
171
-    
171
+
172 172
     /** {@inheritDoc} */
173 173
     @Override
174 174
     public void dragDropEnd(final DragSourceDropEvent dsde) {
@@ -177,7 +177,7 @@ public final class ReorderableJList extends JList implements DragSourceListener,
177 177
         draggedIndex = -1;
178 178
         repaint();
179 179
     }
180
-    
180
+
181 181
     /** {@inheritDoc} */
182 182
     @Override
183 183
     public void dragEnter(final DropTargetDragEvent dtde) {
@@ -188,7 +188,7 @@ public final class ReorderableJList extends JList implements DragSourceListener,
188 188
             dtde.rejectDrag();
189 189
         }
190 190
     }
191
-    
191
+
192 192
     /** {@inheritDoc} */
193 193
     @Override
194 194
     public void dragOver(final DropTargetDragEvent dtde) {
@@ -196,11 +196,11 @@ public final class ReorderableJList extends JList implements DragSourceListener,
196 196
         if (dtde.getSource() != dropTarget) {
197 197
             dtde.rejectDrag();
198 198
         }
199
-        
199
+
200 200
         //get location and index
201 201
         final Point dragPoint = dtde.getLocation();
202 202
         final int index = locationToIndex(dragPoint);
203
-        
203
+
204 204
         //set drag variables and repaint
205 205
         if (index == -1) {
206 206
             dropTargetCell = null;
@@ -208,29 +208,29 @@ public final class ReorderableJList extends JList implements DragSourceListener,
208 208
             dropTargetCell = getModel().getElementAt(index);
209 209
             //check whether the drop point is after the last index
210 210
             final Rectangle bounds = getCellBounds(index, index);
211
-            if (index == getModel().getSize() - 1 
211
+            if (index == getModel().getSize() - 1
212 212
                     && dragPoint.y > bounds.y + bounds.height) {
213 213
                 belowTarget = true;
214 214
             } else {
215 215
                 belowTarget = false;
216 216
             }
217 217
         }
218
-        
218
+
219 219
         repaint();
220 220
     }
221
-    
221
+
222 222
     /** {@inheritDoc} */
223 223
     @Override
224 224
     public void dropActionChanged(final DropTargetDragEvent dtde) {
225 225
         //Ignore
226 226
     }
227
-    
227
+
228 228
     /** {@inheritDoc} */
229 229
     @Override
230 230
     public void dragExit(final DropTargetEvent dte) {
231 231
         //Ignore
232 232
     }
233
-    
233
+
234 234
     /** {@inheritDoc} */
235 235
     @Override
236 236
     public void drop(final DropTargetDropEvent dtde) {
@@ -245,16 +245,16 @@ public final class ReorderableJList extends JList implements DragSourceListener,
245 245
         if (belowTarget) {
246 246
             index++;
247 247
         }
248
-        
248
+
249 249
         //reject invalid drops
250 250
         if ((index == -1) || (index == draggedIndex)) {
251 251
             dtde.rejectDrop();
252 252
             return;
253 253
         }
254
-        
254
+
255 255
         //accept drop as a move
256 256
         dtde.acceptDrop(DnDConstants.ACTION_MOVE);
257
-        
257
+
258 258
         //get dropped item
259 259
         Object dragged;
260 260
         try {
@@ -264,7 +264,7 @@ public final class ReorderableJList extends JList implements DragSourceListener,
264 264
         } catch (IOException e) {
265 265
             return;
266 266
         }
267
-        
267
+
268 268
         //move items
269 269
         final boolean sourceBeforeTarget = draggedIndex < index;
270 270
         final DefaultListModel mod = getModel();
@@ -273,24 +273,24 @@ public final class ReorderableJList extends JList implements DragSourceListener,
273 273
         for (Object item : (ArrayList<?>) dragged) {
274 274
             mod.add(newIndex, item);
275 275
         }
276
-        
276
+
277 277
         getSelectionModel().setSelectionInterval(newIndex, newIndex);
278
-        
278
+
279 279
         //drop complete
280 280
         dtde.dropComplete(true);
281 281
     }
282
-    
282
+
283 283
     /** {@inheritDoc} */
284 284
     @Override
285 285
     public void dragGestureRecognized(final DragGestureEvent dge) {
286 286
         //find the objects location and index
287 287
         final Point clickPoint = dge.getDragOrigin();
288 288
         final int index = locationToIndex(clickPoint);
289
-        
289
+
290 290
         if (index == -1) {
291 291
             return;
292 292
         }
293
-        
293
+
294 294
         //get the list object
295 295
         final Object target = getModel().getElementAt(index);
296 296
         //create the trasnferable object

+ 22
- 22
src/com/dmdirc/addons/ui_swing/components/substitutions/SubstitutionLabel.java Просмотреть файл

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -62,9 +62,9 @@ public class SubstitutionLabel extends JButton implements MouseListener,
62 62
     /** Previously selected component. */
63 63
     private Component previousComponent;
64 64
 
65
-    /** 
65
+    /**
66 66
      * Instantiates the panel.
67
-     * 
67
+     *
68 68
      * @param substitution Action substitition
69 69
      */
70 70
     public SubstitutionLabel(final Substitution substitution) {
@@ -85,7 +85,7 @@ public class SubstitutionLabel extends JButton implements MouseListener,
85 85
 
86 86
         setText(substitution.getName());
87 87
         setFont(getFont().deriveFont(getFont().getSize() - 2f));
88
-        
88
+
89 89
         setBorder(
90 90
                 BorderFactory.createCompoundBorder(
91 91
                 BorderFactory.createLineBorder(Color.GRAY),
@@ -106,9 +106,9 @@ public class SubstitutionLabel extends JButton implements MouseListener,
106 106
     private void layoutComponents() {
107 107
     }
108 108
 
109
-    /** 
109
+    /**
110 110
      * {@inheritDoc}
111
-     * 
111
+     *
112 112
      * @param e Mouse event
113 113
      */
114 114
     @Override
@@ -116,9 +116,9 @@ public class SubstitutionLabel extends JButton implements MouseListener,
116 116
     //Ignore
117 117
     }
118 118
 
119
-    /** 
119
+    /**
120 120
      * {@inheritDoc}
121
-     * 
121
+     *
122 122
      * @param e Mouse event
123 123
      */
124 124
     @Override
@@ -126,9 +126,9 @@ public class SubstitutionLabel extends JButton implements MouseListener,
126 126
     //Ignore
127 127
     }
128 128
 
129
-    /** 
129
+    /**
130 130
      * {@inheritDoc}
131
-     * 
131
+     *
132 132
      * @param e Mouse event
133 133
      */
134 134
     @Override
@@ -136,9 +136,9 @@ public class SubstitutionLabel extends JButton implements MouseListener,
136 136
     //Ignore
137 137
     }
138 138
 
139
-    /** 
139
+    /**
140 140
      * {@inheritDoc}
141
-     * 
141
+     *
142 142
      * @param e Mouse event
143 143
      */
144 144
     @Override
@@ -146,9 +146,9 @@ public class SubstitutionLabel extends JButton implements MouseListener,
146 146
         setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
147 147
     }
148 148
 
149
-    /** 
149
+    /**
150 150
      * {@inheritDoc}
151
-     * 
151
+     *
152 152
      * @param e Mouse event
153 153
      */
154 154
     @Override
@@ -163,9 +163,9 @@ public class SubstitutionLabel extends JButton implements MouseListener,
163 163
                 new StringTransferable(substitution.toString()), null);
164 164
     }
165 165
 
166
-    /** 
166
+    /**
167 167
      * {@inheritDoc}
168
-     * 
168
+     *
169 169
      * @param e Action event
170 170
      */
171 171
     @Override
@@ -175,9 +175,9 @@ public class SubstitutionLabel extends JButton implements MouseListener,
175 175
         }
176 176
     }
177 177
 
178
-    /** 
178
+    /**
179 179
      * {@inheritDoc}
180
-     * 
180
+     *
181 181
      * @param e Focus event
182 182
      */
183 183
     @Override
@@ -185,9 +185,9 @@ public class SubstitutionLabel extends JButton implements MouseListener,
185 185
         previousComponent = e.getOppositeComponent();
186 186
     }
187 187
 
188
-    /** 
188
+    /**
189 189
      * {@inheritDoc}
190
-     * 
190
+     *
191 191
      * @param e Focus event
192 192
      */
193 193
     @Override

+ 13
- 13
src/com/dmdirc/addons/ui_swing/components/substitutions/SubstitutionsPanel.java Просмотреть файл

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -36,7 +36,7 @@ import net.miginfocom.swing.MigLayout;
36 36
 
37 37
 /**
38 38
  * Generic substitutions panel
39
- * 
39
+ *
40 40
  * @param <T> Type of substitution
41 41
  */
42 42
 public abstract class SubstitutionsPanel<T> extends JPanel {
@@ -63,18 +63,18 @@ public abstract class SubstitutionsPanel<T> extends JPanel {
63 63
         VERTICAL;
64 64
     }
65 65
 
66
-    /** 
66
+    /**
67 67
      * Instantiates the panel.
68
-     * 
68
+     *
69 69
      * @param description Description
70 70
      */
71 71
     public SubstitutionsPanel(final String description) {
72 72
         this(description, Alignment.VERTICAL, null);
73 73
     }
74 74
 
75
-    /** 
75
+    /**
76 76
      * Instantiates the panel.
77
-     * 
77
+     *
78 78
      * @param description Description
79 79
      * @param type Action type
80 80
      */
@@ -82,9 +82,9 @@ public abstract class SubstitutionsPanel<T> extends JPanel {
82 82
         this(description, Alignment.VERTICAL, type);
83 83
     }
84 84
 
85
-    /** 
85
+    /**
86 86
      * Instantiates the panel.
87
-     * 
87
+     *
88 88
      * @param description Description
89 89
      * @param alignment Alignment of the separator
90 90
      */
@@ -93,9 +93,9 @@ public abstract class SubstitutionsPanel<T> extends JPanel {
93 93
         this(description, alignment, null);
94 94
     }
95 95
 
96
-    /** 
96
+    /**
97 97
      * Instantiates the panel.
98
-     * 
98
+     *
99 99
      * @param description Description
100 100
      * @param alignment Alignment of the separator
101 101
      * @param type Action type
@@ -158,7 +158,7 @@ public abstract class SubstitutionsPanel<T> extends JPanel {
158 158
 
159 159
     /**
160 160
      * Sets the type for this substitution panel.
161
-     * 
161
+     *
162 162
      * @param type New action type
163 163
      */
164 164
     public abstract void setType(final T type);

+ 46
- 46
src/com/dmdirc/addons/ui_swing/components/validating/ValidatingJTextField.java Просмотреть файл

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -63,7 +63,7 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
63 63
 
64 64
     /**
65 65
      * Instantiates a new Validating text field.
66
-     * 
66
+     *
67 67
      * @param validator Validator instance
68 68
      */
69 69
     public ValidatingJTextField(final Validator<String> validator) {
@@ -72,7 +72,7 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
72 72
 
73 73
     /**
74 74
      * Instantiates a new Validating text field.
75
-     * 
75
+     *
76 76
      * @param textField JTextField to wrap
77 77
      * @param validator Validator instance
78 78
      */
@@ -121,9 +121,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
121 121
 
122 122
     /**
123 123
      * Checks if the text validates.
124
-     * 
124
+     *
125 125
      * @see com.dmdirc.ui.swing.components.validating.Validator#validate(Object)
126
-     * 
126
+     *
127 127
      * @return true iif the text validates
128 128
      */
129 129
     public boolean validateText() {
@@ -164,7 +164,7 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
164 164
         textField.setEnabled(enabled);
165 165
         checkError();
166 166
     }
167
-    
167
+
168 168
     /** {@inheritDoc} */
169 169
     @Override
170 170
     public void requestFocus() {
@@ -179,9 +179,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
179 179
 
180 180
     /**
181 181
      * Sets the text in the textfield.
182
-     * 
182
+     *
183 183
      * @see javax.swing.JTextField#setText(String)
184
-     * 
184
+     *
185 185
      * @param t Text to set
186 186
      */
187 187
     public void setText(final String t) {
@@ -190,9 +190,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
190 190
 
191 191
     /**
192 192
      * Sets the selection start.
193
-     * 
193
+     *
194 194
      * @see javax.swing.JTextField#setSelectionStart(int)
195
-     * 
195
+     *
196 196
      * @param selectionStart Start of the selection
197 197
      */
198 198
     public void setSelectionStart(final int selectionStart) {
@@ -201,9 +201,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
201 201
 
202 202
     /**
203 203
      * Sets the selection end.
204
-     * 
204
+     *
205 205
      * @see javax.swing.JTextField#setSelectionEnd(int)
206
-     * 
206
+     *
207 207
      * @param selectionEnd End of the selection
208 208
      */
209 209
     public void setSelectionEnd(final int selectionEnd) {
@@ -212,9 +212,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
212 212
 
213 213
     /**
214 214
      * Sets whether the component is editable.
215
-     * 
215
+     *
216 216
      * @see javax.swing.JTextField#setEditable(boolean)
217
-     * 
217
+     *
218 218
      * @param b editable state for the component
219 219
      */
220 220
     public void setEditable(final boolean b) {
@@ -223,7 +223,7 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
223 223
 
224 224
     /**
225 225
      * Selects all text in the textfield.
226
-     * 
226
+     *
227 227
      * @see javax.swing.JTextField#selectAll()
228 228
      */
229 229
     public void selectAll() {
@@ -232,9 +232,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
232 232
 
233 233
     /**
234 234
      * Selects the specified text in the textfield.
235
-     * 
235
+     *
236 236
      * @see javax.swing.JTextField#select(int, int)
237
-     * 
237
+     *
238 238
      * @param selectionStart Selection start
239 239
      * @param selectionEnd Selection end
240 240
      */
@@ -244,9 +244,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
244 244
 
245 245
     /**
246 246
      * Replaces the textfields selection with the specified content.
247
-     * 
247
+     *
248 248
      * @see javax.swing.JTextField#replaceSelection(String)
249
-     * 
249
+     *
250 250
      * @param content Text to replace selection with
251 251
      */
252 252
     public void replaceSelection(final String content) {
@@ -255,7 +255,7 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
255 255
 
256 256
     /**
257 257
      * Paste's the system clipboard into the textfield.
258
-     * 
258
+     *
259 259
      * @see javax.swing.JTextField#paste()
260 260
      */
261 261
     public void paste() {
@@ -264,9 +264,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
264 264
 
265 265
     /**
266 266
      * Checks if the textfield is editable.
267
-     * 
267
+     *
268 268
      * @see javax.swing.JTextField#isEditable()
269
-     * 
269
+     *
270 270
      * @return true iif the textfield is editable
271 271
      */
272 272
     public boolean isEditable() {
@@ -275,9 +275,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
275 275
 
276 276
     /**
277 277
      * Returns the text in the textfield.
278
-     * 
278
+     *
279 279
      * @see javax.swing.JTextField#getText()
280
-     * 
280
+     *
281 281
      * @return Textfield content
282 282
      */
283 283
     public String getText() {
@@ -286,14 +286,14 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
286 286
 
287 287
     /**
288 288
      * Returns the specified section of text in the textfield.
289
-     * 
289
+     *
290 290
      * @see javax.swing.JTextField#getText(int, int)
291
-     * 
291
+     *
292 292
      * @param offs Start offset
293 293
      * @param len section length
294
-     * 
294
+     *
295 295
      * @return Specified textfield content
296
-     * 
296
+     *
297 297
      * @throws javax.swing.text.BadLocationException
298 298
      */
299 299
     public String getText(final int offs, final int len) throws BadLocationException {
@@ -302,9 +302,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
302 302
 
303 303
     /**
304 304
      * Returns the start of the selection in the textfield.
305
-     * 
305
+     *
306 306
      * @see javax.swing.JTextField#getSelectionStart()
307
-     * 
307
+     *
308 308
      * @return Selection start
309 309
      */
310 310
     public int getSelectionStart() {
@@ -313,9 +313,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
313 313
 
314 314
     /**
315 315
      * Returns the end of the textfield selection.
316
-     * 
316
+     *
317 317
      * @see javax.swing.JTextField#getSelectionEnd()
318
-     * 
318
+     *
319 319
      * @return Selection end
320 320
      */
321 321
     public int getSelectionEnd() {
@@ -324,9 +324,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
324 324
 
325 325
     /**
326 326
      * Returns the selected text in the textfield.
327
-     * 
327
+     *
328 328
      * @see javax.swing.JTextField#getSelectedText()
329
-     * 
329
+     *
330 330
      * @return Selected text
331 331
      */
332 332
     public String getSelectedText() {
@@ -335,9 +335,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
335 335
 
336 336
     /**
337 337
      * Returns the textfield's document.
338
-     * 
338
+     *
339 339
      * @see javax.swing.JTextField#getDocument()
340
-     * 
340
+     *
341 341
      * @return Textfield's document
342 342
      */
343 343
     public Document getDocument() {
@@ -346,7 +346,7 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
346 346
 
347 347
     /**
348 348
      * Cuts the selected text from the textfield into the clipboard.
349
-     * 
349
+     *
350 350
      * @see javax.swing.JTextField#cut()
351 351
      */
352 352
     public void cut() {
@@ -355,7 +355,7 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
355 355
 
356 356
     /**
357 357
      * Copies the selected text from the textfield into the clipboard.
358
-     * 
358
+     *
359 359
      * @see javax.swing.JTextField#copy()
360 360
      */
361 361
     public void copy() {
@@ -364,7 +364,7 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
364 364
 
365 365
     /**
366 366
      * Returns the font for the textfield.
367
-     * 
367
+     *
368 368
      * @see javax.swing.JTextField#copy()
369 369
      */
370 370
     @Override
@@ -395,16 +395,16 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
395 395
     public synchronized void removeMouseListener(final MouseListener l) {
396 396
         textField.removeMouseListener(l);
397 397
     }
398
-    
398
+
399 399
     /**
400 400
      * Sets the drag enabled property on the textfield.
401
-     * 
401
+     *
402 402
      * @param enabled Enabled?
403 403
      */
404 404
     public void setDragEnabled(final boolean enabled) {
405 405
         textField.setDragEnabled(enabled);
406 406
     }
407
-    
407
+
408 408
     /** {@inheritDoc} */
409 409
     @Override
410 410
     public void setTransferHandler(final TransferHandler newHandler) {
@@ -413,9 +413,9 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
413 413
 
414 414
     /**
415 415
      * Returns the validator used by this text field.
416
-     * 
416
+     *
417 417
      * @since 0.6.3m1
418
-     * 
418
+     *
419 419
      * @return This field's validator
420 420
      */
421 421
     public Validator<String> getValidator() {

+ 9
- 9
src/com/dmdirc/addons/ui_swing/dialogs/about/AboutDialog.java Просмотреть файл

@@ -57,9 +57,9 @@ public final class AboutDialog extends StandardDialog implements
57 57
     /** Tab history. */
58 58
     private int history = 0;
59 59
 
60
-    /** 
61
-     * Creates a new instance of AboutDialog. 
62
-     * 
60
+    /**
61
+     * Creates a new instance of AboutDialog.
62
+     *
63 63
      * @param parentWindow Parent window
64 64
      */
65 65
     private AboutDialog(final Window parentWindow) {
@@ -67,9 +67,9 @@ public final class AboutDialog extends StandardDialog implements
67 67
         initComponents();
68 68
     }
69 69
 
70
-    /** 
71
-     * Creates the dialog if one doesn't exist, and displays it. 
72
-     * 
70
+    /**
71
+     * Creates the dialog if one doesn't exist, and displays it.
72
+     *
73 73
      * @param parentWindow Parent window*/
74 74
     public static void showAboutDialog(final Window parentWindow) {
75 75
         me = getAboutDialog(parentWindow);
@@ -80,7 +80,7 @@ public final class AboutDialog extends StandardDialog implements
80 80
 
81 81
     /**
82 82
      * Returns the current instance of the AboutDialog.
83
-     * 
83
+     *
84 84
      * @param parentWindow Parent window
85 85
      *
86 86
      * @return The current AboutDialog instance
@@ -122,9 +122,9 @@ public final class AboutDialog extends StandardDialog implements
122 122
         getContentPane().add(getOkButton(), "right");
123 123
     }
124 124
 
125
-    /** 
125
+    /**
126 126
      * {@inheritDoc}.
127
-     * 
127
+     *
128 128
      * @param e Action event
129 129
      */
130 130
     @Override

+ 17
- 17
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionTypeModel.java Просмотреть файл

@@ -39,44 +39,44 @@ import javax.swing.SwingUtilities;
39 39
  * and ensures they can't be selected.
40 40
  */
41 41
 public final class ActionTypeModel extends DefaultComboBoxModel {
42
-    
42
+
43 43
     /**
44 44
      * A version number for this class. It should be changed whenever the class
45 45
      * structure is changed (or anything else that would prevent serialized
46 46
      * objects being unserialized with the new class).
47 47
      */
48
-    private static final long serialVersionUID = 1;    
48
+    private static final long serialVersionUID = 1;
49 49
     /** Max Width. */
50 50
     private int maxWidth = -1;
51 51
     /** Font metrics. */
52 52
     private FontMetrics fm;
53
-    
53
+
54 54
     /**
55 55
      * Creates a new instance of ActionTypeModel.
56
-     * 
56
+     *
57 57
      * @param fm Font metrics
58 58
      * @param typeGroups The action type groups to use
59 59
      */
60 60
     public ActionTypeModel(final FontMetrics fm, final MapList<String, ActionType> typeGroups) {
61 61
         super();
62
-        
62
+
63 63
         this.fm = fm;
64
-        
64
+
65 65
         for (Map.Entry<String, List<ActionType>> entry : typeGroups.entrySet()) {
66 66
             addElement(entry.getKey());
67
-            
67
+
68 68
             final List<ActionType> types = entry.getValue();
69 69
             Collections.sort(types, new ActionTypeComparator());
70
-            
70
+
71 71
             for (ActionType type : types) {
72 72
                 addElement(type);
73 73
             }
74 74
         }
75 75
     }
76 76
 
77
-    /** 
77
+    /**
78 78
      * {@inheritDoc}
79
-     * 
79
+     *
80 80
      * @param anObject Objerct to add
81 81
      */
82 82
     @Override
@@ -98,30 +98,30 @@ public final class ActionTypeModel extends DefaultComboBoxModel {
98 98
             super.setSelectedItem(anObject);
99 99
         }
100 100
     }
101
-    
101
+
102 102
     /**
103 103
      * Sets the type group for this model.
104
-     * 
104
+     *
105 105
      * @param typeGroup New type group
106 106
      */
107 107
     public void setTypeGroup(final MapList<String, ActionType> typeGroup) {
108 108
         removeAllElements();
109
-        
109
+
110 110
         for (Map.Entry<String, List<ActionType>> entry : typeGroup.entrySet()) {
111 111
             addElement(entry.getKey());
112
-            
112
+
113 113
             final List<ActionType> types = entry.getValue();
114 114
             Collections.sort(types, new ActionTypeComparator());
115
-            
115
+
116 116
             for (ActionType type : types) {
117 117
                 addElement(type);
118 118
             }
119 119
         }
120 120
     }
121
-    
121
+
122 122
     /**
123 123
      * Returns the maximum width of a string in this model.
124
-     * 
124
+     *
125 125
      * @return String max width
126 126
      */
127 127
     public int getMaxWidth() {

+ 1
- 1
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/StringTransferable.java Просмотреть файл

@@ -65,7 +65,7 @@ public class StringTransferable implements Transferable {
65 65
     /** {@inheritDoc} */
66 66
     @Override
67 67
     public DataFlavor[] getTransferDataFlavors() {
68
-        return new DataFlavor[]{localStringFlavor, serialStringFlavor,};
68
+        return new DataFlavor[]{localStringFlavor, serialStringFlavor, };
69 69
     }
70 70
 
71 71
     /** {@inheritDoc} */

+ 1
- 1
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicHistoryPane.java Просмотреть файл

@@ -76,7 +76,7 @@ public class TopicHistoryPane extends JPanel implements ListSelectionListener {
76 76
         scrollPane.getVerticalScrollBar().setUnitIncrement(15);
77 77
 
78 78
         for (Topic topic : topics) {
79
-            topicHistory.getModel().addRow(new Object[]{new TopicLabel(channel, topic),});
79
+            topicHistory.getModel().addRow(new Object[]{new TopicLabel(channel, topic), });
80 80
         }
81 81
         topicHistory.getSelectionModel().setSelectionInterval(0, 0);
82 82
         topicHistory.setShowGrid(false);

+ 1
- 1
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicLabel.java Просмотреть файл

@@ -117,7 +117,7 @@ public class TopicLabel extends JPanel {
117 117
 
118 118
         if (!topic.getTopic().isEmpty()) {
119 119
             channel.getStyliser().addStyledString((StyledDocument) pane.getDocument(),
120
-                    new String[]{topic.getTopic(),},
120
+                    new String[]{topic.getTopic(), },
121 121
                     as);
122 122
             add(pane, "wmax 450, grow, push, wrap, gapleft 5, gapleft 5");
123 123
         }

+ 31
- 31
src/com/dmdirc/addons/ui_swing/dialogs/error/ErrorDetailPanel.java Просмотреть файл

@@ -41,43 +41,43 @@ import net.miginfocom.swing.MigLayout;
41 41
  * Shows information about an error.
42 42
  */
43 43
 public final class ErrorDetailPanel extends JPanel implements ErrorListener {
44
-    
44
+
45 45
     /**
46 46
      * A version number for this class. It should be changed whenever the class
47 47
      * structure is changed (or anything else that would prevent serialized
48 48
      * objects being unserialized with the new class).
49 49
      */
50 50
     private static final long serialVersionUID = 3;
51
-    
51
+
52 52
     /** Error to show. */
53 53
     private ProgramError error;
54
-    
54
+
55 55
     /** ID field. */
56 56
     private JTextField id;
57
-    
57
+
58 58
     /** Date field. */
59 59
     private JTextField date;
60
-    
60
+
61 61
     /** Severity field. */
62 62
     private JTextField level;
63
-    
63
+
64 64
     /** Report Status field. */
65 65
     private JTextField reportStatus;
66
-    
66
+
67 67
     /** Error status field. */
68 68
     private JTextField errorStatus;
69
-    
69
+
70 70
     /** Details field. */
71 71
     private JTextArea details;
72
-    
72
+
73 73
     /** Details scrollpane. */
74 74
     private JScrollPane scrollPane;
75
-    
75
+
76 76
     /** Creates a new instance of ErrorDetailPanel. */
77 77
     public ErrorDetailPanel() {
78 78
         this(null);
79 79
     }
80
-    
80
+
81 81
     /**
82 82
      * Creates a new instance of ErrorDetailPanel.
83 83
      *
@@ -85,16 +85,16 @@ public final class ErrorDetailPanel extends JPanel implements ErrorListener {
85 85
      */
86 86
     public ErrorDetailPanel(final ProgramError error) {
87 87
         super();
88
-        
88
+
89 89
         this.error = error;
90
-        
90
+
91 91
         initComponents();
92
-        
92
+
93 93
         updateDetails();
94
-        
94
+
95 95
         layoutComponents();
96 96
     }
97
-    
97
+
98 98
     /**
99 99
      * Sets the error used for this panel.
100 100
      *
@@ -104,7 +104,7 @@ public final class ErrorDetailPanel extends JPanel implements ErrorListener {
104 104
         error = newError;
105 105
         updateDetails();
106 106
     }
107
-    
107
+
108 108
     /** Initialises the components. */
109 109
     private void initComponents() {
110 110
         id = new JTextField();
@@ -123,10 +123,10 @@ public final class ErrorDetailPanel extends JPanel implements ErrorListener {
123 123
         details.setEditable(false);
124 124
         details.setRows(5);
125 125
         details.setWrapStyleWord(true);
126
-        
126
+
127 127
         ErrorManager.getErrorManager().addErrorListener(this);
128 128
     }
129
-    
129
+
130 130
     /** Updates the panels details. */
131 131
     private void updateDetails() {
132 132
         SwingUtilities.invokeLater(new Runnable() {
@@ -139,16 +139,16 @@ public final class ErrorDetailPanel extends JPanel implements ErrorListener {
139 139
                     level.setText("");
140 140
                     reportStatus.setText("");
141 141
                     errorStatus.setText("");
142
-                    
142
+
143 143
                     return;
144 144
                 }
145
-                
145
+
146 146
                 id.setText(String.valueOf(error.getID()));
147 147
                 date.setText(error.occurrencesString());
148 148
                 level.setText(error.getLevel().toString());
149 149
                 reportStatus.setText(error.getReportStatus().toString());
150 150
                 errorStatus.setText(error.getFixedStatus().toString());
151
-                
151
+
152 152
                 details.append(error.getMessage() + '\n');
153 153
                 final String[] trace = error.getTrace();
154 154
                 if (trace.length > 0) {
@@ -162,31 +162,31 @@ public final class ErrorDetailPanel extends JPanel implements ErrorListener {
162 162
                 } catch (BadLocationException ex) {
163 163
                     //Ignore
164 164
                 }
165
-                
165
+
166 166
                 UIUtilities.resetScrollPane(scrollPane);
167 167
             }
168 168
         });
169 169
     }
170
-    
170
+
171 171
     /** Lays out the components. */
172 172
     private void layoutComponents() {
173 173
         setLayout(new MigLayout("fill, wrap 2", "[right]rel[grow,fill]", ""));
174
-        
174
+
175 175
         add(new JLabel("ID: "));
176 176
         add(id);
177
-        
177
+
178 178
         add(new JLabel("Date: "));
179 179
         add(date);
180
-        
180
+
181 181
         add(new JLabel("Severity: "));
182 182
         add(level);
183
-        
183
+
184 184
         add(new JLabel("Report status: "));
185 185
         add(reportStatus);
186
-        
186
+
187 187
         add(new JLabel("Error status: "));
188 188
         add(errorStatus);
189
-        
189
+
190 190
         add(new JLabel("Details: "));
191 191
         add(scrollPane, "grow, push");
192 192
     }
@@ -215,5 +215,5 @@ public final class ErrorDetailPanel extends JPanel implements ErrorListener {
215 215
     public boolean isReady() {
216 216
         return isVisible();
217 217
     }
218
-    
218
+
219 219
 }

+ 2
- 2
src/com/dmdirc/addons/ui_swing/framemanager/buttonbar/ButtonBar.java Просмотреть файл

@@ -125,7 +125,7 @@ public final class ButtonBar implements FrameManager, ActionListener,
125 125
                 .HORIZONTAL_SCROLLBAR_NEVER);
126 126
         scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants
127 127
                 .VERTICAL_SCROLLBAR_AS_NEEDED);
128
-        scrollPane.setMinimumSize(new Dimension(0,buttonHeight
128
+        scrollPane.setMinimumSize(new Dimension(0, buttonHeight
129 129
                 + ((int) PlatformDefaults.getUnitValueX("related").getValue()) * 2));
130 130
 
131 131
         buttons = Collections.synchronizedMap(new HashMap<Window, FrameToggleButton>());
@@ -311,7 +311,7 @@ public final class ButtonBar implements FrameManager, ActionListener,
311 311
         button.addActionListener(this);
312 312
         button.addMouseListener(this);
313 313
         button.setHorizontalAlignment(SwingConstants.LEFT);
314
-        button.setMinimumSize(new Dimension(0,buttonHeight));
314
+        button.setMinimumSize(new Dimension(0, buttonHeight));
315 315
         button.setMargin(new Insets(0, 0, 0, 0));
316 316
         buttons.put(source, button);
317 317
     }

+ 37
- 37
src/com/dmdirc/addons/ui_swing/wizard/StepLayout.java Просмотреть файл

@@ -59,19 +59,19 @@ public class StepLayout implements LayoutManager2, Serializable {
59 59
     public StepLayout() {
60 60
         this(0, 0);
61 61
     }
62
-    
62
+
63 63
     /**
64 64
      * Instantiates a new step layout.
65
-     * 
65
+     *
66 66
      * @param parent Parent component
67 67
      */
68 68
     public StepLayout(final Container parent) {
69 69
         this(0, 0, parent);
70 70
     }
71
-    
71
+
72 72
     /**
73 73
      * Instantiates a new step layout with the specified gaps.
74
-     * 
74
+     *
75 75
      * @param hGap Horizontal gap
76 76
      * @param vGap Vertical gap
77 77
      */
@@ -84,7 +84,7 @@ public class StepLayout implements LayoutManager2, Serializable {
84 84
 
85 85
     /**
86 86
      * Instantiates a new step layout with the specified gaps.
87
-     * 
87
+     *
88 88
      * @param hGap Horizontal gap
89 89
      * @param vGap Vertical gap
90 90
      * @param parent Parent component
@@ -99,7 +99,7 @@ public class StepLayout implements LayoutManager2, Serializable {
99 99
 
100 100
     /**
101 101
      * Returns the number of steps in the layout.
102
-     * 
102
+     *
103 103
      * @return number of steps >= 0
104 104
      */
105 105
     public int size() {
@@ -108,7 +108,7 @@ public class StepLayout implements LayoutManager2, Serializable {
108 108
 
109 109
     /**
110 110
      * Checks if the layout is empty
111
-     * 
111
+     *
112 112
      * @return true iif the layout has no steps
113 113
      */
114 114
     public boolean isEmpty() {
@@ -117,9 +117,9 @@ public class StepLayout implements LayoutManager2, Serializable {
117 117
 
118 118
     /**
119 119
      * Returns the specified step from the layout.
120
-     * 
120
+     *
121 121
      * @param index Step to retrieve
122
-     * 
122
+     *
123 123
      * @return Step
124 124
      */
125 125
     public Step getStep(final int index) {
@@ -128,7 +128,7 @@ public class StepLayout implements LayoutManager2, Serializable {
128 128
 
129 129
     /**
130 130
      * Returns the step list.
131
-     * 
131
+     *
132 132
      * @return List of steps
133 133
      */
134 134
     public List getSteps() {
@@ -137,7 +137,7 @@ public class StepLayout implements LayoutManager2, Serializable {
137 137
 
138 138
     /**
139 139
      * Show the first step.
140
-     * 
140
+     *
141 141
      * @param parent Parent container
142 142
      */
143 143
     public void first(final Container parent) {
@@ -146,7 +146,7 @@ public class StepLayout implements LayoutManager2, Serializable {
146 146
 
147 147
     /**
148 148
      * Show the last step.
149
-     * 
149
+     *
150 150
      * @param parent Parent container
151 151
      */
152 152
     public void last(final Container parent) {
@@ -155,16 +155,16 @@ public class StepLayout implements LayoutManager2, Serializable {
155 155
 
156 156
     /**
157 157
      * Show the next step.
158
-     * 
158
+     *
159 159
      * @param parent Parent container
160 160
      */
161 161
     public void next(final Container parent) {
162 162
         show(currentStep + 1, parent);
163 163
     }
164 164
 
165
-    /** 
165
+    /**
166 166
      * Show the previous step.
167
-     * 
167
+     *
168 168
      * @param parent Parent container
169 169
      */
170 170
     public void previous(final Container parent) {
@@ -173,7 +173,7 @@ public class StepLayout implements LayoutManager2, Serializable {
173 173
 
174 174
     /**
175 175
      * Show the specified step.
176
-     * 
176
+     *
177 177
      * @param step Step to show
178 178
      * @param parent Parent container
179 179
      */
@@ -183,7 +183,7 @@ public class StepLayout implements LayoutManager2, Serializable {
183 183
 
184 184
     /**
185 185
      * Show the step at the specified index.
186
-     * 
186
+     *
187 187
      * @param step Step to show
188 188
      * @param parent Parent container
189 189
      */
@@ -223,12 +223,12 @@ public class StepLayout implements LayoutManager2, Serializable {
223 223
         addLayoutComponent((Step) comp);
224 224
     }
225 225
 
226
-    /** 
226
+    /**
227 227
      * {@inheritDoc}
228
-     * 
229
-     * @deprecated Use addLayoutComponent(Component, Object) or 
228
+     *
229
+     * @deprecated Use addLayoutComponent(Component, Object) or
230 230
      * addLayoutComponent(Component)
231
-     * 
231
+     *
232 232
      * @see addLayoutComponent(Component)
233 233
      * @see addLayoutComponent(Component, Object)
234 234
      */
@@ -243,7 +243,7 @@ public class StepLayout implements LayoutManager2, Serializable {
243 243
 
244 244
     /**
245 245
      * Adds a component to the layout.
246
-     * 
246
+     *
247 247
      * @param step Component to add
248 248
      */
249 249
     public void addLayoutComponent(final Step step) {
@@ -267,9 +267,9 @@ public class StepLayout implements LayoutManager2, Serializable {
267 267
         }
268 268
     }
269 269
 
270
-    /** 
270
+    /**
271 271
      * {@inheritDoc}
272
-     * 
272
+     *
273 273
      * @return Returns the preferred size of the container
274 274
      */
275 275
     @Override
@@ -295,9 +295,9 @@ public class StepLayout implements LayoutManager2, Serializable {
295 295
         }
296 296
     }
297 297
 
298
-    /** 
298
+    /**
299 299
      * {@inheritDoc}
300
-     * 
300
+     *
301 301
      * @return Returns the minimum size of the container
302 302
      */
303 303
     @Override
@@ -323,11 +323,11 @@ public class StepLayout implements LayoutManager2, Serializable {
323 323
         }
324 324
     }
325 325
 
326
-    /** 
326
+    /**
327 327
      * {@inheritDoc}
328
-     * 
328
+     *
329 329
      * @param parent Container to get the size for
330
-     * 
330
+     *
331 331
      * @return Returns the maximum size of the container
332 332
      */
333 333
     @Override
@@ -335,11 +335,11 @@ public class StepLayout implements LayoutManager2, Serializable {
335 335
         return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
336 336
     }
337 337
 
338
-    /** 
338
+    /**
339 339
      * {@inheritDoc}
340
-     * 
340
+     *
341 341
      * @param target Container to get the alignment from
342
-     * 
342
+     *
343 343
      * @return Alignment
344 344
      */
345 345
     @Override
@@ -347,11 +347,11 @@ public class StepLayout implements LayoutManager2, Serializable {
347 347
         return 0.5f;
348 348
     }
349 349
 
350
-    /** 
350
+    /**
351 351
      * {@inheritDoc}
352
-     * 
352
+     *
353 353
      * @param target Container to get the alignment from
354
-     * 
354
+     *
355 355
      * @return Alignment
356 356
      */
357 357
     @Override
@@ -359,9 +359,9 @@ public class StepLayout implements LayoutManager2, Serializable {
359 359
         return 0.5f;
360 360
     }
361 361
 
362
-    /** 
362
+    /**
363 363
      * {@inheritDoc}
364
-     * 
364
+     *
365 365
      * @param target  Container to invalidate
366 366
      */
367 367
     @Override

+ 7
- 7
src/com/dmdirc/addons/ui_swing/wizard/firstrun/MigrationExtrationStep.java Просмотреть файл

@@ -31,40 +31,40 @@ import net.miginfocom.swing.MigLayout;
31 31
  * Queries the user for which core actions they wish to extract.
32 32
  */
33 33
 public final class MigrationExtrationStep extends ExtractionStep {
34
-    
34
+
35 35
     /**
36 36
      * A version number for this class. It should be changed whenever the class
37 37
      * structure is changed (or anything else that would prevent serialized
38 38
      * objects being unserialized with the new class).
39 39
      */
40 40
     private static final long serialVersionUID = 2;
41
-    
41
+
42 42
     /**
43 43
      * Creates a new instance of StepOne.
44 44
      */
45 45
     public MigrationExtrationStep() {
46 46
         super();
47 47
     }
48
-    
48
+
49 49
     /** {@inheritDoc} */
50 50
     @Override
51 51
     protected void initComponents() {
52 52
         setLayout(new MigLayout("fillx, wrap 1"));
53
-        
53
+
54 54
         TextLabel infoLabel;
55
-        
55
+
56 56
         infoLabel = new TextLabel("This version of DMDirc contains an update to "
57 57
                 + " the core plugins and actions.\n\nWould you like to extract the"
58 58
                 + " core plugins to update them? Note that older plugins may not"
59 59
                 + " function correctly with this version of DMDirc.");
60 60
         add(infoLabel, "growx, pushx");
61 61
         add(plugins, "");
62
-        
62
+
63 63
         infoLabel = new TextLabel("Would you like to extract the default actions"
64 64
                 + " to update them? Any changes you have made to the default"
65 65
                 + " actions will be lost.");
66 66
         add(infoLabel, "growx, pushx");
67 67
         add(actions, "");
68 68
     }
69
-    
69
+
70 70
 }

+ 12
- 12
src/com/dmdirc/addons/ui_web/Client.java Просмотреть файл

@@ -35,27 +35,27 @@ import org.mortbay.util.ajax.Continuation;
35 35
  * @author chris
36 36
  */
37 37
 public class Client {
38
-    
38
+
39 39
     private long lastSeenTime = System.currentTimeMillis();
40 40
 
41 41
     private Continuation continuation;
42
-    
42
+
43 43
     private final String ip;
44
-    
44
+
45 45
     private final List<Event> events = new LinkedList<Event>();
46 46
 
47 47
     public Client(final String ip) {
48 48
         events.add(new Event("statusbar", "Welcome to the DMDirc web interface"));
49
-        
49
+
50 50
         this.ip = ip;
51
-        
51
+
52 52
         final List<Window> added = new LinkedList<Window>();
53 53
         final List<Window> queued = new LinkedList<Window>(WebWindow.getWindows());
54 54
 
55 55
         while (!queued.isEmpty()) {
56 56
             final Window window = queued.remove(0);
57 57
             final Window parent = window.getContainer().getParent().getFrame();
58
-            
58
+
59 59
             if (parent == null) {
60 60
                 events.add(new Event("newwindow", window));
61 61
                 added.add(window);
@@ -67,11 +67,11 @@ public class Client {
67 67
             }
68 68
         }
69 69
     }
70
-    
70
+
71 71
     public String getIp() {
72 72
         return ip;
73 73
     }
74
-    
74
+
75 75
     public long getTime() {
76 76
         return System.currentTimeMillis() - lastSeenTime;
77 77
     }
@@ -83,11 +83,11 @@ public class Client {
83 83
     public void setContinuation(Continuation continuation) {
84 84
         this.continuation = continuation;
85 85
     }
86
-    
86
+
87 87
     public void touch() {
88 88
         lastSeenTime = System.currentTimeMillis();
89 89
     }
90
-    
90
+
91 91
     public void addEvent(final Event event) {
92 92
         synchronized (events) {
93 93
             events.add(event);
@@ -97,7 +97,7 @@ public class Client {
97 97
             }
98 98
         }
99 99
     }
100
-    
100
+
101 101
     public List<Event> retrieveEvents() {
102 102
         synchronized (events) {
103 103
             final List<Event> res = new LinkedList<Event>(events);
@@ -105,7 +105,7 @@ public class Client {
105 105
             return res;
106 106
         }
107 107
     }
108
-    
108
+
109 109
     public int getEventCount() {
110 110
         return events.size();
111 111
     }

+ 37
- 37
src/com/dmdirc/addons/ui_web/uicomponents/WebWindow.java Просмотреть файл

@@ -53,35 +53,35 @@ import org.apache.commons.lang.StringEscapeUtils;
53 53
  * @author chris
54 54
  */
55 55
 public class WebWindow implements Window {
56
-    
56
+
57 57
     protected static int counter = 0;
58
-    
59
-    protected static Map<String, WebWindow> windows = new HashMap<String, WebWindow>();
60
-    
58
+
59
+    protected static final Map<String, WebWindow> WINDOWS = new HashMap<String, WebWindow>();
60
+
61 61
     protected int myID = ++counter;
62
-    
62
+
63 63
     private final FrameContainer<?> parent;
64
-    
64
+
65 65
     private List<String> messages = new ArrayList<String>();
66
-    
66
+
67 67
     private String title;
68
-    
68
+
69 69
     public WebWindow(final FrameContainer<?> parent) {
70 70
         super();
71
-        
71
+
72 72
         this.parent = parent;
73
-        
74
-        windows.put(getId(), this);
73
+
74
+        WINDOWS.put(getId(), this);
75 75
     }
76
-    
76
+
77 77
     public static Collection<WebWindow> getWindows() {
78
-        return windows.values();
78
+        return WINDOWS.values();
79 79
     }
80
-    
80
+
81 81
     public static WebWindow getWindow(final String id) {
82
-        return windows.get(id);
82
+        return WINDOWS.get(id);
83 83
     }
84
-    
84
+
85 85
     public List<String> getMessages() {
86 86
         return messages;
87 87
     }
@@ -109,7 +109,7 @@ public class WebWindow implements Window {
109 109
     @Deprecated
110 110
     public void addLine(String line, boolean timestamp) {
111 111
         for (String linepart : line.split("\n")) {
112
-            final String message = 
112
+            final String message =
113 113
                     style(Formatter.formatMessage(parent.getConfigManager(), "timestamp",
114 114
                     new Date()), getConfigManager()) + style(linepart, getConfigManager());
115 115
             messages.add(message);
@@ -155,7 +155,7 @@ public class WebWindow implements Window {
155 155
     public String getTitle() {
156 156
         return title;
157 157
     }
158
-    
158
+
159 159
     public String getName() {
160 160
         return parent.toString();
161 161
     }
@@ -195,7 +195,7 @@ public class WebWindow implements Window {
195 195
     public void close() {
196 196
         throw new UnsupportedOperationException("Not supported yet.");
197 197
     }
198
-    
198
+
199 199
     public String getType() {
200 200
         if (this instanceof WebServerWindow) {
201 201
             return "server";
@@ -207,44 +207,44 @@ public class WebWindow implements Window {
207 207
             return "window";
208 208
         }
209 209
     }
210
-    
210
+
211 211
     public String getId() {
212 212
         return String.valueOf(myID);
213 213
     }
214
-    
214
+
215 215
     protected String style(final String input, final ConfigManager config) {
216 216
         final StringBuilder builder = new StringBuilder();
217 217
         final AttributedCharacterIterator aci = Utils.getAttributedString(parent.getStyliser(),
218 218
                 new String[]{input}, "dialog", 12).getAttributedString().getIterator();
219
-         
219
+
220 220
         Map<AttributedCharacterIterator.Attribute, Object> map = null;
221 221
         char chr = aci.current();
222
-        
222
+
223 223
         while (aci.getIndex() < aci.getEndIndex()) {
224
-            if (!aci.getAttributes().equals(map)) {                
224
+            if (!aci.getAttributes().equals(map)) {
225 225
                 style(aci.getAttributes(), builder);
226 226
                 map = aci.getAttributes();
227 227
             }
228
-            
228
+
229 229
             builder.append(StringEscapeUtils.escapeHtml(String.valueOf(chr)));
230 230
             chr = aci.next();
231 231
         }
232
-        
232
+
233 233
         return builder.toString();
234 234
     }
235
-    
235
+
236 236
     protected static void style(final Map<AttributedCharacterIterator.Attribute, Object> map,
237 237
             final StringBuilder builder) {
238 238
         if (builder.length() > 0) {
239 239
             builder.append("</span>");
240 240
         }
241
-        
241
+
242 242
         String link = null;
243
-                
243
+
244 244
         builder.append("<span style=\"");
245
-        
245
+
246 246
         for (Map.Entry<AttributedCharacterIterator.Attribute, Object> entry : map.entrySet()) {
247
-        
247
+
248 248
             if (entry.getKey().equals(TextAttribute.FOREGROUND)) {
249 249
                 builder.append("color: ");
250 250
                 builder.append(toColour(entry.getValue()));
@@ -253,7 +253,7 @@ public class WebWindow implements Window {
253 253
                 builder.append("background-color: ");
254 254
                 builder.append(toColour(entry.getValue()));
255 255
                 builder.append("; ");
256
-            } else if (entry.getKey().equals(TextAttribute.WEIGHT)) { 
256
+            } else if (entry.getKey().equals(TextAttribute.WEIGHT)) {
257 257
                 builder.append("font-weight: bold; ");
258 258
             } else if (entry.getKey().equals(TextAttribute.FAMILY)) {
259 259
                 builder.append("font-family: monospace; ");
@@ -281,21 +281,21 @@ public class WebWindow implements Window {
281 281
                         + "');";
282 282
             }
283 283
         }
284
-        
284
+
285 285
         builder.append('"');
286
-        
286
+
287 287
         if (link != null) {
288 288
             builder.append(" onClick=\"");
289 289
             builder.append(link);
290 290
             builder.append('"');
291 291
         }
292
-        
292
+
293 293
         builder.append('>');
294 294
     }
295
-    
295
+
296 296
     protected static String toColour(final Object object) {
297 297
         final Color colour = (Color) object;
298
-        
298
+
299 299
         return "rgb(" + colour.getRed() + ", " + colour.getGreen() + ", "
300 300
                 + colour.getBlue() + ")";
301 301
     }

+ 30
- 30
test/com/dmdirc/addons/identd/IdentClientTest.java Просмотреть файл

@@ -39,9 +39,9 @@ public class IdentClientTest {
39 39
 
40 40
     protected IdentClient getClient() {
41 41
         IdentdPlugin plugin = mock(IdentdPlugin.class);
42
-        
42
+
43 43
         when(plugin.getDomain()).thenReturn("plugin-Identd");
44
-        
44
+
45 45
         return new IdentClient(null, null, plugin);
46 46
     }
47 47
 
@@ -49,44 +49,44 @@ public class IdentClientTest {
49 49
     public void testInvalidIdent() {
50 50
         final String response = getClient().getIdentResponse("invalid request!",
51 51
                 IdentityManager.getGlobalConfig());
52
-        
52
+
53 53
         assertContains("Illegal requests must result in an ERROR response",
54 54
                 response, "ERROR");
55 55
     }
56
-    
56
+
57 57
     @Test
58 58
     public void testQuoting() {
59 59
         final String response = getClient().getIdentResponse("in\\valid:invalid",
60 60
                 IdentityManager.getGlobalConfig());
61
-        
61
+
62 62
         assertStartsWith("Special chars in illegal requests must be quoted",
63 63
                 response, "in\\\\valid\\:invalid");
64 64
     }
65
-    
65
+
66 66
     @Test
67 67
     public void testQuoting2() {
68 68
         final String response = getClient().getIdentResponse("in\\\\valid\\ inv\\:alid",
69 69
                 IdentityManager.getGlobalConfig());
70
-        
70
+
71 71
         assertStartsWith("Escaped characters in illegal requests shouldn't be doubly-escaped",
72 72
                 response, "in\\\\valid\\ inv\\:alid");
73
-    }    
74
-    
73
+    }
74
+
75 75
     @Test
76 76
     public void testNonNumericPort() {
77 77
         final String response = getClient().getIdentResponse("abc, def",
78 78
                 IdentityManager.getGlobalConfig());
79
-        
79
+
80 80
         assertContains("Non-numeric ports must result in an ERROR response",
81 81
                 response, "ERROR");
82 82
         assertStartsWith("Specified ports must be returned in the response",
83 83
                 response.replaceAll("\\s+", ""), "abc,def:");
84 84
     }
85
-    
85
+
86 86
     private void doPortTest(final String ports) {
87 87
         final String response = getClient().getIdentResponse(ports,
88 88
                 IdentityManager.getGlobalConfig());
89
-        
89
+
90 90
         assertContains("Illegal ports must result in an ERROR response",
91 91
                 response, "ERROR");
92 92
         assertContains("Illegal ports must result in an INVALID-PORT response",
@@ -94,7 +94,7 @@ public class IdentClientTest {
94 94
         assertStartsWith("Port numbers must be returned as part of the response",
95 95
                 response.replaceAll("\\s+", ""), ports.replaceAll("\\s+", ""));
96 96
     }
97
-    
97
+
98 98
     @Test
99 99
     public void testOutOfRangePorts() {
100 100
         doPortTest("0, 50");
@@ -102,32 +102,32 @@ public class IdentClientTest {
102 102
         doPortTest("50, 0");
103 103
         doPortTest("50, 65536");
104 104
     }
105
-    
105
+
106 106
     @Test
107 107
     public void testAlwaysOn() {
108 108
         final TestConfigManagerMap tcm = new TestConfigManagerMap();
109 109
         tcm.settings.put("plugin-Identd.advanced.alwaysOn", "false");
110
-        
110
+
111 111
         final String response = getClient().getIdentResponse("50, 50", tcm);
112 112
         assertContains("Unknown port requests must return an ERROR response",
113 113
                 response, "ERROR");
114 114
         assertContains("Unknown port requests must return a NO-USER response",
115 115
                 response, "NO-USER");
116 116
     }
117
-    
117
+
118 118
     @Test
119 119
     public void testHidden() {
120 120
         final TestConfigManagerMap tcm = new TestConfigManagerMap();
121 121
         tcm.settings.put("plugin-Identd.advanced.alwaysOn", "true");
122 122
         tcm.settings.put("plugin-Identd.advanced.isHiddenUser", "true");
123
-        
123
+
124 124
         final String response = getClient().getIdentResponse("50, 50", tcm);
125 125
         assertContains("Hidden requests must return an ERROR response",
126 126
                 response, "ERROR");
127 127
         assertContains("Hidden requests must return a HIDDEN-USER response",
128 128
                 response, "HIDDEN-USER");
129 129
     }
130
-    
130
+
131 131
     @Test
132 132
     public void testSystemNameQuoting() {
133 133
         final TestConfigManagerMap tcm = new TestConfigManagerMap();
@@ -137,12 +137,12 @@ public class IdentClientTest {
137 137
         tcm.settings.put("plugin-Identd.advanced.customSystem", "a:b\\c,d");
138 138
         tcm.settings.put("plugin-Identd.general.useCustomName", "false");
139 139
         tcm.settings.put("plugin-Identd.general.customName", "");
140
-        
140
+
141 141
         final String response = getClient().getIdentResponse("50, 50", tcm);
142 142
         assertContains("Special characters must be quoted in system names",
143
-                response, "a\\:b\\\\c\\,d");        
143
+                response, "a\\:b\\\\c\\,d");
144 144
     }
145
-    
145
+
146 146
     @Test
147 147
     public void testCustomNameQuoting() {
148 148
         final TestConfigManagerMap tcm = new TestConfigManagerMap();
@@ -152,12 +152,12 @@ public class IdentClientTest {
152 152
         tcm.settings.put("plugin-Identd.advanced.customSystem", "");
153 153
         tcm.settings.put("plugin-Identd.general.useCustomName", "true");
154 154
         tcm.settings.put("plugin-Identd.general.customName", "a:b\\c,d");
155
-        
155
+
156 156
         final String response = getClient().getIdentResponse("50, 50", tcm);
157 157
         assertContains("Special characters must be quoted in custom names",
158
-                response, "a\\:b\\\\c\\,d");        
158
+                response, "a\\:b\\\\c\\,d");
159 159
     }
160
-    
160
+
161 161
     @Test
162 162
     public void testCustomNames() {
163 163
         final TestConfigManagerMap tcm = new TestConfigManagerMap();
@@ -167,26 +167,26 @@ public class IdentClientTest {
167 167
         tcm.settings.put("plugin-Identd.advanced.customSystem", "system");
168 168
         tcm.settings.put("plugin-Identd.general.useCustomName", "true");
169 169
         tcm.settings.put("plugin-Identd.general.customName", "name");
170
-        
170
+
171 171
         final String response = getClient().getIdentResponse("50, 60", tcm);
172 172
         final String[] bits = response.split(":");
173
-        
173
+
174 174
         assertTrue("Responses must include port pair",
175 175
                 bits[0].matches("\\s*50\\s*,\\s*60\\s*"));
176 176
         assertEquals("Positive response must include USERID",
177 177
                 "USERID", bits[1].trim());
178 178
         assertEquals("Must use custom system name", "system", bits[2].trim());
179 179
         assertEquals("Must use custom name", "name", bits[3].trim());
180
-    }    
181
-    
180
+    }
181
+
182 182
     private static void assertContains(final String msg, final String haystack,
183 183
             final String needle) {
184 184
         assertTrue(msg, haystack.indexOf(needle) > -1);
185 185
     }
186
-    
186
+
187 187
     private static void assertStartsWith(final String msg, final String haystack,
188 188
             final String needle) {
189 189
         assertTrue(msg, haystack.startsWith(needle));
190
-    }    
190
+    }
191 191
 
192 192
 }

+ 40
- 40
test/com/dmdirc/addons/ui_swing/components/reorderablelist/ArrayListTransferHandlerTest.java Просмотреть файл

@@ -41,36 +41,36 @@ public class ArrayListTransferHandlerTest {
41 41
         test.add("abc");
42 42
         test.add("def");
43 43
         test.add(null);
44
-        
44
+
45 45
         final JList list = new JList(test.toArray());
46 46
         list.setSelectedIndex(0);
47
-        
47
+
48 48
         final ArrayListTransferHandler handler = new ArrayListTransferHandler();
49 49
         final Transferable transferable = handler.createTransferable(list);
50
-        
50
+
51 51
         assertNotNull(transferable);
52 52
         final Object data = transferable.getTransferData(transferable.getTransferDataFlavors()[0]);
53
-        
53
+
54 54
         assertTrue(data instanceof ArrayList<?>);
55 55
         assertEquals(1, ((ArrayList<?>) data).size());
56 56
         assertEquals("abc", ((ArrayList<?>) data).get(0));
57 57
     }
58
-    
58
+
59 59
     @Test
60 60
     public void testCreateTransferrable2() throws IOException, UnsupportedFlavorException {
61 61
         final ArrayList<String> test = new ArrayList<String>();
62 62
         test.add("abc");
63 63
         test.add("def");
64 64
         test.add(null);
65
-        
65
+
66 66
         final JList list = new JList(test.toArray());
67
-        
67
+
68 68
         final ArrayListTransferHandler handler = new ArrayListTransferHandler();
69 69
         final Transferable transferable = handler.createTransferable(list);
70
-        
70
+
71 71
         assertNull(transferable);
72
-    }    
73
-    
72
+    }
73
+
74 74
     @Test
75 75
     public void testCreateTransferrable3() throws IOException, UnsupportedFlavorException {
76 76
         final ArrayList<Object> test = new ArrayList<Object>();
@@ -80,64 +80,64 @@ public class ArrayListTransferHandlerTest {
80 80
             public String toString() {
81 81
                 return null;
82 82
             }
83
-            
83
+
84 84
         });
85 85
         test.add("def");
86 86
         test.add(null);
87
-        
87
+
88 88
         final JList list = new JList(test.toArray());
89 89
         list.setSelectedIndex(0);
90
-        
90
+
91 91
         final ArrayListTransferHandler handler = new ArrayListTransferHandler();
92 92
         final Transferable transferable = handler.createTransferable(list);
93
-        
93
+
94 94
         assertNotNull(transferable);
95 95
         final Object data = transferable.getTransferData(transferable.getTransferDataFlavors()[0]);
96
-        
96
+
97 97
         assertTrue(data instanceof ArrayList<?>);
98 98
         assertEquals(1, ((ArrayList<?>) data).size());
99 99
         assertEquals("", ((ArrayList<?>) data).get(0));
100
-    }    
101
-    
100
+    }
101
+
102 102
     @Test
103 103
     public void testCreateTransferrable4() throws IOException, UnsupportedFlavorException {
104 104
         final ArrayListTransferHandler handler = new ArrayListTransferHandler();
105 105
         final Transferable transferable = handler.createTransferable(null);
106
-        
106
+
107 107
         assertNull(transferable);
108 108
     }
109
-    
109
+
110 110
     @Test
111 111
     public void testCanImport() {
112 112
         final ArrayListTransferHandler handler = new ArrayListTransferHandler();
113 113
         final ArrayListTransferable transferable = new ArrayListTransferable(null);
114 114
         final JList list = new JList(new DefaultListModel());
115
-        
115
+
116 116
         for (DataFlavor df : transferable.getTransferDataFlavors()) {
117 117
             assertTrue(handler.canImport(list, new DataFlavor[]{df}));
118 118
             assertFalse(handler.canImport(null, new DataFlavor[]{df}));
119 119
         }
120
-        
120
+
121 121
         assertFalse(handler.canImport(list, new DataFlavor[]{}));
122 122
     }
123
-    
123
+
124 124
     @Test
125 125
     public void testImportData() {
126 126
         final ArrayList<String> test = new ArrayList<String>();
127 127
         test.add("abc");
128 128
         test.add("def");
129 129
         test.add(null);
130
-        
130
+
131 131
         final JList list = new JList(new DefaultListModel());
132 132
         ((DefaultListModel) list.getModel()).addElement("123");
133 133
         ((DefaultListModel) list.getModel()).addElement("456");
134 134
         list.setSelectedIndex(0);
135
-        
135
+
136 136
         final ArrayListTransferHandler handler = new ArrayListTransferHandler();
137 137
         final ArrayListTransferable alt = new ArrayListTransferable(test);
138
-        
138
+
139 139
         handler.createTransferable(new JList(new DefaultListModel()));
140
-        
140
+
141 141
         assertTrue(handler.importData(list, alt));
142 142
         assertEquals(5, list.getModel().getSize());
143 143
         assertEquals("123", list.getModel().getElementAt(0));
@@ -145,63 +145,63 @@ public class ArrayListTransferHandlerTest {
145 145
         assertEquals(null, list.getModel().getElementAt(3));
146 146
         assertEquals("456", list.getModel().getElementAt(4));
147 147
     }
148
-    
148
+
149 149
     @Test
150 150
     public void testImportData2() {
151 151
         final ArrayListTransferHandler handler = new ArrayListTransferHandler();
152 152
         final ArrayListTransferable alt = new ArrayListTransferable(null);
153 153
         assertFalse(handler.importData(null, alt));
154 154
     }
155
-    
155
+
156 156
     @Test
157 157
     public void testExportDone() {
158 158
         final ArrayList<String> test = new ArrayList<String>();
159 159
         test.add("123");
160 160
         test.add("456");
161
-        
161
+
162 162
         final JList list = new JList(new DefaultListModel());
163 163
         ((DefaultListModel) list.getModel()).addElement("123");
164 164
         ((DefaultListModel) list.getModel()).addElement("456");
165 165
         list.setSelectedIndex(0);
166
-        
166
+
167 167
         final ArrayListTransferHandler handler = new ArrayListTransferHandler();
168 168
         final ArrayListTransferable alt = new ArrayListTransferable(test);
169
-        
169
+
170 170
         handler.createTransferable(list);
171
-        
171
+
172 172
         final JList list2 = new JList(new DefaultListModel());
173 173
         list2.setSelectedIndex(0);
174 174
         assertTrue(handler.importData(list2, alt));
175
-        
175
+
176 176
         handler.exportDone(list, alt, TransferHandler.MOVE);
177 177
         assertEquals(1, list.getModel().getSize());
178 178
         assertEquals("456", list.getModel().getElementAt(0));
179 179
     }
180
-    
180
+
181 181
     @Test
182 182
     public void testExportDone2() {
183 183
         final ArrayList<String> test = new ArrayList<String>();
184 184
         test.add("123");
185 185
         test.add("456");
186
-        
186
+
187 187
         final JList list = new JList(new DefaultListModel());
188 188
         ((DefaultListModel) list.getModel()).addElement("123");
189 189
         ((DefaultListModel) list.getModel()).addElement("456");
190 190
         list.setSelectedIndex(0);
191
-        
191
+
192 192
         final ArrayListTransferHandler handler = new ArrayListTransferHandler();
193 193
         final ArrayListTransferable alt = new ArrayListTransferable(test);
194
-        
194
+
195 195
         handler.createTransferable(list);
196
-        
196
+
197 197
         final JList list2 = new JList(new DefaultListModel());
198 198
         list2.setSelectedIndex(0);
199 199
         assertTrue(handler.importData(list2, alt));
200
-        
200
+
201 201
         handler.exportDone(list, alt, TransferHandler.COPY);
202 202
         assertEquals(2, list.getModel().getSize());
203 203
         assertEquals("123", list.getModel().getElementAt(0));
204 204
         assertEquals("456", list.getModel().getElementAt(1));
205
-    }        
205
+    }
206 206
 
207 207
 }

Загрузка…
Отмена
Сохранить