Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Resource res = new ResourceSetImpl().getResource(
- URI.createURI(Urls.URL_Model), true);
- WorldCupForecastQuery worldCupOnlineScores = new WorldCupForecastQuery(
- (WorldCupForecast) res.getContents().get(0));
- EObject currentPlayer = selectedDay.eContainer();
- Player bestPlayer = worldCupOnlineScores.getBestPlayer();
- /* prepare the options */
- Map<String, Object> options = new HashMap<String, Object>();
- options.put(MatchOptions.OPTION_IGNORE_XMI_ID, Boolean.TRUE);
- options.put(MatchOptions.OPTION_IGNORE_ID, Boolean.TRUE);
- /* match both versions of the models */
- MatchModel match = new ForeCastMatcher().contentMatch(bestPlayer,
- currentPlayer, options);
- /* build a delta from this match */
- DiffModel diff = DiffService.doDiff(match);
- /* prepare the ui content */
- ComparisonResourceSnapshot snapshot = DiffFactory.eINSTANCE
- .createComparisonResourceSnapshot();
- snapshot.setDiff(diff);
- snapshot.setMatch(match);
- /* open the ui */
- CompareUI.openCompareEditor(new ModelCompareEditorInput(
- (ComparisonSnapshot) snapshot));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement