org.jurvis.beans.editors
Class KeyStrokeEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by org.jurvis.beans.editors.KeyStrokeEditor
All Implemented Interfaces:
PropertyEditor

public class KeyStrokeEditor
extends PropertyEditorSupport

A PropertyEditor for converting back and forth between a String and a KeyStroke. The string should be of the form modifiers+shortcut where modifiers is any combination of A for Alt, C for Control, S for Shift or M for Meta, and shortcut is either a single character, or a keycode name from the KeyEvent class, without the VK_ prefix.


Constructor Summary
KeyStrokeEditor()
           
 
Method Summary
 void setAsText(String text)
          Sets the property value by parsing a given String.
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyStrokeEditor

public KeyStrokeEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Sets the property value by parsing a given String. May raise java.lang.IllegalArgumentException if either the String is badly formatted or if this kind of property can't be expressed as text.

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Parameters:
text - The string to be parsed.
Throws:
IllegalArgumentException


Copyright © 1999-2004 Neil W. Weber. All Rights Reserved.