Class ListingFieldHighlightFactoryAdapter

java.lang.Object
ghidra.app.util.viewer.field.ListingFieldHighlightFactoryAdapter
All Implemented Interfaces:
FieldHighlightFactory

public class ListingFieldHighlightFactoryAdapter extends Object implements FieldHighlightFactory
Wrapper class to translate calls to FieldHighlightFactory into a call needed by the ListingHighlightProvider. This class holds field factory information in the text field to be provided to the highlightProvider to get highlights just before the field is painted.

This class is needed to allow the basic Field API to be used with more richness at the ListingPanel level.

  • Constructor Details

    • ListingFieldHighlightFactoryAdapter

      public ListingFieldHighlightFactoryAdapter(ListingHighlightProvider provider)
      Constructor
      Parameters:
      provider - the HighlightProvider that will actually compute the highlights.
  • Method Details

    • createHighlights

      public Highlight[] createHighlights(Field field, String text, int cursorTextOffset)
      Description copied from interface: FieldHighlightFactory
      Returns the highlights for the given text
      Specified by:
      createHighlights in interface FieldHighlightFactory
      Parameters:
      field - the field that is requesting the highlight
      text - the text to be considered for highlighting
      cursorTextOffset - the position in the given text of the cursor. A -1 indicates the cursor is not in this field.
      Returns:
      an array of highlights to be rendered