Package ghidra.app.services

# Interface DebuggerConsoleService

public interface DebuggerConsoleService

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addResolutionAction(DockingActionIf action)`
  Add an action which might be applied to an actionable log message
  `List<ActionContext>`
  `getActionContexts()`
  Get the action context for all actionable messages
  `void`
  `log(Icon icon, String message)`
  Log a message to the console
  `void`
  `log(Icon icon, String message, ActionContext context)`
  Log an actionable message to the console
  `void`
  `log(Icon icon, String message, Throwable error)`
  Log an error message to the console
  `void`
  `log(Icon icon, String message, Throwable error, ActionContext context)`
  Log an actionable error message to the console
  `boolean`
  `logContains(ActionContext context)`
  Check if the console contains an actionable message for the given context
  `void`
  `removeFromLog(ActionContext context)`
  Remove an actionable message from the console
  `void`
  `removeResolutionAction(DockingActionIf action)`
  Remove an action

- ## Method Details

  - ### log

    void log(Icon icon, String message)
    Log a message to the console

    WARNING: See `log(Icon, String, Throwable, ActionContext)` regarding HTML.

    Parameters:
      `icon` - an icon for the message
      `message` - the HTML-formatted message

  - ### log

    void log(Icon icon, String message, Throwable error)
    Log an error message to the console

    WARNING: See `log(Icon, String, Throwable, ActionContext)` regarding HTML.

    Parameters:
      `icon` - an icon for the message
      `message` - the HTML-formatted message
      `error` - an exception, if applicable

  - ### log

    void log(Icon icon, String message, ActionContext context)
    Log an actionable message to the console

    WARNING: See `log(Icon, String, Throwable, ActionContext)` regarding HTML.

    Parameters:
      `icon` - an icon for the message
      `message` - the HTML-formatted message
      `context` - an (immutable) context for actions

  - ### log

    void log(Icon icon, String message, Throwable error, ActionContext context)
    Log an actionable error message to the console

    WARNING: The log accepts and will interpret HTML in its messages, allowing a rich and flexible display; however, you MUST sanitize any content derived from the user or target. We recommend using `HTMLUtilities.escapeHTML(String)`.

    Parameters:
      `icon` - an icon for the message
      `message` - the HTML-formatted message
      `error` - an exception, if applicable
      `context` - an (immutable) context for actions

  - ### removeFromLog

    void removeFromLog(ActionContext context)
    Remove an actionable message from the console

    It is common courtesy to remove the entry when the user has resolved the issue, whether via the presented actions, or some other means. The framework does not do this automatically, because simply activating an action does not imply the issue will be resolved.

    Parameters:
      `context` - the context of the entry to remove

  - ### logContains

    boolean logContains(ActionContext context)
    Check if the console contains an actionable message for the given context
    Parameters:
      `context` - the context to check for
    Returns:
      true if present, false if absent

  - ### getActionContexts

    List<ActionContext> getActionContexts()
    Get the action context for all actionable messages
    Returns:
      a copy of the collection of contexts, in no particular order

  - ### addResolutionAction

    void addResolutionAction(DockingActionIf action)
    Add an action which might be applied to an actionable log message

    Please invoke this method from the Swing thread. Only toolbar and pop-up menu placement is considered. Toolbar actions are placed as icon-only buttons in the "Actions" column for any log message where the action is applicable to the context given for that message. Pop-up actions are placed in the context menu when a single message is selected and the action is applicable to its given context. In most cases, the action should be presented both as a button and as a pop-up menu. Less commonly, an action may be presented only as a pop-up, likely because it is an uncommon resolution, or because you don't want the user to activated it accidentally. Rarely, if ever, should an action be a button, but not in the menu. The user may expect the menu to give more complete descriptions of actions presented as buttons.

    IMPORTANT: Unlike other action managers, you are required to remove your actions upon plugin disposal.

    Parameters:
      `action` - the action

  - ### removeResolutionAction

    void removeResolutionAction(DockingActionIf action)
    Remove an action

    Please invoke this method from the Swing thread.

    Parameters:
      `action` - the action