|
|
|
|
Re: How to use SpellingService [message #726146 is a reply to message #724954] |
Fri, 16 September 2011 16:40 |
Dennis Melzer Messages: 244 Registered: July 2009 |
Senior Member |
|
|
no i have jdt installed
here my new version with underlined words =), but now i miss the quick assistant =(. and how can i choose a dictanory?
private void createSourceViewer(Composite parent) {
final IAnnotationAccess access = new DefaultMarkerAnnotationAccess();
final SourceViewer sourceViewer = new SourceViewer(parent, null,
null, true, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
Document document = new Document("dfg");
SourceViewerConfiguration config = new TextSourceViewerConfiguration(
EditorsUI.getPreferenceStore());
sourceViewer.configure(config);
sourceViewer.setDocument(document, new AnnotationModel());
SourceViewerDecorationSupport decorationSupport = new SourceViewerDecorationSupport(
sourceViewer, null, access, EditorsPlugin.getDefault()
.getSharedTextColors());
configureSourceViewerDecorationSupport(decorationSupport);
if (sourceViewer instanceof ISourceViewerExtension3)
((IAnnotationAccessExtension2) access)
.setQuickAssistAssistant(((ISourceViewerExtension3) sourceViewer)
.getQuickAssistAssistant());
GridDataFactory.fillDefaults().grab(true, true)
.applyTo(sourceViewer.getTextWidget());
}
private void configureSourceViewerDecorationSupport(
SourceViewerDecorationSupport support) {
for(Object o :new MarkerAnnotationPreferences()
.getAnnotationPreferences())
support.setAnnotationPreference((AnnotationPreference)o);
support.setCursorLinePainterPreferenceKeys(
AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE,
AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR);
support.install(EditorsUI.getPreferenceStore());
}
|
|
|
Re: How to use SpellingService [message #727886 is a reply to message #726146] |
Thu, 22 September 2011 06:45 |
Dani Megert Messages: 3802 Registered: July 2009 |
Senior Member |
|
|
On 16.09.2011 18:40, SirWayne wrote:
> no i have jdt installed
>
> here my new version with underlined words =), but now i miss the quick
> assistant =(. and how can i choose a dictanory?
Take a look at TextSourceViewerConfiguration.
Dani
>
>
> private void createSourceViewer(Composite parent) {
> final IAnnotationAccess access = new
> DefaultMarkerAnnotationAccess();
> final SourceViewer sourceViewer = new SourceViewer(parent,
> null,
> null, true, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
> Document document = new Document("dfg");
> SourceViewerConfiguration config = new
> TextSourceViewerConfiguration(
> EditorsUI.getPreferenceStore());
> sourceViewer.configure(config);
> sourceViewer.setDocument(document, new AnnotationModel());
> SourceViewerDecorationSupport decorationSupport = new
> SourceViewerDecorationSupport(
> sourceViewer, null, access,
> EditorsPlugin.getDefault()
> .getSharedTextColors());
> configureSourceViewerDecorationSupport(decorationSupport);
> if (sourceViewer instanceof ISourceViewerExtension3)
> ((IAnnotationAccessExtension2) access)
>
> .setQuickAssistAssistant(((ISourceViewerExtension3) sourceViewer)
> .getQuickAssistAssistant());
>
> GridDataFactory.fillDefaults().grab(true, true)
> .applyTo(sourceViewer.getTextWidget());
>
> }
>
> private void configureSourceViewerDecorationSupport(
> SourceViewerDecorationSupport support) {
>
> for(Object o :new MarkerAnnotationPreferences()
> .getAnnotationPreferences())
> support.setAnnotationPreference((AnnotationPreference)o);
>
> support.setCursorLinePainterPreferenceKeys(
>
> AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE,
>
> AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR);
> support.install(EditorsUI.getPreferenceStore());
> }
>
>
|
|
|
Re: How to use SpellingService [message #728378 is a reply to message #727886] |
Fri, 23 September 2011 07:02 |
Dennis Melzer Messages: 244 Registered: July 2009 |
Senior Member |
|
|
ok which line,section or methode =).
i set the textviewerconfiguration in my sourceviewer
if (sourceViewer instanceof ISourceViewerExtension3)
((IAnnotationAccessExtension2)access).setQuickAssistAssistant(((ISourceViewerExtension3)sourceViewer).getQuickAssistAssistant());
the QuickAssistAssistant is the SpellingCorrectionProcessor
[Updated on: Fri, 23 September 2011 07:33] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03636 seconds