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.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsFields inherited from class ghidra.features.base.codecompare.panel.CodeComparisonPanel
activeSide, comparisonData, HELP_TOPIC, owner, toolFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionListingCodeComparisonPanel(String owner, PluginTool tool) Creates a comparison panel with two listings. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHighlightProviders(ListingHighlightProvider leftHighlightProvider, ListingHighlightProvider rightHighlightProvider) Adds the indicated highlight providers for the left and right listing panels.protected voidNotification to subclasses that the comparison data has changedvoiddispose()Cleans up resources when this panel is no longer neededvoidNotifies 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.SidegetContextObjectForMarginPanels(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.voidoptionsChanged(ToolOptions options, String optionName, Object oldValue, Object newValue) Notification that an option changed.voidremoveHighlightProviders(ListingHighlightProvider leftHighlightProvider, ListingHighlightProvider rightHighlightProvider) Removes the indicated highlight providers from the left and right listing panels.voidsetLocation(Duo.Side side, Program program, ProgramLocation location) Sets the cursor for the side to the given locationvoidsetStatusInfo(String text) Displays the indicated text int the tool's status area.voidsetSynchronizedScrolling(boolean synchronize) Sets whether or not scrolling is synchronized.voidsetVisible(boolean b) voidUpdates the enablement for all actions provided by this panel.voidRepaints 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, getTool, isSideBySide, loadComparisons, programClosed, programRestored, setActiveSide, setShowDataTitles, setSideBySide, setTitlePrefixes, setTopComponentMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:CodeComparisonPanelReturns the Component for the givenDuo.Side- Specified by:
getComparisonComponentin 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:OptionsChangeListenerNotification that an option changed.Note: to reject an options change, you can throw a
OptionsVetoException.- Specified by:
optionsChangedin 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:CodeComparisonPanelForce subclasses to supply a descriptive name.- Specified by:
getNamein classCodeComparisonPanel- Returns:
- a descriptive name for this panel type
-
setVisible
public void setVisible(boolean b) - Overrides:
setVisiblein 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:CodeComparisonPanelReturns the actions for this panel- Overrides:
getActionsin classCodeComparisonPanel- Returns:
- an array of docking actions
-
updateActionEnablement
public void updateActionEnablement()Updates the enablement for all actions provided by this panel.- Specified by:
updateActionEnablementin 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:CodeComparisonPanelCleans up resources when this panel is no longer needed- Specified by:
disposein classCodeComparisonPanel
-
getActionContext
Description copied from class:CodeComparisonPanelReturns 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:
getActionContextin 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:FormatModelListenerNotifies that the given format model was changed.- Specified by:
formatModelChangedin 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:CodeComparisonPanelSets whether or not scrolling is synchronized.- Specified by:
setSynchronizedScrollingin classCodeComparisonPanel- Parameters:
synchronize- true means synchronize scrolling between the two views.
-
comparisonDataChanged
protected void comparisonDataChanged()Description copied from class:CodeComparisonPanelNotification to subclasses that the comparison data has changed- Specified by:
comparisonDataChangedin classCodeComparisonPanel
-