本文整理汇总了Java中com.intellij.usageView.UsageInfo.EMPTY_ARRAY属性的典型用法代码示例。如果您正苦于以下问题:Java UsageInfo.EMPTY_ARRAY属性的具体用法?Java UsageInfo.EMPTY_ARRAY怎么用?Java UsageInfo.EMPTY_ARRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.usageView.UsageInfo
的用法示例。
在下文中一共展示了UsageInfo.EMPTY_ARRAY属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findUsages
@NotNull
@Override
protected UsageInfo[] findUsages() {
if (!myProperties.hasSomethingToDo()) {
return UsageInfo.EMPTY_ARRAY;
}
final List<UsageInfo> list = new ArrayList<UsageInfo>();
if (myProperties.updateAndroidManifest) {
addManifestRefactoring(list);
// TODO: Update build.gradle as well
}
if (myProperties.updateLayouts) {
addLayoutRefactoring(list);
}
final int size = list.size();
return list.toArray(new UsageInfo[size]);
}
示例2: findUsages
@NotNull
@Override
protected UsageInfo[] findUsages() {
final GrVariable var = (GrVariable)myHelper.getToSearchFor();
if (var != null) {
final List<UsageInfo> result = new ArrayList<UsageInfo>();
for (PsiReference ref : ReferencesSearch.search(var)) {
final PsiElement element = ref.getElement();
if (element.getLanguage() != GroovyLanguage.INSTANCE) {
result.add(new OtherLanguageUsageInfo(ref));
continue;
}
final GrCall call = GroovyRefactoringUtil.getCallExpressionByMethodReference(element);
if (call == null) continue;
result.add(new ExternalUsageInfo(element));
}
return result.toArray(new UsageInfo[result.size()]);
}
return UsageInfo.EMPTY_ARRAY;
}
示例3: findUsages
@NotNull
protected UsageInfo[] findUsages() {
ArrayList<UsageInfo> usagesVector = new ArrayList<UsageInfo>();
try {
if (myMigrationMap == null) {
return UsageInfo.EMPTY_ARRAY;
}
for (int i = 0; i < myMigrationMap.getEntryCount(); i++) {
MigrationMapEntry entry = myMigrationMap.getEntryAt(i);
UsageInfo[] usages;
if (entry.getType() == MigrationMapEntry.PACKAGE) {
usages = MigrationUtil.findPackageUsages(myProject, myPsiMigration, entry.getOldName());
}
else {
usages = MigrationUtil.findClassUsages(myProject, myPsiMigration, entry.getOldName());
}
for (UsageInfo usage : usages) {
usagesVector.add(new MigrationUsageInfo(usage, entry));
}
}
}
finally {
myPsiMigration.finish();
myPsiMigration = null;
}
return usagesVector.toArray(new MigrationUsageInfo[usagesVector.size()]);
}
示例4: findUsages
public UsageInfo[] findUsages() {
ArrayList<UsageInfo> result = new ArrayList<UsageInfo>();
final PsiElement element = myChangeInfo.getMethod();
if (element instanceof PsiMethod) {
final PsiMethod method = (PsiMethod)element;
findSimpleUsages(method, result);
final UsageInfo[] usageInfos = result.toArray(new UsageInfo[result.size()]);
return UsageViewUtil.removeDuplicatedUsages(usageInfos);
}
return UsageInfo.EMPTY_ARRAY;
}
示例5: findUsages
@Override
public UsageInfo[] findUsages(ChangeInfo info) {
if (info instanceof JavaChangeInfo) {
return new JavaChangeSignatureUsageSearcher((JavaChangeInfo)info).findUsages();
}
else {
return UsageInfo.EMPTY_ARRAY;
}
}
示例6: findUsages
@Override
@NotNull
protected UsageInfo[] findUsages() {
final List<UsageInfo> result = new ArrayList<UsageInfo>();
for (MemberInfo memberInfo : myMembersToMove) {
final PsiMember member = memberInfo.getMember();
if (member.hasModifierProperty(PsiModifier.STATIC)) {
for (PsiReference reference : ReferencesSearch.search(member)) {
result.add(new UsageInfo(reference));
}
}
}
return result.isEmpty() ? UsageInfo.EMPTY_ARRAY : result.toArray(new UsageInfo[result.size()]);
}
示例7: findUsages
@Override
@NotNull
protected UsageInfo[] findUsages() {
final List<SmartPsiElementPointer> toInvert = new ArrayList<SmartPsiElementPointer>();
final LinkedHashSet<PsiElement> elementsToInvert = new LinkedHashSet<PsiElement>();
myDelegate.collectRefElements(myElement, myRenameProcessor, myNewName, elementsToInvert);
for (PsiElement element : elementsToInvert) {
toInvert.add(mySmartPointerManager.createSmartPsiElementPointer(element));
}
final UsageInfo[] renameUsages = myRenameProcessor != null ? myRenameProcessor.findUsages() : UsageInfo.EMPTY_ARRAY;
final SmartPsiElementPointer[] usagesToInvert = toInvert.toArray(new SmartPsiElementPointer[toInvert.size()]);
//merge rename and invert usages
Map<PsiElement, UsageInfo> expressionsToUsages = new HashMap<PsiElement, UsageInfo>();
List<UsageInfo> result = new ArrayList<UsageInfo>();
for (UsageInfo renameUsage : renameUsages) {
expressionsToUsages.put(renameUsage.getElement(), renameUsage);
result.add(renameUsage);
}
for (SmartPsiElementPointer pointer : usagesToInvert) {
final PsiElement expression = pointer.getElement();
if (!expressionsToUsages.containsKey(expression)) {
final UsageInfo usageInfo = new UsageInfo(expression);
expressionsToUsages.put(expression, usageInfo);
result.add(usageInfo); //fake UsageInfo
myToInvert.put(usageInfo, pointer);
} else {
myToInvert.put(expressionsToUsages.get(expression), pointer);
}
}
return result.toArray(new UsageInfo[result.size()]);
}
示例8: findUsages
@Override
public UsageInfo[] findUsages(ChangeInfo info) {
if (info instanceof PyChangeInfo) {
final List<UsageInfo> usages = PyRefactoringUtil.findUsages(((PyChangeInfo)info).getMethod(), true);
final Query<PyFunction> search = PyOverridingMethodsSearch.search(((PyChangeInfo)info).getMethod(), true);
final Collection<PyFunction> functions = search.findAll();
for (PyFunction function : functions) {
usages.add(new UsageInfo(function));
usages.addAll(PyRefactoringUtil.findUsages(function, true));
}
return usages.toArray(new UsageInfo[usages.size()]);
}
return UsageInfo.EMPTY_ARRAY;
}
示例9: findUsages
@Override
public UsageInfo[] findUsages(ChangeInfo info) {
if (info instanceof JavaChangeInfo) {
return new GrChageSignatureUsageSearcher((JavaChangeInfo)info).findUsages();
}
return UsageInfo.EMPTY_ARRAY;
}
示例10: findUsages
@NotNull
@Override
protected UsageInfo[] findUsages() {
return UsageInfo.EMPTY_ARRAY;
}