|
@@ -66,7 +66,7 @@ public final class SwingPreferencesDialog extends StandardDialog implements
|
66
|
66
|
/** Serial version UID. */
|
67
|
67
|
private static final long serialVersionUID = 9;
|
68
|
68
|
/** Preferences tab list, used to switch option types. */
|
69
|
|
- private JList tabList;
|
|
69
|
+ private JList<PreferencesCategory> tabList;
|
70
|
70
|
/** Main panel. */
|
71
|
71
|
private CategoryPanel mainPanel;
|
72
|
72
|
/** Previously selected category. */
|
|
@@ -161,7 +161,7 @@ public final class SwingPreferencesDialog extends StandardDialog implements
|
161
|
161
|
private void initComponents() {
|
162
|
162
|
mainPanel = categoryPanelProvider.get();
|
163
|
163
|
|
164
|
|
- tabList = new JList(new DefaultListModel());
|
|
164
|
+ tabList = new JList<>(new DefaultListModel<PreferencesCategory>());
|
165
|
165
|
tabList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
166
|
166
|
tabList.addListSelectionListener(this);
|
167
|
167
|
ListScroller.register(tabList);
|
|
@@ -199,7 +199,7 @@ public final class SwingPreferencesDialog extends StandardDialog implements
|
199
|
199
|
tabList.removeListSelectionListener(SwingPreferencesDialog.this);
|
200
|
200
|
for (PreferencesCategory category : categories) {
|
201
|
201
|
if (!category.isInline()) {
|
202
|
|
- ((DefaultListModel) tabList.getModel()).addElement(
|
|
202
|
+ ((DefaultListModel<PreferencesCategory>) tabList.getModel()).addElement(
|
203
|
203
|
category);
|
204
|
204
|
}
|
205
|
205
|
addCategories(category.getSubcats());
|
|
@@ -233,11 +233,6 @@ public final class SwingPreferencesDialog extends StandardDialog implements
|
233
|
233
|
return count;
|
234
|
234
|
}
|
235
|
235
|
|
236
|
|
- /**
|
237
|
|
- * Handles the actions for the dialog.
|
238
|
|
- *
|
239
|
|
- * @param actionEvent Action event
|
240
|
|
- */
|
241
|
236
|
@Override
|
242
|
237
|
public void actionPerformed(final ActionEvent actionEvent) {
|
243
|
238
|
if (selected != null) {
|
|
@@ -262,19 +257,12 @@ public final class SwingPreferencesDialog extends StandardDialog implements
|
262
|
257
|
dispose();
|
263
|
258
|
}
|
264
|
259
|
|
265
|
|
- /**
|
266
|
|
- * {@inheritDoc}
|
267
|
|
- *
|
268
|
|
- * @param e List selection event
|
269
|
|
- *
|
270
|
|
- * @since 0.6.3m1
|
271
|
|
- */
|
272
|
260
|
@Override
|
273
|
261
|
public void valueChanged(final ListSelectionEvent e) {
|
274
|
262
|
if (!e.getValueIsAdjusting()) {
|
275
|
263
|
PreferencesCategory node = null;
|
276
|
264
|
try {
|
277
|
|
- node = (PreferencesCategory) tabList.getSelectedValue();
|
|
265
|
+ node = tabList.getSelectedValue();
|
278
|
266
|
} catch (ArrayIndexOutOfBoundsException ex) {
|
279
|
267
|
//I hate the JVM
|
280
|
268
|
}
|