@@ -31,17 +31,26 @@ public class IgnoreAction extends JosmAction {
3131 */
3232 private final IgnoreType type ;
3333
34+ /**
35+ * Generate shortcuts in a manner friendly for the ShortcutsList
36+ * @param type The type
37+ * @return The shortcut
38+ */
39+ private static Shortcut generateShortcut (IgnoreType type ) {
40+ return switch (type ) {
41+ case IGNORE_TASK -> Shortcut .registerShortcut ("maproulette:ignore.ignore_task" , tr ("MapRoulette: Ignore Task" ), KeyEvent .CHAR_UNDEFINED , Shortcut .NONE );
42+ case IGNORE_CHALLENGE -> Shortcut .registerShortcut ("maproulette:ignore.ignore_challenge" , tr ("MapRoulette: Ignore Challenge" ), KeyEvent .CHAR_UNDEFINED , Shortcut .NONE );
43+ };
44+ }
45+
3446 /**
3547 * Create a new action object
3648 *
3749 * @param type The type of object we are ignoring
3850 */
3951 public IgnoreAction (IgnoreType type ) {
4052 super (tr (type .getButtonText ()), "dialogs/fix" , tr (type .getButtonText ()),
41- Shortcut .registerShortcut (
42- /* NO-SHORTCUT */ "maproulette:ignore." + type .name ().toLowerCase (Locale .ROOT ),
43- tr ("MapRoulette: {0}" , tr (type .getButtonText ())), KeyEvent .CHAR_UNDEFINED , Shortcut .NONE ),
44- false );
53+ generateShortcut (type ), false );
4554 this .type = type ;
4655 }
4756
@@ -68,9 +77,7 @@ public void actionPerformed(ActionEvent e) {
6877 * The ignore type
6978 */
7079 public enum IgnoreType {
71- /* SHORTCUT(MapRoulette: Ignore Task, maproulette:ignore.task, NONE, UNDEFINED) */
7280 IGNORE_TASK (marktr ("Ignore Task" )),
73- /* SHORTCUT(MapRoulette: Ignore Challenge, maproulette:ignore.challenge, NONE, UNDEFINED) */
7481 IGNORE_CHALLENGE (marktr ("Ignore Challenge" ));
7582
7683 private final String buttonText ;
0 commit comments