public class BaseIndentEnterHandler extends EnterHandlerDelegateAdapter
EnterHandlerDelegate.Result
EP_NAME
Constructor and Description |
---|
BaseIndentEnterHandler(Language language,
TokenSet indentTokens,
IElementType lineCommentType,
java.lang.String lineCommentPrefix,
TokenSet whitespaceTokens) |
BaseIndentEnterHandler(Language language,
TokenSet indentTokens,
IElementType lineCommentType,
java.lang.String lineCommentPrefix,
TokenSet whitespaceTokens,
boolean worksWithFormatter) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getNewIndent(PsiFile file,
Document document,
java.lang.CharSequence oldIndent) |
protected IElementType |
getNonWhitespaceElementType(HighlighterIterator iterator,
int currentLineStartOffset,
int prevLineStartOffset) |
EnterHandlerDelegate.Result |
preprocessEnter(PsiFile file,
Editor editor,
Ref<java.lang.Integer> caretOffset,
Ref<java.lang.Integer> caretAdvance,
DataContext dataContext,
EditorActionHandler originalHandler)
Called before the actual Enter processing is done.
|
protected EnterHandlerDelegate.Result |
shouldSkipWithResult(PsiFile file,
Editor editor,
DataContext dataContext) |
postProcessEnter
public BaseIndentEnterHandler(Language language, TokenSet indentTokens, IElementType lineCommentType, java.lang.String lineCommentPrefix, TokenSet whitespaceTokens)
public BaseIndentEnterHandler(Language language, TokenSet indentTokens, IElementType lineCommentType, java.lang.String lineCommentPrefix, TokenSet whitespaceTokens, boolean worksWithFormatter)
protected EnterHandlerDelegate.Result shouldSkipWithResult(PsiFile file, Editor editor, DataContext dataContext)
public EnterHandlerDelegate.Result preprocessEnter(PsiFile file, Editor editor, Ref<java.lang.Integer> caretOffset, 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.caretOffset
- 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 java.lang.String getNewIndent(PsiFile file, Document document, java.lang.CharSequence oldIndent)
protected IElementType getNonWhitespaceElementType(HighlighterIterator iterator, int currentLineStartOffset, int prevLineStartOffset)