Skip to content

Commit

Permalink
dbeaver#5758 Data type edit reflect fix
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rider committed Feb 11, 2020
1 parent 0716b41 commit d246ab6
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,22 @@ private void createPropertyEditor(Composite group, DBPPropertyDescriptor prop) {
Control finalEditControl = editControl;

if (finalEditControl instanceof Combo) {
((Combo) finalEditControl).addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updatePropertyValue(prop, ((Combo) finalEditControl).getText());
}
});
if ((finalEditControl.getStyle() & SWT.READ_ONLY) == SWT.READ_ONLY) {
((Combo) finalEditControl).addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updatePropertyValue(prop, ((Combo) finalEditControl).getText());
}
});
} else {
((Combo) finalEditControl).addModifyListener(e -> {
try {
updatePropertyValue(prop, ((Combo) finalEditControl).getText());
} catch (Exception ex) {
log.debug("Error setting value from combo: " + ex.getMessage());
}
});
}
} else if (finalEditControl instanceof Text) {
((Text) finalEditControl).addModifyListener(e -> updatePropertyValue(prop, ((Text) finalEditControl).getText()));
} else if (finalEditControl instanceof Button) {
Expand Down

0 comments on commit d246ab6

Please sign in to comment.