Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
284,800 | void (final ListSelectionEvent e) { if (!shouldUpdateHint()) return; int selected = ((ListSelectionModel)e.getSource()).getLeadSelectionIndex(); int rowCount = table.getRowCount(); if (selected == -1 || rowCount == 0) return; PsiElement element = getPsiElementForHint(table.getValueAt(Math.min(selected, rowCount - 1), 0)); if (element != null && element.isValid()) { updateHint(element); } } | valueChanged |
284,801 | void (final @NotNull JTree tree) { tree.addTreeSelectionListener(new TreeSelectionListener() { @Override public void valueChanged(final TreeSelectionEvent e) { if (!shouldUpdateHint()) return; TreePath path = tree.getSelectionPath(); if (path != null) { final PsiElement psiElement = getPsiElementForHint(path.getLastPathComponent()); if (psiElement != null && psiElement.isValid()) { updateHint(psiElement); } } } }); } | installTreeListener |
284,802 | void (final TreeSelectionEvent e) { if (!shouldUpdateHint()) return; TreePath path = tree.getSelectionPath(); if (path != null) { final PsiElement psiElement = getPsiElementForHint(path.getLastPathComponent()); if (psiElement != null && psiElement.isValid()) { updateHint(psiElement); } } } | valueChanged |
284,803 | void (@NotNull JList list) { list.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(final ListSelectionEvent e) { if (!shouldUpdateHint()) return; Object[] selectedValues = ((JList<?>)e.getSource()).getSelectedValues(); if (selectedValues.length != 1) return; PsiElement element = getPsiElementForHint(selectedValues[0]); if (element != null && element.isValid()) { updateHint(element); } } }); } | installListListener |
284,804 | void (final ListSelectionEvent e) { if (!shouldUpdateHint()) return; Object[] selectedValues = ((JList<?>)e.getSource()).getSelectedValues(); if (selectedValues.length != 1) return; PsiElement element = getPsiElementForHint(selectedValues[0]); if (element != null && element.isValid()) { updateHint(element); } } | valueChanged |
284,805 | void (@NotNull JComponent component) { component.putClientProperty(HINT_UPDATE_MARKER, this); myComponent = component; } | installSupply |
284,806 | void (JBPopup hint) { hideHint(); myHint = hint; Disposer.register(hint, () -> myHint = null); } | registerHint |
284,807 | void () { if (isHintVisible(myHint)) { myHint.cancel(); } myHint = null; } | hideHint |
284,808 | void (PsiElement element) { if (!isHintVisible(myHint)) return; PopupUpdateProcessorBase updateProcessor = myHint.getUserData(PopupUpdateProcessorBase.class); if (updateProcessor != null) { updateProcessor.updatePopup(element); } } | updateHint |
284,809 | boolean () { return isHintVisible(myHint) && !isSelectedByMouse(myComponent); } | shouldUpdateHint |
284,810 | boolean (JBPopup hint) { return hint != null && hint.isVisible(); } | isHintVisible |
284,811 | boolean (@NotNull JComponent c) { return Boolean.TRUE.equals(c.getClientProperty(ListUtil.SELECTED_BY_MOUSE_EVENT)); } | isSelectedByMouse |
284,812 | void () { hidden = false; } | markAsShown |
284,813 | void () { hidden = true; time = System.currentTimeMillis(); } | markAsHidden |
284,814 | boolean () { if (!hidden) return false; hidden = false; return (System.currentTimeMillis() - time) < intValue("ide.popup.hide.show.threshold", 200); } | isRecentlyHidden |
284,815 | void (@NotNull LightweightWindowEvent event) { markAsShown(); } | beforeShown |
284,816 | void (@NotNull LightweightWindowEvent event) { markAsHidden(); } | onClosed |
284,817 | void (PopupMenuEvent event) { markAsShown(); } | popupMenuWillBecomeVisible |
284,818 | void (PopupMenuEvent event) { markAsHidden(); } | popupMenuWillBecomeInvisible |
284,819 | void (PopupMenuEvent event) { } | popupMenuCanceled |
284,820 | JLabel () { return myNextStepLabel; } | getNextStepLabel |
284,821 | Component (JList<? extends E> list, E value, int index, boolean isSelected, boolean cellHasFocus) { String caption = myDescriptor.getCaptionAboveOf(value); boolean hasSeparator = hasSeparator(value, index); Icon icon = getItemIcon(value, isSelected); final JComponent result = configureComponent(myDescriptor.getTextFor(value), myDescriptor.getTooltipFor(value), icon, icon, isSelected, hasSeparator, caption, -1); myCurrentIndex = index; myRendererComponent.setBackground(list.getBackground()); customizeComponent(list, value, isSelected); if (ExperimentalUI.isNewUI() && getItemComponent() instanceof SelectablePanel selectablePanel) { selectablePanel.setSelectionColor(isSelected ? JBUI.CurrentTheme.List.background(true, true) : null); } return result; } | getListCellRendererComponent |
284,822 | boolean (E value, int index) { String caption = myDescriptor.getCaptionAboveOf(value); if (index == 0 && StringUtil.isEmptyOrSpaces(caption)) { return false; } return myDescriptor.hasSeparatorAboveOf(value); } | hasSeparator |
284,823 | JComponent () { createLabel(); return layoutComponent(myTextLabel); } | createItemComponent |
284,824 | void () { myTextLabel = new ErrorLabel(); myTextLabel.setBorder(ExperimentalUI.isNewUI() ? JBUI.Borders.empty() : JBUI.Borders.emptyBottom(1)); myTextLabel.setOpaque(true); } | createLabel |
284,825 | JComponent (JComponent middleItemComponent) { myNextStepLabel = new JLabel(); myNextStepLabel.setOpaque(false); if (ExperimentalUI.isNewUI()) { SelectablePanel result = SelectablePanel.wrap(middleItemComponent); PopupUtil.configListRendererFlexibleHeight(result); result.add(myNextStepLabel, BorderLayout.EAST); return result; } else { return JBUI.Panels.simplePanel(middleItemComponent) .addToRight(myNextStepLabel) .withBorder(getDefaultItemComponentBorder()); } } | layoutComponent |
284,826 | void (JList<? extends E> list, E value, boolean isSelected) { } | customizeComponent |
284,827 | boolean () { return this == PER_CLIENT || this == PROJECTOR_INSTANCING; } | isPerClientLike |
284,828 | boolean () { return this == MIRROR || this == PROJECTOR_STEALING; } | isMirrorLike |
284,829 | boolean () { return this == UNSUPPORTED; } | isUnsupported |
284,830 | boolean () { return this == PROJECTOR_INSTANCING || this == PROJECTOR_STEALING; } | isProjected |
284,831 | HintManager () { return ApplicationManager.getApplication().getService(HintManager.class); } | getInstance |
284,832 | void (@NotNull Editor editor, @NotNull @HintText String text) { showInformationHint(editor, text, ABOVE); } | showInformationHint |
284,833 | void (@NotNull Editor editor, @NotNull @HintText String text) { showSuccessHint(editor, text, ABOVE); } | showSuccessHint |
284,834 | void (@NotNull Editor editor, @NotNull @HintText String text, @PositionFlags short position) {} | showSuccessHint |
284,835 | void (@NotNull Editor editor, @NotNull @HintText String text, @Nullable HyperlinkListener listener) {} | showSuccessHint |
284,836 | boolean () { return true; } | requiresProvider |
284,837 | FileBreadcrumbsCollector (Project project, VirtualFile file) { if (file != null) { for (FileBreadcrumbsCollector extension : EP_NAME.getExtensions(project)) { if (extension.handlesFile(file)) { return extension; } } } return ContainerUtil.getLastItem(EP_NAME.getPoint(project).getExtensionList()); } | findBreadcrumbsCollector |
284,838 | boolean (@NotNull String refSuffix, @NotNull Editor editor) { return false; } | handleLink |
284,839 | void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(getUsages(e).length > 0); } | update |
284,840 | void (@NotNull AnActionEvent e) { process(getUsages(e), e.getData(UsageView.USAGE_VIEW_KEY)); } | actionPerformed |
284,841 | void (Usage @NotNull [] usages, @NotNull UsageView usageView) { ThreadingAssertions.assertEventDispatchThread(); if (usages.length == 0) return; Arrays.sort(usages, UsageViewImpl.USAGE_COMPARATOR_BY_FILE_AND_OFFSET); final Usage nextToSelect = getNextToSelect(usageView, usages[usages.length - 1]); usageView.removeUsagesBulk(Arrays.asList(usages)); if (nextToSelect != null) { usageView.selectUsages(new Usage[]{nextToSelect}); } } | process |
284,842 | ActionUpdateThread () { return ActionUpdateThread.BGT; } | getActionUpdateThread |
284,843 | Usage (@NotNull UsageView usageView, @NotNull Usage toDelete) { return ((UsageViewImpl)usageView).getNextToSelect(toDelete); } | getNextToSelect |
284,844 | String () { StringBuilder buf = new StringBuilder(); appendNode(buf, myUsageView.getModelRoot(), System.lineSeparator(), ""); return buf.toString(); } | getReportText |
284,845 | void (StringBuilder buf, DefaultMutableTreeNode node, String lineSeparator, String indent) { buf.append(indent); final String childIndent; if (node.getParent() != null) { childIndent = indent + " "; appendNodeText(buf, node, lineSeparator); } else { childIndent = indent; } Enumeration enumeration = node.children(); while (enumeration.hasMoreElements()) { DefaultMutableTreeNode child = (DefaultMutableTreeNode)enumeration.nextElement(); appendNode(buf, child, lineSeparator, childIndent); } } | appendNode |
284,846 | void (StringBuilder buf, DefaultMutableTreeNode node, String lineSeparator) { if (node instanceof Node && ((Node)node).isExcluded()) { buf.append("(").append(UsageViewBundle.message("usage.excluded")).append(") "); } if (node instanceof UsageNode) { appendUsageNodeText(buf, (UsageNode) node); } else if (node instanceof GroupNode) { UsageGroup group = ((GroupNode)node).getGroup(); buf.append(group != null ? group.getPresentableGroupText() : UsageViewBundle.message("usages.title")); buf.append(" "); int count = ((GroupNode)node).getRecursiveUsageCount(); buf.append(" (").append(UsageViewBundle.message("usages.n", count)).append(")"); } else if (node instanceof UsageTargetNode) { buf.append(((UsageTargetNode)node).getTarget().getPresentation().getPresentableText()); } else { buf.append(node.toString()); } buf.append(lineSeparator); } | appendNodeText |
284,847 | void (StringBuilder buf, UsageNode node) { TextChunk[] chunks = node.getUsage().getPresentation().getText(); int chunkCount = 0; for (TextChunk chunk : chunks) { if (chunkCount == 1) buf.append(" "); // add space after line number buf.append(chunk.getText()); ++chunkCount; } } | appendUsageNodeText |
284,848 | String () { return myUsageViewSettings.getExportFileName(); } | getDefaultFilePath |
284,849 | void (@NotNull String filePath) { myUsageViewSettings.setExportFileName(filePath); } | exportedTo |
284,850 | boolean () { return !myUsageView.isSearchInProgress() && myUsageView.areTargetsValid(); } | canExport |
284,851 | String () { return getUsage().toString(); } | toString |
284,852 | int (@NotNull UsageNode usageNode) { return UsageViewImpl.USAGE_COMPARATOR_BY_FILE_AND_OFFSET.compare(getUsage(), usageNode.getUsage()); } | compareTo |
284,853 | Usage () { return (Usage)getUserObject(); } | getUsage |
284,854 | void (boolean requestFocus) { getUsage().navigate(requestFocus); } | navigate |
284,855 | boolean () { return getUsage().isValid() && getUsage().canNavigate(); } | canNavigate |
284,856 | boolean () { return getUsage().isValid() && getUsage().canNavigate(); } | canNavigateToSource |
284,857 | boolean () { return getUsage().isValid(); } | isDataValid |
284,858 | boolean () { return getUsage().isReadOnly(); } | isDataReadOnly |
284,859 | boolean () { return isExcluded(); } | isDataExcluded |
284,860 | String () { return getUsage().getPresentation().getPlainText(); } | getNodeText |
284,861 | void () { getUsage().getPresentation().updateCachedPresentation(); } | updateCachedPresentation |
284,862 | String (@NonNls UsageTarget @NotNull [] searchFor) { KeyboardShortcut shortcut = UsageViewImpl.getShowUsagesWithSettingsShortcut(searchFor); HtmlBuilder builder = new HtmlBuilder() .appendLink(FIND_OPTIONS_HREF_TARGET, UsageViewBundle.message("link.display.name.find.options")); if (shortcut != null) { builder.nbsp().append("(" + KeymapUtil.getShortcutText(shortcut) + ")"); } return builder.toString(); } | createOptionsHtml |
284,863 | String () { return HtmlChunk.link(SEARCH_IN_PROJECT_HREF_TARGET, UsageViewBundle.message("link.display.name.search.in.project")).toString(); } | createSearchInProjectHtml |
284,864 | void (@Nullable HyperlinkListener listener, @NotNull MessageType messageType, @NotNull List<String> lines) { UsageViewContentManager.getInstance(myProject); // in case tool window not registered Collection<VirtualFile> largeFiles = myProcessPresentation.getLargeFiles(); List<String> resultLines = new ArrayList<>(lines); HyperlinkListener resultListener = listener; if (!largeFiles.isEmpty()) { String shortMessage = "(<a href='" + LARGE_FILES_HREF_TARGET + "'>" + UsageViewBundle.message("large.files.were.ignored", largeFiles.size()) + "</a>)"; resultLines.add(shortMessage); resultListener = addHrefHandling(resultListener, LARGE_FILES_HREF_TARGET, () -> { String detailedMessage = detailedLargeFilesMessage(largeFiles); List<String> strings = new ArrayList<>(lines); strings.add(detailedMessage); //noinspection SSBasedInspection ToolWindowManager.getInstance(myProject).notifyByBalloon(ToolWindowId.FIND, messageType, wrapInHtml(strings), AllIcons.Actions.Find, listener); }); } Runnable searchIncludingProjectFileUsages = myProcessPresentation.searchIncludingProjectFileUsages(); if (searchIncludingProjectFileUsages != null) { resultLines.add(UsageViewBundle.message("message.occurrences.in.project.configuration.files.are.skipped") + " <a href='" + SHOW_PROJECT_FILE_OCCURRENCES_HREF_TARGET + "'>" + UsageViewBundle.message("message.include.them") + "</a>"); resultListener = addHrefHandling(resultListener, SHOW_PROJECT_FILE_OCCURRENCES_HREF_TARGET, searchIncludingProjectFileUsages); } Collection<UnloadedModuleDescription> unloaded; try (AccessToken ignore = SlowOperations.knownIssue("IDEA-333936, EA-828575")) { unloaded = getUnloadedModulesBelongingToScope(); } MessageType actualType = messageType; if (!unloaded.isEmpty()) { if (actualType == MessageType.INFO) { actualType = MessageType.WARNING; } resultLines.add(mayHaveUsagesInUnloadedModulesMessage(unloaded)); } //noinspection SSBasedInspection ToolWindowManager.getInstance(myProject).notifyByBalloon(ToolWindowId.FIND, actualType, wrapInHtml(resultLines), AllIcons.Actions.Find, resultListener); } | notifyByFindBalloon |
284,865 | Collection<UnloadedModuleDescription> () { return ReadAction.compute(() -> { if (!(mySearchScopeToWarnOfFallingOutOf instanceof GlobalSearchScope)) return Collections.emptySet(); Collection<UnloadedModuleDescription> unloadedInSearchScope = ((GlobalSearchScope)mySearchScopeToWarnOfFallingOutOf).getUnloadedModulesBelongingToScope(); Set<UnloadedModuleDescription> unloadedInUseScope = getUnloadedModulesBelongingToUseScopes(); if (unloadedInUseScope != null) { //when searching for usages of PsiElements return only those unloaded modules which may contain references to the elements, this way // we won't show a warning if e.g., 'find usages' for a private method is invoked return ContainerUtil.intersection(unloadedInSearchScope, unloadedInUseScope); } return unloadedInSearchScope; }); } | getUnloadedModulesBelongingToScope |
284,866 | Set<UnloadedModuleDescription> () { Set<UnloadedModuleDescription> resolveScope = new LinkedHashSet<>(); for (UsageTarget target : mySearchFor) { if (!(target instanceof PsiElementUsageTarget)) return null; PsiElement element = ((PsiElementUsageTarget)target).getElement(); if (element == null) return null; SearchScope useScope = element.getUseScope(); if (useScope instanceof GlobalSearchScope) { resolveScope.addAll(((GlobalSearchScope)useScope).getUnloadedModulesBelongingToScope()); } } return resolveScope; } | getUnloadedModulesBelongingToUseScopes |
284,867 | HyperlinkListener (@Nullable HyperlinkListener listener, @NotNull String hrefTarget, @NotNull Runnable handler) { return new HyperlinkAdapter() { @Override protected void hyperlinkActivated(@NotNull HyperlinkEvent e) { if (e.getDescription().equals(hrefTarget)) { handler.run(); } else if (listener != null) { listener.hyperlinkUpdate(e); } } }; } | addHrefHandling |
284,868 | void (@NotNull HyperlinkEvent e) { if (e.getDescription().equals(hrefTarget)) { handler.run(); } else if (listener != null) { listener.hyperlinkUpdate(e); } } | hyperlinkActivated |
284,869 | String (@NotNull Collection<? extends VirtualFile> largeFiles) { return UsageViewBundle.message("files.are.too.large.large.and.cannot.be.scanned", largeFiles.size(), "<br> " + StringUtil.join(ContainerUtil.getFirstItems(new ArrayList<>(largeFiles), 10), vFile -> presentableFileInfo(vFile), "<br> ") + "<br> "); } | detailedLargeFilesMessage |
284,870 | String (@NotNull VirtualFile vFile) { return getPresentablePath(vFile) + " (" + UsageViewManagerImpl.presentableSize(UsageViewManagerImpl.getFileLength(vFile)) + ")"; } | presentableFileInfo |
284,871 | String (@NotNull VirtualFile virtualFile) { return "'" + ReadAction.compute(virtualFile::getPresentableUrl) + "'"; } | getPresentablePath |
284,872 | HyperlinkListener (UsageTarget @NotNull [] targets) { return new HyperlinkAdapter() { @Override protected void hyperlinkActivated(@NotNull HyperlinkEvent e) { if (e.getDescription().equals(FIND_OPTIONS_HREF_TARGET)) { FindManager.getInstance(myProject).showSettingsAndFindUsages(targets); } } }; } | createGotToOptionsListener |
284,873 | void (@NotNull HyperlinkEvent e) { if (e.getDescription().equals(FIND_OPTIONS_HREF_TARGET)) { FindManager.getInstance(myProject).showSettingsAndFindUsages(targets); } } | hyperlinkActivated |
284,874 | HyperlinkListener () { return new HyperlinkAdapter() { @Override protected void hyperlinkActivated(@NotNull HyperlinkEvent e) { if (e.getDescription().equals(SEARCH_IN_PROJECT_HREF_TARGET)) { PsiElement psiElement = getPsiElement(mySearchFor); if (psiElement != null) { FindManager.getInstance(myProject).findUsagesInScope(psiElement, GlobalSearchScope.projectScope(myProject)); } } } }; } | createSearchInProjectListener |
284,875 | void (@NotNull HyperlinkEvent e) { if (e.getDescription().equals(SEARCH_IN_PROJECT_HREF_TARGET)) { PsiElement psiElement = getPsiElement(mySearchFor); if (psiElement != null) { FindManager.getInstance(myProject).findUsagesInScope(psiElement, GlobalSearchScope.projectScope(myProject)); } } } | hyperlinkActivated |
284,876 | PsiElement (UsageTarget @NotNull [] searchFor) { UsageTarget target = searchFor[0]; if (!(target instanceof PsiElementUsageTarget)) return null; return ReadAction.compute(((PsiElementUsageTarget)target)::getElement); } | getPsiElement |
284,877 | void (@NotNull Usage usage) { if (!(usage instanceof UsageInfo2UsageAdapter usageInfo)) { return; } Editor editor = usageInfo.openTextEditor(true); if (editor == null) return; TextAttributes attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.BLINKING_HIGHLIGHTS_ATTRIBUTES); RangeBlinker rangeBlinker = new RangeBlinker(editor, attributes, 6); List<Segment> segments = new ArrayList<>(); Processor<Segment> processor = Processors.cancelableCollectProcessor(segments); usageInfo.processRangeMarkers(processor); rangeBlinker.resetMarkers(segments); rangeBlinker.startBlinking(); } | flashUsageScriptaculously |
284,878 | UsageViewEx (@NotNull ProgressIndicator indicator, long startSearchStamp) { UsageViewEx existingUsageView = myUsageViewRef.get(); if (existingUsageView != null) { return existingUsageView; } int usageCount = myUsageCountWithoutDefinition.get(); if (usageCount == 0 || usageCount == 1 && !myProcessPresentation.isShowPanelIfOnlyOneUsage() && System.currentTimeMillis() < startSearchStamp + 500) { return null; } UsageViewEx usageView = myUsageViewManager.createUsageView(mySearchFor, Usage.EMPTY_ARRAY, myPresentation, mySearcherFactory); if (myUsageViewRef.compareAndSet(null, usageView)) { // associate progress only if created successfully, otherwise Dispose will cancel the actual progress, see IDEA-195542 PsiElement element = getPsiElement(mySearchFor); ReadAction.run(() -> UsageViewStatisticsCollector.logSearchStarted(myProject, usageView, CodeNavigateSource.FindToolWindow, element, mySearchFor.length)); usageView.associateProgress(indicator); if (myProcessPresentation.isShowFindOptionsPrompt()) { openView(usageView); } else if (myListener != null) { SwingUtilities.invokeLater(() -> { if (!myProject.isDisposed()) { UsageViewEx uv = myUsageViewRef.get(); if (uv != null) { myListener.usageViewCreated(uv); } } }); } Usage firstUsage = myFirstUsage.get(); if (firstUsage != null) { ApplicationManager.getApplication().runReadAction(() -> usageView.appendUsage(firstUsage)); } return usageView; } // dispose duplicate UsageView created in a race Disposer.register(myProject, usageView); // UI thread because dispose does some sort of swing magic e.g., AnAction.unregisterCustomShortcutSet() ApplicationManager.getApplication().invokeLater(() -> Disposer.dispose(usageView), ModalityState.any(), myProject.getDisposed()); return myUsageViewRef.get(); } | getUsageView |
284,879 | void (@NotNull UsageViewEx usageView) { SwingUtilities.invokeLater(() -> { if (myProject.isDisposed()) return; myUsageViewManager.showUsageView(usageView, myPresentation); if (myListener != null) { myListener.usageViewCreated(usageView); } myUsageViewManager.showToolWindow(false); }); } | openView |
284,880 | void () { PerformanceWatcher.Snapshot snapshot = PerformanceWatcher.takeSnapshot(); searchUsages(); endSearchForUsages(); snapshot.logResponsivenessSinceCreation("Find Usages in " + myProject.getName()); } | run |
284,881 | void () { ProgressIndicator current = ProgressManager.getInstance().getProgressIndicator(); if (current == null) throw new IllegalStateException("must run find usages under progress"); ProgressIndicator indicator = ProgressWrapper.unwrapAll(current); if (!ApplicationManager.getApplication().isDispatchThread()) { CoreProgressManager.assertUnderProgress(indicator); } TooManyUsagesStatus.createFor(indicator); UsageSearcher usageSearcher = mySearcherFactory.create(); long startSearchStamp = System.currentTimeMillis(); usageSearcher.generate(usage -> { ProgressIndicator currentIndicator = ProgressManager.getInstance().getProgressIndicator(); if (currentIndicator == null) throw new IllegalStateException("must run find usages under progress"); ProgressIndicator originalIndicator = ProgressWrapper.unwrapAll(current); ProgressManager.checkCanceled(); if (!UsageViewManagerImpl.isInScope(usage, mySearchScopeToWarnOfFallingOutOf)) { myOutOfScopeUsages.incrementAndGet(); return true; } boolean incrementCounter = !UsageViewManager.isSelfUsage(usage, mySearchFor); if (incrementCounter) { int usageCount = myUsageCountWithoutDefinition.incrementAndGet(); if (usageCount == 1 && !myProcessPresentation.isShowPanelIfOnlyOneUsage()) { myFirstUsage.compareAndSet(null, usage); } myFirstItemFoundTS.compareAndSet(0, System.nanoTime()); // Successes only once - at first assignment UsageViewEx usageView = getUsageView(originalIndicator, startSearchStamp); TooManyUsagesStatus tooManyUsagesStatus= TooManyUsagesStatus.getFrom(originalIndicator); if (usageCount > UsageLimitUtil.USAGES_LIMIT && tooManyUsagesStatus.switchTooManyUsagesStatus()) { myTooManyUsages.set(true); PsiElement element = getPsiElement(mySearchFor); Class<? extends PsiElement> elementClass = element == null ? null : element.getClass(); String scopeText = myPresentation.getScopeText(); Language language = element == null ? null : element.getLanguage(); Consumer<UsageLimitUtil.Result> onUserClicked = result -> UsageViewStatisticsCollector.logTooManyDialog(myProject, myUsageViewRef.get(), result == UsageLimitUtil.Result.ABORT ? TooManyUsagesUserAction.Aborted : TooManyUsagesUserAction.Continued, elementClass, scopeText, language); UsageViewManagerImpl.showTooManyUsagesWarningLater(myProject, tooManyUsagesStatus, originalIndicator, usageView, () -> UsageViewBundle.message("find.excessive.usage.count.prompt"), onUserClicked); UsageViewStatisticsCollector.logTooManyDialog(myProject, myUsageViewRef.get(), TooManyUsagesUserAction.Shown, elementClass, scopeText, language); } tooManyUsagesStatus.pauseProcessingIfTooManyUsages(); if (usageView != null) { ApplicationManager.getApplication().runReadAction(() -> usageView.appendUsage(usage)); } } return true; }); if (myProcessPresentation.isShowFindOptionsPrompt() && getUsageView(indicator, startSearchStamp) != null) { ApplicationManager.getApplication().invokeLater(() -> myUsageViewManager.showToolWindow(true), myProject.getDisposed()); } } | searchUsages |
284,882 | void () { ApplicationManager.getApplication().assertIsNonDispatchThread(); int usageCount = myUsageCountWithoutDefinition.get(); if (usageCount == 0) { if (myProcessPresentation.isShowNotFoundMessage()) { ApplicationManager.getApplication().invokeLater(() -> { if (myProcessPresentation.isCanceled()) { notifyByFindBalloon(null, MessageType.WARNING, Collections.singletonList(UsageViewBundle.message("message.usage.search.was.canceled"))); } else { List<String> lines = new ArrayList<>(); lines.add(StringUtil.escapeXmlEntities(myPresentation.getSearchString())); lines.add(UsageViewBundle.message("search.result.nothing.in.0", StringUtil.escapeXmlEntities(myPresentation.getScopeText()))); if (myOutOfScopeUsages.get() != 0) { lines.add(UsageViewManagerImpl.outOfScopeMessage(myOutOfScopeUsages.get(), mySearchScopeToWarnOfFallingOutOf)); } if (myProcessPresentation.isShowFindOptionsPrompt()) { lines.add(createOptionsHtml(mySearchFor)); } MessageType type = myOutOfScopeUsages.get() == 0 ? MessageType.INFO : MessageType.WARNING; notifyByFindBalloon(createGotToOptionsListener(mySearchFor), type, lines); } }, ModalityState.nonModal(), myProject.getDisposed()); } } else if (usageCount == 1 && !myProcessPresentation.isShowPanelIfOnlyOneUsage()) { ApplicationManager.getApplication().invokeLater(() -> { Usage usage = myFirstUsage.get(); if (usage.canNavigate()) { usage.navigate(true); flashUsageScriptaculously(usage); } List<String> lines = new ArrayList<>(); lines.add(UsageViewBundle.message("message.only.one.usage.found")); if (myOutOfScopeUsages.get() != 0) { lines.add(UsageViewManagerImpl.outOfScopeMessage(myOutOfScopeUsages.get(), mySearchScopeToWarnOfFallingOutOf)); } lines.add(createOptionsHtml(mySearchFor)); MessageType type = myOutOfScopeUsages.get() == 0 ? MessageType.INFO : MessageType.WARNING; notifyByFindBalloon(createGotToOptionsListener(mySearchFor), type, lines); }, ModalityState.nonModal(), myProject.getDisposed()); } else { UsageViewEx usageView = myUsageViewRef.get(); usageView.searchFinished(); List<String> lines; HyperlinkListener hyperlinkListener; if (myOutOfScopeUsages.get() == 0 || getPsiElement(mySearchFor)==null) { lines = Collections.emptyList(); hyperlinkListener = null; } else { lines = Arrays.asList(UsageViewManagerImpl.outOfScopeMessage(myOutOfScopeUsages.get(), mySearchScopeToWarnOfFallingOutOf), createSearchInProjectHtml()); hyperlinkListener = createSearchInProjectListener(); } if (!myProcessPresentation.getLargeFiles().isEmpty() || myOutOfScopeUsages.get() != 0 || myProcessPresentation.searchIncludingProjectFileUsages() != null || !getUnloadedModulesBelongingToScope().isEmpty()) { ApplicationManager.getApplication().invokeLater(() -> { MessageType type = myOutOfScopeUsages.get() == 0 ? MessageType.INFO : MessageType.WARNING; notifyByFindBalloon(hyperlinkListener, type, lines); }, ModalityState.nonModal(), myProject.getDisposed()); } } UsageViewEx usageView = myUsageViewRef.get(); if (usageView != null) { usageView.waitForUpdateRequestsCompletion(); } if (myListener != null) { myListener.findingUsagesFinished(usageView); } } | endSearchForUsages |
284,883 | String (@NotNull Collection<? extends UnloadedModuleDescription> unloadedModules) { String modulesText = unloadedModules.size() > 1 ? UsageViewBundle.message("message.part.number.of.unloaded.modules", unloadedModules.size()) : UsageViewBundle.message("message.part.unloaded.module.0", Objects.requireNonNull(ContainerUtil.getFirstItem(unloadedModules)).getName()); return UsageViewBundle.message( "message.occurrences.in.0.may.be.skipped.load.all.modules.and.repeat.the.search.to.get.complete.results", modulesText); } | mayHaveUsagesInUnloadedModulesMessage |
284,884 | UsageFilteringRuleStateService () { return ApplicationManager.getApplication().getService(UsageFilteringRuleStateService.class); } | getInstance |
284,885 | UsageFilteringRuleState () { return new UsageFilteringRuleStateImpl(getInstance().myState); } | createFilteringRuleState |
284,886 | AccessToken (@NotNull String ruleId, boolean active) { UsageFilteringRuleStateService instance = getInstance(); Set<String> state = instance.myState; boolean modified = active ? state.add(ruleId) : state.remove(ruleId); if (!modified) { return AccessToken.EMPTY_ACCESS_TOKEN; } else { return new AccessToken() { @Override public void finish() { boolean modifiedBack = active ? state.remove(ruleId) : state.add(ruleId); assert modifiedBack; } }; } } | withRule |
284,887 | void () { boolean modifiedBack = active ? state.remove(ruleId) : state.add(ruleId); assert modifiedBack; } | finish |
284,888 | boolean () { return getTarget().isValid(); } | isDataValid |
284,889 | boolean () { return getTarget().isReadOnly(); } | isDataReadOnly |
284,890 | boolean () { return false; } | isDataExcluded |
284,891 | String () { return ObjectUtils.notNull(getTarget().getPresentation().getPresentableText(), ""); } | getNodeText |
284,892 | UsageTarget () { return (UsageTarget)getUserObject(); } | getTarget |
284,893 | void () { super.updateNotify(); getTarget().update(); } | updateNotify |
284,894 | void (@NotNull PsiTreeChangeEvent event) { doFire(event, false); } | childAdded |
284,895 | void (@NotNull PsiTreeChangeEvent event) { doFire(event, false); } | childRemoved |
284,896 | void (@NotNull PsiTreeChangeEvent event) { doFire(event, false); } | childReplaced |
284,897 | void (@NotNull PsiTreeChangeEvent event) { doFire(event, false); } | childrenChanged |
284,898 | void (@NotNull PsiTreeChangeEvent event) { doFire(event, false); } | childMoved |
284,899 | void (@NotNull PsiTreeChangeEvent event) { doFire(event, true); } | propertyChanged |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.