ソースを参照

Code tidying.

Reorderable list should not be final
Validating textfield doesn't need to take an icon manager, I will fully remove this in a later commit.

Change-Id: I0412f79b951b37d6e72a4fc70d41f0d512731c99
Reviewed-on: http://gerrit.dmdirc.com/2236
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.7rc1
Greg Holmes 12年前
コミット
e545495d36

+ 1
- 2
src/com/dmdirc/addons/ui_swing/components/reorderablelist/ReorderableJList.java ファイルの表示

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.components.reorderablelist;
24 24
 
25
-
26 25
 import com.dmdirc.addons.ui_swing.components.renderers.ReorderableJListCellRenderer;
27 26
 import com.dmdirc.logger.ErrorLevel;
28 27
 import com.dmdirc.logger.Logger;
@@ -56,7 +55,7 @@ import javax.swing.ListSelectionModel;
56 55
 /**
57 56
  * Reorderable JList.
58 57
  */
59
-public final class ReorderableJList extends JList implements DragSourceListener,
58
+public class ReorderableJList extends JList implements DragSourceListener,
60 59
         DropTargetListener, DragGestureListener {
61 60
 
62 61
     /**

+ 14
- 2
src/com/dmdirc/addons/ui_swing/components/validating/ValidatingJTextField.java ファイルの表示

@@ -32,6 +32,7 @@ import java.awt.Font;
32 32
 import java.awt.event.KeyListener;
33 33
 import java.awt.event.MouseListener;
34 34
 
35
+import javax.swing.Icon;
35 36
 import javax.swing.JComponent;
36 37
 import javax.swing.JLabel;
37 38
 import javax.swing.JTextField;
@@ -71,7 +72,6 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
71 72
             final Validator<String> validator) {
72 73
         this(iconManager, new JTextField(), validator);
73 74
     }
74
-
75 75
     /**
76 76
      * Instantiates a new Validating text field.
77 77
      *
@@ -81,10 +81,22 @@ public class ValidatingJTextField extends JComponent implements DocumentListener
81 81
      */
82 82
     public ValidatingJTextField(final IconManager iconManager,
83 83
             final JTextField textField, final Validator<String> validator) {
84
+        this(iconManager.getIcon("input-error"), textField, validator);
85
+    }
86
+
87
+    /**
88
+     * Instantiates a new Validating text field.
89
+     *
90
+     * @param icon Icon to show on error
91
+     * @param textField JTextField to wrap
92
+     * @param validator Validator instance
93
+     */
94
+    public ValidatingJTextField(final Icon icon,
95
+            final JTextField textField, final Validator<String> validator) {
84 96
         super();
85 97
         this.textField = textField;
86 98
         this.validator = validator;
87
-        errorIcon = new JLabel(iconManager.getIcon("input-error"));
99
+        errorIcon = new JLabel(icon);
88 100
 
89 101
         setLayout(new MigLayout("fill, ins 0, hidemode 3, gap 0"));
90 102
         add(textField, "grow, pushx");

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