1 11 12 package org.eclipse.ui.keys; 13 14 import org.eclipse.ui.internal.keys.CompactKeyFormatter; 15 import org.eclipse.ui.internal.keys.EmacsKeyFormatter; 16 import org.eclipse.ui.internal.keys.FormalKeyFormatter; 17 18 27 public final class KeyFormatterFactory { 28 private static final IKeyFormatter COMPACT_KEY_FORMATTER = new CompactKeyFormatter(); 29 30 private static final IKeyFormatter FORMAL_KEY_FORMATTER = new FormalKeyFormatter(); 31 32 private static final IKeyFormatter EMACS_KEY_FORMATTER = new EmacsKeyFormatter(); 33 34 private static IKeyFormatter defaultKeyFormatter = FORMAL_KEY_FORMATTER; 35 36 41 public static final IKeyFormatter getCompactKeyFormatter() { 42 return COMPACT_KEY_FORMATTER; 43 } 44 45 50 public static IKeyFormatter getDefault() { 51 return defaultKeyFormatter; 52 } 53 54 59 public static IKeyFormatter getEmacsKeyFormatter() { 60 return EMACS_KEY_FORMATTER; 61 } 62 63 68 public static IKeyFormatter getFormalKeyFormatter() { 69 return FORMAL_KEY_FORMATTER; 70 } 71 72 78 public static void setDefault(IKeyFormatter defaultKeyFormatter) { 79 if (defaultKeyFormatter == null) { 80 throw new NullPointerException (); 81 } 82 83 KeyFormatterFactory.defaultKeyFormatter = defaultKeyFormatter; 84 } 85 86 private KeyFormatterFactory() { 87 } 89 } 90 | Popular Tags |