Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.ui.keys
Class Key

    java.lang.Object
      org.eclipse.ui.keys.Key

All Implemented Interfaces:
  Comparable

Direct Known Subclasses:
  ModifierKey, NaturalKey

public abstract class Key
extends Object
implements Comparable

`Key` is the abstract base class for all objects representing keys on the keyboard.

All `Key` objects have a formal string representation, called the 'name' of the key, available via the `toString()` method.

All `Key` objects, via the `format()` method, provide a version of their formal string representation translated by platform and locale, suitable for display to a user.

`Key` objects are immutable. Clients are not permitted to extend this class.

Since:
  3.0

Field Summary
`protected String` | `name` The formal string representation for this object.

Method Summary
`int` | `compareTo(Object object)`
`boolean` | `equals(Object object)`
`int` | `hashCode()`
`String` | `toString()` Returns the formal string representation for this key.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### name

    protected String name

  The formal string representation for this object. Equality of Key objects is determined solely by this field.

Method Detail

### compareTo

    public int compareTo(Object object)

  Specified by:
    `compareTo` in interface `Comparable`
  See Also:
    `Comparable.compareTo(java.lang.Object)`

### equals

    public boolean equals(Object object)

  See Also:
    `Object.equals(java.lang.Object)`

### hashCode

    public int hashCode()

  See Also:
    `Object.hashCode()`

### toString

    public String toString()

  Returns the formal string representation for this key.

  Returns:
    The formal string representation for this key. Guaranteed not to be `null`.
  See Also:
    `Object.toString()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.