本文整理汇总了Java中org.eclipse.search.core.text.TextSearchMatchAccess.getMatchLength方法的典型用法代码示例。如果您正苦于以下问题:Java TextSearchMatchAccess.getMatchLength方法的具体用法?Java TextSearchMatchAccess.getMatchLength怎么用?Java TextSearchMatchAccess.getMatchLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.search.core.text.TextSearchMatchAccess
的用法示例。
在下文中一共展示了TextSearchMatchAccess.getMatchLength方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: acceptPatternMatch
import org.eclipse.search.core.text.TextSearchMatchAccess; //导入方法依赖的package包/类
@Override
public boolean acceptPatternMatch(TextSearchMatchAccess matchAccess) throws CoreException {
int start = matchAccess.getMatchOffset();
int length = matchAccess.getMatchLength();
// skip embedded FQNs (bug 130764):
if (start > 0) {
char before = matchAccess.getFileContentChar(start - 1);
if (before == '.' || Character.isJavaIdentifierPart(before)) return true;
}
int fileContentLength = matchAccess.getFileContentLength();
int end = start + length;
if (end < fileContentLength) {
char after = matchAccess.getFileContentChar(end);
if (Character.isJavaIdentifierPart(after)) return true;
}
IFile file = matchAccess.getFile();
TextChange change = fResult.getChange(file);
TextChangeCompatibility.addTextEdit(
change,
RefactoringCoreMessages.QualifiedNameFinder_update_name,
new ReplaceEdit(start, length, fNewValue),
QUALIFIED_NAMES);
return true;
}
示例2: acceptPatternMatch
import org.eclipse.search.core.text.TextSearchMatchAccess; //导入方法依赖的package包/类
@Override
public boolean acceptPatternMatch(TextSearchMatchAccess matchAccess) throws CoreException {
int start= matchAccess.getMatchOffset();
int length= matchAccess.getMatchLength();
// skip embedded FQNs (bug 130764):
if (start > 0) {
char before= matchAccess.getFileContentChar(start - 1);
if (before == '.' || Character.isJavaIdentifierPart(before))
return true;
}
int fileContentLength= matchAccess.getFileContentLength();
int end= start + length;
if (end < fileContentLength) {
char after= matchAccess.getFileContentChar(end);
if (Character.isJavaIdentifierPart(after))
return true;
}
IFile file= matchAccess.getFile();
TextChange change= fResult.getChange(file);
TextChangeCompatibility.addTextEdit(
change,
RefactoringCoreMessages.QualifiedNameFinder_update_name,
new ReplaceEdit(start, length, fNewValue), QUALIFIED_NAMES);
return true;
}
示例3: acceptPatternMatch
import org.eclipse.search.core.text.TextSearchMatchAccess; //导入方法依赖的package包/类
@Override
public boolean acceptPatternMatch(TextSearchMatchAccess matchAccess) throws CoreException {
int start= matchAccess.getMatchOffset();
int length= matchAccess.getMatchLength();
if (fIsKeyDoubleQuoted) {
start= start + 1;
length= length - 2;
}
fResult.add(new KeyReference(matchAccess.getFile(), null, start, length, true));
return true;
}
示例4: acceptPatternMatch
import org.eclipse.search.core.text.TextSearchMatchAccess; //导入方法依赖的package包/类
@Override
public boolean acceptPatternMatch(TextSearchMatchAccess matchAccess) throws CoreException {
int start= matchAccess.getMatchOffset();
int length= matchAccess.getMatchLength();
if (fIsKeyDoubleQuoted) {
start= start + 1;
length= length - 2;
}
fResult.add(new KeyReference(matchAccess.getFile(), start, length));
return true;
}
示例5: acceptPatternMatch
import org.eclipse.search.core.text.TextSearchMatchAccess; //导入方法依赖的package包/类
@Override
public boolean acceptPatternMatch(TextSearchMatchAccess matchRequestor) throws CoreException {
int matchOffset = matchRequestor.getMatchOffset();
int matchLength = matchRequestor.getMatchLength();
IFile file = matchRequestor.getFile();
FileMatch fileMatch = new FileMatch(file, matchOffset, matchLength, expression);
fCachedMatches.add(fileMatch);
return true;
}