Package ghidra.app.util.viewer.field

# 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.

- ## Field Summary

  ### Fields inherited from interface docking.widgets.fieldpanel.support.FieldHighlightFactory

  `NO_HIGHLIGHTS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ListingFieldHighlightFactoryAdapter(ListingHighlightProvider provider)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Highlight[]`
  `createHighlights(Field field, String text, int cursorTextOffset)`
  Returns the highlights for the given text

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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