Class ListingDiffHighlightProvider
- java.lang.Object
-
- ghidra.app.util.viewer.listingpanel.ListingDiffHighlightProvider
-
- All Implemented Interfaces:
HighlightProvider
public class ListingDiffHighlightProvider extends java.lang.Object implements HighlightProvider
-
-
Field Summary
-
Fields inherited from interface ghidra.app.util.HighlightProvider
EMPTY_HIGHLIGHT
-
-
Constructor Summary
Constructors Constructor Description ListingDiffHighlightProvider(ListingDiff listingDiff, boolean isListing1, ListingCodeComparisonOptions comparisonOptions)
Constructor for this highlight provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Highlight[]
getHighlights(java.lang.String text, java.lang.Object obj, java.lang.Class<? extends FieldFactory> fieldFactoryClass, int cursorTextOffset)
Get the highlights appropriate for the given text, object, and FieldFactory class.boolean
isListing1()
Determines if this highlight provider is for the first listing of the ListingDiff.
-
-
-
Constructor Detail
-
ListingDiffHighlightProvider
public ListingDiffHighlightProvider(ListingDiff listingDiff, boolean isListing1, ListingCodeComparisonOptions comparisonOptions)
Constructor for this highlight provider.- Parameters:
listingDiff
- the ListingDiff to use to determine where there are differences that need highlighting.isListing1
- true means that these are the highlights for the first listing. false means the highlights are for the second listing.comparisonOptions
- the tool options that indicate the current background colors for the Listing code comparison panel.
-
-
Method Detail
-
getHighlights
public Highlight[] getHighlights(java.lang.String text, java.lang.Object obj, java.lang.Class<? extends FieldFactory> fieldFactoryClass, int cursorTextOffset)
Description copied from interface:HighlightProvider
Get the highlights appropriate for the given text, object, and FieldFactory class.- Specified by:
getHighlights
in interfaceHighlightProvider
- Parameters:
text
- the entire text contained in the field, regardless of layout.obj
- object that provides the information to be rendered (usually a code unit)fieldFactoryClass
- the class that indicates what type of field is being rendered. For Example, address fields would have the AddressFieldFactory class.cursorTextOffset
- the cursor position within the given text or -1 if no cursor in this field.- Returns:
- an array of highlight objects that indicate the location within the text string to be highlighted.
-
isListing1
public boolean isListing1()
Determines if this highlight provider is for the first listing of the ListingDiff.- Returns:
- true if this provider's highlights are for the first listing. false if the highlights are for the second listing.
-
-