Class SpellingService
java.lang.Object
org.eclipse.ui.texteditor.spelling.SpellingService
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
-
Constructor Summary
ConstructorDescriptionSpellingService
(IPreferenceStore preferences) Initializes the spelling service with the given preferences. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getActiveSpellingEngineDescriptor
(IPreferenceStore preferences) Returns the descriptor of the active spelling engine based on the value of thePREFERENCE_SPELLING_ENGINE
preference in the given preferences.Returns the default spelling engine descriptor from extensions to the spelling engine extension point.Returns all spelling engine descriptors from extensions to the spelling engine extension point.
-
Field Details
-
PREFERENCE_SPELLING_ENABLED
A named preference that controls if spelling is enabled or disabled.Value is of type
Boolean
.- See Also:
-
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:
-
-
Constructor Details
-
SpellingService
Initializes the spelling service with the given preferences.- Parameters:
preferences
- the preferences- See Also:
-
-
Method Details
-
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
Returns all spelling engine descriptors from extensions to the spelling engine extension point.- Returns:
- all spelling engine descriptors
-
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
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:
-