提交 cd68c70a 编写于 作者: S serge-rider

#3553 Save editor values before dialog close


Former-commit-id: 83ab9760
上级 8862a356
......@@ -120,7 +120,7 @@ public class AttributeEditPage extends BaseObjectEditPage {
@Override
protected void performFinish() throws DBException {
// Change focus to save currently editing value
propertyViewer.getTree().setFocus();
// Save any active editors
propertyViewer.saveEditorValues();
}
}
......@@ -629,6 +629,20 @@ public class PropertyTreeViewer extends TreeViewer {
this.extraLabelProvider = extraLabelProvider;
}
public void saveEditorValues() {
if (curCellEditor != null && curCellEditor.isActivated()) {
try {
// This is a hack. On MacOS buttons don't get focus so when user closes dialog
// by clicking on Ok button CellEditor doesn't get FocusLost event and thus doesn't save its value.
// This is workaround. Calling protected method fireApplyEditorValue in okPressed saves the value.
// See https://github.com/dbeaver/dbeaver/issues/3553
BeanUtils.invokeObjectMethod(curCellEditor, "fireApplyEditorValue");
} catch (Throwable throwable) {
throwable.printStackTrace();
}
}
}
private static class TreeNode {
final TreeNode parent;
final DBPPropertySource propertySource;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册