Java源码示例:org.eclipse.ui.texteditor.spelling.SpellingReconcileStrategy
示例1
@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;
}
示例2
@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;
}
示例3
public GWTJavaSpellingReconcileStrategy(ISourceViewer viewer,
ITextEditor editor) {
super(viewer, editor);
try {
// Reflectively set the spelling service to our own
Field spellingServiceField = SpellingReconcileStrategy.class.getDeclaredField("fSpellingService");
spellingServiceField.setAccessible(true);
spellingServiceField.set(this, GWTSpellingService.getSpellingService());
} catch (Exception e) {
GWTPluginLog.logError(e);
}
}
示例4
/**
* Verify that
* {@link org.eclipse.ui.texteditor.spelling.SpellingReconcileStrategy}
* contains the private fields we access reflectively in
* {@link GWTJavaSpellingReconcileStrategy}.
*
* @throws NoSuchFieldException
* @throws SecurityException
*/
public void testPrivateFields() throws SecurityException,
NoSuchFieldException {
Field spellingServiceField = SpellingReconcileStrategy.class.getDeclaredField("fSpellingService");
spellingServiceField.setAccessible(true);
}