Search in sources :

Example 1 with ImpactResultDialog

use of org.talend.mdm.repository.ui.dialogs.impact.ImpactResultDialog in project tmdm-studio-se by Talend.

the class ModelImpactAnalyseService method analyzeModelImpact.

public static Map<IRepositoryViewObject, ImpactOperation> analyzeModelImpact(MDMServerDef serverDef, List<IRepositoryViewObject> modelViewObjs) throws InterruptedException {
    try {
        Map<IRepositoryViewObject, Result> changes = analyzeModelChanges(serverDef, modelViewObjs);
        if (!changes.isEmpty()) {
            Shell shell = Display.getDefault().getActiveShell();
            ImpactResultDialog dialog = new ImpactResultDialog(shell, changes);
            if (dialog.open() == IDialogConstants.OK_ID) {
                Map<IRepositoryViewObject, ImpactOperation> configuration = dialog.getImpactConfiguration();
                return configuration;
            } else {
                Map<IRepositoryViewObject, ImpactOperation> configuration = new HashMap<IRepositoryViewObject, ModelImpactAnalyseService.ImpactOperation>(changes.size());
                for (IRepositoryViewObject viewObj : changes.keySet()) {
                    configuration.put(viewObj, ImpactOperation.CANCEL);
                }
                return configuration;
            }
        }
    } catch (XtentisException e) {
        log.error(e.getMessage(), e);
    }
    return null;
}
Also used : ImpactResultDialog(org.talend.mdm.repository.ui.dialogs.impact.ImpactResultDialog) Shell(org.eclipse.swt.widgets.Shell) HashMap(java.util.HashMap) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) XtentisException(com.amalto.workbench.utils.XtentisException)

Aggregations

XtentisException (com.amalto.workbench.utils.XtentisException)1 HashMap (java.util.HashMap)1 Shell (org.eclipse.swt.widgets.Shell)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 ImpactResultDialog (org.talend.mdm.repository.ui.dialogs.impact.ImpactResultDialog)1