showWarning(result2.second);
comparator2.test(getSession(), monitor);
changes2 = comparator2.getChanges();
- if (monitor.isCanceled())
+ if (monitor.isCanceled()) {
+ dispose();
return;
+ }
changes2 = getSession().syncRequest(createFilterRead(changes2, filters));
Pair<UpdateTree, UpdateList> chg2 = createChangeObjects(changes2, null);
updateTree2 = chg2.first;
changes3 = comparator3.getChanges();
changes3 = getSession().syncRequest(createFilterRead(changes3, filters));
}
- if (monitor.isCanceled())
+ if (monitor.isCanceled()) {
+ dispose();
return;
+ }
Pair<GraphComparator,String> result = getChanges(oldModel,newModel);
GraphComparator comparator = result.first;
}
}
}
- if (monitor.isCanceled())
+ if (monitor.isCanceled()) {
+ dispose();
return;
+ }
comparator.test(getSession(), monitor);
monitor.setTaskName("Processing changes...");
monitor.subTask("");
changes = comparator.getChanges();
changes = getSession().syncRequest(createFilterRead(changes, filters));
Pair<UpdateTree, UpdateList> chg = createChangeObjects(changes, monitor);
+ if (chg == null) {
+ dispose();
+ return;
+ }
updateTree = chg.first;
updateList = chg.second;
if (userFilters.size() != 0) {
protected abstract Pair<GraphComparator,String> getChanges(Resource r1, Resource r2) throws DatabaseException;
protected Pair<UpdateTree, UpdateList> createChangeObjects(GraphChanges changes, IProgressMonitor monitor) throws DatabaseException{
- if (monitor != null)
+ if (monitor != null) {
+ if (monitor.isCanceled())
+ return null;
monitor.subTask("Processing structural changes");
+ }
UpdateTree updateTree = getUpdateTree(changes);
- if (monitor != null)
+ if (monitor != null) {
+ if (monitor.isCanceled())
+ return null;
monitor.subTask("Processing property changes");
+ }
UpdateList updateList = getUpdateList(changes);
- if (monitor != null)
+ if (monitor != null) {
+ if (monitor.isCanceled())
+ return null;
monitor.subTask("Postprocessing changes");
+ }
postProcess(updateTree, updateList);
return new Pair<UpdateTree, UpdateList>(updateTree, updateList);
}
}
public UpdateList getUpdateList3() throws DatabaseException {
if (updateList3 == null && changes3 != null) {
- Pair<UpdateTree, UpdateList> chg3 = createChangeObjects(changes3, null);
- updateTree3 = chg3.first;
- updateList3 = chg3.second;
+ Pair<UpdateTree, UpdateList> chg3 = createChangeObjects(changes3, null);
+ updateTree3 = chg3.first;
+ updateList3 = chg3.second;
}
return updateList3;
}
updateTree2 = null;
updateTree3 = null;
updateNode3 = null;
+ init = false;
}
}