本文整理匯總了Java中org.eclipse.jdt.core.search.SearchEngine.createHierarchyScope方法的典型用法代碼示例。如果您正苦於以下問題:Java SearchEngine.createHierarchyScope方法的具體用法?Java SearchEngine.createHierarchyScope怎麽用?Java SearchEngine.createHierarchyScope使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jdt.core.search.SearchEngine
的用法示例。
在下文中一共展示了SearchEngine.createHierarchyScope方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: chooseResourceType
import org.eclipse.jdt.core.search.SearchEngine; //導入方法依賴的package包/類
private IType chooseResourceType() {
IJavaSearchScope scope;
try {
scope = SearchEngine.createHierarchyScope(ClientBundleUtilities.findResourcePrototypeType(javaProject));
FilteredTypesSelectionDialog dialog = new FilteredTypesSelectionDialog(
getShell(), false, PlatformUI.getWorkbench().getProgressService(),
scope, IJavaSearchConstants.INTERFACE);
dialog.setTitle("Resource Type Selection");
dialog.setMessage("Choose a resource type:");
if (dialog.open() == Window.OK) {
return (IType) dialog.getFirstResult();
}
} catch (JavaModelException e) {
GWTPluginLog.logError(e);
}
return null;
}
示例2: chooseClientBundleType
import org.eclipse.jdt.core.search.SearchEngine; //導入方法依賴的package包/類
private IType chooseClientBundleType() {
try {
// Create a search scope for finding ClientBundle subtypes
IJavaSearchScope scope = SearchEngine.createHierarchyScope(ClientBundleUtilities.findClientBundleType(getJavaProject()));
// Configure the type selection dialog
FilteredTypesSelectionDialog dialog = new FilteredTypesSelectionDialog(
getShell(), false, PlatformUI.getWorkbench().getProgressService(),
scope, IJavaSearchConstants.INTERFACE);
dialog.setTitle("ClientBundle Type Selection");
dialog.setMessage("Choose a type:");
if (dialog.open() == Window.OK) {
return (IType) dialog.getFirstResult();
}
} catch (JavaModelException e) {
GWTPluginLog.logError(e);
}
return null;
}
示例3: createQuery
import org.eclipse.jdt.core.search.SearchEngine; //導入方法依賴的package包/類
@Override
QuerySpecification createQuery(IJavaElement element) throws JavaModelException, InterruptedException {
JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();
IType type= getType(element);
if (type == null) {
return super.createQuery(element);
}
IJavaSearchScope scope= SearchEngine.createHierarchyScope(type);
String description= factory.getHierarchyScopeDescription(type);
return new ElementQuerySpecification(element, getLimitTo(), scope, description);
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:13,代碼來源:FindDeclarationsInHierarchyAction.java
示例4: createQuery
import org.eclipse.jdt.core.search.SearchEngine; //導入方法依賴的package包/類
@Override
QuerySpecification createQuery(IJavaElement element) throws JavaModelException, InterruptedException {
IType type= getType(element);
if (type == null) {
return super.createQuery(element);
}
JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();
IJavaSearchScope scope= SearchEngine.createHierarchyScope(type);
String description= factory.getHierarchyScopeDescription(type);
return new ElementQuerySpecification(element, getLimitTo(), scope, description);
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:12,代碼來源:FindReferencesInHierarchyAction.java
示例5: proposeImplementation
import org.eclipse.jdt.core.search.SearchEngine; //導入方法依賴的package包/類
private static List<ICompletionProposal> proposeImplementation(IJavaProject project,
final int start, final int length, String matchString, String interfaceFqn)
{
final List<ICompletionProposal> results = new ArrayList<ICompletionProposal>();
IType interfaceType;
IJavaSearchScope scope;
try
{
interfaceType = project.findType(interfaceFqn);
if (interfaceType == null)
return results;
scope = SearchEngine.createHierarchyScope(interfaceType);
final Map<String, String> aliasMap = TypeAliasCache.getInstance()
.searchTypeAliases(project, matchString);
TypeNameRequestor requestor = new JavaTypeNameRequestor()
{
@Override
public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName,
char[][] enclosingTypeNames, String path)
{
// Ignore abstract classes.
if (Flags.isAbstract(modifiers) || Arrays.equals(JAVA_LANG, packageName))
return;
addJavaTypeProposal(results, start, length, packageName, simpleTypeName,
enclosingTypeNames);
String qualifiedName = NameUtil.buildQualifiedName(packageName, simpleTypeName,
enclosingTypeNames, true);
String alias = aliasMap.get(qualifiedName);
if (alias != null)
{
results.add(new JavaCompletionProposal(alias, start, length, alias.length(),
Activator.getIcon("/icons/mybatis-alias.png"), alias + " - " + qualifiedName,
null, null, 200));
}
}
};
searchJavaType(matchString, scope, requestor);
}
catch (JavaModelException e)
{
Activator.log(Status.ERROR, e.getMessage(), e);
}
return results;
}