Package ghidra.program.util
Class PlateFieldLocation
java.lang.Object
ghidra.program.util.ProgramLocation
ghidra.program.util.CodeUnitLocation
ghidra.program.util.CommentFieldLocation
ghidra.program.util.PlateFieldLocation
- All Implemented Interfaces:
Cloneable,Comparable<ProgramLocation>
The
PlateFieldLocation class contains specific location information
within the Plate field of a CodeUnitLocation object.-
Field Summary
Fields inherited from class ghidra.program.util.CommentFieldLocation
comment, typeFields inherited from class ghidra.program.util.ProgramLocation
addr, program, refAddr -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor needed for restoring a plate field location from XML.PlateFieldLocation(Program program, Address addr, int[] componentPath, int row, int charOffset, String[] comment, int commentRow) Construct a new PlateFieldLocation. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintReturns the index into the String[] returned byCommentFieldLocation.getComment()that represents the comment row that was clicked.voidrestoreState(Program p, SaveState obj) Restore this program location using the given program and save state object.voidSave this program location to the given save state object.toString()Returns a String representation of this location.Methods inherited from class ghidra.program.util.CommentFieldLocation
getComment, getCommentType, hashCodeMethods inherited from class ghidra.program.util.CodeUnitLocation
isValidMethods inherited from class ghidra.program.util.ProgramLocation
clone, compareAddr, compareTo, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow, getTranslatedCopy
-
Constructor Details
-
PlateFieldLocation
public PlateFieldLocation(Program program, Address addr, int[] componentPath, int row, int charOffset, String[] comment, int commentRow) Construct a new PlateFieldLocation.- Parameters:
program- the program of the locationaddr- the address of the code unit.componentPath- the componentPath of the codeUnitrow- the line of the locationcharOffset- the character position on the row of the location.comment- plate comment textcommentRow- The row index into the comments of this location. This is different than therowdue to the fact that the PlateField has fictitious borders that don't exist in the actual comment.
-
PlateFieldLocation
public PlateFieldLocation()Default constructor needed for restoring a plate field location from XML.
-
-
Method Details
-
toString
Description copied from class:CommentFieldLocationReturns a String representation of this location.- Overrides:
toStringin classCommentFieldLocation
-
equals
- Overrides:
equalsin classCommentFieldLocation
-
getCommentRow
public int getCommentRow()Returns the index into the String[] returned byCommentFieldLocation.getComment()that represents the comment row that was clicked.-1will be returned if the border of the plate field was clicked.Note: This value is different than that returned by
ProgramLocation.getRow(), as that value represents the screen row clicked. Further, the PlateField adds screen decoration to the comments, which causes the screen row to differ from the comment row.- Returns:
- the index into the String[] returned by
CommentFieldLocation.getComment()that represents the comment row that was clicked.-1will be returned if the border of the plate field was clicked.
-
restoreState
Description copied from class:ProgramLocationRestore this program location using the given program and save state object.- Overrides:
restoreStatein classCommentFieldLocation- Parameters:
p- program to restore fromobj- the save state to restore from
-
saveState
Description copied from class:ProgramLocationSave this program location to the given save state object.- Overrides:
saveStatein classCommentFieldLocation- Parameters:
obj- the save state object for saving the location
-