/** * Creates a new reconciler that uses the same reconciling strategy to * reconcile its document independent of the type of the document's contents. * * @param strategy the reconciling strategy to be used * @param isIncremental the indication whether strategy is incremental or not */ public MonoReconciler(IReconcilingStrategy strategy, boolean isIncremental) { Assert.isNotNull(strategy); fStrategy= strategy; if (fStrategy instanceof IReconcilingStrategyExtension) { IReconcilingStrategyExtension extension= (IReconcilingStrategyExtension)fStrategy; extension.setProgressMonitor(getProgressMonitor()); } setIsIncrementalReconciler(isIncremental); }
/** * Creates a new reconciler that uses the same reconciling strategy to * reconcile its document independent of the type of the document's contents. * * @param strategy the reconciling strategy to be used * @param isIncremental the indication whether strategy is incremental or not */ public MonoReconciler(IReconcilingStrategy strategy, boolean isIncremental) { Assert.isNotNull(strategy); fStrategy= strategy; if (fStrategy instanceof IReconcilingStrategyExtension) { IReconcilingStrategyExtension extension= (IReconcilingStrategyExtension)fStrategy; extension.setProgressMonitor(getProgressMonitor()); } setIsIncrementalReconciler(isIncremental); }
public IReconciler getReconciler(ISourceViewer sourceViewer) { if (!EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) return null; IReconcilingStrategy strategy= new SpellingReconcileStrategy(sourceViewer, EditorsUI.getSpellingService()) { protected IContentType getContentType() { return PROPERTIES_CONTENT_TYPE; } }; MonoReconciler reconciler= new MonoReconciler(strategy, false); reconciler.setIsIncrementalReconciler(false); reconciler.setProgressMonitor(new NullProgressMonitor()); reconciler.setDelay(500); return reconciler; }
/** * Returns the reconciler ready to be used with the given source viewer. * <p> * This implementation currently returns a {@link MonoReconciler} which * is responsible for spell checking. In the future a different reconciler * taking over more responsibilities might be returned.</p> * * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer) * @since 3.3 */ public IReconciler getReconciler(ISourceViewer sourceViewer) { if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) return null; SpellingService spellingService= EditorsUI.getSpellingService(); if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) == null) return null; IReconcilingStrategy strategy= new SpellingReconcileStrategy(sourceViewer, spellingService); MonoReconciler reconciler= new MonoReconciler(strategy, false); reconciler.setIsIncrementalReconciler(false); reconciler.setProgressMonitor(new NullProgressMonitor()); reconciler.setDelay(500); return reconciler; }
@Override public IReconciler getReconciler(ISourceViewer sourceViewer) { IReconcilingStrategy strategy; { if (markupValidationReconcilingStrategy == null) { markupValidationReconcilingStrategy = new MarkupValidationReconcilingStrategy(sourceViewer); markupValidationReconcilingStrategy.setMarkupLanguage(markupLanguage); markupValidationReconcilingStrategy.setResource(file); } IReconciler reconciler = super.getReconciler(sourceViewer); if (reconciler != null) { MultiReconcilingStrategy multiStrategy = new MultiReconcilingStrategy(); for (String contentType : FastMarkupPartitioner.ALL_CONTENT_TYPES) { maybeAddReconcilingStrategyForContentType(multiStrategy, reconciler, contentType); } maybeAddReconcilingStrategyForContentType(multiStrategy, reconciler, IDocument.DEFAULT_CONTENT_TYPE); multiStrategy.add(markupValidationReconcilingStrategy); strategy = multiStrategy; } else { strategy = markupValidationReconcilingStrategy; } } MonoReconciler reconciler = new MarkupMonoReconciler(strategy, false); reconciler.setIsIncrementalReconciler(false); reconciler.setProgressMonitor(new NullProgressMonitor()); reconciler.setDelay(500); return reconciler; }