Class ListingPanel

All Implemented Interfaces:
FieldLocationListener, FieldMouseListener, FieldSelectionListener, LayoutListener, ImageObserver, MenuContainer, Serializable, Accessible

See Also:
  • Field Details Link icon

    • DEFAULT_DIVIDER_LOCATION Link icon

      public static final int DEFAULT_DIVIDER_LOCATION
      See Also:
  • Constructor Details Link icon

    • ListingPanel Link icon

      public ListingPanel(FormatManager manager)
      Constructs a new ListingPanel using the given FormatManager and ServiceProvider.
      Parameters:
      manager - the FormatManager to use.
    • ListingPanel Link icon

      public ListingPanel(FormatManager mgr, Program program)
      Constructs a new ListingPanel for the given program.
      Parameters:
      mgr - the FormatManager to use.
      program - the program for which to create a new ListingPanel
    • ListingPanel Link icon

      public ListingPanel(FormatManager mgr, ListingModel model)
      Constructs a new ListingPanel with the given FormatManager and ListingLayoutModel
      Parameters:
      mgr - the FormatManager to use
      model - the ListingLayoutModel to use.
  • Method Details Link icon

    • getPreferredSize Link icon

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • getNewWindowDefaultWidth Link icon

      protected int getNewWindowDefaultWidth()
      A width for new windows that shows a reasonable amount of the Listing
      Returns:
      the width
    • createFieldPanel Link icon

      protected FieldPanel createFieldPanel(LayoutModel model)
    • createListingModel Link icon

      protected ListingModel createListingModel(Program program)
    • createLayoutModel Link icon

      protected ListingModelAdapter createLayoutModel(ListingModel model)
    • setProgramLocationListener Link icon

      public void setProgramLocationListener(ProgramLocationListener listener)
      Sets the ProgramLocationListener. Only one listener is supported
      Parameters:
      listener - the ProgramLocationListener to use.
    • setProgramSelectionListener Link icon

      public void setProgramSelectionListener(ProgramSelectionListener listener)
      Sets the ProgramSelectionListener. Only one listener is supported
      Parameters:
      listener - the ProgramSelectionListener to use.
    • setLiveProgramSelectionListener Link icon

      public void setLiveProgramSelectionListener(ProgramSelectionListener listener)
      Sets the ProgramSelectionListener for selection changes while dragging. Only one listener is supported
      Parameters:
      listener - the ProgramSelectionListener to use.
    • setStringSelectionListener Link icon

      public void setStringSelectionListener(StringSelectionListener listener)
    • setListingModel Link icon

      public void setListingModel(ListingModel newModel)
      Sets the ListingLayoutModel to use.
      Parameters:
      newModel - the model to use.
    • getListingModel Link icon

      public ListingModel getListingModel()
      Returns the current ListingModel used by this panel.
      Returns:
      the model
    • showHeader Link icon

      public void showHeader(boolean show)
      Sets whether or not the field header component is visible at the top of the listing panel
      Parameters:
      show - if true, the header component will be show, otherwise it will be hidden.
    • getHeaderActions Link icon

      public List<DockingActionIf> getHeaderActions(String ownerName)
    • isHeaderShowing Link icon

      public boolean isHeaderShowing()
      Returns true if the field header component is showing.
      Returns:
      true if showing
    • getFieldHeader Link icon

      public FieldHeader getFieldHeader()
    • updateDisplay Link icon

      public void updateDisplay(boolean updateImmediately)
    • addMarginProvider Link icon

      public void addMarginProvider(MarginProvider provider)
      Adds the MarginProvider to this panel
      Parameters:
      provider - the MarginProvider that will provide components to display in this panel's left margin area.
    • addIndexMapChangeListener Link icon

      public void addIndexMapChangeListener(ChangeListener listener)
      Add a change listener to be notified whenever the indexMap changes.
      Parameters:
      listener - the listener to be added.
    • removeIndexMapChangeListener Link icon

      public void removeIndexMapChangeListener(ChangeListener listener)
      Removes the change listener to be notified when the indexMap changes.
      Parameters:
      listener - the listener to be removed.
    • removeMarginProvider Link icon

      public void removeMarginProvider(MarginProvider provider)
      Removes the given margin provider from this panel
      Parameters:
      provider - the MarginProvider to remove.
    • addOverviewProvider Link icon

      public void addOverviewProvider(OverviewProvider provider)
      Adds the given OverviewProvider with will be displayed in this panels right margin area.
      Parameters:
      provider - the OverviewProvider to display.
    • removeOverviewProvider Link icon

      public void removeOverviewProvider(OverviewProvider provider)
      Removes the given OverviewProvider from this panel
      Parameters:
      provider - the OverviewProvider to remove.
    • addButtonPressedListener Link icon

      public void addButtonPressedListener(ButtonPressedListener listener)
      Adds a ButtonPressedListener to be notified when the user presses the mouse button while over this panel
      Parameters:
      listener - the ButtonPressedListener to add.
    • removeButtonPressedListener Link icon

      public void removeButtonPressedListener(ButtonPressedListener listener)
      Removes the given ButtonPressedListener.
      Parameters:
      listener - the ButtonPressedListener to remove.
    • removeHighlightProvider Link icon

      public void removeHighlightProvider(ListingHighlightProvider highlightProvider)
      Removes the given ListingHighlightProvider from this listing.
      Parameters:
      highlightProvider - The provider to remove.
      See Also:
    • addHighlightProvider Link icon

      public void addHighlightProvider(ListingHighlightProvider highlightProvider)
      Adds a ListingHighlightProvider to this listing. This highlight provider will be used with any other registered providers to paint all the highlights for this listing.
      Parameters:
      highlightProvider - The provider to add
    • getFieldPanel Link icon

      public FieldPanel getFieldPanel()
      Returns the FieldPanel used by this ListingPanel.
      Returns:
      the field panel
    • layoutsChanged Link icon

      public void layoutsChanged(List<AnchoredLayout> layouts)
      Specified by:
      layoutsChanged in interface LayoutListener
    • getDividerLocation Link icon

      public int getDividerLocation()
      Returns the divider location between the left margin areas and the main display.
      Returns:
      the location
    • setDividerLocation Link icon

      public void setDividerLocation(int dividerLocation)
      Sets the divider location between the left margin areas and the main display.
      Parameters:
      dividerLocation - the location to set on the divider.
    • setListingHoverHandler Link icon

      public void setListingHoverHandler(ListingHoverProvider handler)
    • dispose Link icon

      public void dispose()
    • goTo Link icon

      public boolean goTo(ProgramLocation loc)
      Moves the cursor to the given program location and repositions the scrollbar to show that location in the screen.
      Parameters:
      loc - the location to move to.
      Returns:
      true if successful
    • goTo Link icon

      public boolean goTo(ProgramLocation loc, boolean centerWhenNotVisible)
      Moves the cursor to the given program location. Also, repositions the scrollbar to show that location, if the location is not on the screen.
      Parameters:
      loc - the location to move to.
      centerWhenNotVisible - this variable only has an effect if the given location is not on the screen. In that case, when this parameter is true, then the given location will be placed in the center of the screen; when the parameter is false, then the screen will be scrolled only enough to show the cursor.
      Returns:
      true if successful
    • scrollTo Link icon

      public void scrollTo(ProgramLocation location)
      Scroll the view of the listing to the given location.

      If the given location is not displayed, this has no effect.

      Parameters:
      location - the location
    • center Link icon

      public void center(ProgramLocation location)
      Center the view of the listing around the given location.
      Parameters:
      location - the location
    • goTo Link icon

      public boolean goTo(Address addr)
      Positions the ListingPanel to the given address.
      Parameters:
      addr - the address at which to position the listing.
      Returns:
      true if successful
    • goTo Link icon

      public boolean goTo(Address currentAddress, Address gotoAddress)
      Positions the ListingPanel to the given address.
      Parameters:
      currentAddress - used to determine which symbol to goto if the goto address has more than one
      gotoAddress - the address at which to position to listing.
      Returns:
      true if the address exists
    • buttonPressed Link icon

      public void buttonPressed(FieldLocation fieldLocation, Field field, MouseEvent mouseEvent)
      Description copied from interface: FieldMouseListener
      Called whenever the mouse button is pressed.
      Specified by:
      buttonPressed in interface FieldMouseListener
      Parameters:
      fieldLocation - the field location of the mouse pointer
      field - the Field object that was clicked on
      mouseEvent - the mouse event that generated this call.
    • setProgram Link icon

      public void setProgram(Program program)
      Sets the program to be displayed by this listing panel
      Parameters:
      program - the program to display.
    • fieldLocationChanged Link icon

      public void fieldLocationChanged(FieldLocation location, Field field, EventTrigger trigger)
      Description copied from interface: FieldLocationListener
      Called whenever the cursor position changes.
      Specified by:
      fieldLocationChanged in interface FieldLocationListener
      Parameters:
      location - the new field location.
      field - the Field object containing the location.
      trigger - the type of the location change
    • setView Link icon

      public void setView(AddressSetView view)
      Restricts the program's view to the given address set
      Parameters:
      view - the set of address to include in the view.
    • getView Link icon

      public AddressSetView getView()
      Gets the view of this listing panel (meant to be used in conjunction with setView(AddressSetView).
      Returns:
      the addresses
    • setBackgroundColorModel Link icon

      public void setBackgroundColorModel(ListingBackgroundColorModel colorModel)
      Sets the externally supplied ListingBackgroundColorModel to be blended with its own PropertyBasedBackgroundColorModel.
      Parameters:
      colorModel - the ListingBackgroundColorModel to use in conjunction with the built-in PropertyBasedBackgroundColorModel
    • setTextBackgroundColor Link icon

      public void setTextBackgroundColor(Color c)
      Sets the background color for the listing panel. This will set the background for the main listing display.
      Parameters:
      c - the color
    • getTextBackgroundColor Link icon

      public Color getTextBackgroundColor()
    • isActive Link icon

      public boolean isActive()
      Returns true if this component has focus.
      Returns:
      true if this component has focus.
    • getProgramLocation Link icon

      public ProgramLocation getProgramLocation()
      Returns the current program location of the cursor.
      Returns:
      the location
    • getProgramLocation Link icon

      public ProgramLocation getProgramLocation(Point point)
      Get a program location for the given point.
      Parameters:
      point - the point
      Returns:
      program location, or null if point does not correspond to a program location
    • getMarginProviders Link icon

      public List<MarginProvider> getMarginProviders()
      Get the margin providers in this ListingPanel.
      Returns:
      the providers
    • getOverviewProviders Link icon

      public List<OverviewProvider> getOverviewProviders()
      Get the overview providers in this ListingPanel.
      Returns:
      the providers
    • isStartDragOk Link icon

      public boolean isStartDragOk()
      Returns true if the mouse is at a location that can be dragged.
      Returns:
      true if the mouse is at a location that can be dragged.
    • setCursorPosition Link icon

      public void setCursorPosition(ProgramLocation loc)
      Sets the cursor to the given program location.
      Parameters:
      loc - the location at which to move the cursor.
    • setCursorPosition Link icon

      public void setCursorPosition(ProgramLocation loc, EventTrigger trigger)
      Sets the cursor to the given program location with a given trigger This method should only be used in automated testing to programmatically simulate a user navigating within the listing panel.
      Parameters:
      loc - the location at which to move the cursor.
      trigger - the event trigger
    • getCursorLocation Link icon

      public ProgramLocation getCursorLocation()
    • getCursorPoint Link icon

      public Point getCursorPoint()
    • getCursorBounds Link icon

      public Rectangle getCursorBounds()
    • getAddressIndexMap Link icon

      public AddressIndexMap getAddressIndexMap()
      Returns the AddressIndexMap currently used by this listing panel.
      Returns:
      the map
    • getVerticalScrollBar Link icon

      public JScrollBar getVerticalScrollBar()
      Returns the vertical scrollbar used by this panel.
      Returns:
      the scroll bar
    • getFormatManager Link icon

      public FormatManager getFormatManager()
      Returns the FormatManager used by this listing panel.
      Returns:
      the format manager
    • getLayout Link icon

      public Layout getLayout(Address addr)
    • addHoverService Link icon

      public void addHoverService(ghidra.app.plugin.core.codebrowser.hover.ListingHoverService hoverService)
    • removeHoverService Link icon

      public void removeHoverService(ghidra.app.plugin.core.codebrowser.hover.ListingHoverService hoverService)
    • setHoverMode Link icon

      public void setHoverMode(boolean enabled)
    • isHoverShowing Link icon

      public boolean isHoverShowing()
    • getProgram Link icon

      public Program getProgram()
    • getProgramSelection Link icon

      public ProgramSelection getProgramSelection()
      Returns the current program selection.
      Returns:
      the selection
    • getProgramSelection Link icon

      public ProgramSelection getProgramSelection(FieldSelection fieldSelection)
    • selectAll Link icon

      public void selectAll()
      Sets the selection to the entire listing view.
    • selectComplement Link icon

      public AddressSet selectComplement()
      Sets the selection to the complement of the current selection in the listing view.
      Returns:
      the addresses
    • setSelection Link icon

      public void setSelection(ProgramSelection sel)
      Sets the selection.
      Parameters:
      sel - the new selection
    • setSelection Link icon

      public void setSelection(ProgramSelection sel, EventTrigger trigger)
      Sets the selection.
      Parameters:
      sel - the new selection
      trigger - the cause of the change
    • setHighlight Link icon

      public void setHighlight(ProgramSelection highlight)
      Sets the highlight.
      Parameters:
      highlight - the new highlight.
    • getProgramHighlight Link icon

      public ProgramSelection getProgramHighlight()
    • selectionChanged Link icon

      public void selectionChanged(FieldSelection selection, EventTrigger trigger)
      Description copied from interface: FieldSelectionListener
      Called whenever the FieldViewer selection changes.
      Specified by:
      selectionChanged in interface FieldSelectionListener
      Parameters:
      selection - the new selection.
      trigger - indicates the cause of the selection changing
    • getTextSelection Link icon

      public String getTextSelection()
      Returns the currently selected text. The value will only be non-null for selections within a single field.
      Returns:
      the selected text or null
    • enablePropertyBasedColorModel Link icon

      public void enablePropertyBasedColorModel(boolean b)
    • setNeverSroll Link icon

      public void setNeverSroll()
      Sets listing panel to never show scroll bars. This is useful when you want this listing's parent to always be as big as this listing.
    • setFormatManager Link icon

      public void setFormatManager(FormatManager formatManager)
    • addDisplayListener Link icon

      public void addDisplayListener(AddressSetDisplayListener listener)
    • removeDisplayListener Link icon

      public void removeDisplayListener(AddressSetDisplayListener listener)
    • addFocusListener Link icon

      public void addFocusListener(FocusListener l)
      Overrides:
      addFocusListener in class Component
    • removeFocusListener Link icon

      public void removeFocusListener(FocusListener l)
      Overrides:
      removeFocusListener in class Component