edu.rice.cs.drjava.config
Class KeyStrokeOption
java.lang.Object
edu.rice.cs.drjava.config.OptionParser<T>
edu.rice.cs.drjava.config.Option<KeyStroke>
edu.rice.cs.drjava.config.KeyStrokeOption
- All Implemented Interfaces:
- FormatStrategy<KeyStroke>, ParseStrategy<KeyStroke>
public class KeyStrokeOption
- extends Option<KeyStroke>
Class representing all configuration options with values of type KeyStroke. Only runs in the event thread, so no
synchronization is necessary (or advisable).
NULL_KEYSTROKE
public static final KeyStroke NULL_KEYSTROKE
KeyStrokeOption
public KeyStrokeOption(String key,
KeyStroke def)
- Standard constructor
- Parameters:
key
- The name of this option.
parse
public KeyStroke parse(String s)
- Description copied from class:
OptionParser
- The ability to parse a string to an object of type T. All concrete versions of this class must override this
method to provide some sort of parser implementation.
- Specified by:
parse
in interface ParseStrategy<KeyStroke>
- Specified by:
parse
in class OptionParser<KeyStroke>
- Parameters:
s
- The String to be parsed; must be the string representation of the KeyStroke to be created. Uses the
method KeyStroke.getKeyStroke(String s) which returns a KeyStroke if the string is correctly formatted or null
otherwise.
- Returns:
- The KeyStroke object corresponding to the input string "s".
format
public String format(KeyStroke k)
- Description copied from class:
Option
- Formats a statically typed T value as a String. The default implementation uses the toString() method.
- Specified by:
format
in interface FormatStrategy<KeyStroke>
- Overrides:
format
in class Option<KeyStroke>
- Parameters:
k
- The instance of class KeyStroke to be formatted.
- Returns:
- A String representing the KeyStroke "k".