class CompletionWrapper
extends java.lang.Object
Constructor and Description |
---|
CompletionWrapper(CompletionTokenType tokenType,
java.lang.Class completionClass,
java.lang.String enteredText)
Builds a wrapper with the given values for use later int the completions
|
CompletionWrapper(CompletionTokenType tokenType,
java.lang.Class completionClass,
java.lang.String enteredText,
java.util.Map<java.lang.String,java.lang.Class> variablesInScope)
Builds a wrapper with the given values for use later int the completions
|
CompletionWrapper(int caretPosition,
CompletionTokenType tokenType,
java.lang.Class completionClass,
java.lang.String enteredText,
java.util.Map<java.lang.String,java.lang.Class> variablesInScope,
java.util.Collection<? extends org.fife.ui.autocomplete.VariableCompletion> additionalCompletions)
Builds a wrapper with the given values for use later int the completions
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<? extends org.fife.ui.autocomplete.Completion> |
getAdditionalCompletions()
Gets a collection of additional completions to include for the given position.
|
int |
getCaretPosition()
Gets the caret position this relates to
|
java.lang.Class |
getCompletionClass()
Gets the class of the object (or class) at the given caret position, or null if no class type is relevant
|
java.lang.String |
getEnteredText()
Gets the text that is at the current caret position.
|
CompletionTokenType |
getTokenType()
Gets the type of the token found at the given caret position
|
java.util.Map<java.lang.String,java.lang.Class> |
getVariablesInScope()
Returns a map of the variables that are in scope at the given caret position
|
boolean |
isLogObject()
Returns true if this is a completion for the log object, false otherwise
|
boolean |
isSessionObject()
Returns true if this is a completion for the session object, false otherwise
|
<U extends org.fife.ui.autocomplete.Completion> |
setAdditionalCompletions(java.util.Collection<U> additionalCompletions)
Sets a collection of additional completions to include for the given position.
|
void |
setCaretPosition(int caretPosition)
Sets the caret position this relates to
|
void |
setCompletionClass(java.lang.Class completionClass)
Sets the class of the object (or class) at the given caret position, or null if no class type is relevant
|
void |
setEnteredText(java.lang.String enteredText)
Sets the text that is at the current caret position.
|
void |
setLogObject(boolean logObject)
Sets whether or not this is a completion for the log object
|
void |
setSessionObject(boolean sessionObject)
Sets whether or not this is a completion for the session object
|
void |
setTokenType(CompletionTokenType tokenType)
Sets the type of the token found at the given caret position
|
void |
setVariablesInScope(java.util.Map<java.lang.String,java.lang.Class> variablesInScope)
Sets a map of the variables that are in scope at the given caret position.
|
java.lang.String |
toString() |
public CompletionWrapper(CompletionTokenType tokenType, @Nullable java.lang.Class completionClass, @Nullable java.lang.String enteredText)
tokenType
- The type of token that was found at the given positioncompletionClass
- The class of the object or Class name that was found at the given positionenteredText
- The currently entered text. This would be the variable/method name as far as it has been typedpublic CompletionWrapper(CompletionTokenType tokenType, java.lang.Class completionClass, java.lang.String enteredText, java.util.Map<java.lang.String,java.lang.Class> variablesInScope)
tokenType
- The type of token that was found at the given positioncompletionClass
- The class of the object or Class name that was found at the given positionenteredText
- The currently entered text. This would be the variable/method name as far as it has been typedvariablesInScope
- A map from variable name to it's type of all the variables currently in scopepublic CompletionWrapper(int caretPosition, CompletionTokenType tokenType, java.lang.Class completionClass, java.lang.String enteredText, java.util.Map<java.lang.String,java.lang.Class> variablesInScope, java.util.Collection<? extends org.fife.ui.autocomplete.VariableCompletion> additionalCompletions)
caretPosition
- The caret position that was being examinedtokenType
- The type of token that was found at the given positioncompletionClass
- The class of the object or Class name that was found at the given positionenteredText
- The currently entered text. This would be the variable/method name as far as it has been typedvariablesInScope
- A map from variable name to it's type of all the variables currently in scopeadditionalCompletions
- Additional completions that should be added (user-defined methods, etc...)public int getCaretPosition()
public void setCaretPosition(int caretPosition)
caretPosition
- The caret position this relates topublic CompletionTokenType getTokenType()
public void setTokenType(CompletionTokenType tokenType)
tokenType
- The type of the token found at the given caret positionpublic java.lang.Class getCompletionClass()
public void setCompletionClass(java.lang.Class completionClass)
completionClass
- The class of the object (or class) at the given caret position, or null if no class type is relevantpublic java.lang.String getEnteredText()
public void setEnteredText(java.lang.String enteredText)
enteredText
- The text that is at the current caret position. This should be the name of the variable or method, as it has been completed so farpublic java.util.Map<java.lang.String,java.lang.Class> getVariablesInScope()
public void setVariablesInScope(java.util.Map<java.lang.String,java.lang.Class> variablesInScope)
variablesInScope
- A map of the variables that are in scope at the given caret position. The map will be copied, so it can be safely modified laterpublic java.util.Collection<? extends org.fife.ui.autocomplete.Completion> getAdditionalCompletions()
public <U extends org.fife.ui.autocomplete.Completion> void setAdditionalCompletions(java.util.Collection<U> additionalCompletions)
additionalCompletions
- A collection of additional completions to include for the given position. These could include things such as the user-defined
methods and classes. The collection will be copied.public boolean isLogObject()
public void setLogObject(boolean logObject)
logObject
- True if this is a completion for the log object, false otherwisepublic boolean isSessionObject()
public void setSessionObject(boolean sessionObject)
sessionObject
- True if this is a completion for the session object, false otherwisepublic java.lang.String toString()
toString
in class java.lang.Object