Interface DecompilerHighlightService


public interface DecompilerHighlightService
A service that allows clients to create highlights in the form of background colors for ClangTokens in the Decompiler UI.

Note: highlights apply to a full token and not strings of text. To highlight a token, you create an instance of the CTokenHighlightMatcher to pass to one of the createHighlighter(String, CTokenHighlightMatcher) methods of this interface.

There is no limit to the number of highlighters that may be installed. If multiple highlights overlap, then their colors will be blended. The number of color blends may be limited for performance reasons.

  • Method Details

    • createHighlighter

      default DecompilerHighlighter createHighlighter(CTokenHighlightMatcher tm)
      Creates a highlighter that will use the given matcher to create highlights as functions get decompiled. The highlighter created will be applied to every decompiled function.
      Parameters:
      tm - the matcher
      Returns:
      the new highlighter
    • createHighlighter

      DecompilerHighlighter createHighlighter(Function function, CTokenHighlightMatcher tm)
      Creates a highlighter that will use the given matcher to create highlights as functions get decompiled. The highlighter created will only be applied to the given function.
      Parameters:
      function - the function to which the highlighter will be applied
      tm - the matcher
      Returns:
      the new highlighter
      See Also:
    • createHighlighter

      default DecompilerHighlighter createHighlighter(String id, CTokenHighlightMatcher tm)
      A version of createHighlighter(String, CTokenHighlightMatcher) that allows clients to specify an ID. This ID will be used to ensure that any existing highlighters with that ID will be removed before creating a new highlighter. The highlighter created will be applied to every decompiled function.

      This method is convenient for scripts, since a script cannot hold on to any created highlighters between repeated script executions. A good value for script writers to use is the name of their script class.

      Parameters:
      id - the ID
      tm - the matcher
      Returns:
      the new highlighter
    • createHighlighter

      DecompilerHighlighter createHighlighter(String id, Function function, CTokenHighlightMatcher tm)
      A version of createHighlighter(String, CTokenHighlightMatcher) that allows clients to specify an ID. This ID will be used to ensure that any existing highlighters with that ID will be removed before creating a new highlighter. The highlighter created will only be applied to the given function.

      This method is convenient for scripts, since a script cannot hold on to any created highlighters between repeated script executions. A good value for script writers to use is the name of their script class.

      Parameters:
      id - the ID
      function - the function to which the highlighter will be applied
      tm - the matcher
      Returns:
      the new highlighter