Package ghidra.app.services
Interface CodeViewerService
- All Known Subinterfaces:
DebuggerListingService
public interface CodeViewerService
Service provided by a plugin that shows the Code Viewer listing for a Program. The service
allows other plugins to add components and actions local to the Code Viewer.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a listener that is notified when a mouse button is pressed.voidAdds a listener to be notified when the set of visible addresses change.voidaddLocalAction(DockingAction action) Add an action that is local to the Code Viewer.voidaddMarginProvider(ListingMarginProvider marginProvider) Deprecated, for removal: This API element is subject to removal in a future version.voidaddOverviewProvider(ListingOverviewProvider overviewProvider) Add a provider that shows an overview of the program.voidaddProgramDropProvider(ProgramDropProvider provider) Add a provider that will be notified for drag and drop actions.Returns the current address index map..Returns the current field under the cursor.Returns a String representing the current character-based selection of the currently selected field.Returns the current cursor location.Returns the current program selection (which crosses multiple fields).Deprecated, for removal: This API element is subject to removal in a future version.usegetListingPanel()to get the field panelReturns the format manager..Gets the current ListingLayoutModel;Get the main Listing panel for the code viewer service.Gets the navigatable for the code viewer service.getView()booleangoTo(ProgramLocation loc, boolean centerOnScreen) Commands the code viewer to position the cursor at the given location.voidRemove the button pressed listener.voidremoveHighlightProvider(ListingHighlightProvider provider, Program program) Remove the highlight provider.voidRemoves listener from being notified when the set of visible addresses change.voidremoveListingPanel(ListingPanel listingPanel) Remove the given listing panel from the code viewer.voidremoveLocalAction(DockingAction action) Remove the local action from the Code Viewer.voidremoveMarginProvider(ListingMarginProvider marginProvider) Deprecated, for removal: This API element is subject to removal in a future version.clients that wish to be margin providers should now create aListingMarginProviderService.voidremoveOverviewProvider(ListingOverviewProvider overviewProvider) Remove a provider that shows an overview of the program.voidRequest that the main connected Listing view gets focusvoidSet theCoordinatedListingPanelListenerfor this listing.voidsetHighlightProvider(ListingHighlightProvider provider, Program program) Set the highlight provider.voidsetListingPanel(ListingPanel listingPanel) Set a listing panel on the code viewer.voidsetNorthComponent(JComponent comp) Place a component in the North area of the CodeViewer.voidtells the browser to rebuild the display.
-
Method Details
-
addOverviewProvider
Add a provider that shows an overview of the program.Note: the provider passed here will only appear in the primary code viewer, not in any of the snapshot windows. to have an overview provider appear in all windows, you must create a
ListingOverviewProviderServiceimplementation instead of using this method.- Parameters:
overviewProvider- provider to add
-
removeOverviewProvider
Remove a provider that shows an overview of the program.- Parameters:
overviewProvider- provider to remove- See Also:
-
addMarginProvider
@Deprecated(since="12.1", forRemoval=true) void addMarginProvider(ListingMarginProvider marginProvider) Deprecated, for removal: This API element is subject to removal in a future version.clients that wish to be margin providers should now create aListingMarginProviderService.Add a provider that shows markers in a program for the portion that is visible.- Parameters:
marginProvider- provider to add
-
removeMarginProvider
@Deprecated(since="12.1", forRemoval=true) void removeMarginProvider(ListingMarginProvider marginProvider) Deprecated, for removal: This API element is subject to removal in a future version.clients that wish to be margin providers should now create aListingMarginProviderService.Remove a provider that shows markers in a program for the portion that is visible.- Parameters:
marginProvider- provider to remove
-
addLocalAction
Add an action that is local to the Code Viewer.- Parameters:
action- local action to add
-
removeLocalAction
Remove the local action from the Code Viewer.- Parameters:
action- local action to remove
-
addProgramDropProvider
Add a provider that will be notified for drag and drop actions.- Parameters:
provider- for drag and drop
-
addButtonPressedListener
Add a listener that is notified when a mouse button is pressed.- Parameters:
listener- the listener
-
removeButtonPressedListener
Remove the button pressed listener.- Parameters:
listener- the listener
-
setHighlightProvider
Set the highlight provider. The existing provider is replaced with the given provider.- Parameters:
provider- The provider to set.program- The program with which to associate the given provider.
-
removeHighlightProvider
Remove the highlight provider.- Parameters:
provider- the provider to remove.program- the program associated with the given provider.
-
setListingPanel
Set a listing panel on the code viewer. The given listing panel is a secondary listing panel to be displayed along with the primary listing panel.- Parameters:
listingPanel- the panel to add.
-
setCoordinatedListingPanelListener
Set theCoordinatedListingPanelListenerfor this listing.- Parameters:
listener- the listener to add.
-
removeListingPanel
Remove the given listing panel from the code viewer.- Parameters:
listingPanel- the listing panel
-
getView
AddressSetView getView()- Returns:
- the current set of addresses that the CodeViewer is showing.}
-
goTo
Commands the code viewer to position the cursor at the given location.- Parameters:
loc- the location at which to position the cursor.centerOnScreen- if true, the location will be placed in the center of the display window- Returns:
- true if the location exists.
-
getFieldPanel
Deprecated, for removal: This API element is subject to removal in a future version.usegetListingPanel()to get the field panelReturns the current field panel.- Returns:
- the current field panel.
-
getAddressIndexMap
AddressIndexMap getAddressIndexMap()Returns the current address index map..- Returns:
- the current address index map.
-
getFormatManager
FormatManager getFormatManager()Returns the format manager..- Returns:
- the format manager.
-
setNorthComponent
Place a component in the North area of the CodeViewer.- Parameters:
comp- component to place in the North area of the CodeViewer
-
updateDisplay
void updateDisplay()tells the browser to rebuild the display. -
getListingModel
ListingModel getListingModel()Gets the current ListingLayoutModel;- Returns:
- the current ListingLayoutModel;
-
getListingPanel
ListingPanel getListingPanel()Get the main Listing panel for the code viewer service.- Returns:
- the listing panel.
-
getCurrentFieldTextSelection
String getCurrentFieldTextSelection()Returns a String representing the current character-based selection of the currently selected field. If there is no selection, or if there is aProgramSelection(which spans multiple fields), then this method will return null.To know which field contains the selection,
- Returns:
- the currently selected text within a given field
-
getCurrentField
Field getCurrentField()Returns the current field under the cursor.- Returns:
- the current field under the cursor.
-
getCurrentLocation
ProgramLocation getCurrentLocation()Returns the current cursor location.- Returns:
- the current cursor location.
-
getCurrentSelection
ProgramSelection getCurrentSelection()Returns the current program selection (which crosses multiple fields).- Returns:
- the current program selection.
-
addListingDisplayListener
Adds a listener to be notified when the set of visible addresses change.- Parameters:
listener- the listener to be notified;
-
removeListingDisplayListener
Removes listener from being notified when the set of visible addresses change.- Parameters:
listener- the listener to be notified;
-
requestFocus
void requestFocus()Request that the main connected Listing view gets focus
-
ListingMarginProviderService.