Browse Source

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 years ago
parent
commit
430711e424
65 changed files with 923 additions and 948 deletions
  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 View File

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

+ 35
- 35
src/com/dmdirc/addons/freedesktop_notifications/commons/Entities.java View File

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

+ 2
- 2
src/com/dmdirc/addons/freedesktop_notifications/commons/StringEscapeUtils.java View File

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

+ 2
- 2
src/com/dmdirc/addons/logging/LoggingPlugin.java View File

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

+ 28
- 28
src/com/dmdirc/addons/nickcolours/NickColourInputDialog.java View File

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

+ 1
- 1
src/com/dmdirc/addons/nickcolours/NickColourPlugin.java View File

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

+ 18
- 18
src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java View File

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

+ 36
- 36
src/com/dmdirc/addons/nowplaying/NowPlayingPlugin.java View File

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

+ 35
- 35
src/com/dmdirc/addons/osd/OsdWindow.java View File

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

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

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

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

132
     /** {@inheritDoc} */
132
     /** {@inheritDoc} */
133
     @Override
133
     @Override
134
     public void kick(final String message) {
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
         myChannel.delChannelClient(this);
136
         myChannel.delChannelClient(this);
137
         myClient.delChannelClient(this);
137
         myClient.delChannelClient(this);
138
     }
138
     }

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

180
     public ChannelClientInfo getChannelClient(final String client, final boolean create) {
180
     public ChannelClientInfo getChannelClient(final String client, final boolean create) {
181
         ChannelClientInfo cci = getChannelClient(client);
181
         ChannelClientInfo cci = getChannelClient(client);
182
         if (create && cci == null) {
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
         return cci;
185
         return cci;
186
     }
186
     }

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

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

+ 6
- 6
src/com/dmdirc/addons/parser_twitter/api/TwitterAPI.java View File

1061
         synchronized (statusCache) {
1061
         synchronized (statusCache) {
1062
             final Map<Long, TwitterStatus> current = new HashMap<Long, TwitterStatus>(statusCache);
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
             if (doc.isGood()) {
1243
             if (doc.isGood()) {
1244
                 final NodeList nodes = doc.getElementsByTagName("id");
1244
                 final NodeList nodes = doc.getElementsByTagName("id");
1245
                 for (int i = 0; i < nodes.getLength(); i++) {
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
                     final Long id = parseLong(element.getTextContent(), -1);
1247
                     final Long id = parseLong(element.getTextContent(), -1);
1248
                     result.add(id);
1248
                     result.add(id);
1249
 
1249
 
1490
             final String resetTimeString = getElementContents(element, "reset-time-in-seconds", getElementContents(element, "reset_time_in_seconds", "0"));
1490
             final String resetTimeString = getElementContents(element, "reset-time-in-seconds", getElementContents(element, "reset_time_in_seconds", "0"));
1491
             resetTime = 1000 * parseLong(resetTimeString, -1);
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
         } else {
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 View File

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

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

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

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

458
          * {@inheritDoc}
458
          * {@inheritDoc}
459
          */
459
          */
460
         public void add(String name, int value) {
460
         public void add(String name, int value) {
461
-            mapNameToValue.put(name, new Integer(value));
461
+            mapNameToValue.put(name, value);
462
             mapValueToName.put(value, name);
462
             mapValueToName.put(value, name);
463
         }
463
         }
464
 
464
 
490
          * {@inheritDoc}
490
          * {@inheritDoc}
491
          */
491
          */
492
         public void add(String name, int value) {
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
          * {@inheritDoc}
498
          * {@inheritDoc}
499
          */
499
          */
500
         public String name(int value) {
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 View File

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

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

47
     private ParserDebugCommand command = null;
47
     private ParserDebugCommand command = null;
48
 
48
 
49
     /** Map of parsers registered. */
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
      * Creates a new instance of the Debug Plugin.
54
      * Creates a new instance of the Debug Plugin.
93
     @Override
93
     @Override
94
     public void processEvent(final ActionType type, final StringBuffer format, final Object... arguments) {
94
     public void processEvent(final ActionType type, final StringBuffer format, final Object... arguments) {
95
         if (type == CoreActionType.SERVER_DISCONNECTED) {
95
         if (type == CoreActionType.SERVER_DISCONNECTED) {
96
-            final Server thisServer = (Server)arguments[0];
96
+            final Server thisServer = (Server) arguments[0];
97
             final Parser parser = thisServer.getParser();
97
             final Parser parser = thisServer.getParser();
98
             if (registeredParsers.containsKey(parser)) {
98
             if (registeredParsers.containsKey(parser)) {
99
                 try {
99
                 try {

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

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

+ 8
- 8
src/com/dmdirc/addons/relaybot/RelayBotPlugin.java View File

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

+ 3
- 3
src/com/dmdirc/addons/relaybot/RelayChannelHandler.java View File

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

+ 1
- 1
src/com/dmdirc/addons/relaybot/RelayClientInfo.java View File

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

+ 2
- 2
src/com/dmdirc/addons/scriptplugin/JavaScriptHelper.java View File

38
     private static final int VERSION = 2;
38
     private static final int VERSION = 2;
39
 
39
 
40
     /** Hashtable for storing stuff. */
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
      * Method to set Stuff.
44
      * Method to set Stuff.
50
         if (setting.equals("")) { return; }
50
         if (setting.equals("")) { return; }
51
         setting = setting.toLowerCase();
51
         setting = setting.toLowerCase();
52
         if (SETTINGS.containsKey(setting)) { SETTINGS.remove(setting); }
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 View File

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

+ 36
- 36
src/com/dmdirc/addons/systray/SystrayPlugin.java View File

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

+ 25
- 25
src/com/dmdirc/addons/ui_dummy/DummyInputWindow.java View File

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

+ 10
- 10
src/com/dmdirc/addons/ui_dummy/DummyMainWindow.java View File

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

+ 13
- 13
src/com/dmdirc/addons/ui_swing/UIUtilities.java View File

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

+ 22
- 22
src/com/dmdirc/addons/ui_swing/actions/CopyAction.java View File

31
 /**
31
 /**
32
  * Copy action.
32
  * Copy action.
33
  */
33
  */
34
-public final class CopyAction extends AbstractAction { 
35
-    
34
+public final class CopyAction extends AbstractAction {
35
+
36
     /**
36
     /**
37
      * A version number for this class. It should be changed whenever the class
37
      * A version number for this class. It should be changed whenever the class
38
      * structure is changed (or anything else that would prevent serialized
38
      * structure is changed (or anything else that would prevent serialized
39
      * objects being unserialized with the new class).
39
      * objects being unserialized with the new class).
40
      */
40
      */
41
     private static final long serialVersionUID = 1;
41
     private static final long serialVersionUID = 1;
42
-    
42
+
43
     /** Text component to be acted upon. */
43
     /** Text component to be acted upon. */
44
-    private final JTextComponent comp; 
45
- 
46
-    /** 
44
+    private final JTextComponent comp;
45
+
46
+    /**
47
      * Instantiates a new copy action.
47
      * Instantiates a new copy action.
48
-     * 
48
+     *
49
      * @param comp Component to be acted upon
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
      * {@inheritDoc}
58
      * {@inheritDoc}
59
      *
59
      *
60
      * @param e Action event
60
      * @param e Action event
61
      */
61
      */
62
     @Override
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
     /** {@inheritDoc} */
67
     /** {@inheritDoc} */
68
     @Override
68
     @Override
69
-    public boolean isEnabled() { 
70
-        return comp.isEnabled() 
69
+    public boolean isEnabled() {
70
+        return comp.isEnabled()
71
                 && comp.getSelectedText() != null
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 View File

31
 /**
31
 /**
32
  * Cut action.
32
  * Cut action.
33
  */
33
  */
34
-public final class CutAction extends AbstractAction { 
35
-    
34
+public final class CutAction extends AbstractAction {
35
+
36
     /**
36
     /**
37
      * A version number for this class. It should be changed whenever the class
37
      * A version number for this class. It should be changed whenever the class
38
      * structure is changed (or anything else that would prevent serialized
38
      * structure is changed (or anything else that would prevent serialized
39
      * objects being unserialized with the new class).
39
      * objects being unserialized with the new class).
40
      */
40
      */
41
     private static final long serialVersionUID = 1;
41
     private static final long serialVersionUID = 1;
42
-    
42
+
43
     /** Text component to be acted upon. */
43
     /** Text component to be acted upon. */
44
-    private final JTextComponent comp; 
45
- 
46
-    /** 
44
+    private final JTextComponent comp;
45
+
46
+    /**
47
      * Instantiates a new cut action.
47
      * Instantiates a new cut action.
48
-     * 
48
+     *
49
      * @param comp Component to be acted upon
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
      * {@inheritDoc}
58
      * {@inheritDoc}
59
      *
59
      *
60
      * @param e Action event
60
      * @param e Action event
61
      */
61
      */
62
     @Override
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
     /** {@inheritDoc} */
67
     /** {@inheritDoc} */
68
     @Override
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
                 && comp.getSelectedText() != null
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 View File

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

+ 19
- 19
src/com/dmdirc/addons/ui_swing/components/NicklistListModel.java View File

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

+ 44
- 44
src/com/dmdirc/addons/ui_swing/components/SplitPane.java View File

1
 /*
1
 /*
2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
6
  * in the Software without restriction, including without limitation the rights
6
  * in the Software without restriction, including without limitation the rights
7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
  * copies of the Software, and to permit persons to whom the Software is
8
  * copies of the Software, and to permit persons to whom the Software is
9
  * furnished to do so, subject to the following conditions:
9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11
  * The above copyright notice and this permission notice shall be included in
11
  * The above copyright notice and this permission notice shall be included in
12
  * all copies or substantial portions of the Software.
12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
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
      * split, two null components and snapping to the left component.
66
      * split, two null components and snapping to the left component.
67
      */
67
      */
68
     public SplitPane() {
68
     public SplitPane() {
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
      * split, two null components and snapping to the left component.
74
      * split, two null components and snapping to the left component.
75
-     * 
75
+     *
76
      * @param snapDistance Distance to around the preferred size
76
      * @param snapDistance Distance to around the preferred size
77
      */
77
      */
78
     public SplitPane(final int snapDistance) {
78
     public SplitPane(final int snapDistance) {
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
      * split and two null components.
84
      * split and two null components.
85
-     * 
85
+     *
86
      * @param leftComponentSnap Snap to the preferred size of the left component?
86
      * @param leftComponentSnap Snap to the preferred size of the left component?
87
      */
87
      */
88
     public SplitPane(final boolean leftComponentSnap) {
88
     public SplitPane(final boolean leftComponentSnap) {
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
      * split and two null components.
94
      * split and two null components.
95
-     * 
95
+     *
96
      * @param leftComponentSnap Snap to the preferred size of the left component?
96
      * @param leftComponentSnap Snap to the preferred size of the left component?
97
      * @param snapDistance Distance to around the preferred size
97
      * @param snapDistance Distance to around the preferred size
98
      */
98
      */
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
      * components and snapping to the left component.
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
      * <code>JSplitPane.VERTICAL_SPLIT</code>
110
      * <code>JSplitPane.VERTICAL_SPLIT</code>
111
      */
111
      */
112
     public SplitPane(final Orientation orientation) {
112
     public SplitPane(final Orientation orientation) {
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
      * components and snapping to the left component.
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
      * <code>JSplitPane.VERTICAL_SPLIT</code>
122
      * <code>JSplitPane.VERTICAL_SPLIT</code>
123
      * @param snapDistance Distance to around the preferred size
123
      * @param snapDistance Distance to around the preferred size
124
      */
124
      */
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
      * components.
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
      * <code>JSplitPane.VERTICAL_SPLIT</code>
136
      * <code>JSplitPane.VERTICAL_SPLIT</code>
137
      * @param leftComponentSnap Snap to the preferred size of the left component?
137
      * @param leftComponentSnap Snap to the preferred size of the left component?
138
      */
138
      */
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
      * components.
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
      * <code>JSplitPane.VERTICAL_SPLIT</code>
150
      * <code>JSplitPane.VERTICAL_SPLIT</code>
151
      * @param leftComponentSnap Snap to the preferred size of the left component?
151
      * @param leftComponentSnap Snap to the preferred size of the left component?
152
      * @param snapDistance Distance to around the preferred size
152
      * @param snapDistance Distance to around the preferred size
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
      * components and snapping to the left component.
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
      * <code>JSplitPane.VERTICAL_SPLIT</code>
165
      * <code>JSplitPane.VERTICAL_SPLIT</code>
166
      * @param leftComponent left component
166
      * @param leftComponent left component
167
      * @param rightComponent right component
167
      * @param rightComponent right component
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
      * components and snapping to the left component.
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
      * <code>JSplitPane.VERTICAL_SPLIT</code>
180
      * <code>JSplitPane.VERTICAL_SPLIT</code>
181
      * @param leftComponent left component
181
      * @param leftComponent left component
182
      * @param rightComponent right component
182
      * @param rightComponent right component
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
      * components.
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
      * <code>JSplitPane.VERTICAL_SPLIT</code>
197
      * <code>JSplitPane.VERTICAL_SPLIT</code>
198
      * @param leftComponent left component
198
      * @param leftComponent left component
199
      * @param rightComponent right component
199
      * @param rightComponent right component
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
      * components.
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
      * <code>JSplitPane.VERTICAL_SPLIT</code>
214
      * <code>JSplitPane.VERTICAL_SPLIT</code>
215
      * @param leftComponent left component
215
      * @param leftComponent left component
216
      * @param rightComponent right component
216
      * @param rightComponent right component
231
 
231
 
232
         setOneTouchExpandable(useOneTouchExpandable);
232
         setOneTouchExpandable(useOneTouchExpandable);
233
         setContinuousLayout(true);
233
         setContinuousLayout(true);
234
-        
234
+
235
         getActionMap().setParent(null);
235
         getActionMap().setParent(null);
236
         getActionMap().clear();
236
         getActionMap().clear();
237
 
237
 
253
         });
253
         });
254
     }
254
     }
255
 }
255
 }
256
-    
256
+

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

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

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

214
                             new String[]{Styliser.CODE_HEXCOLOUR + ColourManager.
214
                             new String[]{Styliser.CODE_HEXCOLOUR + ColourManager.
215
                                 getHex(
215
                                 getHex(
216
                                 foregroundColour) + channel.getCurrentTopic().
216
                                 foregroundColour) + channel.getCurrentTopic().
217
-                                getTopic(),},
217
+                                getTopic(), },
218
                             as);
218
                             as);
219
                 }
219
                 }
220
                 if (channel.getConfigManager().getOptionBool(controller.
220
                 if (channel.getConfigManager().getOptionBool(controller.

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

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

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

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

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

54
         if (value instanceof AddonInfoLabel) {
54
         if (value instanceof AddonInfoLabel) {
55
             final AddonInfoLabel label = (AddonInfoLabel) value;
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
             if (!label.getBackground().equals(colour)) {
58
             if (!label.getBackground().equals(colour)) {
59
                 label.setBackground(colour);
59
                 label.setBackground(colour);
60
             }
60
             }

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

48
 
48
 
49
 /**
49
 /**
50
  * The main window that allows users to browse addons.
50
  * The main window that allows users to browse addons.
51
- * 
51
+ *
52
  * @author chris
52
  * @author chris
53
  */
53
  */
54
 public class BrowserWindow extends JDialog implements ActionListener {
54
 public class BrowserWindow extends JDialog implements ActionListener {
211
 
211
 
212
         for (Map<String, String> entry : data.getKeyDomains().values()) {
212
         for (Map<String, String> entry : data.getKeyDomains().values()) {
213
             final AddonInfo info = new AddonInfo(entry);
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 View File

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

+ 27
- 27
src/com/dmdirc/addons/ui_swing/components/expandingsettings/AddOptionPanel.java View File

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

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

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

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

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

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

+ 13
- 13
src/com/dmdirc/addons/ui_swing/components/renderers/AddonCellRenderer.java View File

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

+ 11
- 11
src/com/dmdirc/addons/ui_swing/components/renderers/ReorderableJListCellRenderer.java View File

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

+ 6
- 6
src/com/dmdirc/addons/ui_swing/components/reorderablelist/ListReorderButtonPanel.java View File

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

+ 35
- 35
src/com/dmdirc/addons/ui_swing/components/reorderablelist/ReorderableJList.java View File

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

+ 22
- 22
src/com/dmdirc/addons/ui_swing/components/substitutions/SubstitutionLabel.java View File

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

+ 13
- 13
src/com/dmdirc/addons/ui_swing/components/substitutions/SubstitutionsPanel.java View File

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

+ 46
- 46
src/com/dmdirc/addons/ui_swing/components/validating/ValidatingJTextField.java View File

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

+ 9
- 9
src/com/dmdirc/addons/ui_swing/dialogs/about/AboutDialog.java View File

57
     /** Tab history. */
57
     /** Tab history. */
58
     private int history = 0;
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
      * @param parentWindow Parent window
63
      * @param parentWindow Parent window
64
      */
64
      */
65
     private AboutDialog(final Window parentWindow) {
65
     private AboutDialog(final Window parentWindow) {
67
         initComponents();
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
      * @param parentWindow Parent window*/
73
      * @param parentWindow Parent window*/
74
     public static void showAboutDialog(final Window parentWindow) {
74
     public static void showAboutDialog(final Window parentWindow) {
75
         me = getAboutDialog(parentWindow);
75
         me = getAboutDialog(parentWindow);
80
 
80
 
81
     /**
81
     /**
82
      * Returns the current instance of the AboutDialog.
82
      * Returns the current instance of the AboutDialog.
83
-     * 
83
+     *
84
      * @param parentWindow Parent window
84
      * @param parentWindow Parent window
85
      *
85
      *
86
      * @return The current AboutDialog instance
86
      * @return The current AboutDialog instance
122
         getContentPane().add(getOkButton(), "right");
122
         getContentPane().add(getOkButton(), "right");
123
     }
123
     }
124
 
124
 
125
-    /** 
125
+    /**
126
      * {@inheritDoc}.
126
      * {@inheritDoc}.
127
-     * 
127
+     *
128
      * @param e Action event
128
      * @param e Action event
129
      */
129
      */
130
     @Override
130
     @Override

+ 17
- 17
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionTypeModel.java View File

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

+ 1
- 1
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/StringTransferable.java View File

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

+ 1
- 1
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicHistoryPane.java View File

76
         scrollPane.getVerticalScrollBar().setUnitIncrement(15);
76
         scrollPane.getVerticalScrollBar().setUnitIncrement(15);
77
 
77
 
78
         for (Topic topic : topics) {
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
         topicHistory.getSelectionModel().setSelectionInterval(0, 0);
81
         topicHistory.getSelectionModel().setSelectionInterval(0, 0);
82
         topicHistory.setShowGrid(false);
82
         topicHistory.setShowGrid(false);

+ 1
- 1
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicLabel.java View File

117
 
117
 
118
         if (!topic.getTopic().isEmpty()) {
118
         if (!topic.getTopic().isEmpty()) {
119
             channel.getStyliser().addStyledString((StyledDocument) pane.getDocument(),
119
             channel.getStyliser().addStyledString((StyledDocument) pane.getDocument(),
120
-                    new String[]{topic.getTopic(),},
120
+                    new String[]{topic.getTopic(), },
121
                     as);
121
                     as);
122
             add(pane, "wmax 450, grow, push, wrap, gapleft 5, gapleft 5");
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 View File

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

+ 2
- 2
src/com/dmdirc/addons/ui_swing/framemanager/buttonbar/ButtonBar.java View File

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

+ 37
- 37
src/com/dmdirc/addons/ui_swing/wizard/StepLayout.java View File

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

+ 7
- 7
src/com/dmdirc/addons/ui_swing/wizard/firstrun/MigrationExtrationStep.java View File

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

+ 12
- 12
src/com/dmdirc/addons/ui_web/Client.java View File

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

+ 37
- 37
src/com/dmdirc/addons/ui_web/uicomponents/WebWindow.java View File

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

+ 30
- 30
test/com/dmdirc/addons/identd/IdentClientTest.java View File

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

+ 40
- 40
test/com/dmdirc/addons/ui_swing/components/reorderablelist/ArrayListTransferHandlerTest.java View File

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

Loading…
Cancel
Save