本文整理汇总了Java中org.eclipse.jface.text.reconciler.IReconcilingStrategy类的典型用法代码示例。如果您正苦于以下问题:Java IReconcilingStrategy类的具体用法?Java IReconcilingStrategy怎么用?Java IReconcilingStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IReconcilingStrategy类属于org.eclipse.jface.text.reconciler包,在下文中一共展示了IReconcilingStrategy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getReconciler
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
/**
* @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;
}
示例2: getReconciler
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
@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;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:PropertiesFileSourceViewerConfiguration.java
示例3: getReconciler
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
@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;
}
示例4: getReconciler
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
@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;
}
示例5: create
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
private static IReconcilingStrategy create(IPreferenceStore preferenceStore, IResource resource) {
if (EditorConfigConstants.EDITORCONFIG.equals(resource.getName())) {
// it's an .editorconfig file, add validation
CompositeReconcilingStrategy strategy = new CompositeReconcilingStrategy();
strategy.setReconcilingStrategies(new IReconcilingStrategy[] { new ValidateEditorConfigStrategy(resource),
new ValidateAppliedOptionsStrategy(preferenceStore, resource), new EditorConfigFoldingStrategy() });
return strategy;
}
return new ValidateAppliedOptionsStrategy(preferenceStore, resource);
}
示例6: getReconcilingStrategies
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
public IReconcilingStrategy[] getReconcilingStrategies() {
if (store.getBoolean(Prefs.SPELLING_ENABLED)) {
SpellingService service = new SpellingService(store);
if (service.getActiveSpellingEngineDescriptor(store) != null) {
IReconcilingStrategy spellStrategy = new SpellingReconcileStrategy(viewer, service);
return new IReconcilingStrategy[] { spellStrategy };
}
}
return new IReconcilingStrategy[] { new NullReconcilingStrategy() };
}
示例7: setDocument
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
@Override
public void setDocument(IDocument document) {
if (strategies == null) return;
for (IReconcilingStrategy strategy : strategies) {
strategy.setDocument(document);
}
}
示例8: reconcile
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
@Override
public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
if (strategies == null) return;
for (IReconcilingStrategy strategy : strategies) {
strategy.reconcile(dirtyRegion, subRegion);
}
}
示例9: setProgressMonitor
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
@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);
}
}
}
示例10: initialReconcile
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
@Override
public void initialReconcile() {
if (strategies == null) return;
for (IReconcilingStrategy strategy : strategies) {
if (strategy instanceof IReconcilingStrategyExtension) {
IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension) strategy;
extension.initialReconcile();
}
}
}
示例11: getTypeScriptFoldingStrategy
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
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;
}
示例12: getCodeLensStrategy
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
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;
}
示例13: getSpellcheckStrategy
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
@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;
}
示例14: getReconciler
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
@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;
}
示例15: dispose
import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
public void dispose()
{
for (IReconcilingStrategy strategy : fStrategies)
{
if (strategy instanceof IDisposableReconcilingStrategy)
{
((IDisposableReconcilingStrategy) strategy).dispose();
}
}
}