|
@@ -45,6 +45,7 @@ import java.util.ArrayList;
|
45
|
45
|
import java.util.HashMap;
|
46
|
46
|
import java.util.List;
|
47
|
47
|
import java.util.Map;
|
|
48
|
+import java.util.logging.Level;
|
48
|
49
|
|
49
|
50
|
/**
|
50
|
51
|
* Manages all actions for the client.
|
|
@@ -54,6 +55,10 @@ public final class ActionManager {
|
54
|
55
|
/** A singleton instance of the ActionManager. */
|
55
|
56
|
private static final ActionManager INSTANCE = new ActionManager();
|
56
|
57
|
|
|
58
|
+ /** A logger for the action manager to use. */
|
|
59
|
+ private static final java.util.logging.Logger LOGGER
|
|
60
|
+ = java.util.logging.Logger.getLogger(ActionManager.class.getName());
|
|
61
|
+
|
57
|
62
|
/** A list of registered action types. */
|
58
|
63
|
private final List<ActionType> types
|
59
|
64
|
= new ArrayList<ActionType>();
|
|
@@ -104,35 +109,26 @@ public final class ActionManager {
|
104
|
109
|
return INSTANCE;
|
105
|
110
|
}
|
106
|
111
|
|
107
|
|
- /**
|
108
|
|
- * Initialises the action manager.
|
109
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
110
|
|
- */
|
111
|
|
- @Deprecated
|
112
|
|
- public static void init() {
|
113
|
|
- INSTANCE.initialise();
|
114
|
|
- }
|
115
|
|
-
|
116
|
112
|
/**
|
117
|
113
|
* Initialises the action manager.
|
118
|
114
|
*/
|
119
|
115
|
public void initialise() {
|
120
|
|
- registerActionTypes(CoreActionType.values());
|
121
|
|
- registerActionComparisons(CoreActionComparison.values());
|
122
|
|
- registerActionComponents(CoreActionComponent.values());
|
|
116
|
+ registerTypes(CoreActionType.values());
|
|
117
|
+ registerComparisons(CoreActionComparison.values());
|
|
118
|
+ registerComponents(CoreActionComponent.values());
|
123
|
119
|
|
124
|
|
- registerGroup(AliasWrapper.getAliasWrapper());
|
125
|
|
- registerGroup(PerformWrapper.getPerformWrapper());
|
|
120
|
+ addGroup(AliasWrapper.getAliasWrapper());
|
|
121
|
+ addGroup(PerformWrapper.getPerformWrapper());
|
126
|
122
|
|
127
|
123
|
new WhoisNumericFormatter(IdentityManager.getAddonIdentity()).register();
|
128
|
124
|
|
129
|
125
|
// Register a listener for the closing event, so we can save actions
|
130
|
|
- addListener(new ActionListener() {
|
|
126
|
+ registerListener(new ActionListener() {
|
131
|
127
|
/** {@inheritDoc} */
|
132
|
128
|
@Override
|
133
|
129
|
public void processEvent(final ActionType type, final StringBuffer format,
|
134
|
130
|
final Object... arguments) {
|
135
|
|
- saveActions();
|
|
131
|
+ saveAllActions();
|
136
|
132
|
}
|
137
|
133
|
}, CoreActionType.CLIENT_CLOSED);
|
138
|
134
|
|
|
@@ -148,15 +144,6 @@ public final class ActionManager {
|
148
|
144
|
});
|
149
|
145
|
}
|
150
|
146
|
|
151
|
|
- /**
|
152
|
|
- * Saves all actions.
|
153
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
154
|
|
- */
|
155
|
|
- @Deprecated
|
156
|
|
- public static void saveActions() {
|
157
|
|
- INSTANCE.saveAllActions();
|
158
|
|
- }
|
159
|
|
-
|
160
|
147
|
/**
|
161
|
148
|
* Saves all actions.
|
162
|
149
|
*/
|
|
@@ -168,18 +155,6 @@ public final class ActionManager {
|
168
|
155
|
}
|
169
|
156
|
}
|
170
|
157
|
|
171
|
|
- /**
|
172
|
|
- * Registers the specified default setting for actions.
|
173
|
|
- *
|
174
|
|
- * @param name The name of the setting to be registered
|
175
|
|
- * @param value The default value for the setting
|
176
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
177
|
|
- */
|
178
|
|
- @Deprecated
|
179
|
|
- public static void registerDefault(final String name, final String value) {
|
180
|
|
- INSTANCE.registerSetting(name, value);
|
181
|
|
- }
|
182
|
|
-
|
183
|
158
|
/**
|
184
|
159
|
* Registers the specified default setting for actions.
|
185
|
160
|
*
|
|
@@ -190,17 +165,6 @@ public final class ActionManager {
|
190
|
165
|
IdentityManager.getAddonIdentity().setOption("actions", name, value);
|
191
|
166
|
}
|
192
|
167
|
|
193
|
|
- /**
|
194
|
|
- * Registers the specified group of actions with the manager.
|
195
|
|
- *
|
196
|
|
- * @param group The group of actions to be registered
|
197
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
198
|
|
- */
|
199
|
|
- @Deprecated
|
200
|
|
- public static void registerGroup(final ActionGroup group) {
|
201
|
|
- INSTANCE.addGroup(group);
|
202
|
|
- }
|
203
|
|
-
|
204
|
168
|
/**
|
205
|
169
|
* Registers the specified group of actions with the manager.
|
206
|
170
|
*
|
|
@@ -211,19 +175,7 @@ public final class ActionManager {
|
211
|
175
|
}
|
212
|
176
|
|
213
|
177
|
/**
|
214
|
|
- * Registers a set of actiontypes with the manager.
|
215
|
|
- *
|
216
|
|
- * @param types An array of ActionTypes to be registered
|
217
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
218
|
|
- */
|
219
|
|
- @Deprecated
|
220
|
|
- @Precondition("None of the specified ActionTypes are null")
|
221
|
|
- public static void registerActionTypes(final ActionType[] types) {
|
222
|
|
- INSTANCE.registerTypes(types);
|
223
|
|
- }
|
224
|
|
-
|
225
|
|
- /**
|
226
|
|
- * Registers a set of actiontypes with the manager.
|
|
178
|
+ * Registers a set of action types with the manager.
|
227
|
179
|
*
|
228
|
180
|
* @param newTypes An array of ActionTypes to be registered
|
229
|
181
|
*/
|
|
@@ -233,24 +185,13 @@ public final class ActionManager {
|
233
|
185
|
Logger.assertTrue(type != null);
|
234
|
186
|
|
235
|
187
|
if (!types.contains(type)) {
|
|
188
|
+ LOGGER.log(Level.FINEST, "Registering action type: {0}", type);
|
236
|
189
|
types.add(type);
|
237
|
190
|
typeGroups.add(type.getType().getGroup(), type);
|
238
|
191
|
}
|
239
|
192
|
}
|
240
|
193
|
}
|
241
|
194
|
|
242
|
|
- /**
|
243
|
|
- * Registers a set of action components with the manager.
|
244
|
|
- *
|
245
|
|
- * @param comps An array of ActionComponents to be registered
|
246
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
247
|
|
- */
|
248
|
|
- @Deprecated
|
249
|
|
- @Precondition("None of the specified ActionComponents are null")
|
250
|
|
- public static void registerActionComponents(final ActionComponent[] comps) {
|
251
|
|
- INSTANCE.registerComponents(comps);
|
252
|
|
- }
|
253
|
|
-
|
254
|
195
|
/**
|
255
|
196
|
* Registers a set of action components with the manager.
|
256
|
197
|
*
|
|
@@ -261,22 +202,11 @@ public final class ActionManager {
|
261
|
202
|
for (ActionComponent comp : comps) {
|
262
|
203
|
Logger.assertTrue(comp != null);
|
263
|
204
|
|
|
205
|
+ LOGGER.log(Level.FINEST, "Registering action component: {0}", comp);
|
264
|
206
|
components.add(comp);
|
265
|
207
|
}
|
266
|
208
|
}
|
267
|
209
|
|
268
|
|
- /**
|
269
|
|
- * Registers a set of action comparisons with the manager.
|
270
|
|
- *
|
271
|
|
- * @param comps An array of ActionComparisons to be registered
|
272
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
273
|
|
- */
|
274
|
|
- @Deprecated
|
275
|
|
- @Precondition("None of the specified ActionComparisons are null")
|
276
|
|
- public static void registerActionComparisons(final ActionComparison[] comps) {
|
277
|
|
- INSTANCE.registerComparisons(comps);
|
278
|
|
- }
|
279
|
|
-
|
280
|
210
|
/**
|
281
|
211
|
* Registers a set of action comparisons with the manager.
|
282
|
212
|
*
|
|
@@ -287,21 +217,11 @@ public final class ActionManager {
|
287
|
217
|
for (ActionComparison comp : comps) {
|
288
|
218
|
Logger.assertTrue(comp != null);
|
289
|
219
|
|
|
220
|
+ LOGGER.log(Level.FINEST, "Registering action comparison: {0}", comp);
|
290
|
221
|
comparisons.add(comp);
|
291
|
222
|
}
|
292
|
223
|
}
|
293
|
224
|
|
294
|
|
- /**
|
295
|
|
- * Returns a map of groups to action lists.
|
296
|
|
- *
|
297
|
|
- * @return a map of groups to action lists
|
298
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
299
|
|
- */
|
300
|
|
- @Deprecated
|
301
|
|
- public static Map<String, ActionGroup> getGroups() {
|
302
|
|
- return INSTANCE.getGroupsMap();
|
303
|
|
- }
|
304
|
|
-
|
305
|
225
|
/**
|
306
|
226
|
* Returns a map of groups to action lists.
|
307
|
227
|
*
|
|
@@ -311,17 +231,6 @@ public final class ActionManager {
|
311
|
231
|
return groups;
|
312
|
232
|
}
|
313
|
233
|
|
314
|
|
- /**
|
315
|
|
- * Returns a map of type groups to types.
|
316
|
|
- *
|
317
|
|
- * @return A map of type groups to types
|
318
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
319
|
|
- */
|
320
|
|
- @Deprecated
|
321
|
|
- public static MapList<String, ActionType> getTypeGroups() {
|
322
|
|
- return INSTANCE.getGroupedTypes();
|
323
|
|
- }
|
324
|
|
-
|
325
|
234
|
/**
|
326
|
235
|
* Returns a map of type groups to types.
|
327
|
236
|
*
|
|
@@ -331,15 +240,6 @@ public final class ActionManager {
|
331
|
240
|
return typeGroups;
|
332
|
241
|
}
|
333
|
242
|
|
334
|
|
- /**
|
335
|
|
- * Loads actions from the user's directory.
|
336
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
337
|
|
- */
|
338
|
|
- @Deprecated
|
339
|
|
- public static void loadActions() {
|
340
|
|
- INSTANCE.loadUserActions();
|
341
|
|
- }
|
342
|
|
-
|
343
|
243
|
/**
|
344
|
244
|
* Loads actions from the user's directory.
|
345
|
245
|
*/
|
|
@@ -394,6 +294,8 @@ public final class ActionManager {
|
394
|
294
|
Logger.assertTrue(dir != null);
|
395
|
295
|
Logger.assertTrue(dir.isDirectory());
|
396
|
296
|
|
|
297
|
+ LOGGER.log(Level.FINER, "Loading actions from directory: {0}", dir.getAbsolutePath());
|
|
298
|
+
|
397
|
299
|
if (!groups.containsKey(dir.getName())) {
|
398
|
300
|
groups.put(dir.getName(), new ActionGroup(dir.getName()));
|
399
|
301
|
}
|
|
@@ -403,18 +305,6 @@ public final class ActionManager {
|
403
|
305
|
}
|
404
|
306
|
}
|
405
|
307
|
|
406
|
|
- /**
|
407
|
|
- * Registers an action with the manager.
|
408
|
|
- *
|
409
|
|
- * @param action The action to be registered
|
410
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
411
|
|
- */
|
412
|
|
- @Deprecated
|
413
|
|
- @Precondition("The specified action is not null")
|
414
|
|
- public static void registerAction(final Action action) {
|
415
|
|
- INSTANCE.addAction(action);
|
416
|
|
- }
|
417
|
|
-
|
418
|
308
|
/**
|
419
|
309
|
* Registers an action with the manager.
|
420
|
310
|
*
|
|
@@ -424,24 +314,17 @@ public final class ActionManager {
|
424
|
314
|
public void addAction(final Action action) {
|
425
|
315
|
Logger.assertTrue(action != null);
|
426
|
316
|
|
427
|
|
- for (ActionType trigger : action.getTriggers()) {
|
428
|
|
- actions.add(trigger, action);
|
429
|
|
- }
|
|
317
|
+ LOGGER.log(Level.FINE, "Registering action: {0}/{1} (status: {2})",
|
|
318
|
+ new Object[] { action.getGroup(), action.getName(), action.getStatus() });
|
430
|
319
|
|
431
|
|
- getGroup(action.getGroup()).add(action);
|
432
|
|
- }
|
|
320
|
+ if (action.getStatus() != ActionStatus.FAILED) {
|
|
321
|
+ for (ActionType trigger : action.getTriggers()) {
|
|
322
|
+ LOGGER.log(Level.FINER, "Action has trigger {0}", trigger);
|
|
323
|
+ actions.add(trigger, action);
|
|
324
|
+ }
|
|
325
|
+ }
|
433
|
326
|
|
434
|
|
- /**
|
435
|
|
- * Retrieves the action group with the specified name. A new group is
|
436
|
|
- * created if it doesn't already exist.
|
437
|
|
- *
|
438
|
|
- * @param name The name of the group to retrieve
|
439
|
|
- * @return The corresponding ActionGroup
|
440
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
441
|
|
- */
|
442
|
|
- @Deprecated
|
443
|
|
- public static ActionGroup getGroup(final String name) {
|
444
|
|
- return INSTANCE.getOrCreateGroup(name);
|
|
327
|
+ getOrCreateGroup(action.getGroup()).add(action);
|
445
|
328
|
}
|
446
|
329
|
|
447
|
330
|
/**
|
|
@@ -459,18 +342,6 @@ public final class ActionManager {
|
459
|
342
|
return groups.get(name);
|
460
|
343
|
}
|
461
|
344
|
|
462
|
|
- /**
|
463
|
|
- * Unregisters an action with the manager.
|
464
|
|
- *
|
465
|
|
- * @param action The action to be unregistered
|
466
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
467
|
|
- */
|
468
|
|
- @Deprecated
|
469
|
|
- @Precondition("The specified action is not null")
|
470
|
|
- public static void unregisterAction(final Action action) {
|
471
|
|
- INSTANCE.removeAction(action);
|
472
|
|
- }
|
473
|
|
-
|
474
|
345
|
/**
|
475
|
346
|
* Unregisters an action with the manager.
|
476
|
347
|
*
|
|
@@ -481,7 +352,7 @@ public final class ActionManager {
|
481
|
352
|
Logger.assertTrue(action != null);
|
482
|
353
|
|
483
|
354
|
actions.removeFromAll(action);
|
484
|
|
- getGroup(action.getGroup()).remove(action);
|
|
355
|
+ getOrCreateGroup(action.getGroup()).remove(action);
|
485
|
356
|
}
|
486
|
357
|
|
487
|
358
|
/**
|
|
@@ -489,50 +360,10 @@ public final class ActionManager {
|
489
|
360
|
* triggers change.
|
490
|
361
|
*
|
491
|
362
|
* @param action The action to be reregistered
|
492
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
493
|
|
- */
|
494
|
|
- @Deprecated
|
495
|
|
- public static void reregisterAction(final Action action) {
|
496
|
|
- unregisterAction(action);
|
497
|
|
- registerAction(action);
|
498
|
|
- }
|
499
|
|
-
|
500
|
|
- /**
|
501
|
|
- * Deletes the specified action.
|
502
|
|
- *
|
503
|
|
- * @param action The action to be deleted
|
504
|
|
- * @deprecated Use {@link ActionGroup#deleteAction(com.dmdirc.actions.Action)} instead.
|
505
|
|
- */
|
506
|
|
- @Precondition("The specified Action is not null")
|
507
|
|
- @Deprecated
|
508
|
|
- public static void deleteAction(final Action action) {
|
509
|
|
- Logger.assertTrue(action != null);
|
510
|
|
-
|
511
|
|
- unregisterAction(action);
|
512
|
|
-
|
513
|
|
- action.delete();
|
514
|
|
- }
|
515
|
|
-
|
516
|
|
- /**
|
517
|
|
- * Processes an event of the specified type.
|
518
|
|
- *
|
519
|
|
- * @param type The type of the event to process
|
520
|
|
- * @param format The format of the message that's going to be displayed for
|
521
|
|
- * the event. Actions may change this format.
|
522
|
|
- * @param arguments The arguments for the event
|
523
|
|
- * @return True if the event should be processed, or false if an action
|
524
|
|
- * listener has requested the event be skipped.
|
525
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
526
|
363
|
*/
|
527
|
|
- @Deprecated
|
528
|
|
- @Precondition({
|
529
|
|
- "The specified ActionType is not null",
|
530
|
|
- "The specified ActionType has a valid ActionMetaType",
|
531
|
|
- "The length of the arguments array equals the arity of the ActionType's ActionMetaType"
|
532
|
|
- })
|
533
|
|
- public static boolean processEvent(final ActionType type,
|
534
|
|
- final StringBuffer format, final Object ... arguments) {
|
535
|
|
- return INSTANCE.triggerEvent(type, format, arguments);
|
|
364
|
+ public void reregisterAction(final Action action) {
|
|
365
|
+ removeAction(action);
|
|
366
|
+ addAction(action);
|
536
|
367
|
}
|
537
|
368
|
|
538
|
369
|
/**
|
|
@@ -631,23 +462,6 @@ public final class ActionManager {
|
631
|
462
|
return Main.getConfigDir() + "actions" + System.getProperty("file.separator");
|
632
|
463
|
}
|
633
|
464
|
|
634
|
|
- /**
|
635
|
|
- * Creates a new group with the specified name.
|
636
|
|
- *
|
637
|
|
- * @param group The group to be created
|
638
|
|
- *
|
639
|
|
- * @return The newly created group
|
640
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
641
|
|
- */
|
642
|
|
- @Deprecated
|
643
|
|
- @Precondition({
|
644
|
|
- "The specified group is non-null and not empty",
|
645
|
|
- "The specified group is not an existing group"
|
646
|
|
- })
|
647
|
|
- public static ActionGroup makeGroup(final String group) {
|
648
|
|
- return INSTANCE.createGroup(group);
|
649
|
|
- }
|
650
|
|
-
|
651
|
465
|
/**
|
652
|
466
|
* Creates a new group with the specified name.
|
653
|
467
|
*
|
|
@@ -675,21 +489,6 @@ public final class ActionManager {
|
675
|
489
|
}
|
676
|
490
|
}
|
677
|
491
|
|
678
|
|
- /**
|
679
|
|
- * Removes the group with the specified name.
|
680
|
|
- *
|
681
|
|
- * @param group The group to be removed
|
682
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
683
|
|
- */
|
684
|
|
- @Deprecated
|
685
|
|
- @Precondition({
|
686
|
|
- "The specified group is non-null and not empty",
|
687
|
|
- "The specified group is an existing group"
|
688
|
|
- })
|
689
|
|
- public static void removeGroup(final String group) {
|
690
|
|
- INSTANCE.deleteGroup(group);
|
691
|
|
- }
|
692
|
|
-
|
693
|
492
|
/**
|
694
|
493
|
* Removes the group with the specified name.
|
695
|
494
|
*
|
|
@@ -705,7 +504,7 @@ public final class ActionManager {
|
705
|
504
|
Logger.assertTrue(groups.containsKey(group));
|
706
|
505
|
|
707
|
506
|
for (Action action : groups.get(group).getActions()) {
|
708
|
|
- unregisterAction(action);
|
|
507
|
+ removeAction(action);
|
709
|
508
|
}
|
710
|
509
|
|
711
|
510
|
final File dir = new File(getDirectory() + group);
|
|
@@ -729,25 +528,6 @@ public final class ActionManager {
|
729
|
528
|
groups.remove(group);
|
730
|
529
|
}
|
731
|
530
|
|
732
|
|
- /**
|
733
|
|
- * Renames the specified group.
|
734
|
|
- *
|
735
|
|
- * @param oldName The old name of the group
|
736
|
|
- * @param newName The new name of the group
|
737
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
738
|
|
- */
|
739
|
|
- @Deprecated
|
740
|
|
- @Precondition({
|
741
|
|
- "The old name is non-null and not empty",
|
742
|
|
- "The old name is an existing group",
|
743
|
|
- "The new name is non-null and not empty",
|
744
|
|
- "The new name is not an existing group",
|
745
|
|
- "The old name does not equal the new name"
|
746
|
|
- })
|
747
|
|
- public static void renameGroup(final String oldName, final String newName) {
|
748
|
|
- INSTANCE.changeGroupName(oldName, newName);
|
749
|
|
- }
|
750
|
|
-
|
751
|
531
|
/**
|
752
|
532
|
* Renames the specified group.
|
753
|
533
|
*
|
|
@@ -770,28 +550,15 @@ public final class ActionManager {
|
770
|
550
|
Logger.assertTrue(!groups.containsKey(newName));
|
771
|
551
|
Logger.assertTrue(!newName.equals(oldName));
|
772
|
552
|
|
773
|
|
- makeGroup(newName);
|
|
553
|
+ createGroup(newName);
|
774
|
554
|
|
775
|
555
|
for (Action action : groups.get(oldName).getActions()) {
|
776
|
556
|
action.setGroup(newName);
|
777
|
|
- getGroup(oldName).remove(action);
|
778
|
|
- getGroup(newName).add(action);
|
|
557
|
+ getOrCreateGroup(oldName).remove(action);
|
|
558
|
+ getOrCreateGroup(newName).add(action);
|
779
|
559
|
}
|
780
|
560
|
|
781
|
|
- removeGroup(oldName);
|
782
|
|
- }
|
783
|
|
-
|
784
|
|
- /**
|
785
|
|
- * Returns the action comparison specified by the given string, or null if it
|
786
|
|
- * doesn't match a valid registered action comparison.
|
787
|
|
- *
|
788
|
|
- * @param type The name of the action comparison to try and find
|
789
|
|
- * @return The type with the specified name, or null on failure
|
790
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
791
|
|
- */
|
792
|
|
- @Deprecated
|
793
|
|
- public static ActionType getActionType(final String type) {
|
794
|
|
- return INSTANCE.getType(type);
|
|
561
|
+ deleteGroup(oldName);
|
795
|
562
|
}
|
796
|
563
|
|
797
|
564
|
/**
|
|
@@ -815,20 +582,6 @@ public final class ActionManager {
|
815
|
582
|
return null;
|
816
|
583
|
}
|
817
|
584
|
|
818
|
|
- /**
|
819
|
|
- * Returns a list of action types that are compatible with the one
|
820
|
|
- * specified.
|
821
|
|
- *
|
822
|
|
- * @param type The type to be checked against
|
823
|
|
- * @return A list of compatible action types
|
824
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
825
|
|
- */
|
826
|
|
- @Deprecated
|
827
|
|
- @Precondition("The specified type is not null")
|
828
|
|
- public static List<ActionType> getCompatibleTypes(final ActionType type) {
|
829
|
|
- return INSTANCE.findCompatibleTypes(type);
|
830
|
|
- }
|
831
|
|
-
|
832
|
585
|
/**
|
833
|
586
|
* Returns a list of action types that are compatible with the one
|
834
|
587
|
* specified.
|
|
@@ -850,20 +603,6 @@ public final class ActionManager {
|
850
|
603
|
return res;
|
851
|
604
|
}
|
852
|
605
|
|
853
|
|
- /**
|
854
|
|
- * Returns a list of action components that are compatible with the
|
855
|
|
- * specified class.
|
856
|
|
- *
|
857
|
|
- * @param target The class to be tested
|
858
|
|
- * @return A list of compatible action components
|
859
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
860
|
|
- */
|
861
|
|
- @Deprecated
|
862
|
|
- @Precondition("The specified target is not null")
|
863
|
|
- public static List<ActionComponent> getCompatibleComponents(final Class<?> target) {
|
864
|
|
- return INSTANCE.findCompatibleComponents(target);
|
865
|
|
- }
|
866
|
|
-
|
867
|
606
|
/**
|
868
|
607
|
* Returns a list of action components that are compatible with the
|
869
|
608
|
* specified class.
|
|
@@ -885,20 +624,6 @@ public final class ActionManager {
|
885
|
624
|
return res;
|
886
|
625
|
}
|
887
|
626
|
|
888
|
|
- /**
|
889
|
|
- * Returns a list of action comparisons that are compatible with the
|
890
|
|
- * specified class.
|
891
|
|
- *
|
892
|
|
- * @param target The class to be tested
|
893
|
|
- * @return A list of compatible action comparisons
|
894
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
895
|
|
- */
|
896
|
|
- @Deprecated
|
897
|
|
- @Precondition("The specified target is not null")
|
898
|
|
- public static List<ActionComparison> getCompatibleComparisons(final Class<?> target) {
|
899
|
|
- return INSTANCE.findCompatibleComparisons(target);
|
900
|
|
- }
|
901
|
|
-
|
902
|
627
|
/**
|
903
|
628
|
* Returns a list of action comparisons that are compatible with the
|
904
|
629
|
* specified class.
|
|
@@ -920,17 +645,6 @@ public final class ActionManager {
|
920
|
645
|
return res;
|
921
|
646
|
}
|
922
|
647
|
|
923
|
|
- /**
|
924
|
|
- * Returns a list of all the action types registered by this manager.
|
925
|
|
- *
|
926
|
|
- * @return A list of registered action types
|
927
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
928
|
|
- */
|
929
|
|
- @Deprecated
|
930
|
|
- public static List<ActionType> getTypes() {
|
931
|
|
- return INSTANCE.getAllTypes();
|
932
|
|
- }
|
933
|
|
-
|
934
|
648
|
/**
|
935
|
649
|
* Returns a list of all the action types registered by this manager.
|
936
|
650
|
*
|
|
@@ -940,17 +654,6 @@ public final class ActionManager {
|
940
|
654
|
return types;
|
941
|
655
|
}
|
942
|
656
|
|
943
|
|
- /**
|
944
|
|
- * Returns a list of all the action types registered by this manager.
|
945
|
|
- *
|
946
|
|
- * @return A list of registered action comparisons
|
947
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
948
|
|
- */
|
949
|
|
- @Deprecated
|
950
|
|
- public static List<ActionComparison> getComparisons() {
|
951
|
|
- return INSTANCE.getAllComparisons();
|
952
|
|
- }
|
953
|
|
-
|
954
|
657
|
/**
|
955
|
658
|
* Returns a list of all the action types registered by this manager.
|
956
|
659
|
*
|
|
@@ -960,20 +663,6 @@ public final class ActionManager {
|
960
|
663
|
return comparisons;
|
961
|
664
|
}
|
962
|
665
|
|
963
|
|
- /**
|
964
|
|
- * Returns the action component specified by the given string, or null if it
|
965
|
|
- * doesn't match a valid registered action component.
|
966
|
|
- *
|
967
|
|
- * @param type The name of the action component to try and find
|
968
|
|
- * @return The actioncomponent with the specified name, or null on failure
|
969
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
970
|
|
- */
|
971
|
|
- @Deprecated
|
972
|
|
- @Precondition("The specified type is non-null and not empty")
|
973
|
|
- public static ActionComponent getActionComponent(final String type) {
|
974
|
|
- return INSTANCE.getComponent(type);
|
975
|
|
- }
|
976
|
|
-
|
977
|
666
|
/**
|
978
|
667
|
* Returns the action component specified by the given string, or null if it
|
979
|
668
|
* doesn't match a valid registered action component.
|
|
@@ -995,20 +684,6 @@ public final class ActionManager {
|
995
|
684
|
return null;
|
996
|
685
|
}
|
997
|
686
|
|
998
|
|
- /**
|
999
|
|
- * Returns the action type specified by the given string, or null if it
|
1000
|
|
- * doesn't match a valid registered action type.
|
1001
|
|
- *
|
1002
|
|
- * @param type The name of the action type to try and find
|
1003
|
|
- * @return The actiontype with the specified name, or null on failure
|
1004
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
1005
|
|
- */
|
1006
|
|
- @Deprecated
|
1007
|
|
- @Precondition("The specified type is non-null and not empty")
|
1008
|
|
- public static ActionComparison getActionComparison(final String type) {
|
1009
|
|
- return INSTANCE.getComparison(type);
|
1010
|
|
- }
|
1011
|
|
-
|
1012
|
687
|
/**
|
1013
|
688
|
* Returns the action type specified by the given string, or null if it
|
1014
|
689
|
* doesn't match a valid registered action type.
|
|
@@ -1041,23 +716,11 @@ public final class ActionManager {
|
1041
|
716
|
|
1042
|
717
|
ziprm.extractResources("", getDirectory());
|
1043
|
718
|
|
1044
|
|
- loadActions();
|
|
719
|
+ getActionManager().loadUserActions();
|
1045
|
720
|
|
1046
|
721
|
new File(path).delete();
|
1047
|
722
|
}
|
1048
|
723
|
|
1049
|
|
- /**
|
1050
|
|
- * Adds a new listener for the specified action type.
|
1051
|
|
- *
|
1052
|
|
- * @param types The action types that are to be listened for
|
1053
|
|
- * @param listener The listener to be added
|
1054
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
1055
|
|
- */
|
1056
|
|
- @Deprecated
|
1057
|
|
- public static void addListener(final ActionListener listener, final ActionType ... types) {
|
1058
|
|
- INSTANCE.registerListener(listener, types);
|
1059
|
|
- }
|
1060
|
|
-
|
1061
|
724
|
/**
|
1062
|
725
|
* Adds a new listener for the specified action type.
|
1063
|
726
|
*
|
|
@@ -1070,18 +733,6 @@ public final class ActionManager {
|
1070
|
733
|
}
|
1071
|
734
|
}
|
1072
|
735
|
|
1073
|
|
- /**
|
1074
|
|
- * Removes a listener for the specified action type.
|
1075
|
|
- *
|
1076
|
|
- * @param types The action types that were being listened for
|
1077
|
|
- * @param listener The listener to be removed
|
1078
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
1079
|
|
- */
|
1080
|
|
- @Deprecated
|
1081
|
|
- public static void removeListener(final ActionListener listener, final ActionType ... types) {
|
1082
|
|
- INSTANCE.unregisterListener(listener, types);
|
1083
|
|
- }
|
1084
|
|
-
|
1085
|
736
|
/**
|
1086
|
737
|
* Removes a listener for the specified action type.
|
1087
|
738
|
*
|
|
@@ -1094,17 +745,6 @@ public final class ActionManager {
|
1094
|
745
|
}
|
1095
|
746
|
}
|
1096
|
747
|
|
1097
|
|
- /**
|
1098
|
|
- * Removes a listener for all action types.
|
1099
|
|
- *
|
1100
|
|
- * @param listener The listener to be removed
|
1101
|
|
- * @deprecated Use {@link #getActionManager()} and non-static methods
|
1102
|
|
- */
|
1103
|
|
- @Deprecated
|
1104
|
|
- public static void removeListener(final ActionListener listener) {
|
1105
|
|
- INSTANCE.unregisterListener(listener);
|
1106
|
|
- }
|
1107
|
|
-
|
1108
|
748
|
/**
|
1109
|
749
|
* Removes a listener for all action types.
|
1110
|
750
|
*
|