|
@@ -57,14 +57,10 @@ import net.miginfocom.swing.MigLayout;
|
57
|
57
|
public class ConfigPanel extends JPanel implements PreferencesInterface,
|
58
|
58
|
KeyListener {
|
59
|
59
|
|
60
|
|
- /**
|
61
|
|
- * A version number for this class. It should be changed whenever the class structure is changed
|
62
|
|
- * (or anything else that would prevent serialized objects being unserialized with the new
|
63
|
|
- * class).
|
64
|
|
- */
|
|
60
|
+ /** A version number for this class. */
|
65
|
61
|
private static final long serialVersionUID = 1;
|
66
|
62
|
/** Media source order list. */
|
67
|
|
- private ReorderableJList list;
|
|
63
|
+ private ReorderableJList<String> list;
|
68
|
64
|
/** Media sources. */
|
69
|
65
|
private final List<String> sources;
|
70
|
66
|
/** The plugin that owns this panel. */
|
|
@@ -109,7 +105,7 @@ public class ConfigPanel extends JPanel implements PreferencesInterface,
|
109
|
105
|
* Initialises the components.
|
110
|
106
|
*/
|
111
|
107
|
private void initComponents() {
|
112
|
|
- list = new ReorderableJList();
|
|
108
|
+ list = new ReorderableJList<>();
|
113
|
109
|
|
114
|
110
|
for (String source : sources) {
|
115
|
111
|
list.getModel().addElement(source);
|
|
@@ -130,7 +126,7 @@ public class ConfigPanel extends JPanel implements PreferencesInterface,
|
130
|
126
|
|
131
|
127
|
panel.add(new JLabel("Drag and drop items to reorder"), "wrap");
|
132
|
128
|
panel.add(new JScrollPane(list), "growx, pushx");
|
133
|
|
- panel.add(new ListReorderButtonPanel(list), "");
|
|
129
|
+ panel.add(new ListReorderButtonPanel<>(list), "");
|
134
|
130
|
|
135
|
131
|
add(panel, "growx, wrap");
|
136
|
132
|
|
|
@@ -192,10 +188,10 @@ public class ConfigPanel extends JPanel implements PreferencesInterface,
|
192
|
188
|
public List<String> getSources() {
|
193
|
189
|
final List<String> newSources = new LinkedList<>();
|
194
|
190
|
|
195
|
|
- final Enumeration<?> values = list.getModel().elements();
|
|
191
|
+ final Enumeration<String> values = list.getModel().elements();
|
196
|
192
|
|
197
|
193
|
while (values.hasMoreElements()) {
|
198
|
|
- newSources.add((String) values.nextElement());
|
|
194
|
+ newSources.add(values.nextElement());
|
199
|
195
|
}
|
200
|
196
|
|
201
|
197
|
return newSources;
|