public class BasePasteHandler extends EditorWriteActionHandler
Modifier and Type | Field and Description |
---|---|
protected java.awt.datatransfer.Transferable |
myTransferable |
Constructor and Description |
---|
BasePasteHandler() |
Modifier and Type | Method and Description |
---|---|
static void |
contentLengthLimitExceededMessage(int contentLength) |
void |
doExecute(Editor editor,
Caret caret,
DataContext dataContext)
Executes the action in the context of given caret.
|
void |
executeWriteAction(Editor editor,
Caret caret,
DataContext dataContext) |
protected java.awt.datatransfer.Transferable |
getContentsToPaste(Editor editor,
DataContext dataContext) |
static boolean |
isContentTooLarge(int contentLength) |
boolean |
isEnabledForCaret(Editor editor,
Caret caret,
DataContext dataContext)
Implementations can override this method to define whether handler is enabled for a specific caret in a given editor.
|
executeWriteAction
execute, execute, executeInCommand, getCommandGroupId, isEnabled, isEnabled, runForAllCarets
public boolean isEnabledForCaret(Editor editor, Caret caret, DataContext dataContext)
EditorActionHandler
isEnabledForCaret
in class EditorActionHandler
public void doExecute(Editor editor, Caret caret, DataContext dataContext)
EditorActionHandler
doExecute
in class EditorWriteActionHandler
editor
- the editor in which the action is invoked.caret
- the caret for which the action is performed at the moment, or null
if it's a 'one-off' action executed
without current contextdataContext
- the data context for the action.public void executeWriteAction(Editor editor, Caret caret, DataContext dataContext)
executeWriteAction
in class EditorWriteActionHandler
protected java.awt.datatransfer.Transferable getContentsToPaste(Editor editor, DataContext dataContext)
public static boolean isContentTooLarge(int contentLength)
public static void contentLengthLimitExceededMessage(int contentLength)