use of org.eclipse.emf.compare.Diff in project tdq-studio-se by Talend.
the class DataProviderComparisonLevel method compareWithReloadObject.
@Override
protected boolean compareWithReloadObject() throws ReloadCompareException {
Map<ResourceSet, List<Resource>> rsJrxmlMap = removeJrxmlsFromResourceSet();
EMFCompare comparator = createDefaultEMFCompare();
IComparisonScope scope = new DefaultComparisonScope(oldDataProvider, getSavedReloadObject(), null);
Comparison compare = comparator.compare(scope);
// add the jrxml into the ResourceSet after doMatch
addJrxmlsIntoResourceSet(rsJrxmlMap);
EList<Diff> differences = compare.getDifferences();
for (Diff diff : differences) {
// ignore the move Kind
if (diff.getKind() == DifferenceKind.MOVE) {
continue;
}
if (diff instanceof ReferenceChange) {
EObject value = ((ReferenceChange) diff).getValue();
if (isCatalogOrSchema(value)) {
copyRightToLeft(diff);
}
}
}
return true;
}
use of org.eclipse.emf.compare.Diff in project tdq-studio-se by Talend.
the class TableViewComparisonLevel method compareWithReloadObject.
@Override
protected boolean compareWithReloadObject() throws ReloadCompareException {
// remove the jrxml from the ResourceSet before doMatch
Map<ResourceSet, List<Resource>> rsJrxmlMap = removeJrxmlsFromResourceSet();
DBColumnFolderRepNode columnFolderRepNode = (DBColumnFolderRepNode) selectedObj;
// Compare the two models
EMFCompare comparator = createDefaultEMFCompare();
IComparisonScope scope = new DefaultComparisonScope(columnFolderRepNode.getColumnSet(), getSavedReloadObject(), null);
Comparison compare = comparator.compare(scope);
// add the jrxml into the ResourceSet after doMatch
addJrxmlsIntoResourceSet(rsJrxmlMap);
EList<Diff> differences = compare.getDifferences();
for (Diff diff : differences) {
// ignore the move Kind
if (diff.getKind() == DifferenceKind.MOVE) {
continue;
}
// copy right to left
copyRightToLeft(diff);
}
return true;
}
use of org.eclipse.emf.compare.Diff in project InformationSystem by ObeoNetwork.
the class AbtractTest method diff.
protected Comparison diff(TableContainer left, TableContainer right) throws Exception {
Comparison comparison = DatabaseCompareService.compare(left, right);
assertNotNull(comparison);
// DatabaseChangeSet databaseChangeSet = null;
// if (comparison instanceof DatabaseChangeSet) {
// databaseChangeSet = (DatabaseChangeSet) comparison;
// }
// assertNotNull(databaseChangeSet);
DiffContentService DiffContentService = new DiffContentService();
System.out.println("---- Print ChangeSet -----");
for (Diff element : comparison.getDifferences()) {
System.out.println("\t" + element.eClass().getName());
List<Diff> subDiffs = DiffContentService.getSubDiffs(element, comparison);
if (!subDiffs.isEmpty()) {
for (Diff e : subDiffs) {
System.out.println("\t\t" + e.eClass().getName() + "(" + e + ")");
}
}
}
return comparison;
}
use of org.eclipse.emf.compare.Diff in project tdq-studio-se by Talend.
the class CatalogSchemaComparisonLevel method compareWithReloadObject.
@Override
protected boolean compareWithReloadObject() throws ReloadCompareException {
// remove the jrxml from the ResourceSet before doMatch
Map<ResourceSet, List<Resource>> rsJrxmlMap = removeJrxmlsFromResourceSet();
EMFCompare comparator = createDefaultEMFCompare();
IComparisonScope scope = new DefaultComparisonScope(getPackageFromObject(selectedObj), getSavedReloadObject(), null);
Comparison compare = comparator.compare(scope);
// add the jrxml into the ResourceSet after doMatch
addJrxmlsIntoResourceSet(rsJrxmlMap);
EList<Diff> differences = compare.getDifferences();
for (Diff diff : differences) {
// ignore the move Kind
if (diff.getKind() == DifferenceKind.MOVE) {
continue;
}
// ignore others except TdTable and TdView and Related TaggetValue
if (diff instanceof ReferenceChange) {
EObject value = ((ReferenceChange) diff).getValue();
boolean isIgnore = true;
if (value instanceof TaggedValue) {
TdTable tableContianer = SwitchHelpers.TABLE_SWITCH.doSwitch(value.eContainer());
if (tableContianer != null) {
isIgnore = false;
}
} else if (isValidTableHandle(value) || isValidViewHandle(value)) {
isIgnore = false;
}
if (!isIgnore) {
copyRightToLeft(diff);
}
}
}
return true;
}
use of org.eclipse.emf.compare.Diff in project tdq-studio-se by Talend.
the class AbstractComparisonLevel method compareWithReloadObject.
/**
* Compare the old selected object with reload object(rightResource), and updated the content of old selected
* object.
*
* @param rightResource
* @return
* @throws ReloadCompareException
*/
protected boolean compareWithReloadObject() throws ReloadCompareException {
Map<ResourceSet, List<Resource>> rsJrxmlMap = removeJrxmlsFromResourceSet();
EMFCompare comparator = createDefaultEMFCompare();
IComparisonScope scope = new DefaultComparisonScope(oldDataProvider, getSavedReloadObject(), null);
Comparison compare = comparator.compare(scope);
// add the jrxml into the ResourceSet after doMatch
addJrxmlsIntoResourceSet(rsJrxmlMap);
EList<Diff> differences = compare.getDifferences();
for (Diff diff : differences) {
// ignore the move Kind
if (diff.getKind() == DifferenceKind.MOVE) {
continue;
}
copyRightToLeft(diff);
}
return true;
}
Aggregations