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


Java IJavaSearchConstants.DECLARATIONS属性代码示例

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

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:36,代码来源:RippleMethodFinder2.java

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

示例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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:RippleMethodFinder2.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:JavaSearchQuery.java

示例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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:30,代码来源:VariablePattern.java

示例7: getLimitTo

@Override
int getLimitTo() {
	return IJavaSearchConstants.DECLARATIONS | IJavaSearchConstants.IGNORE_DECLARING_TYPE | IJavaSearchConstants.IGNORE_RETURN_TYPE;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:FindDeclarationsAction.java

示例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();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:52,代码来源:MethodPattern.java

示例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();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:48,代码来源:ConstructorPattern.java


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