Interface ContextMenuEvent

All Superinterfaces:
ComponentEvent, InvocationSource, ToolSource

public interface ContextMenuEvent extends ComponentEvent, ToolSource, InvocationSource
Provides useful information when generating context menu items from a ContextMenuItemsProvider.
  • Method Details

    • messageEditorRequestResponse

      Optional<MessageEditorHttpRequestResponse> messageEditorRequestResponse()
      This method can be used to retrieve details of the currently selected HTTP request/response when the context menu was invoked.
      Returns:
      an Optional describing the currently selected request response with selection metadata.
    • selectedRequestResponses

      List<HttpRequestResponse> selectedRequestResponses()
      This method can be used to retrieve details of the currently selected HTTP request/response pair that was selected by the user when the context menu was invoked. This will return an empty list if the user has not made a selection.
      Returns:
      A list of request responses that have been selected by the user.
    • selectedIssues

      List<AuditIssue> selectedIssues()
      This method can be used to retrieve details of the Scanner issues that were selected by the user when the context menu was invoked. This will return an empty list if no issues are applicable to the invocation.
      Returns:
      a List of AuditIssue objects representing the items that were shown or selected by the user when the context menu was invoked.
    • toolType

      ToolType toolType()
      Specified by:
      toolType in interface ToolSource
      Returns:
      the tool type.
    • isFromTool

      boolean isFromTool(ToolType... toolType)
      Determine whether this tool source is from a specified tool.
      Specified by:
      isFromTool in interface ToolSource
      Parameters:
      toolType - The tool types to check.
      Returns:
      Returns true if this tool source is from any of the specified tool types.
    • inputEvent

      InputEvent inputEvent()
      This method can be used to retrieve the native Java input event that was the trigger for the context menu invocation.
      Specified by:
      inputEvent in interface ComponentEvent
      Returns:
      The InputEvent that was the trigger for the context menu invocation.
    • invocationType

      InvocationType invocationType()
      Specified by:
      invocationType in interface InvocationSource
      Returns:
      An instance of InvocationType which provides the current location of the context menu being invoked.
    • isFrom

      boolean isFrom(InvocationType... invocationType)
      A helper method to allow the extension to ask if the context is within a set of locations.
      Specified by:
      isFrom in interface InvocationSource
      Parameters:
      invocationType - One or more instances of InvocationType to check.
      Returns:
      True if the context menu is being invoked from one of the types that is being checked.