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
Modifier and TypeFieldDescriptionstatic final String
Key for theCharacter
representing contributor of the other line.static final String
Key for theString
of the line of text this line is being compared to.static final String
Key for theCharacter
representing contributor of this line.static final String
Key for theString
of the line of text being compared. -
Method Summary
Modifier and TypeMethodDescriptionboolean
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.IRegion[]
getFilteredRegions
(HashMap lineComparison) Identifies the regions of a line of text in a comparison that should be ignored for comparison purposes.boolean
Returns whether the filter should be enabled when first initializedvoid
Forwards the current input objects of the compare
-
Field Details
-
THIS_LINE
Key for theString
of the line of text being compared.- See Also:
-
THIS_CONTRIBUTOR
Key for theCharacter
representing contributor of this line. Value is either 'A' for ancestor, 'L' for left, or 'R' for right.- See Also:
-
OTHER_LINE
Key for theString
of the line of text this line is being compared to.- See Also:
-
OTHER_CONTRIBUTOR
Key for theCharacter
representing 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_LINE
andOTHER_CONTRIBUTOR
- Returns:
- Regions of
THIS_LINE
to 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, returningtrue
to 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
-