Package ghidra.app.nav
Interface Navigatable
-
- All Known Implementing Classes:
NavigatableComponentProviderAdapter
public interface NavigatableInterface 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 longDEFAULT_NAVIGATABLE_ID
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddNavigatableListener(NavigatableRemovalListener listener)Adds a listener to be notified if this Navigatable is terminatedProgramSelectiongetHighlight()Returns the current highlight of this NavigatablelonggetInstanceID()ProgramLocationgetLocation()Returns the current location of this NavigatableLocationMementogetMemento()Returns the view state for this navigatablejavax.swing.IcongetNavigatableIcon()Returns an icon that represents this NavigatableProgramgetProgram()Returns the current Program of this NavigatableProgramSelectiongetSelection()Returns the current selection of this Navigatablejava.lang.StringgetTextSelection()Returns the current text selection or nullbooleangoTo(Program program, ProgramLocation location)Commands this navigatable to goto (display) the given program and locationbooleanisConnected()Returns true if this Navigatable is "connected".booleanisDisposed()Returns true if this navigatable is no longer valid, false if it is still goodbooleanisVisible()Returns true if this provider is visiblevoidremoveHighlightProvider(HighlightProvider highlightProvider, Program program)Removes the given highlight provider for the given programvoidremoveNavigatableListener(NavigatableRemovalListener listener)Removes a listener to be notified if this Navigatable is terminated.voidrequestFocus()Tells this provider to request focus.voidsetHighlight(ProgramSelection highlight)Tells this Navigatable to set its highlight to the given highlightvoidsetHighlightProvider(HighlightProvider highlightProvider, Program program)Set the highlight provider for the given programvoidsetMemento(LocationMemento memento)Sets the view state for this navigatable.voidsetSelection(ProgramSelection selection)Tells this Navigatable to set its selection to the given selectionbooleansupportsHighlight()Returns true if this navigatable supports highlightingbooleansupportsMarkers()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
-
-