public class TypedHandler extends TypedActionHandlerBase
myOriginalHandler
Constructor and Description |
---|
TypedHandler(TypedActionHandler originalHandler) |
Modifier and Type | Method and Description |
---|---|
static void |
autoPopupCompletion(Editor editor,
char charTyped,
Project project,
PsiFile file) |
void |
beforeExecute(Editor editor,
char c,
DataContext context,
ActionPlan plan)
The method is invoked before acquiring a write lock and actually executing an action.
|
static void |
commitDocumentIfCurrentCaretIsNotTheFirstOne(Editor editor,
Project project) |
void |
execute(Editor originalEditor,
char charTyped,
DataContext dataContext)
Processes a key typed in the editor.
|
static QuoteHandler |
getLanguageQuoteHandler(Language baseLanguage) |
static QuoteHandler |
getQuoteHandler(PsiFile file,
Editor editor) |
static QuoteHandler |
getQuoteHandlerForType(FileType fileType) |
static boolean |
handleRParen(Editor editor,
FileType fileType,
char charTyped) |
static void |
indentOpenedBrace(Project project,
Editor editor) |
static Editor |
injectedEditorIfCharTypedIsSignificant(char charTyped,
Editor editor,
PsiFile oldFile) |
static Editor |
injectedEditorIfCharTypedIsSignificant(int charTyped,
Editor editor,
PsiFile oldFile) |
static void |
registerBaseLanguageQuoteHandler(java.lang.Class<? extends Language> languageClass,
QuoteHandler quoteHandler) |
static void |
registerQuoteHandler(FileType fileType,
QuoteHandler quoteHandler)
Deprecated.
use
QuoteHandlerEP |
public TypedHandler(TypedActionHandler originalHandler)
public static QuoteHandler getQuoteHandler(PsiFile file, Editor editor)
public static QuoteHandler getLanguageQuoteHandler(Language baseLanguage)
public static void registerBaseLanguageQuoteHandler(java.lang.Class<? extends Language> languageClass, QuoteHandler quoteHandler)
public static QuoteHandler getQuoteHandlerForType(FileType fileType)
@Deprecated public static void registerQuoteHandler(FileType fileType, QuoteHandler quoteHandler)
QuoteHandlerEP
public void beforeExecute(Editor editor, char c, DataContext context, ActionPlan plan)
TypedActionHandlerEx
There's no need to mirror all the oncoming changes, focus on latency-sensitive activity (like typing).
Implementation should not modify entities besides ActionPlan
(e.g. Editor
, Document
, CaretModel
, etc.).
Moreover, as the handlers can be chained, implementation must rely primarily on the state that is provided by the ActionPlan
(i.e. ActionPlan.getText()
must be used instead of a direct Document.getText()
call).
The handler is responsible for delegating to the previously registered handler if needed.
beforeExecute
in interface TypedActionHandlerEx
beforeExecute
in class TypedActionHandlerBase
editor
- the editor in which the key was typed.c
- the typed character.context
- the current data context.plan
- the current action plan draft.public void execute(Editor originalEditor, char charTyped, DataContext dataContext)
TypedActionHandler
originalEditor
- the editor in which the key was typed.charTyped
- the typed character.dataContext
- the current data context.public static void autoPopupCompletion(Editor editor, char charTyped, Project project, PsiFile file)
public static void commitDocumentIfCurrentCaretIsNotTheFirstOne(Editor editor, Project project)
public static Editor injectedEditorIfCharTypedIsSignificant(char charTyped, Editor editor, PsiFile oldFile)
public static Editor injectedEditorIfCharTypedIsSignificant(int charTyped, Editor editor, PsiFile oldFile)