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; }
/** * Call this method to cause the reconciler to reconcile. */ @Override public void forceReconciling() { super.forceReconciling(); }
@Override protected void initialProcess() { synchronized (fMutex) { super.initialProcess(); } fIninitalProcessDone= true; }
/** * 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); }
/** * {@inheritDoc} */ public IReconciler getReconciler( ISourceViewer sourceViewer ) { if ( this.reconciler == null ) { this.reconcilingStrategy = new LdifReconcilingStrategy( editor ); // Reconciler reconciler = new Reconciler(); // reconciler.setIsIncrementalReconciler(true); // reconciler.setReconcilingStrategy(strategy, // LdifPartitionScanner.LDIF_RECORD); // reconciler.setReconcilingStrategy(strategy, // IDocument.DEFAULT_CONTENT_TYPE); // reconciler.setProgressMonitor(new NullProgressMonitor()); // reconciler.setDelay(500); // return reconciler; this.reconciler = new MonoReconciler( this.reconcilingStrategy, true ); this.reconciler.setProgressMonitor( new NullProgressMonitor() ); this.reconciler.setDelay( 500 ); } return this.reconciler; }
@Override public IReconciler getReconciler(ISourceViewer sourceViewer) { if (!EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) return null; IReconcilingStrategy strategy= new SpellingReconcileStrategy(sourceViewer, EditorsUI.getSpellingService()) { @Override protected IContentType getContentType() { return PROPERTIES_CONTENT_TYPE; } }; MonoReconciler reconciler= new MonoReconciler(strategy, false); 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; }
/** * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer) */ public IReconciler getReconciler( ISourceViewer sourceViewer ) { if ( reconcilingStrategy == null ) { reconcilingStrategy = new FilterReconcilingStrategy( sourceViewer, parser ); } if ( reconciler == null ) { reconciler = new MonoReconciler( reconcilingStrategy, false ); } return reconciler; }
protected void reconcilerReset() { super.reconcilerReset(); JavaCompositeReconcilingStrategy strategy= (JavaCompositeReconcilingStrategy) getReconcilingStrategy(IDocument.DEFAULT_CONTENT_TYPE); strategy.notifyListeners(true); }
public void uninstall() { IWorkbenchPartSite site= fTextEditor.getSite(); IWorkbenchWindow window= site.getWorkbenchWindow(); window.getPartService().removePartListener(fPartListener); fPartListener= null; Shell shell= window.getShell(); if (shell != null && !shell.isDisposed()) shell.removeShellListener(fActivationListener); fActivationListener= null; JavaCore.removeElementChangedListener(fJavaElementChangedListener); fJavaElementChangedListener= null; IWorkspace workspace= JavaPlugin.getWorkspace(); workspace.removeResourceChangeListener(fResourceChangeListener); fResourceChangeListener= null; JavaPlugin.getDefault().getCombinedPreferenceStore().removePropertyChangeListener(fPropertyChangeListener); fPropertyChangeListener= null; super.uninstall(); }
public void install(ITextViewer textViewer) { super.install(textViewer); fPartListener= new PartListener(); IWorkbenchPartSite site= fTextEditor.getSite(); IWorkbenchWindow window= site.getWorkbenchWindow(); window.getPartService().addPartListener(fPartListener); fActivationListener= new ActivationListener(textViewer.getTextWidget()); Shell shell= window.getShell(); shell.addShellListener(fActivationListener); fJavaElementChangedListener= new ElementChangedListener(); JavaCore.addElementChangedListener(fJavaElementChangedListener); fResourceChangeListener= new ResourceChangeListener(); IWorkspace workspace= JavaPlugin.getWorkspace(); workspace.addResourceChangeListener(fResourceChangeListener); fPropertyChangeListener= new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (SpellingService.PREFERENCE_SPELLING_ENABLED.equals(event.getProperty()) || SpellingService.PREFERENCE_SPELLING_ENGINE.equals(event.getProperty())) forceReconciling(); } }; JavaPlugin.getDefault().getCombinedPreferenceStore().addPropertyChangeListener(fPropertyChangeListener); }
@Override public IReconciler getReconciler(ISourceViewer sourceViewer) { if (!EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) return null; IReconcilingStrategy strategy= new SpellingReconcileStrategy(sourceViewer, EditorsUI.getSpellingService()) { @Override protected IContentType getContentType() { return PROPERTIES_CONTENT_TYPE; } }; MonoReconciler reconciler= new MonoReconciler(strategy, false); reconciler.setDelay(500); return reconciler; }
@Override public IReconciler getReconciler(ISourceViewer sourceViewer) { JsonReconcilingStrategy strategy = new JsonReconcilingStrategy(); strategy.setEditor(editor); MonoReconciler reconciler = new MonoReconciler(strategy, false); return reconciler; }
/** * 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); }
@Override protected void reconcilerReset() { super.reconcilerReset(); JavaCompositeReconcilingStrategy strategy= (JavaCompositeReconcilingStrategy) getReconcilingStrategy(IDocument.DEFAULT_CONTENT_TYPE); strategy.notifyListeners(true); }
@Override public void uninstall() { IWorkbenchPartSite site= fTextEditor.getSite(); IWorkbenchWindow window= site.getWorkbenchWindow(); window.getPartService().removePartListener(fPartListener); fPartListener= null; Shell shell= window.getShell(); if (shell != null && !shell.isDisposed()) shell.removeShellListener(fActivationListener); fActivationListener= null; JavaCore.removeElementChangedListener(fJavaElementChangedListener); fJavaElementChangedListener= null; IWorkspace workspace= JavaPlugin.getWorkspace(); workspace.removeResourceChangeListener(fResourceChangeListener); fResourceChangeListener= null; JavaPlugin.getDefault().getCombinedPreferenceStore().removePropertyChangeListener(fPropertyChangeListener); fPropertyChangeListener= null; super.uninstall(); }
@Override public void install(ITextViewer textViewer) { super.install(textViewer); fPartListener= new PartListener(); IWorkbenchPartSite site= fTextEditor.getSite(); IWorkbenchWindow window= site.getWorkbenchWindow(); window.getPartService().addPartListener(fPartListener); fActivationListener= new ActivationListener(textViewer.getTextWidget()); Shell shell= window.getShell(); shell.addShellListener(fActivationListener); fJavaElementChangedListener= new ElementChangedListener(); JavaCore.addElementChangedListener(fJavaElementChangedListener); fResourceChangeListener= new ResourceChangeListener(); IWorkspace workspace= JavaPlugin.getWorkspace(); workspace.addResourceChangeListener(fResourceChangeListener); fPropertyChangeListener= new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { if (SpellingService.PREFERENCE_SPELLING_ENABLED.equals(event.getProperty()) || SpellingService.PREFERENCE_SPELLING_ENGINE.equals(event.getProperty())) forceReconciling(); } }; JavaPlugin.getDefault().getCombinedPreferenceStore().addPropertyChangeListener(fPropertyChangeListener); fReconciledElement= EditorUtility.getEditorInputJavaElement(fTextEditor, false); }
/** * 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; }
/** * 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 */ @Override 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.setDelay(500); return reconciler; }
@Override public IReconciler getReconciler(ISourceViewer sourceViewer) { if (fSourcePage != null && fReconciler == null) { IBaseModel model = fSourcePage.getInputContext().getModel(); if (model instanceof IReconcilingParticipant) { ReconcilingStrategy strategy = new ReconcilingStrategy(); strategy.addParticipant((IReconcilingParticipant) model); ISortableContentOutlinePage outline = fSourcePage.getContentOutline(); if (outline instanceof IReconcilingParticipant) strategy.addParticipant((IReconcilingParticipant) outline); fReconciler = new MonoReconciler(strategy, false); fReconciler.setDelay(500); } } return fReconciler; }