Package org.eclipse.compare
Interface ICompareFilter
public interface ICompareFilter
A filter that can be applied during the comparison of documents that can be
used to customize the detection of text differences via the compareFilter
extension point. Filters are exposed as toggle actions in the compare viewer.
- Since:
- 3.6
- Restriction:
- This interface is not intended to be referenced by clients
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey for theCharacterrepresenting contributor of the other line.static final StringKey for theStringof the line of text this line is being compared to.static final StringKey for theCharacterrepresenting contributor of this line.static final StringKey for theStringof the line of text being compared. -
Method Summary
Modifier and TypeMethodDescriptionbooleanBecause the comparison routine may compare each line multiple times to other lines, the ignored regions may need to be calculated multiple times for the same line during a comparison.IRegion[]getFilteredRegions(HashMap lineComparison) Identifies the regions of a line of text in a comparison that should be ignored for comparison purposes.booleanReturns whether the filter should be enabled when first initializedvoidForwards the current input objects of the compare
-
Field Details
-
THIS_LINE
Key for theStringof the line of text being compared.- See Also:
-
THIS_CONTRIBUTOR
Key for theCharacterrepresenting contributor of this line. Value is either 'A' for ancestor, 'L' for left, or 'R' for right.- See Also:
-
OTHER_LINE
Key for theStringof the line of text this line is being compared to.- See Also:
-
OTHER_CONTRIBUTOR
Key for theCharacterrepresenting contributor of the other line. Value is either 'A' for ancestor, 'L' for left, or 'R' for right.- See Also:
-
-
Method Details
-
setInput
Forwards the current input objects of the compare- Parameters:
input- the merge viewer inputancestor- input into ancestor viewerleft- input into left viewerright- input into right viewer
-
getFilteredRegions
Identifies the regions of a line of text in a comparison that should be ignored for comparison purposes.- Parameters:
lineComparison- contains values for the keysTHIS_LINE,THIS_CONTRIBUTOR,OTHER_LINEandOTHER_CONTRIBUTOR- Returns:
- Regions of
THIS_LINEto be ignored for comparison purposes.
-
isEnabledInitially
boolean isEnabledInitially()Returns whether the filter should be enabled when first initialized- Returns:
- default enablement
-
canCacheFilteredRegions
boolean canCacheFilteredRegions()Because the comparison routine may compare each line multiple times to other lines, the ignored regions may need to be calculated multiple times for the same line during a comparison. If the ignored regions for each line will be the same regardless of what line it is being compared to, returningtrueto this method will cause the ignored region calculations to be re-used and improve the performance of the comparison.- Returns:
- ignored region results can be cached
-