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 boolean
activeByDefault
The initial activation state of the filter.protected String
description
protected String
label
A 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 boolean
defaultSelected()
Returns the initial activation state that the filter should have.String
getDescription()
A human-readable description for this filter.String
getLabel()
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.boolean
isActive()
Whether the filter is enabled, i.e. will be taken into account in computations and displayed in the UI.boolean
isEnabled(IComparisonScope scope, Comparison comparison)
Returns the activation condition based on the scope and comparison objects.void
setActive(boolean active)
Set the activation of the filter.void
setDefaultSelected(boolean active)
Set the initial activation state that the filter should have.void
setDescription(String description)
Set the description for this filter.void
setLabel(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:
getPredicateWhenSelected
in 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:
getPredicateWhenUnselected
in 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:
getLabel
in 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:
setLabel
in 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:
getDescription
in 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:
setDescription
in 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:
defaultSelected
in 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:
isActive
in 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:
setDefaultSelected
in 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:IDeactivableDiffFilter
Set the activation of the filter.- Specified by:
setActive
in 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:
isEnabled
in 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)
-
-