|
@@ -42,7 +42,6 @@ import javax.swing.SwingWorker;
|
42
|
42
|
import net.miginfocom.layout.ComponentWrapper;
|
43
|
43
|
import net.miginfocom.layout.LayoutCallback;
|
44
|
44
|
|
45
|
|
-import net.miginfocom.layout.PlatformDefaults;
|
46
|
45
|
import net.miginfocom.swing.MigLayout;
|
47
|
46
|
|
48
|
47
|
/**
|
|
@@ -56,15 +55,6 @@ public class CategoryPanel extends JPanel {
|
56
|
55
|
* serialized objects being unserialized with the new class).
|
57
|
56
|
*/
|
58
|
57
|
private static final long serialVersionUID = -3268284364607758509L;
|
59
|
|
- /** Panel gap. */
|
60
|
|
- private final int padding = (int) PlatformDefaults.getUnitValueX("related").
|
61
|
|
- getValue();
|
62
|
|
- /** Panel left padding. */
|
63
|
|
- private final int leftPadding = (int) PlatformDefaults.getPanelInsets(1).
|
64
|
|
- getValue();
|
65
|
|
- /** Panel right padding. */
|
66
|
|
- private final int rightPadding = (int) PlatformDefaults.getPanelInsets(3).
|
67
|
|
- getValue();
|
68
|
58
|
/** Active preferences category. */
|
69
|
59
|
private PreferencesCategory category;
|
70
|
60
|
/** Parent window. */
|
|
@@ -85,8 +75,6 @@ public class CategoryPanel extends JPanel {
|
85
|
75
|
private Map<PreferencesCategory, JPanel> panels;
|
86
|
76
|
/** Category loading swing worker. */
|
87
|
77
|
private SwingWorker worker;
|
88
|
|
- /** Waiting. */
|
89
|
|
- private boolean waiting;
|
90
|
78
|
|
91
|
79
|
/**
|
92
|
80
|
* Instantiates a new category panel.
|
|
@@ -226,8 +214,20 @@ public class CategoryPanel extends JPanel {
|
226
|
214
|
*
|
227
|
215
|
* @param b
|
228
|
216
|
*/
|
229
|
|
- public void setWaiting(boolean b) {
|
230
|
|
- waiting = b;
|
|
217
|
+ public void setWaiting(final boolean b) {
|
231
|
218
|
scrollPane.setViewportView(waitingCategory);
|
232
|
219
|
}
|
|
220
|
+
|
|
221
|
+ /**
|
|
222
|
+ * Displays an error panel to the end user.
|
|
223
|
+ *
|
|
224
|
+ * @param message Message to display
|
|
225
|
+ */
|
|
226
|
+ public void setError(final String message) {
|
|
227
|
+ final JPanel panel = new JPanel(new MigLayout("fillx"));
|
|
228
|
+ panel.add(new TextLabel("An error has occurred loading the " +
|
|
229
|
+ "preferences dialog, an error has been raised: "), "wrap");
|
|
230
|
+ panel.add(new TextLabel(message));
|
|
231
|
+ scrollPane.setViewportView(panel);
|
|
232
|
+ }
|
233
|
233
|
}
|