public CellEditorAdapter(PropertyEditor editor) {
this.editor = editor;
Component component = editor.getCustomEditor();
if (component instanceof JTextField) {
JTextField field = (JTextField)component;
field.addFocusListener(new SelectOnFocus());
field.addActionListener(new CommitEditing());
field.registerKeyboardAction(
new CancelEditing(),
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
JComponent.WHEN_FOCUSED);