public void install(StyledTextXtextAdapter styledTextXtextAdapter, XtextSourceViewer sourceViewer) { this.styledTextXtextAdapter = styledTextXtextAdapter; fSourceViewer = sourceViewer; if (styledTextXtextAdapter != null) { fConfiguration = styledTextXtextAdapter .getXtextSourceViewerConfiguration(); fPresentationReconciler = (XtextPresentationReconciler) fConfiguration .getPresentationReconciler(sourceViewer); } else { fConfiguration = null; fPresentationReconciler = null; } preferenceStore = getPreferenceStoreAccessor().getPreferenceStore(); preferenceStore.addPropertyChangeListener(this); enable(); }
/** * @since 2.3 */ public void install(XtextSourceViewerConfiguration configuration, XtextSourceViewer sourceViewer) { fSourceViewer= sourceViewer; fConfiguration= configuration; if(sourceViewer != null && configuration != null){ fPresentationReconciler= (XtextPresentationReconciler) fConfiguration.getPresentationReconciler(sourceViewer); } else { fPresentationReconciler = null; fConfiguration = null; } preferenceStore = getPreferenceStoreAccessor().getPreferenceStore(); preferenceStore.addPropertyChangeListener(this); enable(); }
/** * Install this presenter on the given source viewer and background presentation reconciler. * * @param sourceViewer * the source viewer * @param backgroundPresentationReconciler * the background presentation reconciler, can be <code>null</code>, in that case * {@link HighlightingPresenter#createPresentation(List, List)} should not be called */ public void install(XtextSourceViewer sourceViewer, XtextPresentationReconciler backgroundPresentationReconciler) { fSourceViewer = sourceViewer; fPresentationReconciler = backgroundPresentationReconciler; fSourceViewer.prependTextPresentationListener(this); fSourceViewer.addTextPresentationListener(this); fSourceViewer.addTextInputListener(this); manageDocument(fSourceViewer.getDocument()); }