SwingUtilities.invokeLater(new Runnable() {
public void run() {
final JComponent editor = displayRecordFieldSelectionEditor(gem);
//we attach a listener to find out when the editor is finished in order to finalize the undoable edit operation
editor.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent e) {}
/** when the focus is lost it implies the editor is closing, any changes are committed so we can end the compound edit*/
public void focusLost(FocusEvent e) {
undoableEditSupport.endUpdate();