Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EMF Compare/Specifications/ExtensionPointForFiltersAndGroups"

(Tests and Non-regression strategy)
Line 1: Line 1:
 
= Evolution Specification: Extension point for filters and groups =
 
= Evolution Specification: Extension point for filters and groups =
  
Current status is '''DRAFT'''
+
Current status is '''ARCHIVED'''
  
 
== Preamble  ==
 
== Preamble  ==
Line 135: Line 135:
  
 
N/A
 
N/A
 +
 +
[[Category:EMF Compare OUTDATED]]

Revision as of 10:58, 5 March 2014

Evolution Specification: Extension point for filters and groups

Current status is ARCHIVED

Preamble

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:

  • org.eclipse.emf.compare.rcp.ui
    • /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:

  • org.eclipse.emf.compare.rcp.ui
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/impl/EmptyMatchedResourcesFilter.java
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/impl/IdenticalElementsFilter.java
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/impl/PseudoConflictsFilter.java
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/impl/PseudoDeleteConflictsFilter.java
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/impl/SubDiffElementsFilter.java


New groups:

  • org.eclipse.emf.compare.rcp.ui
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/impl/DefaultGroupProvider.java
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/impl/ThreeWayComparisonGroupProvider.java

New interfaces:

  • org.eclipse.emf.compare.rcp.ui
    • /src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/IDifferenceFilter.java
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/IDifferenceFilterSelectionChangeEvent.java
public interface IDifferenceFilterSelectionChangeEvent {
 
	IDifferenceFilter getFilter();
 
	Action getAction();
 
        enum Action {
		ADD,
		REMOVE,
	}
}

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

N/A

Back to the top