"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/SaveScriptDialog.java" between
dbeaver-6.1.5.tar.gz and dbeaver-6.2.0.tar.gz

About: DBeaver is a multi-platform database tool (for developers and database administrators) that supports all popular databases. Java sources.

SaveScriptDialog.java  (dbeaver-6.1.5):SaveScriptDialog.java  (dbeaver-6.2.0)
skipping to change at line 53 skipping to change at line 53
import java.util.List; import java.util.List;
class SaveScriptDialog extends BaseDialog { class SaveScriptDialog extends BaseDialog {
private static final String DIALOG_ID = "DBeaver.RSV.SaveScriptDialog";//$NO N-NLS-1$ private static final String DIALOG_ID = "DBeaver.RSV.SaveScriptDialog";//$NO N-NLS-1$
private ResultSetViewer viewer; private ResultSetViewer viewer;
private Object sqlPanel; private Object sqlPanel;
private ResultSetSaveSettings saveSettings; private ResultSetSaveSettings saveSettings;
private ResultSetSaveReport saveReport; private ResultSetSaveReport saveReport;
private String scriptText;
SaveScriptDialog(ResultSetViewer viewer, ResultSetSaveReport saveReport) { SaveScriptDialog(ResultSetViewer viewer, ResultSetSaveReport saveReport) {
super(viewer.getControl().getShell(), "Preview changes", UIIcon.SQL_SCRI PT); super(viewer.getControl().getShell(), "Preview changes", UIIcon.SQL_SCRI PT);
this.viewer = viewer; this.viewer = viewer;
this.saveSettings = new ResultSetSaveSettings(); this.saveSettings = new ResultSetSaveSettings();
this.saveReport = saveReport; this.saveReport = saveReport;
} }
public ResultSetSaveSettings getSaveSettings() { public ResultSetSaveSettings getSaveSettings() {
skipping to change at line 196 skipping to change at line 197
private void populateSQL() { private void populateSQL() {
try { try {
final List<DBEPersistAction> sqlScript = new ArrayList<>(); final List<DBEPersistAction> sqlScript = new ArrayList<>();
UIUtils.runInProgressService(monitor -> { UIUtils.runInProgressService(monitor -> {
List<DBEPersistAction> script = viewer.generateChangesScript(mon itor, saveSettings); List<DBEPersistAction> script = viewer.generateChangesScript(mon itor, saveSettings);
if (script != null) { if (script != null) {
sqlScript.addAll(script); sqlScript.addAll(script);
} }
}); });
String scriptText = ""; scriptText = "";
if (!sqlScript.isEmpty()) { if (!sqlScript.isEmpty()) {
scriptText = SQLUtils.generateScript( scriptText = SQLUtils.generateScript(
viewer.getDataSource(), viewer.getDataSource(),
sqlScript.toArray(new DBEPersistAction[0]), sqlScript.toArray(new DBEPersistAction[0]),
false); false);
scriptText = scriptText =
SQLUtils.generateCommentLine( SQLUtils.generateCommentLine(
viewer.getDataSource(), viewer.getDataSource(),
"Auto-generated SQL script #" + new SimpleDateFormat(Gen eralUtils.DEFAULT_TIMESTAMP_PATTERN).format(new Date())) + "Auto-generated SQL script #" + new SimpleDateFormat(Gen eralUtils.DEFAULT_TIMESTAMP_PATTERN).format(new Date())) +
scriptText; scriptText;
UIServiceSQL serviceSQL = DBWorkbench.getService(UIServiceSQL.cl ass); UIServiceSQL serviceSQL = DBWorkbench.getService(UIServiceSQL.cl ass);
if (serviceSQL != null) { if (serviceSQL != null) {
serviceSQL.setSQLPanelText(sqlPanel, scriptText); serviceSQL.setSQLPanelText(sqlPanel, scriptText);
} }
} }
} catch (Exception e) { } catch (Exception e) {
DBWorkbench.getPlatformUI().showError("Can't generalte SQL script", "Error generating SQL script from changes", e); DBWorkbench.getPlatformUI().showError("Can't generate SQL script", " Error generating SQL script from data changes", e);
} }
} }
@Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.DETAILS_ID) {
ResultSetUtils.copyToClipboard(scriptText);
super.buttonPressed(IDialogConstants.CANCEL_ID);
}
super.buttonPressed(buttonId);
}
} }
 End of changes. 4 change blocks. 
2 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)