burp
Interface ITextEditor


public interface ITextEditor

This interface is used to provide extensions with an instance of Burp's raw text editor, for the extension to use in its own UI. Extensions should call IBurpExtenderCallbacks.createTextEditor() to obtain an instance of this interface.


Method Summary
 java.awt.Component getComponent()
          This method returns the UI component of the editor, for extensions to add to their own UI.
 byte[] getSelectedText()
          This method is used to obtain the currently selected text.
 int[] getSelectionBounds()
          This method can be used to retrieve the bounds of the user's selection into the displayed text, if applicable.
 byte[] getText()
          This method is used to retrieve the currently displayed text.
 boolean isTextModified()
          This method is used to determine whether the user has modified the contents of the editor.
 void setEditable(boolean editable)
          This method is used to control whether the editor is currently editable.
 void setSearchExpression(java.lang.String expression)
          This method is used to update the search expression that is shown in the search bar below the editor.
 void setText(byte[] text)
          This method is used to update the currently displayed text in the editor.
 

Method Detail

getComponent

java.awt.Component getComponent()
This method returns the UI component of the editor, for extensions to add to their own UI.

Returns:
The UI component of the editor.

setEditable

void setEditable(boolean editable)
This method is used to control whether the editor is currently editable. This status can be toggled on and off as required.

Parameters:
editable - Indicates whether the editor should be currently editable.

setText

void setText(byte[] text)
This method is used to update the currently displayed text in the editor.

Parameters:
text - The text to be displayed.

getText

byte[] getText()
This method is used to retrieve the currently displayed text.

Returns:
The currently displayed text.

isTextModified

boolean isTextModified()
This method is used to determine whether the user has modified the contents of the editor.

Returns:
An indication of whether the user has modified the contents of the editor since the last call to setText().

getSelectedText

byte[] getSelectedText()
This method is used to obtain the currently selected text.

Returns:
The currently selected text, or null if the user has not made any selection.

getSelectionBounds

int[] getSelectionBounds()
This method can be used to retrieve the bounds of the user's selection into the displayed text, if applicable.

Returns:
An int[2] array containing the start and end offsets of the user's selection within the displayed text. If the user has not made any selection in the current message, both offsets indicate the position of the caret within the editor.

setSearchExpression

void setSearchExpression(java.lang.String expression)
This method is used to update the search expression that is shown in the search bar below the editor. The editor will automatically highlight any regions of the displayed text that match the search expression.

Parameters:
expression - The search expression.