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


Java SpellingProblem.getLength方法代码示例

本文整理汇总了Java中org.eclipse.ui.texteditor.spelling.SpellingProblem.getLength方法的典型用法代码示例。如果您正苦于以下问题:Java SpellingProblem.getLength方法的具体用法?Java SpellingProblem.getLength怎么用?Java SpellingProblem.getLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.texteditor.spelling.SpellingProblem的用法示例。


在下文中一共展示了SpellingProblem.getLength方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: accept

import org.eclipse.ui.texteditor.spelling.SpellingProblem; //导入方法依赖的package包/类
public void accept(SpellingProblem problem) {
	IProblemRequestor requestor= fRequestor;
	if (requestor != null) {
		try {
			int line= getDocument().getLineOfOffset(problem.getOffset()) + 1;
			String word= getDocument().get(problem.getOffset(), problem.getLength());
			boolean dictionaryMatch= false;
			boolean sentenceStart= false;
			if (problem instanceof JavaSpellingProblem) {
				dictionaryMatch= ((JavaSpellingProblem)problem).isDictionaryMatch();
				sentenceStart= ((JavaSpellingProblem) problem).isSentenceStart();
			}
			// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=81514
			IEditorInput editorInput= fEditor.getEditorInput();
			if (editorInput != null) {
				CoreSpellingProblem iProblem= new CoreSpellingProblem(problem.getOffset(), problem.getOffset() + problem.getLength() - 1, line, problem.getMessage(), word, dictionaryMatch, sentenceStart, getDocument(), editorInput.getName());
				requestor.acceptProblem(iProblem);
			}
		} catch (BadLocationException x) {
			// drop this SpellingProblem
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:JavaSpellingReconcileStrategy.java

示例2: getReconciler

import org.eclipse.ui.texteditor.spelling.SpellingProblem; //导入方法依赖的package包/类
public IReconciler getReconciler(final 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) {
		
		@Override
		protected ISpellingProblemCollector createSpellingProblemCollector() {
			final ISpellingProblemCollector collector = super.createSpellingProblemCollector();
			
			return new ISpellingProblemCollector() {
				
				public void accept(SpellingProblem problem) {
					int offset = problem.getOffset();
					int length = problem.getLength();
					if (sourceViewer == null) {
						return;
					}
					IDocument document = sourceViewer.getDocument();
					if (document == null) {
						return;
					}
					String text;
					try {
						text = document.get(offset, length);
					} catch (BadLocationException e) {
						return;
					}
					if (new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileIgnoredWordsFilter().ignoreWord(text)) {
						return;
					}
					collector.accept(problem);
				}
				
				public void beginCollecting() {
					collector.beginCollecting();
				}
				
				public void endCollecting() {
					collector.endCollecting();
				}
			};
		}
	};
	
	MonoReconciler reconciler = new MonoReconciler(strategy, false);
	reconciler.setDelay(500);
	return reconciler;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:DwprofileSourceViewerConfiguration.java

示例3: getReconciler

import org.eclipse.ui.texteditor.spelling.SpellingProblem; //导入方法依赖的package包/类
public IReconciler getReconciler(final 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) {
		
		@Override
		protected ISpellingProblemCollector createSpellingProblemCollector() {
			final ISpellingProblemCollector collector = super.createSpellingProblemCollector();
			
			return new ISpellingProblemCollector() {
				
				public void accept(SpellingProblem problem) {
					int offset = problem.getOffset();
					int length = problem.getLength();
					if (sourceViewer == null) {
						return;
					}
					IDocument document = sourceViewer.getDocument();
					if (document == null) {
						return;
					}
					String text;
					try {
						text = document.get(offset, length);
					} catch (BadLocationException e) {
						return;
					}
					if (new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionIgnoredWordsFilter().ignoreWord(text)) {
						return;
					}
					collector.accept(problem);
				}
				
				public void beginCollecting() {
					collector.beginCollecting();
				}
				
				public void endCollecting() {
					collector.endCollecting();
				}
			};
		}
	};
	
	MonoReconciler reconciler = new MonoReconciler(strategy, false);
	reconciler.setDelay(500);
	return reconciler;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:HyexpressionSourceViewerConfiguration.java

示例4: getReconciler

import org.eclipse.ui.texteditor.spelling.SpellingProblem; //导入方法依赖的package包/类
public IReconciler getReconciler(final 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) {
		
		@Override
		protected ISpellingProblemCollector createSpellingProblemCollector() {
			final ISpellingProblemCollector collector = super.createSpellingProblemCollector();
			
			return new ISpellingProblemCollector() {
				
				public void accept(SpellingProblem problem) {
					int offset = problem.getOffset();
					int length = problem.getLength();
					if (sourceViewer == null) {
						return;
					}
					IDocument document = sourceViewer.getDocument();
					if (document == null) {
						return;
					}
					String text;
					try {
						text = document.get(offset, length);
					} catch (BadLocationException e) {
						return;
					}
					if (new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaIgnoredWordsFilter().ignoreWord(text)) {
						return;
					}
					collector.accept(problem);
				}
				
				public void beginCollecting() {
					collector.beginCollecting();
				}
				
				public void endCollecting() {
					collector.endCollecting();
				}
			};
		}
	};
	
	MonoReconciler reconciler = new MonoReconciler(strategy, false);
	reconciler.setDelay(500);
	return reconciler;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:HyvalidityformulaSourceViewerConfiguration.java

示例5: getReconciler

import org.eclipse.ui.texteditor.spelling.SpellingProblem; //导入方法依赖的package包/类
public IReconciler getReconciler(final 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) {
		
		@Override
		protected ISpellingProblemCollector createSpellingProblemCollector() {
			final ISpellingProblemCollector collector = super.createSpellingProblemCollector();
			
			return new ISpellingProblemCollector() {
				
				public void accept(SpellingProblem problem) {
					int offset = problem.getOffset();
					int length = problem.getLength();
					if (sourceViewer == null) {
						return;
					}
					IDocument document = sourceViewer.getDocument();
					if (document == null) {
						return;
					}
					String text;
					try {
						text = document.get(offset, length);
					} catch (BadLocationException e) {
						return;
					}
					if (new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueIgnoredWordsFilter().ignoreWord(text)) {
						return;
					}
					collector.accept(problem);
				}
				
				public void beginCollecting() {
					collector.beginCollecting();
				}
				
				public void endCollecting() {
					collector.endCollecting();
				}
			};
		}
	};
	
	MonoReconciler reconciler = new MonoReconciler(strategy, false);
	reconciler.setDelay(500);
	return reconciler;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:HydatavalueSourceViewerConfiguration.java

示例6: getReconciler

import org.eclipse.ui.texteditor.spelling.SpellingProblem; //导入方法依赖的package包/类
public IReconciler getReconciler(final 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) {
		
		@Override
		protected ISpellingProblemCollector createSpellingProblemCollector() {
			final ISpellingProblemCollector collector = super.createSpellingProblemCollector();
			
			return new ISpellingProblemCollector() {
				
				public void accept(SpellingProblem problem) {
					int offset = problem.getOffset();
					int length = problem.getLength();
					if (sourceViewer == null) {
						return;
					}
					IDocument document = sourceViewer.getDocument();
					if (document == null) {
						return;
					}
					String text;
					try {
						text = document.get(offset, length);
					} catch (BadLocationException e) {
						return;
					}
					if (new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingIgnoredWordsFilter().ignoreWord(text)) {
						return;
					}
					collector.accept(problem);
				}
				
				public void beginCollecting() {
					collector.beginCollecting();
				}
				
				public void endCollecting() {
					collector.endCollecting();
				}
			};
		}
	};
	
	MonoReconciler reconciler = new MonoReconciler(strategy, false);
	reconciler.setDelay(500);
	return reconciler;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:HymappingSourceViewerConfiguration.java

示例7: getReconciler

import org.eclipse.ui.texteditor.spelling.SpellingProblem; //导入方法依赖的package包/类
public IReconciler getReconciler(final 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) {
		
		@Override
		protected ISpellingProblemCollector createSpellingProblemCollector() {
			final ISpellingProblemCollector collector = super.createSpellingProblemCollector();
			
			return new ISpellingProblemCollector() {
				
				public void accept(SpellingProblem problem) {
					int offset = problem.getOffset();
					int length = problem.getLength();
					if (sourceViewer == null) {
						return;
					}
					IDocument document = sourceViewer.getDocument();
					if (document == null) {
						return;
					}
					String text;
					try {
						text = document.get(offset, length);
					} catch (BadLocationException e) {
						return;
					}
					if (new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsIgnoredWordsFilter().ignoreWord(text)) {
						return;
					}
					collector.accept(problem);
				}
				
				public void beginCollecting() {
					collector.beginCollecting();
				}
				
				public void endCollecting() {
					collector.endCollecting();
				}
			};
		}
	};
	
	MonoReconciler reconciler = new MonoReconciler(strategy, false);
	reconciler.setDelay(500);
	return reconciler;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:HyconstraintsSourceViewerConfiguration.java

示例8: getReconciler

import org.eclipse.ui.texteditor.spelling.SpellingProblem; //导入方法依赖的package包/类
public IReconciler getReconciler(final 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) {
		
		@Override
		protected ISpellingProblemCollector createSpellingProblemCollector() {
			final ISpellingProblemCollector collector = super.createSpellingProblemCollector();
			
			return new ISpellingProblemCollector() {
				
				public void accept(SpellingProblem problem) {
					int offset = problem.getOffset();
					int length = problem.getLength();
					if (sourceViewer == null) {
						return;
					}
					IDocument document = sourceViewer.getDocument();
					if (document == null) {
						return;
					}
					String text;
					try {
						text = document.get(offset, length);
					} catch (BadLocationException e) {
						return;
					}
					if (new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestIgnoredWordsFilter().ignoreWord(text)) {
						return;
					}
					collector.accept(problem);
				}
				
				public void beginCollecting() {
					collector.beginCollecting();
				}
				
				public void endCollecting() {
					collector.endCollecting();
				}
			};
		}
	};
	
	MonoReconciler reconciler = new MonoReconciler(strategy, false);
	reconciler.setDelay(500);
	return reconciler;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:56,代码来源:HymanifestSourceViewerConfiguration.java


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