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