本文整理汇总了Java中com.intellij.navigation.NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY属性的典型用法代码示例。如果您正苦于以下问题:Java NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY属性的具体用法?Java NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY怎么用?Java NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.navigation.NavigationItem
的用法示例。
在下文中一共展示了NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getItemsByName
@Override
@NotNull
public NavigationItem[] getItemsByName(String name, final String pattern, Project project, boolean includeNonProjectItems) {
final PsiManager psiManager = PsiManager.getInstance(project);
final VirtualFile baseDir = project.getBaseDir();
if (baseDir == null) return NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY;
final VirtualFile[] files = baseDir.getChildren();
final ArrayList<PsiFile> list = new ArrayList<PsiFile>();
for (VirtualFile file : files) {
if (isEditable(file, includeNonProjectItems) && Comparing.strEqual(name, file.getName())) {
final PsiFile psiFile = psiManager.findFile(file);
if (psiFile != null) {
list.add(psiFile);
}
}
}
return PsiUtilCore.toPsiFileArray(list);
}
示例2: getItemsByName
@NotNull
public NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems) {
if (!includeNonProjectItems) return NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY;
List<NavigationItem> result = new ArrayList<NavigationItem>();
for (VirtualFile each : getSettingsFiles(project)) {
if (each.getName().equals(name)) {
PsiFile psiFile = PsiManager.getInstance(project).findFile(each);
if (psiFile != null) result.add(psiFile);
}
}
return result.toArray(new NavigationItem[result.size()]);
}
示例3: getItemsByName
@NotNull
public NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems) {
if (!includeNonProjectItems) return NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY;
VirtualFile file = MavenPropertiesVirtualFileSystem.getInstance().findFileByPath(name);
if (file != null) {
PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
if (psiFile != null) return new NavigationItem[]{psiFile};
}
return NavigationItem.EMPTY_NAVIGATION_ITEM_ARRAY;
}