Class SpellingService
- java.lang.Object
-
- org.eclipse.ui.texteditor.spelling.SpellingService
-
public class SpellingService extends Object
System wide spelling service.This class is not intended to be subclassed by clients.
- Since:
- 3.1
- Restriction:
- This class is not intended to be subclassed by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static String
PREFERENCE_SPELLING_ENABLED
A named preference that controls if spelling is enabled or disabled.static String
PREFERENCE_SPELLING_ENGINE
A named preference that controls which spelling engine is used.
-
Constructor Summary
Constructors Constructor Description SpellingService(IPreferenceStore preferences)
Initializes the spelling service with the given preferences.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
check(IDocument document, IRegion[] regions, SpellingContext context, ISpellingProblemCollector collector, IProgressMonitor monitor)
Checks the given regions in the given document.void
check(IDocument document, SpellingContext context, ISpellingProblemCollector collector, IProgressMonitor monitor)
Checks the given document.SpellingEngineDescriptor
getActiveSpellingEngineDescriptor(IPreferenceStore preferences)
Returns the descriptor of the active spelling engine based on the value of thePREFERENCE_SPELLING_ENGINE
preference in the given preferences.SpellingEngineDescriptor
getDefaultSpellingEngineDescriptor()
Returns the default spelling engine descriptor from extensions to the spelling engine extension point.SpellingEngineDescriptor[]
getSpellingEngineDescriptors()
Returns all spelling engine descriptors from extensions to the spelling engine extension point.
-
-
-
Field Detail
-
PREFERENCE_SPELLING_ENABLED
public static final String PREFERENCE_SPELLING_ENABLED
A named preference that controls if spelling is enabled or disabled.Value is of type
Boolean
.- See Also:
- Constant Field Values
-
PREFERENCE_SPELLING_ENGINE
public static final String PREFERENCE_SPELLING_ENGINE
A named preference that controls which spelling engine is used. The value is the spelling engine's extension id.Value is of type
String
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SpellingService
public SpellingService(IPreferenceStore preferences)
Initializes the spelling service with the given preferences.- Parameters:
preferences
- the preferences- See Also:
PREFERENCE_SPELLING_ENABLED
,PREFERENCE_SPELLING_ENGINE
-
-
Method Detail
-
check
public void check(IDocument document, SpellingContext context, ISpellingProblemCollector collector, IProgressMonitor monitor)
Checks the given document. Reports all found spelling problems to the collector. The spelling engine is chosen based on the settings from the given preferences.- Parameters:
document
- the document to checkcontext
- the contextcollector
- the problem collectormonitor
- the progress monitor, can benull
-
check
public void check(IDocument document, IRegion[] regions, SpellingContext context, ISpellingProblemCollector collector, IProgressMonitor monitor)
Checks the given regions in the given document. Reports all found spelling problems to the collector. The spelling engine is chosen based on the settings from the given preferences.- Parameters:
document
- the document to checkregions
- the regions to checkcontext
- the contextcollector
- the problem collectormonitor
- the progress monitor, can benull
-
getSpellingEngineDescriptors
public SpellingEngineDescriptor[] getSpellingEngineDescriptors()
Returns all spelling engine descriptors from extensions to the spelling engine extension point.- Returns:
- all spelling engine descriptors
-
getDefaultSpellingEngineDescriptor
public SpellingEngineDescriptor getDefaultSpellingEngineDescriptor()
Returns the default spelling engine descriptor from extensions to the spelling engine extension point.- Returns:
- the default spelling engine descriptor or
null
if none could be found
-
getActiveSpellingEngineDescriptor
public SpellingEngineDescriptor getActiveSpellingEngineDescriptor(IPreferenceStore preferences)
Returns the descriptor of the active spelling engine based on the value of thePREFERENCE_SPELLING_ENGINE
preference in the given preferences.- Parameters:
preferences
- the preferences- Returns:
- the descriptor of the active spelling engine or
null
if none could be found - See Also:
PREFERENCE_SPELLING_ENGINE
-
-