Class ListingPanel

    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JPanel

        javax.swing.JPanel.AccessibleJPanel
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_DIVIDER_LOCATION  
      • Fields inherited from class javax.swing.JComponent

        listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • Fields inherited from class java.awt.Component

        accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addButtonPressedListener​(ButtonPressedListener listener)
      Adds a ButtonPressedListener to be notified when the user presses the mouse button while over this panel
      void addHighlightProvider​(HighlightProvider highlightProvider)
      Adds a HighlightProvider to this listing.
      void addHoverService​(ghidra.app.plugin.core.codebrowser.hover.ListingHoverService hoverService)  
      void addIndexMapChangeListener​(javax.swing.event.ChangeListener listener)
      Add a change listener to be notified whenever the indexMap changes.
      void addMarginProvider​(MarginProvider provider)
      Adds the MarginProvider to this panel
      void addOverviewProvider​(OverviewProvider provider)
      Adds the given OverviewProvider with will be displayed in this panels right margin area.
      void buttonPressed​(FieldLocation fieldLocation, Field field, java.awt.event.MouseEvent mouseEvent)
      Called whenever the mouse button is pressed.
      void center​(ProgramLocation location)
      Center the view of the listing around the given location.
      protected FieldPanel createFieldPanel​(LayoutModel model)  
      protected ListingModelAdapter createLayoutModel​(ListingModel model)  
      protected ListingModel createListingModel​(Program program)  
      void dispose()  
      void enablePropertyBasedColorModel​(boolean b)  
      void fieldLocationChanged​(FieldLocation location, Field field, EventTrigger trigger)
      Called whenever the cursor position changes.
      AddressIndexMap getAddressIndexMap()
      Returns the AddressIndexMap currently used by this listing panel.
      java.awt.Rectangle getCursorBounds()  
      ProgramLocation getCursorLocation()  
      java.awt.Point getCursorPoint()  
      int getDividerLocation()
      Returns the divider location between the left margin areas and the main display.
      FieldHeader getFieldHeader()  
      FieldPanel getFieldPanel()
      Returns the FieldPanel used by this ListingPanel.
      FormatManager getFormatManager()
      Returns the FormatManager used by this listing panel.
      java.util.List<DockingActionIf> getHeaderActions​(java.lang.String ownerName)  
      Layout getLayout​(Address addr)  
      ListingModel getListingModel()
      Returns the current ListingModel used by this panel.
      java.util.List<MarginProvider> getMarginProviders()
      Get the margin providers in this ListingPanel.
      protected int getNewWindowDefaultWidth()
      A width for new windows that shows a reasonable amount of the Listing
      java.util.List<OverviewProvider> getOverviewProviders()
      Get the overview providers in this ListingPanel.
      java.awt.Dimension getPreferredSize()  
      Program getProgram()  
      ProgramSelection getProgramHighlight()  
      ProgramLocation getProgramLocation()
      Returns the current program location of the cursor.
      ProgramLocation getProgramLocation​(java.awt.Point point)
      Get a program location for the given point.
      ProgramSelection getProgramSelection()
      Returns the current program selection.
      ProgramSelection getProgramSelection​(FieldSelection fieldSelection)  
      java.awt.Color getTextBackgroundColor()  
      javax.swing.JScrollBar getVerticalScrollBar()
      Returns the vertical scrollbar used by this panel.
      AddressSetView getView()
      Gets the view of this listing panel (meant to be used in conjunction with setView(AddressSetView).
      boolean goTo​(Address addr)
      Positions the ListingPanel to the given address.
      boolean goTo​(Address currentAddress, Address gotoAddress)
      Positions the ListingPanel to the given address.
      boolean goTo​(ProgramLocation loc)
      Moves the cursor to the given program location and repositions the scrollbar to show that location in the screen.
      boolean goTo​(ProgramLocation loc, boolean centerWhenNotVisible)
      Moves the cursor to the given program location.
      boolean isActive()
      Returns true if this component has focus.
      boolean isHeaderShowing()
      Returns true if the field header component is showing.
      boolean isHoverShowing()  
      boolean isStartDragOk()
      Returns true if the mouse is at a location that can be dragged.
      void layoutsChanged​(java.util.List<AnchoredLayout> layouts)  
      void removeButtonPressedListener​(ButtonPressedListener listener)
      Removes the given ButtonPressedListener.
      void removeHighlightProvider​(HighlightProvider highlightProvider)
      Removes the given HighlightProvider from this listing.
      void removeHoverService​(ghidra.app.plugin.core.codebrowser.hover.ListingHoverService hoverService)  
      void removeIndexMapChangeListener​(javax.swing.event.ChangeListener listener)
      Removes the change listener to be notified when the indexMap changes.
      void removeMarginProvider​(MarginProvider provider)
      Removes the given margin provider from this panel
      void removeOverviewProvider​(OverviewProvider provider)
      Removes the given OverviewProvider from this panel
      void scrollTo​(ProgramLocation location)
      Scroll the view of the listing to the given location.
      void selectAll()
      Sets the selection to the entire listing view.
      AddressSet selectComplement()
      Sets the selection to the complement of the current selection in the listing view.
      void selectionChanged​(FieldSelection selection, EventTrigger trigger)
      Called whenever the FieldViewer selection changes.
      void setBackgroundColorModel​(ListingBackgroundColorModel colorModel)
      Sets the externally supplied ListingBackgroundColorModel to be blended with its own PropertyBasedBackgroundColorModel.
      void setCursorPosition​(ProgramLocation loc)
      Sets the cursor to the given program location.
      void setDividerLocation​(int dividerLocation)
      Sets the divider location between the left margin areas and the main display.
      void setFormatManager​(FormatManager formatManager)  
      void setHighlight​(ProgramSelection highlight)
      Sets the highlight.
      void setHoverMode​(boolean enabled)  
      void setListingHoverHandler​(ListingHoverProvider handler)  
      void setListingModel​(ListingModel newModel)
      Sets the ListingLayoutModel to use.
      void setNeverSroll()
      Sets listing panel to never show scroll bars.
      void setProgram​(Program program)
      Sets the program to be displayed by this listing panel
      void setProgramLocationListener​(ProgramLocationListener listener)
      Sets the ProgramLocationListener.
      void setProgramSelectionListener​(ProgramSelectionListener listener)
      Sets the ProgramSelectionListener.
      void setSelection​(ProgramSelection sel)
      Sets the selection.
      void setStringSelectionListener​(StringSelectionListener listener)  
      void setTextBackgroundColor​(java.awt.Color c)
      Sets the background color for the listing panel.
      void setView​(AddressSetView view)
      Restricts the program's view to the given address set
      void showHeader​(boolean show)
      Sets whether or not the field header component is visible at the top of the listing panel
      void updateDisplay​(boolean updateImmediately)  
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_DIVIDER_LOCATION

        public static final int DEFAULT_DIVIDER_LOCATION
        See Also:
        Constant Field Values
    • Constructor Detail

      • ListingPanel

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

        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

        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 Detail

      • getPreferredSize

        public java.awt.Dimension getPreferredSize()
        Overrides:
        getPreferredSize in class javax.swing.JComponent
      • getNewWindowDefaultWidth

        protected int getNewWindowDefaultWidth()
        A width for new windows that shows a reasonable amount of the Listing
      • setProgramLocationListener

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

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

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

        public ListingModel getListingModel()
        Returns the current ListingModel used by this panel.
      • showHeader

        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

        public java.util.List<DockingActionIf> getHeaderActions​(java.lang.String ownerName)
      • isHeaderShowing

        public boolean isHeaderShowing()
        Returns true if the field header component is showing.
      • updateDisplay

        public void updateDisplay​(boolean updateImmediately)
      • addMarginProvider

        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

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

        public void removeIndexMapChangeListener​(javax.swing.event.ChangeListener listener)
        Removes the change listener to be notified when the indexMap changes.
        Parameters:
        listener - the listener to be removed.
      • removeMarginProvider

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

        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

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

        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

        public void removeButtonPressedListener​(ButtonPressedListener listener)
        Removes the given ButtonPressedListener.
        Parameters:
        listener - the ButtonPressedListener to remove.
      • addHighlightProvider

        public void addHighlightProvider​(HighlightProvider highlightProvider)
        Adds a HighlightProvider 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

        public FieldPanel getFieldPanel()
        Returns the FieldPanel used by this ListingPanel.
      • getDividerLocation

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

        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.
      • dispose

        public void dispose()
      • goTo

        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.
      • goTo

        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.
      • scrollTo

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

        public void center​(ProgramLocation location)
        Center the view of the listing around the given location.
      • goTo

        public boolean goTo​(Address addr)
        Positions the ListingPanel to the given address.
        Parameters:
        addr - the address at which to position the listing.
      • goTo

        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

        public void buttonPressed​(FieldLocation fieldLocation,
                                  Field field,
                                  java.awt.event.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

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

        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.
      • setTextBackgroundColor

        public void setTextBackgroundColor​(java.awt.Color c)
        Sets the background color for the listing panel. This will set the background for the main listing display.
      • getTextBackgroundColor

        public java.awt.Color getTextBackgroundColor()
      • isActive

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

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

        public ProgramLocation getProgramLocation​(java.awt.Point point)
        Get a program location for the given point.
        Returns:
        program location, or null if point does not correspond to a program location
      • getMarginProviders

        public java.util.List<MarginProvider> getMarginProviders()
        Get the margin providers in this ListingPanel.
      • getOverviewProviders

        public java.util.List<OverviewProvider> getOverviewProviders()
        Get the overview providers in this ListingPanel.
      • isStartDragOk

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

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

        public java.awt.Point getCursorPoint()
      • getCursorBounds

        public java.awt.Rectangle getCursorBounds()
      • getAddressIndexMap

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

        public javax.swing.JScrollBar getVerticalScrollBar()
        Returns the vertical scrollbar used by this panel.
      • getFormatManager

        public FormatManager getFormatManager()
        Returns the FormatManager used by this listing panel.
      • addHoverService

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

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

        public void setHoverMode​(boolean enabled)
      • isHoverShowing

        public boolean isHoverShowing()
      • getProgram

        public Program getProgram()
      • getProgramSelection

        public ProgramSelection getProgramSelection()
        Returns the current program selection.
      • selectAll

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

        public AddressSet selectComplement()
        Sets the selection to the complement of the current selection in the listing view.
      • setSelection

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

        public void setHighlight​(ProgramSelection highlight)
        Sets the highlight.
        Parameters:
        highlight - the new highlight.
      • enablePropertyBasedColorModel

        public void enablePropertyBasedColorModel​(boolean b)
      • setNeverSroll

        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

        public void setFormatManager​(FormatManager formatManager)