Package ghidra.app.util.viewer.multilisting

# Class MultiListingLayoutModel

java.lang.Object
ghidra.app.util.viewer.multilisting.MultiListingLayoutModel

All Implemented Interfaces:
  `FormatModelListener`, `ListingModelListener`

public class MultiListingLayoutModel extends Object implements ListingModelListener, FormatModelListener
Class for creating multiple coordinated ListingModels for multiple programs.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MultiListingLayoutModel(FormatManager formatMgr, Program[] programs, AddressSetView primaryAddrSet)`
  Constructs a new MultiListingLayoutModel.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `dataChanged(boolean updateImmediately)`
  Called when the data at an index or range of indexes changes.
  `void`
  `formatModelChanged(FieldFormatModel model)`
  Notifies that the given format model was changed.
  `ListingModel`
  `getAlignedModel(int index)`
  Returns the ListingLayoutModel for the i'th program.
  `ListingModel`
  `getModel(int index)`
  Returns the ListingModel for the program with the indicated index.
  `void`
  `modelSizeChanged()`
  Called whenever the number of indexes changed
  `void`
  `setAddressSet(AddressSetView view)`
  Sets the address set for this MultiListingLayoutModel
  `void`
  `setAddressTranslator(AddressTranslator translator)`

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

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

  ### Methods inherited from interface ghidra.app.util.viewer.format.FormatModelListener

  `formatModelAdded, formatModelRemoved`

- ## Constructor Details

  - ### MultiListingLayoutModel

    public MultiListingLayoutModel(FormatManager formatMgr, Program[] programs, AddressSetView primaryAddrSet)
    Constructs a new MultiListingLayoutModel.
    Parameters:
      `formatMgr` - the FormatManager used to layout the fields.
      `programs` - the list of programs that will be coordinated using listing models. The first program in the array will be used as the primary program.
      `primaryAddrSet` - the addressSet to use for the view. This is compatible with the primary program, which is program[0].

- ## Method Details

  - ### getAlignedModel

    public ListingModel getAlignedModel(int index)
    Returns the ListingLayoutModel for the i'th program.
    Parameters:
      `index` - the index of program for which to return a listing model
    Returns:
      the ListingLayoutModel for the i'th program.

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

  - ### formatModelChanged

    public void formatModelChanged(FieldFormatModel model)
    Description copied from interface: `FormatModelListener`
    Notifies that the given format model was changed.
    Specified by:
      `formatModelChanged` in interface `FormatModelListener`
    Parameters:
      `model` - the model that was changed.

  - ### getModel

    public ListingModel getModel(int index)
    Returns the ListingModel for the program with the indicated index.
    Parameters:
      `index` - the index indicating which program's model to get.
    Returns:
      the program's ListingModel.

  - ### setAddressTranslator

    public void setAddressTranslator(AddressTranslator translator)

  - ### setAddressSet

    public void setAddressSet(AddressSetView view)
    Sets the address set for this MultiListingLayoutModel
    Parameters:
      `view` - the current address set, which must be compatible with the primary program and listingModel