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/Filtering facility"

(Preference page for filter setting configuration)
(Prototype)
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The capability to group differences will be provided by a menu next to the save diff model button. This button will be same for Grouping and Filtering. The tooltip will be "Group/Filter difference elements"
+
__TOC__
  
 +
The capability to group differences will be provided by a menu next to the save diff model button. This button will be same for Grouping and Filtering. The tooltip will be "''Group/Filter difference elements''". The icon is to be defined.
 +
 +
[[Image:Comparison tree editor uml save bordered.png‎]]
  
 
The provided menu will be organized as follow:
 
The provided menu will be organized as follow:
Filter out Structural Differences
+
 
Hide Addition
+
* Filter out Structural Differences
Hide Removal
+
** Hide Addition
Hide Modification
+
** Hide Removal
Hide Move
+
** Hide Modification
 +
** Hide Move
 +
 
 
Each menu entry will be a checkbox button (similar to the ones in the screenshot below), meaning that more than one filter can be selected to customize the content provider of the Diff tree editor.
 
Each menu entry will be a checkbox button (similar to the ones in the screenshot below), meaning that more than one filter can be selected to customize the content provider of the Diff tree editor.
 +
 +
[[Image:Checkbox-button-menu.png]]
 +
 +
== Preference page for filter setting configuration ==
 +
 +
A preference page will be provided to set filter that should be activated by default when the comparison editor is opened.
 +
This preference will not be overridable in project-specific preferences as it would add an EMFCompare entry in each project preference page.
 +
 +
== Provide an API enabling the contribution of new filters ==
  
 
An API and an extension point will be provided to contribute new filtering facilities.
 
An API and an extension point will be provided to contribute new filtering facilities.
 
A new filter will have to implement an interface IDifferenceFilter :
 
A new filter will have to implement an interface IDifferenceFilter :
 +
 +
<source lang="java">
 +
/**
 +
* A filter use to tell if the given DiffElement must be hidden when
 +
* this filter is activated.
 +
*/
 
public interface IDifferenceFilter {
 
public interface IDifferenceFilter {
 
boolean hide(DiffElement d);
 
boolean hide(DiffElement d);
 
}
 
}
 +
</source>
 +
 
The corresponding extension point will be a simple one with two attributes : the name of the filter (string type) and the implementation class (java type).
 
The corresponding extension point will be a simple one with two attributes : the name of the filter (string type) and the implementation class (java type).
 +
 
The extension point will be implemented by the classical tryptic :
 
The extension point will be implemented by the classical tryptic :
"ExtensionDescriptor" (to support lazy loading)
+
* '''ExtensionDescriptor''' (to support lazy loading)
"ExtensionRegistry" will be the bridge between the plugin registry and emfcompare
+
* '''ExtensionRegistry''' will be the bridge between the plugin registry and emfcompare
"ExtensionRegistryListener" to listen installation and de-installation of contributing plugins.
+
* '''ExtensionRegistryListener''' to listen installation and de-installation of contributing plugins.
 
The IDifferenceFilter implementations will be used by the content providers of the diff tree editor to check if the element should be displayed or not.
 
The IDifferenceFilter implementations will be used by the content providers of the diff tree editor to check if the element should be displayed or not.
 +
 
However, the children of hidden elements MAY be displayed if they are not said to be hidden by the filters.
 
However, the children of hidden elements MAY be displayed if they are not said to be hidden by the filters.
  
== Preference page for filter setting configuration ==
+
== Prototype ==
  
A preference page will be provided to set filter that should be activated by default when the comparison editor is opened.
+
As example, in the plugin.xml has been declared a new filter to filter added elements.
This preference will not be overridable in project-specific preferences as it would add an EMFCompare entry in each project preference page.
+
Note that the filtering runs on any kind of grouping.
  
== Provide an API enabling the contribution of new filters ==
+
[[Image:Filtering.png]]
 +
 
 +
[[Category:Modeling]] [[Category:EMF Compare]]

Revision as of 03:49, 18 October 2012

The capability to group differences will be provided by a menu next to the save diff model button. This button will be same for Grouping and Filtering. The tooltip will be "Group/Filter difference elements". The icon is to be defined.

Comparison tree editor uml save bordered.png

The provided menu will be organized as follow:

  • Filter out Structural Differences
    • Hide Addition
    • Hide Removal
    • Hide Modification
    • Hide Move

Each menu entry will be a checkbox button (similar to the ones in the screenshot below), meaning that more than one filter can be selected to customize the content provider of the Diff tree editor.

Checkbox-button-menu.png

Preference page for filter setting configuration

A preference page will be provided to set filter that should be activated by default when the comparison editor is opened. This preference will not be overridable in project-specific preferences as it would add an EMFCompare entry in each project preference page.

Provide an API enabling the contribution of new filters

An API and an extension point will be provided to contribute new filtering facilities. A new filter will have to implement an interface IDifferenceFilter :

/**
 * A filter use to tell if the given DiffElement must be hidden when 
 * this filter is activated.
 */
public interface IDifferenceFilter {
	boolean hide(DiffElement d);
}

The corresponding extension point will be a simple one with two attributes : the name of the filter (string type) and the implementation class (java type).

The extension point will be implemented by the classical tryptic :

  • ExtensionDescriptor (to support lazy loading)
  • ExtensionRegistry will be the bridge between the plugin registry and emfcompare
  • ExtensionRegistryListener to listen installation and de-installation of contributing plugins.

The IDifferenceFilter implementations will be used by the content providers of the diff tree editor to check if the element should be displayed or not.

However, the children of hidden elements MAY be displayed if they are not said to be hidden by the filters.

Prototype

As example, in the plugin.xml has been declared a new filter to filter added elements. Note that the filtering runs on any kind of grouping.

Filtering.png

Back to the top