public class InsertionContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static OffsetKey |
TAIL_OFFSET |
Constructor and Description |
---|
InsertionContext(OffsetMap offsetMap,
char completionChar,
LookupElement[] elements,
PsiFile file,
Editor editor,
boolean addCompletionChar) |
Modifier and Type | Method and Description |
---|---|
void |
commitDocument() |
char |
getCompletionChar() |
Document |
getDocument() |
Editor |
getEditor() |
LookupElement[] |
getElements() |
PsiFile |
getFile() |
java.lang.Runnable |
getLaterRunnable() |
int |
getOffset(OffsetKey key) |
OffsetMap |
getOffsetMap() |
Project |
getProject() |
int |
getSelectionEndOffset() |
int |
getStartOffset() |
int |
getTailOffset() |
void |
setAddCompletionChar(boolean addCompletionChar) |
void |
setLaterRunnable(java.lang.Runnable laterRunnable) |
void |
setTailOffset(int offset) |
boolean |
shouldAddCompletionChar() |
static boolean |
shouldAddCompletionChar(char completionChar) |
OffsetKey |
trackOffset(int offset,
boolean movableToRight) |
public static final OffsetKey TAIL_OFFSET
public InsertionContext(OffsetMap offsetMap, char completionChar, LookupElement[] elements, PsiFile file, Editor editor, boolean addCompletionChar)
public void setTailOffset(int offset)
public int getTailOffset()
public PsiFile getFile()
public Editor getEditor()
public void commitDocument()
public Document getDocument()
public int getOffset(OffsetKey key)
public OffsetMap getOffsetMap()
public OffsetKey trackOffset(int offset, boolean movableToRight)
public int getStartOffset()
public char getCompletionChar()
public LookupElement[] getElements()
public Project getProject()
public int getSelectionEndOffset()
public java.lang.Runnable getLaterRunnable()
public void setLaterRunnable(java.lang.Runnable laterRunnable)
public void setAddCompletionChar(boolean addCompletionChar)
addCompletionChar
- Whether completionChar should be added to document at tail offset (see TAIL_OFFSET
) after insert handler (default: true
).public boolean shouldAddCompletionChar()
public static boolean shouldAddCompletionChar(char completionChar)