01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.keys;
11:
12: /**
13: * Any formatter capable of taking key sequence or a key stroke and converting
14: * it into a string. These formatters are used to produce the strings that the
15: * user sees in the keys preference page and the menus, as well as the strings
16: * that are used for persistent storage.
17: *
18: * @deprecated Please use org.eclipse.jface.bindings.keys.IKeyFormatter
19: * @since 3.0
20: */
21: public interface IKeyFormatter {
22:
23: /**
24: * Formats an individual key into a human readable format. This uses an
25: * internationalization resource bundle to look up the key. This does not
26: * do any platform-specific formatting (e.g., Carbon's command character).
27: *
28: * @param key
29: * The key to format; must not be <code>null</code>.
30: * @return The key formatted as a string; should not be <code>null</code>.
31: */
32: String format(Key key);
33:
34: /**
35: * Format the given key sequence into a string. The manner of the
36: * conversion is dependent on the formatter. It is required that unequal
37: * key seqeunces return unequal strings.
38: *
39: * @param keySequence
40: * The key sequence to convert; must not be <code>null</code>.
41: * @return A string representation of the key sequence; must not be <code>null</code>.
42: */
43: String format(KeySequence keySequence);
44:
45: /**
46: * Format the given key strokes into a string. The manner of the conversion
47: * is dependent on the formatter. It is required that unequal key strokes
48: * return unequal strings.
49: *
50: * @param keyStroke
51: * The key stroke to convert; must not be <Code>null</code>.
52: * @return A string representation of the key stroke; must not be <code>
53: * null</code>
54: */
55: String format(KeyStroke keyStroke);
56: }
|