Package org.eclipse.compare
Interface ICompareFilter
-
public interface ICompareFilterA 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
Fields Modifier and Type Field Description static StringOTHER_CONTRIBUTORKey for theCharacterrepresenting contributor of the other line.static StringOTHER_LINEKey for theStringof the line of text this line is being compared to.static StringTHIS_CONTRIBUTORKey for theCharacterrepresenting contributor of this line.static StringTHIS_LINEKey for theStringof the line of text being compared.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanCacheFilteredRegions()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.booleanisEnabledInitially()Returns whether the filter should be enabled when first initializedvoidsetInput(Object input, Object ancestor, Object left, Object right)Forwards the current input objects of the compare
-
-
-
Field Detail
-
THIS_LINE
static final String THIS_LINE
Key for theStringof the line of text being compared.- See Also:
- Constant Field Values
-
THIS_CONTRIBUTOR
static final String THIS_CONTRIBUTOR
Key for theCharacterrepresenting contributor of this line. Value is either 'A' for ancestor, 'L' for left, or 'R' for right.- See Also:
- Constant Field Values
-
OTHER_LINE
static final String OTHER_LINE
Key for theStringof the line of text this line is being compared to.- See Also:
- Constant Field Values
-
OTHER_CONTRIBUTOR
static final String 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:
- Constant Field Values
-
-
Method Detail
-
setInput
void setInput(Object input, Object ancestor, Object left, Object right)
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
IRegion[] getFilteredRegions(HashMap lineComparison)
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
-
-