|
@@ -31,6 +31,7 @@ import com.dmdirc.actions.interfaces.ActionType;
|
31
|
31
|
import com.dmdirc.config.IdentityManager;
|
32
|
32
|
import com.dmdirc.config.prefs.validator.ActionGroupValidator;
|
33
|
33
|
import com.dmdirc.config.prefs.validator.FileNameValidator;
|
|
34
|
+import com.dmdirc.config.prefs.validator.ValidatorChain;
|
34
|
35
|
import com.dmdirc.ui.swing.components.TextLabel;
|
35
|
36
|
import com.dmdirc.ui.swing.MainFrame;
|
36
|
37
|
import com.dmdirc.ui.swing.SwingController;
|
|
@@ -157,6 +158,7 @@ public final class ActionsManagerDialog extends StandardDialog implements Action
|
157
|
158
|
edit = new JButton("Edit");
|
158
|
159
|
delete = new JButton("Delete");
|
159
|
160
|
groupPanel = new JPanel();
|
|
161
|
+ groupPanel.setName("Groups");
|
160
|
162
|
|
161
|
163
|
groupPanel.setBorder(BorderFactory.createTitledBorder(groupPanel.getBorder(),
|
162
|
164
|
"Groups"));
|
|
@@ -299,11 +301,12 @@ public final class ActionsManagerDialog extends StandardDialog implements Action
|
299
|
301
|
/**
|
300
|
302
|
* Prompts then adds an action group.
|
301
|
303
|
*/
|
|
304
|
+ @SuppressWarnings("unchecked")
|
302
|
305
|
private void addGroup() {
|
303
|
|
- final StandardInputDialog inputDialog = new StandardInputDialog(SwingController.getMainFrame(), false,
|
304
|
|
- "New action group",
|
|
306
|
+ final StandardInputDialog inputDialog = new StandardInputDialog(SwingController.getMainFrame(),
|
|
307
|
+ false, "New action group",
|
305
|
308
|
"Please enter the name of the new action group",
|
306
|
|
- new ActionGroupValidator()) {
|
|
309
|
+ new ValidatorChain<String>(new FileNameValidator(), new ActionGroupValidator())) {
|
307
|
310
|
|
308
|
311
|
/**
|
309
|
312
|
* A version number for this class. It should be changed whenever the class
|
|
@@ -338,13 +341,14 @@ public final class ActionsManagerDialog extends StandardDialog implements Action
|
338
|
341
|
/**
|
339
|
342
|
* Prompts then edits an action group.
|
340
|
343
|
*/
|
|
344
|
+ @SuppressWarnings("unchecked")
|
341
|
345
|
private void editGroup() {
|
342
|
346
|
final String oldName =
|
343
|
347
|
((ActionGroup) groups.getSelectedValue()).getName();
|
344
|
348
|
final StandardInputDialog inputDialog = new StandardInputDialog(SwingController.getMainFrame(), false,
|
345
|
349
|
"Edit action group",
|
346
|
350
|
"Please enter the new name of the action group",
|
347
|
|
- new FileNameValidator()) {
|
|
351
|
+ new ValidatorChain<String>(new FileNameValidator(), new ActionGroupValidator())) {
|
348
|
352
|
|
349
|
353
|
/**
|
350
|
354
|
* A version number for this class. It should be changed whenever the class
|