Package ghidra.app.services
Interface CodeViewerService
public interface CodeViewerService
Service provided by a plugin that shows the listing from a Program, i.e., a
Code Viewer. The service allows other plugins to add components and
actions local to the Code Viewer.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener that is notified when a mouse button is pressed.void
Adds a listener to be notified when the set of visible addresses change.void
addLocalAction
(DockingAction action) Add an action that is local to the Code Viewer.void
addMarginProvider
(MarginProvider marginProvider) Add a provider that shows markers in a program for the portion that is visible.void
addOverviewProvider
(OverviewProvider overviewProvider) Add a provider that shows an overview of the program.void
addProgramDropProvider
(ProgramDropProvider provider) Add a provider that will be notified for drag and drop actions.Returns the current address-index-mapReturns 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).Return the fieldPanel.Gets the current ListingLayoutModel;Get the main Listing panel for the code viewer service.Gets the navigatable for the code viewer service.getView()
Get Current view that the CodeViewer is showing.boolean
goTo
(ProgramLocation loc, boolean centerOnScreen) Commands the code viewer to position the cursor at the given location.void
Remove the button pressed listener.void
removeHighlightProvider
(ListingHighlightProvider provider, Program program) Remove the highlight provider.void
Removes listener from being notified when the set of visible addresses change.void
removeListingPanel
(ListingPanel listingPanel) Remove the given listing panel from the code viewer.void
removeLocalAction
(DockingAction action) Remove the local action from the Code Viewer.void
removeMarginProvider
(MarginProvider marginProvider) Remove a provider that shows markers in a program for the portion that is visible.void
removeOverviewProvider
(OverviewProvider overviewProvider) Remove a provider that shows an overview of the program.void
Request that the main connected Listing view gets focusvoid
Set theCoordinatedListingPanelListener
for this listing.void
setHighlightProvider
(ListingHighlightProvider provider, Program program) Set the highlight provider.void
setListingPanel
(ListingPanel listingPanel) Set a listing panel on the code viewer.void
setNorthComponent
(JComponent comp) Place a component in the North area of the CodeViewer.void
tells the browser to rebuild the display.
-
Method Details
-
addOverviewProvider
Add a provider that shows an overview of the program.- Parameters:
overviewProvider
- provider to add
-
removeOverviewProvider
Remove a provider that shows an overview of the program.- Parameters:
overviewProvider
- provider to remove
-
addMarginProvider
Add a provider that shows markers in a program for the portion that is visible.- Parameters:
marginProvider
- provider to add
-
removeMarginProvider
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
-
-
removeButtonPressedListener
Remove the button pressed listener.- Parameters:
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.- Parameters:
listingPanel
- the panel to add.
-
setCoordinatedListingPanelListener
Set theCoordinatedListingPanelListener
for this listing.- Parameters:
listener
- the listener to add.
-
removeListingPanel
Remove the given listing panel from the code viewer. -
getView
AddressSetView getView()Get Current view 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
FieldPanel getFieldPanel()Return the fieldPanel. -
getAddressIndexMap
AddressIndexMap getAddressIndexMap()Returns the current address-index-map -
getFormatManager
FormatManager getFormatManager() -
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
-