org.eclipse.jface.text.reconciler.IReconcilingStrategy Java Examples
The following examples show how to use
org.eclipse.jface.text.reconciler.IReconcilingStrategy.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TexSourceViewerConfiguration.java From texlipse with Eclipse Public License 1.0 | 6 votes |
/** * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer) */ @Override public IReconciler getReconciler(ISourceViewer sourceViewer) { if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) return null; if (!TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(TexlipseProperties.ECLIPSE_BUILDIN_SPELLCHECKER)) return null; //Set TeXlipse spelling Engine as default PreferenceStore store = new PreferenceStore(); store.setValue(SpellingService.PREFERENCE_SPELLING_ENGINE, "org.eclipse.texlipse.LaTeXSpellEngine"); store.setValue(SpellingService.PREFERENCE_SPELLING_ENABLED, true); SpellingService spellingService = new SpellingService(store); if (spellingService.getActiveSpellingEngineDescriptor(store) == null) return null; IReconcilingStrategy strategy= new TeXSpellingReconcileStrategy(sourceViewer, spellingService); MonoReconciler reconciler= new MonoReconciler(strategy, true); reconciler.setDelay(500); reconciler.setProgressMonitor(new NullProgressMonitor()); return reconciler; }
Example #2
Source File: PropertiesFileSourceViewerConfiguration.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
@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; }
Example #3
Source File: EditorConfigSourceViewerConfiguration.java From editorconfig-eclipse with Apache License 2.0 | 6 votes |
@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 EditorConfigTextTools.EDITORCONFIG_CONTENT_TYPE; } }; MonoReconciler reconciler = new MonoReconciler(strategy, false); reconciler.setDelay(500); return reconciler; }
Example #4
Source File: PyEditConfigurationWithoutEditor.java From Pydev with Eclipse Public License 1.0 | 6 votes |
@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; } //Overridden (just) to return a PyReconciler! IReconcilingStrategy strategy = new PyReconciler(sourceViewer, spellingService); MonoReconciler reconciler = new MonoReconciler(strategy, false); reconciler.setIsIncrementalReconciler(false); reconciler.setProgressMonitor(new NullProgressMonitor()); reconciler.setDelay(500); return reconciler; }
Example #5
Source File: CompositeReconcilingStrategy.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void fullReconcile() { for (IReconcilingStrategy strategy : fStrategies) { if (strategy instanceof IBatchReconcilingStrategy) { IBatchReconcilingStrategy extension = (IBatchReconcilingStrategy) strategy; extension.fullReconcile(); } } }
Example #6
Source File: CompositeReconcilingStrategy.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void initialReconcile() { for (IReconcilingStrategy strategy : fStrategies) { if (strategy instanceof IReconcilingStrategyExtension) { IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension) strategy; extension.initialReconcile(); } } }
Example #7
Source File: CompositeReconcilingStrategy.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void setProgressMonitor(IProgressMonitor monitor) { for (IReconcilingStrategy strategy : fStrategies) { if (strategy instanceof IReconcilingStrategyExtension) { IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension) strategy; extension.setProgressMonitor(monitor); } } }
Example #8
Source File: CompositeReconcilingStrategy.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void reconcile(IRegion partition) { for (IReconcilingStrategy strategy : fStrategies) { strategy.reconcile(partition); } }
Example #9
Source File: CompositeReconcilingStrategy.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) { for (IReconcilingStrategy strategy : fStrategies) { strategy.reconcile(dirtyRegion, subRegion); } }
Example #10
Source File: CompositeReconcilingStrategy.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void setDocument(IDocument document) { for (IReconcilingStrategy strategy : fStrategies) { strategy.setDocument(document); } }
Example #11
Source File: JavaCompositeReconcilingStrategy.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
/** * Creates a new Java reconciling strategy. * * @param viewer the source viewer * @param editor the editor of the strategy's reconciler * @param documentPartitioning the document partitioning this strategy uses for configuration */ public JavaCompositeReconcilingStrategy(ISourceViewer viewer, ITextEditor editor, String documentPartitioning) { fEditor= editor; fJavaStrategy= new JavaReconcilingStrategy(editor); setReconcilingStrategies(new IReconcilingStrategy[] { fJavaStrategy, new JavaSpellingReconcileStrategy(viewer, editor) }); }
Example #12
Source File: CommonReconciler.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
/** * */ public CommonReconciler(IReconcilingStrategy defaultStrategy) { super(); this.defaultStrategy = defaultStrategy; setReconcilingStrategy(defaultStrategy, String.valueOf(System.currentTimeMillis())); }
Example #13
Source File: CommonReconciler.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
@Override public IReconcilingStrategy getReconcilingStrategy(String contentType) { IReconcilingStrategy strategy = super.getReconcilingStrategy(contentType); if (strategy != null) { return strategy; } return defaultStrategy; }
Example #14
Source File: CompositeReconcilingStrategy.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
public void dispose() { for (IReconcilingStrategy strategy : fStrategies) { if (strategy instanceof IDisposableReconcilingStrategy) { ((IDisposableReconcilingStrategy) strategy).dispose(); } } }
Example #15
Source File: CommonReconciler.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
@Override protected void initialProcess() { for (IReconcilingStrategy s : reconcilingStrategies) { if (s instanceof IReconcilingStrategyExtension) { ((IReconcilingStrategyExtension) s).initialReconcile(); } } fInitialProcessDone = true; }
Example #16
Source File: GWTSourceViewerConfiguration.java From gwt-eclipse-plugin with Eclipse Public License 1.0 | 5 votes |
@Override public IReconciler getReconciler(ISourceViewer sourceViewer) { JavaReconciler reconciler = (JavaReconciler) super.getReconciler(sourceViewer); if (reconciler != null) { try { JavaCompositeReconcilingStrategy strategy = (JavaCompositeReconcilingStrategy) reconciler.getReconcilingStrategy(IDocument.DEFAULT_CONTENT_TYPE); IReconcilingStrategy[] strategies = strategy.getReconcilingStrategies(); IReconcilingStrategy[] newStrategies = new IReconcilingStrategy[strategies.length]; for (int i = 0; i < strategies.length; i++) { if (strategies[i] instanceof JavaSpellingReconcileStrategy) { // Replace the default Java reconcile strategy with our own, which // will suppress spell checking within JSNI blocks newStrategies[i] = new GWTJavaSpellingReconcileStrategy( sourceViewer, getEditor()); } else { newStrategies[i] = strategies[i]; } } strategy.setReconcilingStrategies(newStrategies); } catch (Exception e) { // We're being defensive to ensure that we always return a reconciler GWTPluginLog.logError(e); } return reconciler; } return null; }
Example #17
Source File: UiBinderStructuredRegionProcessor.java From gwt-eclipse-plugin with Eclipse Public License 1.0 | 5 votes |
@Override protected IReconcilingStrategy getSpellcheckStrategy() { if (spellcheckStrategy == null) { String contentTypeId = getContentType(getDocument()); if (contentTypeId != null) { if (getTextViewer() instanceof ISourceViewer) { ISourceViewer viewer = (ISourceViewer) getTextViewer(); spellcheckStrategy = new UiBinderSpellcheckStrategy(viewer, contentTypeId); spellcheckStrategy.setDocument(getDocument()); } } } return spellcheckStrategy; }
Example #18
Source File: TypeScriptDocumentRegionProcessor.java From typescript.java with MIT License | 5 votes |
protected IReconcilingStrategy getCodeLensStrategy() { if (!TypeScriptUIPlugin.getDefault().getPreferenceStore() .getBoolean(TypeScriptUIPreferenceConstants.EDITOR_ACTIVATE_CODELENS)) { return null; } if (codeLensStrategy == null && getDocument() != null) { if (getTextViewer() instanceof ISourceViewer) { ISourceViewer viewer = (ISourceViewer) getTextViewer(); codeLensStrategy = new TypeScriptCodeLensStrategy(viewer); codeLensStrategy.setDocument(getDocument()); codeLensStrategy.setProgressMonitor(new NullProgressMonitor()); } } return codeLensStrategy; }
Example #19
Source File: TypeScriptDocumentRegionProcessor.java From typescript.java with MIT License | 5 votes |
protected IReconcilingStrategy getTypeScriptFoldingStrategy() { if ("org.eclipse.wst.jsdt.core.jsSource".equals(contentType)) { return super.getFoldingStrategy(); } if (foldingStrategy == null) { ITextViewer viewer = getTextViewer(); if (viewer instanceof ProjectionViewer) { foldingStrategy = new TypeScriptFoldingStrategy(); foldingStrategy.setViewer((ProjectionViewer) viewer); foldingStrategy.setDocument(getDocument()); } } return foldingStrategy; }
Example #20
Source File: CommonReconciler.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
/** * @param strategy * @param contentTypes */ public void setReconcilingStrategy(IReconcilingStrategy strategy, Collection<String> contentTypes) { for (String contentType : contentTypes) { setReconcilingStrategy(strategy, contentType); } }
Example #21
Source File: CommonSourceViewerConfiguration.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
@Override public IReconciler getReconciler(ISourceViewer sourceViewer) { if (fTextEditor != null && fTextEditor.isEditable()) { IReconcilingStrategy reconcilingStrategy = new CommonReconcilingStrategy(fTextEditor); if (EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) { SpellingService spellingService = EditorsUI.getSpellingService(); Collection<String> spellingContentTypes = getSpellingContentTypes(sourceViewer); if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) != null && !spellingContentTypes.isEmpty()) { reconcilingStrategy = new CompositeReconcilingStrategy(reconcilingStrategy, new MultiRegionSpellingReconcileStrategy(sourceViewer, spellingService, getConfiguredDocumentPartitioning(sourceViewer), spellingContentTypes)); } } CommonReconciler reconciler = new CommonReconciler(reconcilingStrategy); reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); reconciler.setIsIncrementalReconciler(false); reconciler.setIsAllowedToModifyDocument(false); reconciler.setProgressMonitor(new NullProgressMonitor()); reconciler.setDelay(500); return fReconciler = reconciler; } return null; }
Example #22
Source File: CompositeReconcilingStrategy.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
/** * {@inheritDoc} */ @Override public void initialReconcile() { if (strategies == null) return; for (IReconcilingStrategy strategy : strategies) { if (strategy instanceof IReconcilingStrategyExtension) { IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension)strategy; extension.initialReconcile(); } } }
Example #23
Source File: CompositeReconcilingStrategy.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
/** * {@inheritDoc} */ @Override public void setProgressMonitor(IProgressMonitor monitor) { if (strategies == null) return; for (IReconcilingStrategy strategy : strategies) { if (strategy instanceof IReconcilingStrategyExtension) { IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension)strategy; extension.setProgressMonitor(monitor); } } }
Example #24
Source File: CompositeReconcilingStrategy.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
/** * {@inheritDoc} */ @Override public void reconcile(IRegion partition) { if (strategies == null) return; for (IReconcilingStrategy strategy : strategies) { strategy.reconcile(partition); } }
Example #25
Source File: CompositeReconcilingStrategy.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
/** * {@inheritDoc} */ @Override public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) { if (strategies == null) return; for (IReconcilingStrategy strategy : strategies) { strategy.reconcile(dirtyRegion, subRegion); } }
Example #26
Source File: CompositeReconcilingStrategy.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
/** * {@inheritDoc} */ @Override public void setDocument(IDocument document) { if (strategies == null) return; for (IReconcilingStrategy strategy : strategies) { strategy.setDocument(document); } }
Example #27
Source File: XtextCodeMiningReconcileStrategy.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
@Override public IReconcilingStrategy create(ISourceViewer viewer) { if (viewer instanceof ISourceViewerExtension5) { return new XtextCodeMiningReconcileStrategy((ISourceViewerExtension5) viewer); } return null; }
Example #28
Source File: IReconcileStrategyFactory.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
default IReconcilingStrategy createOrNull(ISourceViewer viewer) { try { return create(viewer); } catch(Throwable t) { return null; } }
Example #29
Source File: XtextDocumentReconcileStrategy.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
/** * @since 2.3 */ @Override public void initialReconcile() { for (IReconcilingStrategy strategy: strategies) { if (strategy instanceof IReconcilingStrategyExtension) { ((IReconcilingStrategyExtension) strategy).initialReconcile(); } } }
Example #30
Source File: XtextDocumentReconcileStrategy.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
/** * @since 2.3 */ @Override public void setProgressMonitor(IProgressMonitor monitor) { this.monitor = monitor; for (IReconcilingStrategy strategy: strategies) { if (strategy instanceof IReconcilingStrategyExtension) { ((IReconcilingStrategyExtension) strategy).setProgressMonitor(monitor); } } }