提交 6f2642b9 编写于 作者: S Serge Rider

#11929 Revert data editor changes

上级 98f59d9d
......@@ -25,6 +25,8 @@ import org.jkiss.dbeaver.model.data.DBDDataFilter;
import org.jkiss.dbeaver.model.preferences.DBPPreferenceStore;
import org.jkiss.dbeaver.model.struct.DBSDataContainer;
import org.jkiss.dbeaver.runtime.DBWorkbench;
import org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer;
import org.jkiss.dbeaver.ui.editors.IRevertableEditor;
import org.jkiss.utils.CommonUtils;
import java.io.IOException;
......@@ -32,7 +34,7 @@ import java.io.IOException;
/**
* DatabaseDataEditor
*/
public class DatabaseDataEditor extends AbstractDataEditor<DBSDataContainer> implements ISmartTransactionManager
public class DatabaseDataEditor extends AbstractDataEditor<DBSDataContainer> implements ISmartTransactionManager, IRevertableEditor
{
public static final String ATTR_SUSPEND_QUERY = "suspendQuery";
public static final String ATTR_DATA_FILTER = "dataFilter";
......@@ -89,4 +91,11 @@ public class DatabaseDataEditor extends AbstractDataEditor<DBSDataContainer> imp
}
@Override
public void doRevertToSaved() {
ResultSetViewer viewer = getResultSetController();
if (viewer != null) {
viewer.rejectChanges();
}
}
}
......@@ -315,6 +315,13 @@ public class EntityEditor extends MultiPageDatabaseEditor
@Override
public void doRevertToSaved() {
for (IEditorPart editor : editorMap.values()) {
if (editor instanceof IRevertableEditor) {
((IRevertableEditor) editor).doRevertToSaved();
}
}
// Revert command context
DBECommandContext commandContext = getCommandContext();
if (commandContext != null) {
commandContext.resetChanges(true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册