Search in sources :

Example 1 with CompareObjectsExecutor

use of org.jkiss.dbeaver.tools.compare.simple.CompareObjectsExecutor in project dbeaver by dbeaver.

the class CompareObjectsWizard method performFinish.

@Override
public boolean performFinish() {
    // Save settings
    getSettings().saveTo(new DialogSettingsDelegate(getDialogSettings()));
    showError(null);
    // Compare
    final CompareObjectsExecutor executor = new CompareObjectsExecutor(settings);
    try {
        UIUtils.run(getContainer(), true, true, new DBRRunnableWithProgress() {

            @Override
            public void run(DBRProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                try {
                    CompareReport report = generateReport(monitor, executor);
                    renderReport(monitor, report);
                } catch (DBException e) {
                    throw new InvocationTargetException(e);
                }
            }
        });
        UIUtils.showMessageBox(getShell(), "Objects compare", "Objects compare finished", SWT.ICON_INFORMATION);
    } catch (InvocationTargetException e) {
        if (executor.getInitializeError() != null) {
            showError(executor.getInitializeError().getMessage());
        } else {
            log.error(e.getTargetException());
            showError(e.getTargetException().getMessage());
        }
        return false;
    } catch (InterruptedException e) {
        showError("Compare interrupted");
        return false;
    } finally {
        executor.dispose();
    }
    // Done
    return true;
}
Also used : DBException(org.jkiss.dbeaver.DBException) CompareReport(org.jkiss.dbeaver.tools.compare.simple.CompareReport) DialogSettingsDelegate(org.jkiss.dbeaver.ui.DialogSettingsDelegate) CompareObjectsExecutor(org.jkiss.dbeaver.tools.compare.simple.CompareObjectsExecutor) DBRRunnableWithProgress(org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress) DBRProgressMonitor(org.jkiss.dbeaver.model.runtime.DBRProgressMonitor) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 2 with CompareObjectsExecutor

use of org.jkiss.dbeaver.tools.compare.simple.CompareObjectsExecutor in project dbeaver by serge-rider.

the class CompareObjectsWizard method performFinish.

@Override
public boolean performFinish() {
    // Save settings
    getSettings().saveTo(new DialogSettingsDelegate(getDialogSettings()));
    showError(null);
    // Compare
    final CompareObjectsExecutor executor = new CompareObjectsExecutor(settings);
    try {
        UIUtils.run(getContainer(), true, true, new DBRRunnableWithProgress() {

            @Override
            public void run(DBRProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                try {
                    CompareReport report = generateReport(monitor, executor);
                    renderReport(monitor, report);
                } catch (DBException e) {
                    throw new InvocationTargetException(e);
                }
            }
        });
        UIUtils.showMessageBox(getShell(), "Objects compare", "Objects compare finished", SWT.ICON_INFORMATION);
    } catch (InvocationTargetException e) {
        if (executor.getInitializeError() != null) {
            showError(executor.getInitializeError().getMessage());
        } else {
            log.error(e.getTargetException());
            showError(e.getTargetException().getMessage());
        }
        return false;
    } catch (InterruptedException e) {
        showError("Compare interrupted");
        return false;
    } finally {
        executor.dispose();
    }
    // Done
    return true;
}
Also used : DBException(org.jkiss.dbeaver.DBException) CompareReport(org.jkiss.dbeaver.tools.compare.simple.CompareReport) DialogSettingsDelegate(org.jkiss.dbeaver.ui.DialogSettingsDelegate) CompareObjectsExecutor(org.jkiss.dbeaver.tools.compare.simple.CompareObjectsExecutor) DBRRunnableWithProgress(org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress) DBRProgressMonitor(org.jkiss.dbeaver.model.runtime.DBRProgressMonitor) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)2 DBException (org.jkiss.dbeaver.DBException)2 DBRProgressMonitor (org.jkiss.dbeaver.model.runtime.DBRProgressMonitor)2 DBRRunnableWithProgress (org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress)2 CompareObjectsExecutor (org.jkiss.dbeaver.tools.compare.simple.CompareObjectsExecutor)2 CompareReport (org.jkiss.dbeaver.tools.compare.simple.CompareReport)2 DialogSettingsDelegate (org.jkiss.dbeaver.ui.DialogSettingsDelegate)2