public class EnterBetweenBracesFinalHandler extends EnterHandlerDelegateAdapter
EnterBetweenBracesDelegate
language-specific implementation instead.EnterHandlerDelegate.Result
Modifier and Type | Field and Description |
---|---|
protected static EnterBetweenBracesDelegate |
ourDefaultBetweenDelegate |
EP_NAME
Constructor and Description |
---|
EnterBetweenBracesFinalHandler() |
Modifier and Type | Method and Description |
---|---|
protected EnterBetweenBracesDelegate |
getLanguageImplementation(Language language) |
protected boolean |
isApplicable(PsiFile file,
Editor editor,
java.lang.CharSequence documentText,
int caretOffset,
EnterBetweenBracesDelegate helper) |
protected static boolean |
isValidOffset(int offset,
java.lang.CharSequence text) |
EnterHandlerDelegate.Result |
preprocessEnter(PsiFile file,
Editor editor,
Ref<java.lang.Integer> caretOffsetRef,
Ref<java.lang.Integer> caretAdvance,
DataContext dataContext,
EditorActionHandler originalHandler)
Called before the actual Enter processing is done.
|
postProcessEnter
protected static EnterBetweenBracesDelegate ourDefaultBetweenDelegate
public EnterHandlerDelegate.Result preprocessEnter(PsiFile file, Editor editor, Ref<java.lang.Integer> caretOffsetRef, Ref<java.lang.Integer> caretAdvance, DataContext dataContext, EditorActionHandler originalHandler)
EnterHandlerDelegate
PsiDocumentManager.getInstance(file.getProject()).commitDocument(editor.getDocument);
preprocessEnter
in interface EnterHandlerDelegate
preprocessEnter
in class EnterHandlerDelegateAdapter
file
- The PSI file associated with the document.editor
- The editor.caretOffsetRef
- Indicates a place where line break is to be inserted (it's a caret position initially). Method implementation
can change this value to adjust target line break position.caretAdvance
- A reference to the number of columns by which the caret must be moved forward.dataContext
- The data context passed to the enter handler.originalHandler
- The original handler.EnterHandlerDelegate.Result
values.
protected boolean isApplicable(PsiFile file, Editor editor, java.lang.CharSequence documentText, int caretOffset, EnterBetweenBracesDelegate helper)
protected EnterBetweenBracesDelegate getLanguageImplementation(Language language)
protected static boolean isValidOffset(int offset, java.lang.CharSequence text)