Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search

EMF Compare/Specifications/ExtensionPointForFiltersAndGroups


Evolution Specification: Extension point for filters and groups

Current status is ARCHIVED


Add an extension point to EMF Compare so that users and extenders can provide their own filters and groups.

_Relevant tickets_ (links to the Bugzilla tickets which are related to the change):

Detailed Specification

The filters and groups provided in the UI as depicted below are not extensible by the user.

alt Filters And Groups

  • Add an extension point to EMF Compare so that users and extenders can provide their own filters and groups.
  • Also rewrite the current filters as extension to the extension as examples of how to contribute these items.
  • Enhance the grouping facility to display the tree structure of the model below each group. Currently it displays a flat list of all differences that verify the grouping condition. This flat list display tends to be unusable as soon as the number of differences exceeds a few tens.
  • Another feature will be added to groups and filter. Groups and filters will have an activation state based on the comparison object. This way, it will be able to have some filters and groups in some contexts (e.g. “only on 3 ways comparisons”, “on a given scope”; “on a list of EPackage nsURIs”...). Groups and filters will also have a property to tell whether they should be selected by default.
  • EMF Compare will contribute a new group to group contribution in the case of 3 ways comparison. It will group differences according to their source (left or right) and whether they are conflictual or not.
  • EMF Compare will also contribute new filters. Currently there are a certain number of elements that are not displayed in the structure merge viewer UI that are coded within the *ItemProviders. Thes ItemProviders will migrate as filters activated by default:
    • Pseudo conflict (conflict of kind PSEUDO),
    • Match with no children (match with no differences in their content tree),
    • Empty match (match with null left, right and origin references, this will happen after merging deletions),
    • Implied changes.

The selected filters will be stored in the CompareConfiguration object to let the content viewer and the mergers be notified filtering changes.

In addition, the current “Metaclass” group will be deleted since its semantic is not clear. It was more of an API example than a full-fledged group, and we will now have more meaningful samples.

Backward Compatibility and Migration Paths

Metamodel Changes

This evolution doesn't change the metamodel.

API Changes

New extension points:

    • /schema/filters.exsd
<extension-point id="filters" name="EMF Compare Filters" schema="schema/filters.exsd"/>
    • /schema/groups.exsd
<extension-point id="groups" name="EMF Compare Groups" schema="schema/groups.exsd"/>

New filters:

    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/impl/
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/impl/
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/impl/
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/impl/
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/impl/

New groups:

    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/impl/
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/impl/

New interfaces:

    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/
public interface IDifferenceFilter {
	Predicate<? super EObject> getPredicate();
	String getLabel();
	void setLabel(String label);
	boolean defaultSelected();
	void setDefaultSelected(boolean defaultSelected);
	boolean isEnabled(IComparisonScope scope, Comparison comparison);
	interface Registry {
		Collection<IDifferenceFilter> getFilters(IComparisonScope scope, Comparison comparison);
		IDifferenceFilter add(IDifferenceFilter filter);
		IDifferenceFilter remove(String className);
		void clear();
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/
public interface IDifferenceFilterSelectionChangeEvent {
	IDifferenceFilter getFilter();
	Action getAction();
        enum Action {

User Interface Changes

Every new group or filter will be visible under its category.

alt Groups

alt Filters

Documentation Changes

This documentation will have to be updated:

  • New and Noteworthy
  • Developer Guide

Tests and Non-regression strategy

Automated UI tests :

Implementation choices and tradeoffs


Back to the top