Class ListingCodeComparisonPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
ghidra.features.base.codecompare.panel.CodeComparisonPanel
ghidra.features.base.codecompare.listing.ListingCodeComparisonPanel
- All Implemented Interfaces:
FormatModelListener
,OptionsChangeListener
,ExtensionPoint
,ImageObserver
,MenuContainer
,Serializable
,Accessible
public class ListingCodeComparisonPanel
extends CodeComparisonPanel
implements FormatModelListener, OptionsChangeListener
Panel that displays two listings for comparison.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class ghidra.features.base.codecompare.panel.CodeComparisonPanel
activeSide, comparisonData, HELP_TOPIC, owner, tool
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
-
Constructor Summary
ConstructorDescriptionListingCodeComparisonPanel
(String owner, PluginTool tool) Creates a comparison panel with two listings. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addHighlightProviders
(ListingHighlightProvider leftHighlightProvider, ListingHighlightProvider rightHighlightProvider) Adds the indicated highlight providers for the left and right listing panels.protected void
Notification to subclasses that the comparison data has changedvoid
dispose()
Cleans up resources when this panel is no longer neededvoid
Notifies that the given format model was changed.getActionContext
(ComponentProvider provider, MouseEvent event) Returns the context object which corresponds to the area of focus within this provider's component.Returns the actions for this panelReturns the Component for the givenDuo.Side
getContextObjectForMarginPanels
(ListingPanel panel, MouseEvent event) Gets a marker margin or overview margin context object if the mouse event occurred on one of the GUI components for the indicated listing panel's marker margin (left edge of listing) or overview margin (right edge of listing).getListingPanel
(FieldPanel fieldPanel) Gets the left or right listing panel that contains the indicated field panel.getListingPanel
(Duo.Side side) getName()
Force subclasses to supply a descriptive name.void
optionsChanged
(ToolOptions options, String optionName, Object oldValue, Object newValue) Notification that an option changed.void
removeHighlightProviders
(ListingHighlightProvider leftHighlightProvider, ListingHighlightProvider rightHighlightProvider) Removes the indicated highlight providers from the left and right listing panels.void
setLocation
(Duo.Side side, Program program, ProgramLocation location) Sets the cursor for the side to the given locationvoid
setStatusInfo
(String text) Displays the indicated text int the tool's status area.void
setSynchronizedScrolling
(boolean synchronize) Sets whether or not scrolling is synchronized.void
setVisible
(boolean b) void
Updates the enablement for all actions provided by this panel.void
Repaints both the left and right listing panels if they are visible.Methods inherited from class ghidra.features.base.codecompare.panel.CodeComparisonPanel
buildPanel, clearComparisons, getActiveSide, getAddresses, getFunction, getProgram, isSideBySide, loadComparisons, programClosed, programRestored, setActiveSide, setShowDataTitles, setSideBySide, setTitlePrefixes, setTopComponent
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, getPreferredSize, 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, 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, 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
Methods inherited from interface ghidra.app.util.viewer.format.FormatModelListener
formatModelAdded, formatModelRemoved
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
ListingCodeComparisonPanel
Creates a comparison panel with two listings.- Parameters:
owner
- the owner of this paneltool
- the tool displaying this panel
-
-
Method Details
-
getComparisonComponent
Description copied from class:CodeComparisonPanel
Returns the Component for the givenDuo.Side
- Specified by:
getComparisonComponent
in classCodeComparisonPanel
- Parameters:
side
- the Side to its component- Returns:
- the Component for the given
Duo.Side
-
getListingPanel
-
optionsChanged
public void optionsChanged(ToolOptions options, String optionName, Object oldValue, Object newValue) Description copied from interface:OptionsChangeListener
Notification that an option changed.Note: to reject an options change, you can throw a
OptionsVetoException
.- Specified by:
optionsChanged
in interfaceOptionsChangeListener
- Parameters:
options
- options object containing the property that changedoptionName
- name of option that changedoldValue
- old value of the optionnewValue
- new value of the option
-
getName
Description copied from class:CodeComparisonPanel
Force subclasses to supply a descriptive name.- Specified by:
getName
in classCodeComparisonPanel
- Returns:
- a descriptive name for this panel type
-
setVisible
public void setVisible(boolean b) - Overrides:
setVisible
in classJComponent
-
addHighlightProviders
public void addHighlightProviders(ListingHighlightProvider leftHighlightProvider, ListingHighlightProvider rightHighlightProvider) Adds the indicated highlight providers for the left and right listing panels.- Parameters:
leftHighlightProvider
- the highlight provider for the left side's listing.rightHighlightProvider
- the highlight provider for the right side's listing.
-
removeHighlightProviders
public void removeHighlightProviders(ListingHighlightProvider leftHighlightProvider, ListingHighlightProvider rightHighlightProvider) Removes the indicated highlight providers from the left and right listing panels.- Parameters:
leftHighlightProvider
- the highlight provider for the left side's listing.rightHighlightProvider
- the highlight provider for the right side's listing.
-
getActions
Description copied from class:CodeComparisonPanel
Returns the actions for this panel- Overrides:
getActions
in classCodeComparisonPanel
- Returns:
- an array of docking actions
-
updateActionEnablement
public void updateActionEnablement()Updates the enablement for all actions provided by this panel.- Specified by:
updateActionEnablement
in classCodeComparisonPanel
-
setLocation
Sets the cursor for the side to the given location- Parameters:
side
- The side to gotoprogram
- the side's programlocation
- the location
-
getActiveListingPanel
-
dispose
public void dispose()Description copied from class:CodeComparisonPanel
Cleans up resources when this panel is no longer needed- Specified by:
dispose
in classCodeComparisonPanel
-
getActionContext
Description copied from class:CodeComparisonPanel
Returns the context object which corresponds to the area of focus within this provider's component. Null is returned when there is no context.- Specified by:
getActionContext
in classCodeComparisonPanel
- Parameters:
provider
- the provider that includes this code comparison component.event
- mouse event which corresponds to this request. May be null for key-stroke or other non-mouse event.- Returns:
- the action context for the area of focus in this component.
-
updateListings
public void updateListings()Repaints both the left and right listing panels if they are visible. -
formatModelChanged
Description copied from interface:FormatModelListener
Notifies that the given format model was changed.- Specified by:
formatModelChanged
in interfaceFormatModelListener
- Parameters:
model
- the model that was changed.
-
getListingPanel
Gets the left or right listing panel that contains the indicated field panel.- Parameters:
fieldPanel
- the field panel- Returns:
- the listing panel or null.
-
setStatusInfo
Displays the indicated text int the tool's status area.- Parameters:
text
- the message to display
-
getContextObjectForMarginPanels
Gets a marker margin or overview margin context object if the mouse event occurred on one of the GUI components for the indicated listing panel's marker margin (left edge of listing) or overview margin (right edge of listing).- Parameters:
panel
- The listing panel to checkevent
- the mouse event- Returns:
- a marker margin context object if the event was on a margin.
-
setSynchronizedScrolling
public void setSynchronizedScrolling(boolean synchronize) Description copied from class:CodeComparisonPanel
Sets whether or not scrolling is synchronized.- Specified by:
setSynchronizedScrolling
in classCodeComparisonPanel
- Parameters:
synchronize
- true means synchronize scrolling between the two views.
-
comparisonDataChanged
protected void comparisonDataChanged()Description copied from class:CodeComparisonPanel
Notification to subclasses that the comparison data has changed- Specified by:
comparisonDataChanged
in classCodeComparisonPanel
-