Class ListingModelAdapter

java.lang.Object
ghidra.app.util.viewer.listingpanel.ListingModelAdapter
All Implemented Interfaces:
LayoutModel, ListingModelListener, Iterable<Layout>

public class ListingModelAdapter extends Object implements LayoutModel, ListingModelListener
  • Constructor Details

    • ListingModelAdapter

      public ListingModelAdapter(ListingModel bigListingModel)
  • Method Details

    • flushChanges

      public void flushChanges()
      Description copied from interface: LayoutModel
      Returns true if the model knows about changes that haven't yet been told to the LayoutModelListeners.
      Specified by:
      flushChanges in interface LayoutModel
    • addLayoutModelListener

      public void addLayoutModelListener(LayoutModelListener listener)
      Description copied from interface: LayoutModel
      Adds a LayoutModelListener to be notified when changes occur.
      Specified by:
      addLayoutModelListener in interface LayoutModel
      Parameters:
      listener - the LayoutModelListener to add.
    • getIndexAfter

      public BigInteger getIndexAfter(BigInteger index)
      Description copied from interface: LayoutModel
      Returns the closest larger index in the model that has a non-null layout.
      Specified by:
      getIndexAfter in interface LayoutModel
      Parameters:
      index - for which to find the next index with a non-null layout.
      Returns:
      returns the closest larger index in the model that has a non-null layout.
    • getIndexBefore

      public BigInteger getIndexBefore(BigInteger index)
      Description copied from interface: LayoutModel
      Returns the closest smaller index in the model that has a non-null layout.
      Specified by:
      getIndexBefore in interface LayoutModel
      Parameters:
      index - for which to find the previous index with a non-null layout.
      Returns:
      returns the closest smaller index in the model that has a non-null layout.
    • getLayout

      public Layout getLayout(BigInteger index)
      Description copied from interface: LayoutModel
      Returns a layout for the given index.
      Specified by:
      getLayout in interface LayoutModel
      Parameters:
      index - the index of the layout to retrieve.
    • getPreferredViewSize

      public Dimension getPreferredViewSize()
      Description copied from interface: LayoutModel
      Returns the width of the largest possible layout.
      Specified by:
      getPreferredViewSize in interface LayoutModel
    • getNumIndexes

      public BigInteger getNumIndexes()
      Description copied from interface: LayoutModel
      Returns the total number of indexes.
      Specified by:
      getNumIndexes in interface LayoutModel
    • isUniform

      public boolean isUniform()
      Description copied from interface: LayoutModel
      Returns true if every index returns a non-null layout and all the layouts are the same height.
      Specified by:
      isUniform in interface LayoutModel
    • removeLayoutModelListener

      public void removeLayoutModelListener(LayoutModelListener listener)
      Description copied from interface: LayoutModel
      Removes a LayoutModelListener to be notified when changes occur.
      Specified by:
      removeLayoutModelListener in interface LayoutModel
      Parameters:
      listener - the LayoutModelListener to remove.
    • dispose

      public void dispose()
    • dataChanged

      public void dataChanged(boolean updateImmediately)
      Description copied from interface: ListingModelListener
      Called when the data at an index or range of indexes changes.
      Specified by:
      dataChanged in interface ListingModelListener
      Parameters:
      updateImmediately - true to immediately update the listing upon change.
    • modelSizeChanged

      public void modelSizeChanged()
      Description copied from interface: ListingModelListener
      Called whenever the number of indexes changed
      Specified by:
      modelSizeChanged in interface ListingModelListener
    • getFieldLocation

      public FieldLocation getFieldLocation(ProgramLocation location)
      Translates the given ProgramLocation into a FieldLocation. Attempts to find a field that can exactly find a match for the program location. Otherwise, it will return a fieldLocation to the default field or beginning of the line.
      Parameters:
      location - the ProgramLocation to translate.
      Returns:
      a FieldLocation for the ProgramLocation or null if none can be found.
    • getProgramLocation

      public ProgramLocation getProgramLocation(FieldLocation floc)
    • getProgramLocation

      public ProgramLocation getProgramLocation(FieldLocation location, Field field)
    • getAllProgramSelection

      public ProgramSelection getAllProgramSelection()
    • getProgramSelection

      public ProgramSelection getProgramSelection(FieldSelection selection)
    • resetIndexMap

      protected void resetIndexMap()
    • getLayout

      public Layout getLayout(Address addr)
    • getAddressIndexMap

      public AddressIndexMap getAddressIndexMap()
    • getFieldSelection

      public FieldSelection getFieldSelection(ProgramSelection selection)
    • setAddressSet

      public void setAddressSet(AddressSetView view)
      Sets the addresses displayed by this model's listing.
      Parameters:
      view - the addresses. These must already be compatible with the program associated with this model.