use of org.eclipse.jface.text.ITextViewerExtension8.EnrichMode in project eclipse.platform.text by eclipse.
the class AbstractTextEditor method initializeSourceViewer.
/**
* Initializes the editor's source viewer based on the given editor input.
*
* @param input the editor input to be used to initialize the source viewer
*/
private void initializeSourceViewer(IEditorInput input) {
IDocumentProvider documentProvider = getDocumentProvider();
IAnnotationModel model = documentProvider.getAnnotationModel(input);
IDocument document = documentProvider.getDocument(input);
if (document != null) {
fSourceViewer.setDocument(document, model);
fSourceViewer.setEditable(isEditable());
fSourceViewer.showAnnotations(model != null);
}
if (fElementStateListener instanceof IElementStateListenerExtension) {
boolean isStateValidated = false;
if (documentProvider instanceof IDocumentProviderExtension)
isStateValidated = ((IDocumentProviderExtension) documentProvider).isStateValidated(input);
IElementStateListenerExtension extension = (IElementStateListenerExtension) fElementStateListener;
extension.elementStateValidationChanged(input, isStateValidated);
}
if (fInitialCaret == null)
fInitialCaret = fSourceViewer.getTextWidget().getCaret();
if (fIsOverwriting)
fSourceViewer.getTextWidget().invokeAction(ST.TOGGLE_OVERWRITE);
handleInsertModeChanged();
if (isTabsToSpacesConversionEnabled())
installTabsToSpacesConverter();
if (fSourceViewer instanceof ITextViewerExtension8) {
IPreferenceStore store = getPreferenceStore();
EnrichMode mode = store != null ? convertEnrichModePreference(store.getInt(PREFERENCE_HOVER_ENRICH_MODE)) : EnrichMode.AFTER_DELAY;
((ITextViewerExtension8) fSourceViewer).setHoverEnrichMode(mode);
}
if (fSourceViewer instanceof ISourceViewerExtension5)
installCodeMiningProviders();
}
Aggregations