org.netbeans.modules.editor.settings.storage/1 1.19

org.netbeans.modules.editor.settings.storage.spi.support
Class StorageSupport

java.lang.Object
  extended by org.netbeans.modules.editor.settings.storage.spi.support.StorageSupport

public final class StorageSupport
extends Object


Method Summary
static String getLocalizingBundleMessage(FileObject fo, String key, String defaultValue)
           
static String keyStrokesToString(Collection<? extends KeyStroke> keys, boolean emacsStyle)
          Converts a list of KeyStrokes to its textual representation.
static KeyStroke[] stringToKeyStrokes(String key, boolean emacsStyle)
          Converts a textual representation of key strokes to an array of KeyStroke objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLocalizingBundleMessage

public static String getLocalizingBundleMessage(FileObject fo,
                                                String key,
                                                String defaultValue)

keyStrokesToString

public static String keyStrokesToString(Collection<? extends KeyStroke> keys,
                                        boolean emacsStyle)
Converts a list of KeyStrokes to its textual representation. There are two available formats for the textual representation:
  • Human readable - this format encodes a KeyStroke to a string that looks like for example 'Ctrl+A' or 'Alt+Shift+M'.
  • Emacs style - this format encodes a KeyStroke to a string that's known from Emacs and that looks like for example 'C-A' or 'AS-M'. It uses methods from org.openide.util.Utilities, which take care of Mac OS specifics and use 'D' and 'O' wildcards for encoding 'Ctrl' and 'Alt' keys.

    Parameters:
    keys - The KeyStrokes to convert.
    emacsStyle - If true the returned string will be in so called Emacs style, ortherwise it will be in human readable format.
    Returns:
    The textual representation of KeyStrokes passed in.
    Since:
    1.16

  • stringToKeyStrokes

    public static KeyStroke[] stringToKeyStrokes(String key,
                                                 boolean emacsStyle)
    Converts a textual representation of key strokes to an array of KeyStroke objects. Please see #keyStrokesToString(Collection, boolean) ror details about the available formats.

    Parameters:
    key - The textual representation of keystorkes to convert. Its format depends on the value of emacsStyle parameter.
    emacsStyle - If true the key string is expected to be in so called emacs format, ortherwise it will be in human readable format.
    Returns:
    The KeyStrokes that were represented by the key text or null if the textual representation was malformed.
    Since:
    1.16

    org.netbeans.modules.editor.settings.storage/1 1.19

    Built on December 3 2008.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.