Interface VTMarkupItem

All Known Implementing Classes:
MarkupItemImpl

public interface VTMarkupItem
  • Field Details

  • Method Details

    • canApply

      boolean canApply()
      Returns true if this markup item can be applied.
      Returns:
      true if this markup item can be applied.
    • canUnapply

      boolean canUnapply()
      Returns true if this markup item can be unapplied.
      Returns:
      true if this markup item can be unapplied.
    • apply

      void apply(VTMarkupItemApplyActionType applyAction, ghidra.framework.options.ToolOptions options) throws VersionTrackingApplyException
      Applies this markup item using the given action at the give address. The destination address and the address source must be set prior to calling this method.
      Parameters:
      applyAction - the type of apply action to take when applying the given markup item
      options - the options
      Throws:
      VersionTrackingApplyException - if an error occurred while attempting to apply the markup item.
    • unapply

      void unapply() throws VersionTrackingApplyException
      Returns the value in the destination program back to its original value.
      Throws:
      VersionTrackingApplyException - if an error occurred while attempting to unapply the markup item.
    • setDefaultDestinationAddress

      void setDefaultDestinationAddress(ghidra.program.model.address.Address address, String addressSource)
      Sets the default destination address for this item. This address will not be saved, as it is considered a temporary address value. Further, this value is intended to be a "best guess" as to what the destination address should be.

      Users should not call this method, but should instead call setDestinationAddress(Address).

      Parameters:
      address - the address to set.
      addressSource - the source of the address. This will be the name of a VTProgramCorrelator when a correlator is used to populate default address values.
      See Also:
    • setDestinationAddress

      void setDestinationAddress(ghidra.program.model.address.Address address)
      Sets the actual destination address for the markup item. This method differs from setDefaultDestinationAddress(Address, String) in that the address passed to this method will be saved.

      The getDestinationAddressSource() will return USER_DEFINED_ADDRESS_SOURCE when a valid destination address is set via this method.

      To clear the destination address you may pass null to this method.

      Parameters:
      address - the new destination address for the item.
      Throws:
      IllegalStateException - if this method is called on an applied markup item (you can use canUnapply() to know if this item is applied).
      See Also:
    • getDestinationAddressEditStatus

      VTMarkupItemDestinationAddressEditStatus getDestinationAddressEditStatus()
      Returns the editable status of this markup item's destination address.
      Returns:
      the editable status of this markup item's destination address.
      See Also:
    • setConsidered

      void setConsidered(VTMarkupItemConsideredStatus status)
      Sets a considered status on this item without applying this item. This is useful to indicate that you considered this item and have decided not to apply it, with some indication as to why.

      To clear the considered status pass VTMarkupItemConsideredStatus.UNCONSIDERED.

      If the status was an "applied" status, then an exception will be thrown. To determine if an item is applied you can use canUnapply().

      Parameters:
      status - The considered status to set
      Throws:
      IllegalStateException - if you call this method on an applied item
    • getStatus

      VTMarkupItemStatus getStatus()
      Returns the status of this markup item.
      Returns:
      the status of this markup item.
    • getStatusDescription

      String getStatusDescription()
      Returns an optional description of the current markup item status. For example, if there status is VTMarkupItemStatus.FAILED_APPLY, then this method should return a description of the failure.
      Returns:
      the description.
    • getAssociation

      VTAssociation getAssociation()
      Returns the VTAssocation that generated this markup item.
      Returns:
      the VTAssocation that generated this markup item.
    • getSourceAddress

      ghidra.program.model.address.Address getSourceAddress()
      Returns the address in the source program for this association.
      Returns:
      the address in the source program for this association.
    • getSourceLocation

      ghidra.program.util.ProgramLocation getSourceLocation()
      Returns the field specific program location in the source program for this association.
      Returns:
      the field specific program location in the source program for this association.
    • getSourceValue

      Stringable getSourceValue()
      Returns a Stringable that represents the value of the markup item in the source program.
      Returns:
      a Stringable that represents the value of the markup item in the source program.
    • getDestinationAddress

      ghidra.program.model.address.Address getDestinationAddress()
      Returns the address in the destination program for this association.
      Returns:
      the address in the destination program for this association.
    • getDestinationLocation

      ghidra.program.util.ProgramLocation getDestinationLocation()
      Returns the field specific program location in the destination program for this association.
      Returns:
      the field specific program location in the destination program for this association.
    • getDestinationAddressSource

      String getDestinationAddressSource()
      Returns a string that indicates the origin of the destination address. Typically, it is determined either by an algorithm or the user.
      Returns:
      a string that indicates the origin of the destination address.
    • getCurrentDestinationValue

      Stringable getCurrentDestinationValue()
      Returns a Stringable that represents the current value of the markup item in the destination program.
      Returns:
      a Stringable that represents the current value of the markup item in the destination program.
    • getOriginalDestinationValue

      Stringable getOriginalDestinationValue()
      Returns a Stringable that represents the original value of the markup item in the destination program.
      Returns:
      a Stringable that represents the original value of the markup item in the destination program.
    • supportsApplyAction

      boolean supportsApplyAction(VTMarkupItemApplyActionType actionType)
      Returns true if this markupItem supports an apply for the given apply action type.
      Parameters:
      actionType - the VTMarkupITemApplyActionType to test.
      Returns:
      true if this markup item can be applied using the given action type.
    • getMarkupType

      VTMarkupType getMarkupType()
      Returns the VTMarkupType for this markup Item. VTMarkup types include comments, labels, function names, etc.
      Returns:
      the VTMarkupType for this markup Item.