Package ghidra.app.nav
Interface Navigatable
-
- All Known Implementing Classes:
NavigatableComponentProviderAdapter
public interface Navigatable
Interface for ComponentProviders to implement if they support basic navigation and selection capabilities. Implementing this interface will provide the provider with navigation history and actions that require navigation or selection. (Search Text, Search Memory, Select bytes, Select instructions, etc.)
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_NAVIGATABLE_ID
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addNavigatableListener(NavigatableRemovalListener listener)
Adds a listener to be notified if this Navigatable is terminatedProgramSelection
getHighlight()
Returns the current highlight of this Navigatablelong
getInstanceID()
ProgramLocation
getLocation()
Returns the current location of this NavigatableLocationMemento
getMemento()
Returns the view state for this navigatablejavax.swing.Icon
getNavigatableIcon()
Returns an icon that represents this NavigatableProgram
getProgram()
Returns the current Program of this NavigatableProgramSelection
getSelection()
Returns the current selection of this Navigatablejava.lang.String
getTextSelection()
Returns the current text selection or nullboolean
goTo(Program program, ProgramLocation location)
Commands this navigatable to goto (display) the given program and locationboolean
isConnected()
Returns true if this Navigatable is "connected".boolean
isDisposed()
Returns true if this navigatable is no longer valid, false if it is still goodboolean
isVisible()
Returns true if this provider is visiblevoid
removeHighlightProvider(HighlightProvider highlightProvider, Program program)
Removes the given highlight provider for the given programvoid
removeNavigatableListener(NavigatableRemovalListener listener)
Removes a listener to be notified if this Navigatable is terminated.void
requestFocus()
Tells this provider to request focus.void
setHighlight(ProgramSelection highlight)
Tells this Navigatable to set its highlight to the given highlightvoid
setHighlightProvider(HighlightProvider highlightProvider, Program program)
Set the highlight provider for the given programvoid
setMemento(LocationMemento memento)
Sets the view state for this navigatable.void
setSelection(ProgramSelection selection)
Tells this Navigatable to set its selection to the given selectionboolean
supportsHighlight()
Returns true if this navigatable supports highlightingboolean
supportsMarkers()
Currently only the 'connected' windows support markers
-
-
-
Field Detail
-
DEFAULT_NAVIGATABLE_ID
static final long DEFAULT_NAVIGATABLE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstanceID
long getInstanceID()
-
goTo
boolean goTo(Program program, ProgramLocation location)
Commands this navigatable to goto (display) the given program and location- Parameters:
program
- the programlocation
- the location in that program to display- Returns:
- true if the goto was successful
-
getLocation
ProgramLocation getLocation()
Returns the current location of this Navigatable- Returns:
- the current location of this Navigatable
-
getProgram
Program getProgram()
Returns the current Program of this Navigatable- Returns:
- the current Program of this Navigatable
-
getMemento
LocationMemento getMemento()
Returns the view state for this navigatable- Returns:
- the view state for this navigatable
-
setMemento
void setMemento(LocationMemento memento)
Sets the view state for this navigatable. This is used later to restore the view state.- Parameters:
memento
- the state of this navigatable
-
getNavigatableIcon
javax.swing.Icon getNavigatableIcon()
Returns an icon that represents this Navigatable- Returns:
- the icon
-
isConnected
boolean isConnected()
Returns true if this Navigatable is "connected". Navigatables are connected if they produce and consume location and selection events.- Returns:
- true if this Navigatable is "connected"
-
supportsMarkers
boolean supportsMarkers()
Currently only the 'connected' windows support markers- Returns:
- true if this navigatable supports markers
-
requestFocus
void requestFocus()
Tells this provider to request focus.
-
isVisible
boolean isVisible()
Returns true if this provider is visible- Returns:
- true if visible
-
setSelection
void setSelection(ProgramSelection selection)
Tells this Navigatable to set its selection to the given selection- Parameters:
selection
- the selection to set.
-
setHighlight
void setHighlight(ProgramSelection highlight)
Tells this Navigatable to set its highlight to the given highlight- Parameters:
highlight
- the highlight to set.
-
getSelection
ProgramSelection getSelection()
Returns the current selection of this Navigatable- Returns:
- the current selection of this Navigatable
-
getHighlight
ProgramSelection getHighlight()
Returns the current highlight of this Navigatable- Returns:
- the current highlight of this Navigatable
-
getTextSelection
java.lang.String getTextSelection()
Returns the current text selection or null- Returns:
- the text selection
-
addNavigatableListener
void addNavigatableListener(NavigatableRemovalListener listener)
Adds a listener to be notified if this Navigatable is terminated- Parameters:
listener
- the listener to be notified when this Navigatable is closed
-
removeNavigatableListener
void removeNavigatableListener(NavigatableRemovalListener listener)
Removes a listener to be notified if this Navigatable is terminated.- Parameters:
listener
- the listener that no longer should be notified when this Navigatable is closed.
-
isDisposed
boolean isDisposed()
Returns true if this navigatable is no longer valid, false if it is still good- Returns:
- true if this navigatable is no longer valid, false if it is still good
-
supportsHighlight
boolean supportsHighlight()
Returns true if this navigatable supports highlighting- Returns:
- true if this navigatable supports highlighting
-
setHighlightProvider
void setHighlightProvider(HighlightProvider highlightProvider, Program program)
Set the highlight provider for the given program- Parameters:
highlightProvider
- the providerprogram
- the program
-
removeHighlightProvider
void removeHighlightProvider(HighlightProvider highlightProvider, Program program)
Removes the given highlight provider for the given program- Parameters:
highlightProvider
- the providerprogram
- the program
-
-