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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Key for the Character representing contributor of the other line.
    static final String
    Key for the String of the line of text this line is being compared to.
    static final String
    Key for the Character representing contributor of this line.
    static final String
    Key for the String of the line of text being compared.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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.
    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 initialized
    void
    setInput(Object input, Object ancestor, Object left, Object right)
    Forwards the current input objects of the compare
  • Field Details

    • THIS_LINE

      static final String THIS_LINE
      Key for the String of the line of text being compared.
      See Also:
    • THIS_CONTRIBUTOR

      static final String THIS_CONTRIBUTOR
      Key for the Character representing contributor of this line. Value is either 'A' for ancestor, 'L' for left, or 'R' for right.
      See Also:
    • OTHER_LINE

      static final String OTHER_LINE
      Key for the String of the line of text this line is being compared to.
      See Also:
    • OTHER_CONTRIBUTOR

      static final String OTHER_CONTRIBUTOR
      Key for the Character representing contributor of the other line. Value is either 'A' for ancestor, 'L' for left, or 'R' for right.
      See Also:
  • Method Details

    • setInput

      void setInput(Object input, Object ancestor, Object left, Object right)
      Forwards the current input objects of the compare
      Parameters:
      input - the merge viewer input
      ancestor - input into ancestor viewer
      left - input into left viewer
      right - 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 keys THIS_LINE, THIS_CONTRIBUTOR, OTHER_LINE and OTHER_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, returning true 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