edu.rice.cs.drjava.ui.config
Class KeyStrokeOptionComponent
java.lang.Object
|
+--edu.rice.cs.drjava.ui.config.OptionComponent
|
+--edu.rice.cs.drjava.ui.config.KeyStrokeOptionComponent
- All Implemented Interfaces:
- Comparable
- public class KeyStrokeOptionComponent
- extends OptionComponent
- implements Comparable
Graphical form of a KeyStrokeOption.
- Version:
- $Id: KeyStrokeOptionComponent.java,v 1.11 2002/09/02 21:24:13 csreis Exp $
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
DIALOG_HEIGHT
private static final int DIALOG_HEIGHT
_keyToKSOC
public static Hashtable _keyToKSOC
_button
private JButton _button
_keyField
private JTextField _keyField
_panel
private JPanel _panel
_getKeyDialog
private static KeyStrokeOptionComponent.GetKeyDialog _getKeyDialog
_currentKey
private KeyStroke _currentKey
_newKey
private KeyStroke _newKey
KeyStrokeOptionComponent
public KeyStrokeOptionComponent(KeyStrokeOption opt,
String text,
Frame parent)
toString
public String toString()
- Returns a custom string representation of this option component.
- Overrides:
toString
in class Object
updateConfig
public boolean updateConfig()
- Updates the config object with the new setting.
- Overrides:
updateConfig
in class OptionComponent
- Returns:
- true if the new value is set successfully
setValue
public void setValue(KeyStroke value)
- Displays the given value.
compareTo
public int compareTo(Object o)
- Compares two KeyStrokeOptionComponents based on the text of their labels.
- Specified by:
compareTo
in interface Comparable
- Returns:
- Comparison based on labels, or 1 if o is not a KeyStrokeOptionComponent
getKeyStroke
public KeyStroke getKeyStroke()
- Returns the currently selected KeyStroke.
getConfigKeyStroke
public KeyStroke getConfigKeyStroke()
- Returns the KeyStroke current set in the Config settings.
getComponent
public JComponent getComponent()
- Return's this OptionComponent's configurable component.
- Overrides:
getComponent
in class OptionComponent
_setKeyStroke
private void _setKeyStroke(KeyStroke ks)
- Sets the currently selected KeyStroke.
setValue
public void setValue(Object x0)
- Description copied from class:
OptionComponent
- Sets the value that is currently displayed by this component.
- Overrides:
setValue
in class OptionComponent