本文整理汇总了Java中org.eclipse.jdt.core.search.IJavaSearchConstants.DECLARATIONS属性的典型用法代码示例。如果您正苦于以下问题:Java IJavaSearchConstants.DECLARATIONS属性的具体用法?Java IJavaSearchConstants.DECLARATIONS怎么用?Java IJavaSearchConstants.DECLARATIONS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.search.IJavaSearchConstants
的用法示例。
在下文中一共展示了IJavaSearchConstants.DECLARATIONS属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findAllDeclarations
private void findAllDeclarations(IProgressMonitor monitor, WorkingCopyOwner owner) throws CoreException {
fDeclarations = new ArrayList<>();
class MethodRequestor extends SearchRequestor {
@Override
public void acceptSearchMatch(SearchMatch match) throws CoreException {
IMethod method = (IMethod) match.getElement();
boolean isBinary = method.isBinary();
if (!isBinary) {
fDeclarations.add(method);
}
}
}
int limitTo = IJavaSearchConstants.DECLARATIONS | IJavaSearchConstants.IGNORE_DECLARING_TYPE | IJavaSearchConstants.IGNORE_RETURN_TYPE;
int matchRule = SearchPattern.R_ERASURE_MATCH | SearchPattern.R_CASE_SENSITIVE;
SearchPattern pattern = SearchPattern.createPattern(fMethod, limitTo, matchRule);
MethodRequestor requestor = new MethodRequestor();
SearchEngine searchEngine = owner != null ? new SearchEngine(owner) : new SearchEngine();
searchEngine.search(pattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, createSearchScope(), requestor, monitor);
}
示例2: findAllDeclarations
private void findAllDeclarations(IProgressMonitor monitor, WorkingCopyOwner owner)
throws CoreException {
fDeclarations = new ArrayList<IMethod>();
class MethodRequestor extends SearchRequestor {
@Override
public void acceptSearchMatch(SearchMatch match) throws CoreException {
IMethod method = (IMethod) match.getElement();
boolean isBinary = method.isBinary();
if (fBinaryRefs != null || !(fExcludeBinaries && isBinary)) {
fDeclarations.add(method);
}
if (isBinary && fBinaryRefs != null) {
fDeclarationToMatch.put(method, match);
}
}
}
int limitTo =
IJavaSearchConstants.DECLARATIONS
| IJavaSearchConstants.IGNORE_DECLARING_TYPE
| IJavaSearchConstants.IGNORE_RETURN_TYPE;
int matchRule = SearchPattern.R_ERASURE_MATCH | SearchPattern.R_CASE_SENSITIVE;
SearchPattern pattern = SearchPattern.createPattern(fMethod, limitTo, matchRule);
SearchParticipant[] participants = SearchUtils.getDefaultSearchParticipants();
IJavaSearchScope scope =
RefactoringScopeFactory.createRelatedProjectsScope(
fMethod.getJavaProject(),
IJavaSearchScope.SOURCES
| IJavaSearchScope.APPLICATION_LIBRARIES
| IJavaSearchScope.SYSTEM_LIBRARIES);
MethodRequestor requestor = new MethodRequestor();
SearchEngine searchEngine = owner != null ? new SearchEngine(owner) : new SearchEngine();
searchEngine.search(pattern, participants, scope, requestor, monitor);
}
示例3: getImageDescriptor
ImageDescriptor getImageDescriptor() {
int limitTo = getMaskedLimitTo();
if (limitTo == IJavaSearchConstants.IMPLEMENTORS
|| limitTo == IJavaSearchConstants.DECLARATIONS)
return JavaPluginImages.DESC_OBJS_SEARCH_DECL;
else return JavaPluginImages.DESC_OBJS_SEARCH_REF;
}
示例4: findAllDeclarations
private void findAllDeclarations(IProgressMonitor monitor, WorkingCopyOwner owner) throws CoreException {
fDeclarations= new ArrayList<IMethod>();
class MethodRequestor extends SearchRequestor {
@Override
public void acceptSearchMatch(SearchMatch match) throws CoreException {
IMethod method= (IMethod) match.getElement();
boolean isBinary= method.isBinary();
if (fBinaryRefs != null || ! (fExcludeBinaries && isBinary)) {
fDeclarations.add(method);
}
if (isBinary && fBinaryRefs != null) {
fDeclarationToMatch.put(method, match);
}
}
}
int limitTo = IJavaSearchConstants.DECLARATIONS | IJavaSearchConstants.IGNORE_DECLARING_TYPE | IJavaSearchConstants.IGNORE_RETURN_TYPE;
int matchRule= SearchPattern.R_ERASURE_MATCH | SearchPattern.R_CASE_SENSITIVE;
SearchPattern pattern= SearchPattern.createPattern(fMethod, limitTo, matchRule);
SearchParticipant[] participants= SearchUtils.getDefaultSearchParticipants();
IJavaSearchScope scope= RefactoringScopeFactory.createRelatedProjectsScope(fMethod.getJavaProject(), IJavaSearchScope.SOURCES | IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SYSTEM_LIBRARIES);
MethodRequestor requestor= new MethodRequestor();
SearchEngine searchEngine= owner != null ? new SearchEngine(owner) : new SearchEngine();
searchEngine.search(pattern, participants, scope, requestor, monitor);
}
示例5: getImageDescriptor
ImageDescriptor getImageDescriptor() {
int limitTo= getMaskedLimitTo();
if (limitTo == IJavaSearchConstants.IMPLEMENTORS || limitTo == IJavaSearchConstants.DECLARATIONS)
return JavaPluginImages.DESC_OBJS_SEARCH_DECL;
else
return JavaPluginImages.DESC_OBJS_SEARCH_REF;
}
示例6: VariablePattern
public VariablePattern(int patternKind, char[] name, int limitTo, int matchRule) {
super(patternKind, matchRule);
this.fineGrain = limitTo & FINE_GRAIN_MASK;
if (this.fineGrain == 0) {
switch (limitTo & 0xF) {
case IJavaSearchConstants.DECLARATIONS :
this.findDeclarations = true;
break;
case IJavaSearchConstants.REFERENCES :
this.readAccess = true;
this.writeAccess = true;
break;
case IJavaSearchConstants.READ_ACCESSES :
this.readAccess = true;
break;
case IJavaSearchConstants.WRITE_ACCESSES :
this.writeAccess = true;
break;
case IJavaSearchConstants.ALL_OCCURRENCES :
this.findDeclarations = true;
this.readAccess = true;
this.writeAccess = true;
break;
}
this.findReferences = this.readAccess || this.writeAccess;
}
this.name = (this.isCaseSensitive || this.isCamelCase) ? name : CharOperation.toLowerCase(name);
}
示例7: getLimitTo
@Override
int getLimitTo() {
return IJavaSearchConstants.DECLARATIONS | IJavaSearchConstants.IGNORE_DECLARING_TYPE | IJavaSearchConstants.IGNORE_RETURN_TYPE;
}
示例8: MethodPattern
public MethodPattern(
char[] selector,
char[] declaringQualification,
char[] declaringSimpleName,
char[] returnQualification,
char[] returnSimpleName,
char[][] parameterQualifications,
char[][] parameterSimpleNames,
IType declaringType,
int limitTo,
int matchRule) {
this(matchRule);
this.fineGrain = limitTo & FINE_GRAIN_MASK;
if (this.fineGrain == 0) {
switch (limitTo & 0xF) {
case IJavaSearchConstants.DECLARATIONS :
this.findReferences = false;
break;
case IJavaSearchConstants.REFERENCES :
this.findDeclarations = false;
break;
case IJavaSearchConstants.ALL_OCCURRENCES :
break;
}
} else {
this.findDeclarations = false;
}
this.selector = (this.isCaseSensitive || this.isCamelCase) ? selector : CharOperation.toLowerCase(selector);
this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification);
this.declaringSimpleName = this.isCaseSensitive ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName);
this.returnQualification = this.isCaseSensitive ? returnQualification : CharOperation.toLowerCase(returnQualification);
this.returnSimpleName = this.isCaseSensitive ? returnSimpleName : CharOperation.toLowerCase(returnSimpleName);
if (parameterSimpleNames != null) {
this.parameterCount = parameterSimpleNames.length;
this.parameterQualifications = new char[this.parameterCount][];
this.parameterSimpleNames = new char[this.parameterCount][];
for (int i = 0; i < this.parameterCount; i++) {
this.parameterQualifications[i] = this.isCaseSensitive ? parameterQualifications[i] : CharOperation.toLowerCase(parameterQualifications[i]);
this.parameterSimpleNames[i] = this.isCaseSensitive ? parameterSimpleNames[i] : CharOperation.toLowerCase(parameterSimpleNames[i]);
}
} else {
this.parameterCount = -1;
}
this.declaringType = declaringType;
if (this.declaringType != null) {
this.declaringPackageName = this.declaringType.getPackageFragment().getElementName().toCharArray();
}
this.mustResolve = mustResolve();
}
示例9: ConstructorPattern
public ConstructorPattern(
char[] declaringSimpleName,
char[] declaringQualification,
char[][] parameterQualifications,
char[][] parameterSimpleNames,
int limitTo,
int matchRule) {
this(matchRule);
this.fineGrain = limitTo & FINE_GRAIN_MASK;
if (this.fineGrain == 0) {
switch (limitTo) {
case IJavaSearchConstants.DECLARATIONS :
this.findReferences = false;
break;
case IJavaSearchConstants.REFERENCES :
this.findDeclarations = false;
break;
case IJavaSearchConstants.ALL_OCCURRENCES :
break;
}
} else {
this.findDeclarations = false;
}
this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification);
this.declaringSimpleName = (this.isCaseSensitive || this.isCamelCase) ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName);
if (parameterSimpleNames != null) {
this.parameterCount = parameterSimpleNames.length;
boolean synthetic = this.parameterCount>0 && declaringQualification != null && CharOperation.equals(CharOperation.concat(parameterQualifications[0], parameterSimpleNames[0], '.'), declaringQualification);
int offset = 0;
if (synthetic) {
// skip first synthetic parameter
this.parameterCount--;
offset++;
}
this.parameterQualifications = new char[this.parameterCount][];
this.parameterSimpleNames = new char[this.parameterCount][];
for (int i = 0; i < this.parameterCount; i++) {
this.parameterQualifications[i] = this.isCaseSensitive ? parameterQualifications[i+offset] : CharOperation.toLowerCase(parameterQualifications[i+offset]);
this.parameterSimpleNames[i] = this.isCaseSensitive ? parameterSimpleNames[i+offset] : CharOperation.toLowerCase(parameterSimpleNames[i+offset]);
}
} else {
this.parameterCount = -1;
}
this.mustResolve = mustResolve();
}