use of com.revolsys.swing.listener.WeakFocusListener in project com.revolsys.open by revolsys.
the class LayerRecordForm method addField.
public Field addField(final String fieldName, final Field field) {
Property.addListener(field, fieldName, this);
field.setUndoManager(this.undoManager);
if (field instanceof ComboBox) {
final ComboBox<?> comboBox = (ComboBox<?>) field;
final ComboBoxEditor editor = comboBox.getEditor();
final Component editorComponent = editor.getEditorComponent();
editorComponent.addFocusListener(new WeakFocusListener(this));
} else {
((JComponent) field).addFocusListener(new WeakFocusListener(this));
}
this.fields.put(fieldName, field);
this.fieldToNameMap.put(field, fieldName);
return field;
}
Aggregations