Class FormalKeyFormatter

  • All Implemented Interfaces:
    IKeyFormatter

    public final class FormalKeyFormatter
    extends AbstractKeyFormatter

    Formats the keys in the internal key sequence grammar. This is used for persistence, and is not really intended for display to the user.

    Since:
    3.1
    • Constructor Detail

      • FormalKeyFormatter

        public FormalKeyFormatter()
    • Method Detail

      • format

        public String format​(int key)
        Description copied from interface: IKeyFormatter
        Formats an individual key into a human readable format. This uses an internationalization resource bundle to look up the key. This does not do any platform-specific formatting (e.g., Carbon's command character).
        Specified by:
        format in interface IKeyFormatter
        Overrides:
        format in class AbstractKeyFormatter
        Parameters:
        key - The key to format.
        Returns:
        The key formatted as a string; should not be null.
      • getKeyDelimiter

        protected String getKeyDelimiter()
        Description copied from class: AbstractKeyFormatter
        An accessor for the delimiter you wish to use between keys. This is used by the default format implementations to determine the key delimiter.
        Specified by:
        getKeyDelimiter in class AbstractKeyFormatter
        Returns:
        The delimiter to use between keys; should not be null.
      • getKeyStrokeDelimiter

        protected String getKeyStrokeDelimiter()
        Description copied from class: AbstractKeyFormatter
        An accessor for the delimiter you wish to use between key strokes. This used by the default format implementations to determine the key stroke delimiter.
        Specified by:
        getKeyStrokeDelimiter in class AbstractKeyFormatter
        Returns:
        The delimiter to use between key strokes; should not be null.
      • sortModifierKeys

        protected int[] sortModifierKeys​(int modifierKeys)
        Description copied from class: AbstractKeyFormatter
        Separates the modifier keys from each other, and then places them in an array in some sorted order. The sort order is dependent on the type of formatter.
        Specified by:
        sortModifierKeys in class AbstractKeyFormatter
        Parameters:
        modifierKeys - The modifier keys from the key stroke.
        Returns:
        An array of modifier key values -- separated and sorted in some order. Any values in this array that are KeyStroke.NO_KEY should be ignored.