当前位置: 首页>>代码示例>>Java>>正文


Java IReconcilingStrategy类代码示例

本文整理汇总了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;
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:26,代码来源:TexSourceViewerConfiguration.java

示例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;
}
 
开发者ID:ncjones,项目名称:editorconfig-eclipse,代码行数:17,代码来源:EditorConfigSourceViewerConfiguration.java

示例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;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:21,代码来源:PyEditConfigurationWithoutEditor.java

示例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);
}
 
开发者ID:angelozerr,项目名称:ec4e,代码行数:11,代码来源:EditorConfigReconciler.java

示例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() };
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:11,代码来源:MkReconcilingStrategy.java

示例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);
	}
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:9,代码来源:CompositeReconcilingStrategy.java

示例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);
	}
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:9,代码来源:CompositeReconcilingStrategy.java

示例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);
		}
	}
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:12,代码来源:CompositeReconcilingStrategy.java

示例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();
		}
	}
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:12,代码来源:CompositeReconcilingStrategy.java

示例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;
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:15,代码来源:TypeScriptDocumentRegionProcessor.java

示例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;
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:16,代码来源:TypeScriptDocumentRegionProcessor.java

示例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;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:16,代码来源:UiBinderStructuredRegionProcessor.java

示例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;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:29,代码来源:GWTSourceViewerConfiguration.java

示例15: dispose

import org.eclipse.jface.text.reconciler.IReconcilingStrategy; //导入依赖的package包/类
public void dispose()
{
	for (IReconcilingStrategy strategy : fStrategies)
	{
		if (strategy instanceof IDisposableReconcilingStrategy)
		{
			((IDisposableReconcilingStrategy) strategy).dispose();
		}
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:11,代码来源:CompositeReconcilingStrategy.java


注:本文中的org.eclipse.jface.text.reconciler.IReconcilingStrategy类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。