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

Entity editor fix: save metadata changes before nested editors

上级 92249632
...@@ -914,27 +914,29 @@ public class EntityEditor extends MultiPageDatabaseEditor ...@@ -914,27 +914,29 @@ public class EntityEditor extends MultiPageDatabaseEditor
@Override @Override
protected IStatus run(DBRProgressMonitor monitor) { protected IStatus run(DBRProgressMonitor monitor) {
try { try {
{ final DBECommandContext commandContext = getCommandContext();
if (commandContext != null && commandContext.isDirty()) {
success = saveCommandContext(monitor);
} else {
success = true;
}
if (success) {
// Save nested editors // Save nested editors
ProxyProgressMonitor proxyMonitor = new ProxyProgressMonitor(monitor); ProxyProgressMonitor proxyMonitor = new ProxyProgressMonitor(monitor);
for (IEditorPart editor : editorMap.values()) { for (IEditorPart editor : editorMap.values()) {
editor.doSave(proxyMonitor); editor.doSave(proxyMonitor);
if (monitor.isCanceled()) { if (monitor.isCanceled()) {
success = false;
return Status.CANCEL_STATUS; return Status.CANCEL_STATUS;
} }
} }
if (proxyMonitor.isCanceled()) { if (proxyMonitor.isCanceled()) {
success = false;
return Status.CANCEL_STATUS; return Status.CANCEL_STATUS;
} }
} }
final DBECommandContext commandContext = getCommandContext();
if (commandContext != null && commandContext.isDirty()) {
success = saveCommandContext(monitor);
} else {
success = true;
}
return success ? Status.OK_STATUS : Status.CANCEL_STATUS; return success ? Status.OK_STATUS : Status.CANCEL_STATUS;
} catch (Throwable e) { } catch (Throwable e) {
success = false; success = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册