Package org.eclipse.ease.ui.completion
Class BasicContext
java.lang.Object
org.eclipse.ease.ui.completion.BasicContext
- All Implemented Interfaces:
ICompletionContext,IScriptEngineProvider
- Direct Known Subclasses:
JavaScriptCompletionContext,PythonCompletionContext
public class BasicContext extends Object implements ICompletionContext
-
Constructor Summary
Constructors Constructor Description BasicContext(IScriptEngine scriptEngine, String content, int cursorPosition)BasicContext(ScriptType scriptType, Object resource, String content, int cursorPosition) -
Method Summary
Modifier and Type Method Description StringgetFilter()Get a text filter to be applied for the current input.List<ModuleDefinition>getLoadedModules()Get all loaded modules.intgetReplaceLength()intgetReplaceOffset()ObjectgetResource()IScriptEnginegetScriptEngine()ScriptTypegetScriptType()StringgetText()List<Object>getTokens()booleanisStringLiteral(String input)booleanisValid()
-
Constructor Details
-
BasicContext
-
BasicContext
-
-
Method Details
-
getTokens
- Specified by:
getTokensin interfaceICompletionContext
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceICompletionContext
-
getText
- Specified by:
getTextin interfaceICompletionContext
-
getReplaceOffset
public int getReplaceOffset()- Specified by:
getReplaceOffsetin interfaceICompletionContext
-
getReplaceLength
public int getReplaceLength()- Specified by:
getReplaceLengthin interfaceICompletionContext
-
getScriptEngine
- Specified by:
getScriptEnginein interfaceIScriptEngineProvider
-
getLoadedModules
Description copied from interface:ICompletionContextGet all loaded modules.- Specified by:
getLoadedModulesin interfaceICompletionContext- Returns:
- loaded modules
-
getFilter
Description copied from interface:ICompletionContextGet a text filter to be applied for the current input. This is the prefix of the expected completion proposals.- Specified by:
getFilterin interfaceICompletionContext- Returns:
- filter text or empty string
-
isStringLiteral
- Specified by:
isStringLiteralin interfaceICompletionContext
-
getScriptType
- Specified by:
getScriptTypein interfaceICompletionContext
-
getResource
- Specified by:
getResourcein interfaceICompletionContext
-