comparison dwtx/jface/bindings/keys/formatting/NativeKeyFormatter.d @ 43:ea8ff534f622

Fix override and super aliases
author Frank Benoit <benoit@tionex.de>
date Fri, 11 Apr 2008 01:24:25 +0200
parents 644f1334b451
children 7a3e6c1a4eae
comparison
equal deleted inserted replaced
42:4567a6f54939 43:ea8ff534f622
35 * </p> 35 * </p>
36 * 36 *
37 * @since 3.1 37 * @since 3.1
38 */ 38 */
39 public final class NativeKeyFormatter : AbstractKeyFormatter { 39 public final class NativeKeyFormatter : AbstractKeyFormatter {
40 alias AbstractKeyFormatter.format format;
40 41
41 /** 42 /**
42 * The key into the internationalization resource bundle for the delimiter 43 * The key into the internationalization resource bundle for the delimiter
43 * to use between keys (on the Carbon platform). 44 * to use between keys (on the Carbon platform).
44 */ 45 */
96 * 97 *
97 * @param key 98 * @param key
98 * The key to format. 99 * The key to format.
99 * @return The key formatted as a string; should not be <code>null</code>. 100 * @return The key formatted as a string; should not be <code>null</code>.
100 */ 101 */
101 public final String format(int key) { 102 public override final String format(int key) {
102 IKeyLookup lookup = KeyLookupFactory.getDefault(); 103 IKeyLookup lookup = KeyLookupFactory.getDefault();
103 String name = lookup.formalNameLookup(key); 104 String name = lookup.formalNameLookup(key);
104 105
105 // TODO consider platform-specific resource bundles 106 // TODO consider platform-specific resource bundles
106 if ("carbon".equals(DWT.getPlatform())) { //$NON-NLS-1$ 107 if ("carbon".equals(DWT.getPlatform())) { //$NON-NLS-1$
116 /* 117 /*
117 * (non-Javadoc) 118 * (non-Javadoc)
118 * 119 *
119 * @see dwtx.jface.bindings.keys.AbstractKeyFormatter#getKeyDelimiter() 120 * @see dwtx.jface.bindings.keys.AbstractKeyFormatter#getKeyDelimiter()
120 */ 121 */
121 protected String getKeyDelimiter() { 122 protected override String getKeyDelimiter() {
122 // We must do the look up every time, as our locale might change. 123 // We must do the look up every time, as our locale might change.
123 if ("carbon".equals(DWT.getPlatform())) { //$NON-NLS-1$ 124 if ("carbon".equals(DWT.getPlatform())) { //$NON-NLS-1$
124 return Util.translateString(RESOURCE_BUNDLE, 125 return Util.translateString(RESOURCE_BUNDLE,
125 CARBON_KEY_DELIMITER_KEY, Util.ZERO_LENGTH_STRING); 126 CARBON_KEY_DELIMITER_KEY, Util.ZERO_LENGTH_STRING);
126 } 127 }
132 /* 133 /*
133 * (non-Javadoc) 134 * (non-Javadoc)
134 * 135 *
135 * @see dwtx.jface.bindings.keys.AbstractKeyFormatter#getKeyStrokeDelimiter() 136 * @see dwtx.jface.bindings.keys.AbstractKeyFormatter#getKeyStrokeDelimiter()
136 */ 137 */
137 protected String getKeyStrokeDelimiter() { 138 protected override String getKeyStrokeDelimiter() {
138 // We must do the look up every time, as our locale might change. 139 // We must do the look up every time, as our locale might change.
139 if ("win32".equals(DWT.getPlatform())) { //$NON-NLS-1$ 140 if ("win32".equals(DWT.getPlatform())) { //$NON-NLS-1$
140 return Util.translateString(RESOURCE_BUNDLE, 141 return Util.translateString(RESOURCE_BUNDLE,
141 WIN32_KEY_STROKE_DELIMITER_KEY, 142 WIN32_KEY_STROKE_DELIMITER_KEY,
142 KeySequence.KEY_STROKE_DELIMITER); 143 KeySequence.KEY_STROKE_DELIMITER);
149 /* 150 /*
150 * (non-Javadoc) 151 * (non-Javadoc)
151 * 152 *
152 * @see dwtx.jface.bindings.keys.AbstractKeyFormatter#sortModifierKeys(int) 153 * @see dwtx.jface.bindings.keys.AbstractKeyFormatter#sortModifierKeys(int)
153 */ 154 */
154 protected int[] sortModifierKeys(int modifierKeys) { 155 protected override int[] sortModifierKeys(int modifierKeys) {
155 IKeyLookup lookup = KeyLookupFactory.getDefault(); 156 IKeyLookup lookup = KeyLookupFactory.getDefault();
156 String platform = DWT.getPlatform(); 157 String platform = DWT.getPlatform();
157 int[] sortedKeys = new int[4]; 158 int[] sortedKeys = new int[4];
158 int index = 0; 159 int index = 0;
159 160