Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
70,500
boolean (final Object element, final PsiDirectory directory) { if (super.canRepresent(element, directory)) return true; if (element instanceof PackageElement packageElement) { return Arrays.asList(packageElement.getPackage().getDirectories()).contains(directory); } return false; }
canRepresent
70,501
boolean (@NotNull final VirtualFile file) { ProjectFileIndex index = ProjectRootManager.getInstance(getProject()).getFileIndex(); if (!index.isInLibrary(file)) return false; return someChildContainsFile(file, false); }
contains
70,502
boolean (VirtualFile file) { ProjectFileIndex index = ProjectRootManager.getInstance(getProject()).getFileIndex(); if (!index.isInLibrary(file)) return false; return super.someChildContainsFile(file); }
someChildContainsFile
70,503
void (ModuleRootManager moduleRootManager, List<? super VirtualFile> roots) { final VirtualFile[] files = moduleRootManager.orderEntries().withoutModuleSourceEntries().withoutDepModules().classes().getRoots(); for (final VirtualFile file : files) { if (file.getFileSystem() instanceof JarFileSystem && file.getParent() !...
addModuleLibraryRoots
70,504
void (@NotNull final PresentationData presentation) { presentation.setPresentableText(IdeBundle.message("node.projectview.libraries")); presentation.setIcon(PlatformIcons.LIBRARY_ICON); }
update
70,505
String () { return "Libraries"; }
getTestPresentation
70,506
boolean () { return true; }
shouldUpdateData
70,507
NodeSortOrder (@NotNull NodeSortSettings settings) { return NodeSortOrder.LIBRARY_ROOT; }
getSortOrder
70,508
boolean () { boolean showInnerClasses = Registry.is("projectView.always.show.inner.classes", false); if (showInnerClasses) return true; VirtualFile file = getVirtualFile(); return file != null && FileTypeRegistry.getInstance().isFileOfType(file, JavaClassFileType.INSTANCE); }
isShowInnerClasses
70,509
void (@NotNull PresentationData data) { final PsiClass aClass = getValue(); if (aClass != null) { data.setPresentableText(aClass.getName()); } isAlwaysExpand = getParentValue() instanceof PsiFile; }
updateImpl
70,510
boolean () { return getValue() != null && getValue().getParent()instanceof PsiFile; }
isTopLevel
70,511
boolean () { return false; }
expandOnDoubleClick
70,512
PsiClass () { return getValue(); }
getPsiClass
70,513
boolean () { return isAlwaysExpand; }
isAlwaysExpand
70,514
int () { return 20; }
getWeight
70,515
String () { final PsiClass psiClass = getValue(); if (psiClass != null && psiClass.isValid()) { return psiClass.getQualifiedName(); } return super.getTitle(); }
getTitle
70,516
boolean () { return true; }
isMarkReadOnly
70,517
int (final boolean sortByType) { return sortByType ? 5 : 0; }
getTypeSortWeight
70,518
Comparable () { return new ClassNameSortKey(); }
getTypeSortKey
70,519
int (final PsiClass aClass) { if (aClass == null || !aClass.isValid()) { return 0; } try { int pos = aClass instanceof JspClass ? ElementPresentationUtil.CLASS_KIND_JSP : ElementPresentationUtil.getClassKind(aClass); //abstract class before concrete if (pos == ElementPresentationUtil.CLASS_KIND_CLASS || pos == ElementP...
getClassPosition
70,520
int (final Object o) { if (!(o instanceof ClassNameSortKey rhs)) return 0; return getPosition() - rhs.getPosition(); }
compareTo
70,521
boolean () { return true; }
shouldDrillDownOnEmptyElement
70,522
boolean (final Object element) { if (!mayContain(element)) return false; if (!isValid()) return false; return super.canRepresent(element) || canRepresent(getValue(), element); }
canRepresent
70,523
boolean (final PsiClass psiClass, final Object element) { if (psiClass == null || !psiClass.isValid() || element == null) return false; final PsiFile parentFile = parentFileOf(psiClass); if (parentFile != null && (parentFile == element || element.equals(parentFile.getVirtualFile()))) return true; if (!getSettings().isS...
canRepresent
70,524
PsiFile (final PsiClass psiClass) { return psiClass.getContainingClass() == null ? psiClass.getContainingFile() : null; }
parentFileOf
70,525
void (@NotNull PresentationData data) { PsiMethod method = getValue(); assert method != null; String name; try { name = PsiFormatUtil.formatMethod(method, PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_TYPE | PsiFormatUtilBase.TYPE_AFTER | PsiFormatUtilBase.SHOW_PARAMETERS, PsiFormatUtilBase...
updateImpl
70,526
boolean () { return true; }
isAlwaysLeaf
70,527
boolean () { final PsiMethod psiMethod = getValue(); return psiMethod != null && psiMethod.isConstructor(); }
isConstructor
70,528
int () { return isConstructor() ? 40 : 50; }
getWeight
70,529
String () { final PsiMethod method = getValue(); if (method != null) { PsiClass aClass = method.getContainingClass(); if (aClass != null) { return aClass.getQualifiedName(); } else { return method.getName(); } } return super.getTitle(); }
getTitle
70,530
AbstractTreeNode (@NotNull Module module) { return new PackageViewModuleNode(module.getProject(), module, getSettings()); }
createModuleNode
70,531
ModuleGroupNode (@NotNull ModuleGroup moduleGroup) { return new PackageViewModuleGroupNode(getProject(), moduleGroup, getSettings()); }
createModuleGroupNode
70,532
List<Module> (@NotNull VirtualFile file) { ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex(); Module module = fileIndex.getModuleForFile(file, false); if (module != null) { return Collections.singletonList(module); } List<OrderEntry> entriesForFile = fileIndex.getOrderEntriesForFile(...
getModulesByFile
70,533
void (@NotNull Collection<? super AbstractTreeNode<?>> children, @NotNull PsiPackage aPackage, @Nullable Module module, @NotNull ViewSettings settings, final boolean inLibrary) { final boolean shouldSkipPackage = settings.isHideEmptyMiddlePackages() && isPackageEmpty(aPackage, module, !settings.isFlattenPackages(), inL...
addPackageAsChild
70,534
boolean (@NotNull PsiPackage aPackage, @Nullable Module module, boolean strictlyEmpty, final boolean inLibrary) { final Project project = aPackage.getProject(); final GlobalSearchScope scopeToShow = getScopeToShow(project, module, inLibrary); PsiElement[] children = aPackage.getFiles(scopeToShow); if (children.length >...
isPackageEmpty
70,535
GlobalSearchScope (@NotNull Project project, @Nullable Module module, boolean forLibraries) { if (module == null) { if (forLibraries) { return new ProjectLibrariesSearchScope(project); } return GlobalSearchScope.projectScope(project); } else { if (forLibraries) { return new ModuleLibrariesSearchScope(module); } return ...
getScopeToShow
70,536
boolean (@NotNull PsiPackage directoryPackage) { final String qName = directoryPackage.getQualifiedName(); return qName.isEmpty(); }
isPackageDefault
70,537
String (@NotNull ViewSettings settings, PsiPackage aPackage, final PsiPackage parentPackageInTree, @NotNull String defaultShortName, boolean isFQNameShown) { final String name; if (isFQNameShown) { name = settings.isAbbreviatePackageNames() ? aPackage == null ? defaultShortName : TreeViewUtil.calcAbbreviatedPackageFQNa...
getNodeName
70,538
boolean (@NotNull VirtualFile file) { final OrderEntry orderEntry = ModuleRootManager.getInstance(myModule).getFileIndex().getOrderEntryForFile(file); return orderEntry instanceof JdkOrderEntry || orderEntry instanceof LibraryOrderEntry; }
contains
70,539
int (@NotNull VirtualFile file1, @NotNull VirtualFile file2) { final ModuleFileIndex fileIndex = ModuleRootManager.getInstance(myModule).getFileIndex(); return Comparing.compare(fileIndex.getOrderEntryForFile(file2), fileIndex.getOrderEntryForFile(file1)); }
compare
70,540
boolean (@NotNull Module aModule) { return false; }
isSearchInModuleContent
70,541
boolean () { return true; }
isSearchInLibraries
70,542
boolean (@NotNull VirtualFile file) { return myFileIndex.isInLibraryClasses(file); }
contains
70,543
boolean (@NotNull Module aModule) { return false; }
isSearchInModuleContent
70,544
boolean () { return true; }
isSearchInLibraries
70,545
void (@NotNull PresentationData data) { PsiField field = Objects.requireNonNull(getValue()); String name; try { name = PsiFormatUtil.formatVariable(field, PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_TYPE | PsiFormatUtilBase.TYPE_AFTER, PsiSubstitutor.EMPTY); } catch (IndexNotReadyException e) { name = field.ge...
updateImpl
70,546
int () { return 70; }
getWeight
70,547
boolean () { return true; }
isAlwaysLeaf
70,548
String () { final PsiField field = getValue(); if (field != null) { PsiClass aClass = field.getContainingClass(); if (aClass != null) { return aClass.getQualifiedName(); } else { @NlsSafe String fieldText = field.toString(); return fieldText; } } return super.getTitle(); }
getTitle
70,549
void (Module module, ArrayList<AbstractTreeNode<?>> result) { var grouper = ModuleGrouper.instanceFor(getProject()); var moduleGroupPath = grouper.getModuleAsGroupPath(module); if (moduleGroupPath != null) { var moduleGroup = new ModuleGroup(moduleGroupPath); var childModules = moduleGroup.modulesInGroup(getProject());...
addChildModules
70,550
void (Module module, ArrayList<AbstractTreeNode<?>> result) { List<VirtualFile> roots = Arrays.asList(ModuleRootManager.getInstance(module).getSourceRoots()); result.addAll(PackageUtil.createPackageViewChildrenOnFiles(roots, myProject, getSettings(), module, false)); }
addSourceRoots
70,551
void (Module module, ArrayList<AbstractTreeNode<?>> result) { if (getSettings().isShowLibraryContents()) { result.add(new PackageViewLibrariesNode(getProject(), module, getSettings())); } }
addLibraries
70,552
boolean (@NotNull VirtualFile file) { Module module = getValue(); return module != null && !module.isDisposed() && (ModuleUtilCore.moduleContainsFile(module, file, false) || ModuleUtilCore.moduleContainsFile(module, file, true)); }
contains
70,553
boolean () { return getValue() != null; }
validate
70,554
boolean (VirtualFile file) { return true; }
someChildContainsFile
70,555
boolean (Object element) { Project project = getValue(); if (project == element) return true; if (element instanceof PsiDirectory directory) { element = directory.getVirtualFile(); } if (element instanceof VirtualFile) { ProjectRootManager manager = project == null || project.isDisposed() ? null : ProjectRootManager.ge...
canRepresent
70,556
AbstractTreeNode (@NotNull final Module module) { return new PackageViewModuleNode(getProject(), module, getSettings()); }
createModuleGroup
70,557
AbstractTreeNode (@NotNull final ModuleGroup moduleGroup) { return new PackageViewModuleGroupNode(getProject(), moduleGroup, getSettings()); }
createModuleGroupNode
70,558
boolean (VirtualFile file) { return true; }
someChildContainsFile
70,559
Module () { return myModule; }
getModule
70,560
PsiPackage () { return myElement; }
getPackage
70,561
Collection<VirtualFile> () { Set<VirtualFile> roots= new HashSet<>(); final PsiDirectory[] dirs = PackageUtil.getDirectories(getPackage(), myModule, isLibraryElement()); for (PsiDirectory each : dirs) { roots.add(each.getVirtualFile()); } return roots; }
getRoots
70,562
boolean (Object o) { if (this == o) return true; return o instanceof PackageElement packageElement && myIsLibraryElement == packageElement.myIsLibraryElement && myElement.equals(packageElement.myElement) && Objects.equals(myModule, packageElement.myModule); }
equals
70,563
int () { int result = myModule != null ? myModule.hashCode() : 0; result = 29 * result + myElement.hashCode(); result = 29 * result + (myIsLibraryElement ? 1 : 0); return result; }
hashCode
70,564
boolean () { return myIsLibraryElement; }
isLibraryElement
70,565
void (@NotNull Map<? super String, ? super String> info) { PsiPackage pkg = getPackage(); if (pkg instanceof Queryable) { ((Queryable)pkg).putInfo(info); } }
putInfo
70,566
String () { T t = getValue(); if (t != null && t.isValid()) { return ElementPresentationUtil.getDescription(t); } return super.calcTooltip(); }
calcTooltip
70,567
boolean () { final PsiModifierListOwner element = getValue(); return element != null && element.isValid() && element instanceof PsiDocCommentOwner && ((PsiDocCommentOwner)element).isDeprecated(); }
isDeprecated
70,568
Module () { return myModule; }
getModule
70,569
Project () { return myProject; }
getProject
70,570
boolean (Object o) { if (this == o) return true; return o instanceof LibrariesElement librariesElement && Objects.equals(myModule, librariesElement.myModule) && myProject.equals(librariesElement.myProject); }
equals
70,571
int () { int result; result = (myModule != null ? myModule.hashCode() : 0); result = 29 * result + myProject.hashCode(); return result; }
hashCode
70,572
boolean (@NotNull final VirtualFile file) { if (!isUnderContent(file) || getValue() == null) { return false; } final PsiDirectory[] directories = getValue().getPackage().getDirectories(); for (PsiDirectory directory : directories) { if (VfsUtilCore.isAncestor(directory.getVirtualFile(), file, false)) return true; } ret...
contains
70,573
boolean (final VirtualFile file) { PackageElement element = getValue(); final Module module = element == null ? null : element.getModule(); if (module == null) { return ModuleUtilCore.projectContainsFile(getProject(), file, isLibraryElement()); } return ModuleUtilCore.moduleContainsFile(module, file, isLibraryElement()...
isUnderContent
70,574
boolean () { return getValue() != null && getValue().isLibraryElement(); }
isLibraryElement
70,575
boolean () { return super.validate() && isValid(); }
validate
70,576
boolean () { PackageElement value = getValue(); if (value != null && value.getPackage().isValid()) { Module module = value.getModule(); return module == null || !module.isDisposed(); } return false; }
isValid
70,577
void (@NotNull final PresentationData presentation) { try { if (isValid()) { updateValidData(presentation, getValue()); return; } } catch (IndexNotReadyException ignore) {} setValue(null); }
update
70,578
void (PresentationData presentation, PackageElement value) { final PsiPackage aPackage = value.getPackage(); if (!getSettings().isFlattenPackages() && getSettings().isHideEmptyMiddlePackages() && PackageUtil.isPackageEmpty(aPackage, value.getModule(), true, isLibraryElement())) { setValue(null); return; } PsiPackage pa...
updateValidData
70,579
boolean (final PsiPackage aPackage) { return getSettings().isFlattenPackages() && !aPackage.getQualifiedName().isEmpty(); }
showFQName
70,580
String () { final PresentationData presentation = new PresentationData(); update(presentation); return "PsiPackage: " + presentation.getPresentableText(); }
getTestPresentation
70,581
boolean () { return getValue() != null && CopyPasteManager.getInstance().isCutElement(getValue().getPackage()); }
valueIsCut
70,582
boolean (final Object element) { if (super.canRepresent(element)) return true; final PackageElement value = getValue(); if (value == null) return true; if (element instanceof PackageElement packageElement) { final String otherPackage = packageElement.getPackage().getQualifiedName(); final String aPackage = value.getPac...
canRepresent
70,583
boolean (@NotNull PackageElement element, @NotNull VirtualFile file) { PsiPackage parent = getParentPackage(); for (PsiPackage p = element.getPackage(); p != null && !p.equals(parent); p = p.getParentPackage()) { for (PsiDirectory directory : p.getDirectories()) { if (directory.getVirtualFile().equals(file)) return tru...
isPackageUnderDirectory
70,584
PsiPackage () { Object value = getParentValue(); return value instanceof PackageElement ? ((PackageElement)value).getPackage() : null; }
getParentPackage
70,585
int () { return 0; }
getWeight
70,586
String () { final PackageElement packageElement = getValue(); if (packageElement == null) { return super.getTitle(); } return packageElement.getPackage().getQualifiedName(); }
getTitle
70,587
String () { final PackageElement packageElement = getValue(); if (packageElement != null) { return packageElement.getPackage().getQualifiedName(); } return null; }
getQualifiedNameSortKey
70,588
int (final boolean sortByType) { return 4; }
getTypeSortWeight
70,589
boolean () { for (final VirtualFile dir : getVirtualFiles()) { if (dir.getChildren().length > 0) { return true; } } return false; }
isAlwaysShowPlus
70,590
void (@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { forNodeDescriptorInTree(value, expanded).customize(this); }
customizeCellRenderer
70,591
CellAppearanceEx (Object node, boolean expanded) { NodeDescriptor descriptor = getNodeDescriptor(node); if (descriptor == null) return FileAppearanceService.getInstance().empty(); String name = descriptor.toString(); Object psiElement = descriptor.getElement(); ModifiableCellAppearanceEx result; if (psiElement instance...
forNodeDescriptorInTree
70,592
boolean (Object node, PsiClass psiClass) { PsiClass treeParentClass = getTreeParentClass(node); return treeParentClass != psiClass; }
isInheritedMember
70,593
SimpleTextAttributes (Object value, SimpleTextAttributes nameAttributes) { return isDeprecated(value) ? makeStrikeout(nameAttributes) : nameAttributes; }
applyDeprecation
70,594
SimpleTextAttributes (SimpleTextAttributes nameAttributes) { return new SimpleTextAttributes(nameAttributes.getStyle() | SimpleTextAttributes.STYLE_STRIKEOUT, nameAttributes.getFgColor()); }
makeStrikeout
70,595
boolean (Object psiElement) { return psiElement instanceof PsiDocCommentOwner && ((PsiDocCommentOwner)psiElement).isDeprecated(); }
isDeprecated
70,596
PsiClass (Object element) { if (element instanceof PsiMember) return ((PsiMember) element).getContainingClass(); return null; }
getContainingClass
70,597
PsiClass (Object value) { if (!(value instanceof TreeNode)) return null; for (TreeNode treeNode = ((TreeNode) value).getParent(); treeNode != null; treeNode = treeNode.getParent()) { Object element = getElement(treeNode); if (element instanceof PsiClass) return (PsiClass) element; } return null; }
getTreeParentClass
70,598
NodeDescriptor (Object value) { if (value instanceof DefaultMutableTreeNode node && node.getUserObject() instanceof NodeDescriptor<?> nodeDescriptor) { return nodeDescriptor; } return null; }
getNodeDescriptor
70,599
Object (Object node) { NodeDescriptor<?> descriptor = getNodeDescriptor(node); return descriptor == null ? null : descriptor.getElement(); }
getElement