Class AbstractDifferenceFilter
- java.lang.Object
-
- org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.AbstractDifferenceFilter
-
- All Implemented Interfaces:
IDeactivableDiffFilter,IDifferenceFilter
- Direct Known Subclasses:
CascadingDifferencesFilter,TechnicalitiesFilter
public abstract class AbstractDifferenceFilter extends Object implements IDeactivableDiffFilter
An abstract filter implementation.- Since:
- 4.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter
IDifferenceFilter.Registry
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanactiveByDefaultThe initial activation state of the filter.protected Stringdescriptionprotected StringlabelA human-readable label for this filter.
-
Constructor Summary
Constructors Constructor Description AbstractDifferenceFilter()Constructs the filter with the appropriate predicate.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleandefaultSelected()Returns the initial activation state that the filter should have.StringgetDescription()A human-readable description for this filter.StringgetLabel()A human-readable label for this filter.abstract com.google.common.base.Predicate<? super EObject>getPredicateWhenSelected()Returns the predicate that will filter out objects in the structural differences view when this filter will be selected.com.google.common.base.Predicate<? super EObject>getPredicateWhenUnselected()Returns the predicate that will filter out objects in the structural differences view when this filter will be unselected.booleanisActive()Whether the filter is enabled, i.e. will be taken into account in computations and displayed in the UI.booleanisEnabled(IComparisonScope scope, Comparison comparison)Returns the activation condition based on the scope and comparison objects.voidsetActive(boolean active)Set the activation of the filter.voidsetDefaultSelected(boolean active)Set the initial activation state that the filter should have.voidsetDescription(String description)Set the description for this filter.voidsetLabel(String label)Set the label for this filter.
-
-
-
Method Detail
-
getPredicateWhenSelected
public abstract com.google.common.base.Predicate<? super EObject> getPredicateWhenSelected()
Returns the predicate that will filter out objects in the structural differences view when this filter will be selected.- Specified by:
getPredicateWhenSelectedin interfaceIDifferenceFilter- Returns:
- the predicate that will filter out objects in the structural differences view when this filter will be selected.
- See Also:
IDifferenceFilter.getPredicateWhenSelected()
-
getPredicateWhenUnselected
public com.google.common.base.Predicate<? super EObject> getPredicateWhenUnselected()
Returns the predicate that will filter out objects in the structural differences view when this filter will be unselected.- Specified by:
getPredicateWhenUnselectedin interfaceIDifferenceFilter- Returns:
- the predicate that will filter out objects in the structural differences view when this filter will be unselected.
- See Also:
IDifferenceFilter.getPredicateWhenUnselected()
-
getLabel
public String getLabel()
A human-readable label for this filter. This will be displayed in the EMF Compare UI.- Specified by:
getLabelin interfaceIDifferenceFilter- Returns:
- The label for this filter.
- See Also:
IDifferenceFilter.getLabel()
-
setLabel
public void setLabel(String label)
Set the label for this filter. This will be displayed in the EMF Compare UI.- Specified by:
setLabelin interfaceIDifferenceFilter- Parameters:
label- A human-readable label for this filter.- See Also:
IDifferenceFilter.setLabel(java.lang.String)
-
getDescription
public String getDescription()
A human-readable description for this filter. This will be displayed in the EMF Compare UI.- Specified by:
getDescriptionin interfaceIDifferenceFilter- Returns:
- Description or
null
-
setDescription
public void setDescription(String description)
Set the description for this filter. This will be displayed in the EMF Compare UI.- Specified by:
setDescriptionin interfaceIDifferenceFilter- Parameters:
description- A human-readable description for this filter.
-
defaultSelected
public boolean defaultSelected()
Returns the initial activation state that the filter should have.- Specified by:
defaultSelectedin interfaceIDifferenceFilter- Returns:
- The initial activation state that the filter should have.
- See Also:
IDifferenceFilter.defaultSelected()
-
isActive
public boolean isActive()
Whether the filter is enabled, i.e. will be taken into account in computations and displayed in the UI.- Specified by:
isActivein interfaceIDeactivableDiffFilter- Returns:
- The enablement of the filter.
- Since:
- 4.3
- See Also:
IDeactivableDiffFilter.isActive()
-
setDefaultSelected
public void setDefaultSelected(boolean active)
Set the initial activation state that the filter should have.- Specified by:
setDefaultSelectedin interfaceIDifferenceFilter- Parameters:
active- The initial activation state that the filter should have (true if the filter should be active by default).- See Also:
IDifferenceFilter.setDefaultSelected(boolean)
-
setActive
public void setActive(boolean active)
Description copied from interface:IDeactivableDiffFilterSet the activation of the filter.- Specified by:
setActivein interfaceIDeactivableDiffFilter- Parameters:
active- Whether the filter should be active- Since:
- 4.3
-
isEnabled
public boolean isEnabled(IComparisonScope scope, Comparison comparison)
Returns the activation condition based on the scope and comparison objects.- Specified by:
isEnabledin interfaceIDifferenceFilter- Parameters:
scope- The scope on which the filter will be applied.comparison- The comparison which is to be displayed in the structural view.- Returns:
- The activation condition based on the scope and comparison objects.
- See Also:
IDifferenceFilter.isEnabled(org.eclipse.emf.compare.scope.IComparisonScope, org.eclipse.emf.compare.Comparison)
-
-