Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
275,200
void (Component c, Graphics g, int x, int y) { GraphicsConfig config = GraphicsUtil.setupAAPainting(g); Graphics2D g2 = (Graphics2D)g; int shift = myShift - getChunkWidth(); while (shift < getIconWidth()) { paint(g2, x, y, shift); shift += getChunkWidth(); } config.restore(); }
paintIcon
275,201
int () { return myReferenceComponent.getWidth(); }
getIconWidth
275,202
int () { return 2 * JBUIScale.scale(GRADIENT); }
getChunkWidth
275,203
void (@NotNull Graphics2D g2, int x, int y, int shift) { Color dark = DARK; Color light = LIGHT; g2.setPaint(new GradientPaint(x + shift, y, dark, x + shift + JBUIScale.scale(GRADIENT), y, light)); g2.fill(new Rectangle(x + shift, y, JBUIScale.scale(GRADIENT), getIconHeight())); g2.setPaint(new GradientPaint(x + shift + JBUIScale.scale(GRADIENT), y, light, x + shift + 2 * JBUIScale.scale(GRADIENT), y, dark)); g2.fill(new Rectangle(x + shift + JBUIScale.scale(GRADIENT), y, JBUIScale.scale(GRADIENT), getIconHeight())); }
paint
275,204
int () { return JBUIScale.scale(GRADIENT_HEIGHT); }
getIconHeight
275,205
AsyncProcessIcon (@NotNull JComponent component) { List<Icon> result = new ArrayList<>(); for (int i = 0; i < 2 * JBUIScale.scale(GradientIcon.GRADIENT); i += JBUIScale.scale(TRANSLATE)) { result.add(new GradientIcon(component, i)); } Icon passive = result.get(0); AsyncProcessIcon icon = new AsyncProcessIcon("ProgressStripeIcon", result.toArray(new Icon[0]), passive) { @Override public Dimension getPreferredSize() { return new Dimension(component.getWidth(), passive.getIconHeight()); } }; component.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { super.componentResized(e); icon.revalidate(); } }); return icon; }
generateIcon
275,206
Dimension () { return new Dimension(component.getWidth(), passive.getIconHeight()); }
getPreferredSize
275,207
void (ComponentEvent e) { super.componentResized(e); icon.revalidate(); }
componentResized
275,208
void () { super.updateUI(); // can be null in super constructor. // can be disposed during dispose sequence (ThreeComponentsSplitter can trigger updateUI while removing contents of other toolwindows). if (myDisposable != null && !Disposer.isDisposed(myDisposable)) { createLoadingDecorator(); } }
updateUI
275,209
void () { if (myDecorator != null) { remove(myDecorator.getComponent()); Disposer.dispose(myDecorator.getDisposable()); } Disposable disposable = Disposer.newDisposable(); Disposer.register(myDisposable, disposable); myDecorator = new MyLoadingDecorator(myTargetComponent, myPanel, disposable, myStartDelayMs); add(myDecorator.getComponent(), BorderLayout.CENTER); myDecorator.setLoadingText(""); }
createLoadingDecorator
275,210
void () { myDecorator.startLoading(false); }
startLoading
275,211
void () { myDecorator.startLoadingImmediately(); }
startLoadingImmediately
275,212
void () { myDecorator.stopLoading(); }
stopLoading
275,213
void () { doStartLoading(false); }
startLoadingImmediately
275,214
NonOpaquePanel (JPanel parent, @NotNull JLabel text, @NotNull AnimatedIcon icon) { parent.setLayout(new BorderLayout()); NonOpaquePanel result = new NonOpaquePanel(); result.setLayout(new BoxLayout(result, BoxLayout.Y_AXIS)); result.add(icon); parent.add(result, BorderLayout.NORTH); return result; }
customizeLoadingLayer
275,215
Disposable () { return myDisposable; }
getDisposable
275,216
Dimension () { return VcsLogUiUtil.expandToFitToolbar(super.getMinimumSize(), myChangesBrowser.getToolbar().getComponent()); }
getMinimumSize
275,217
void (boolean state) { getPreviewDiff().updatePreview(state); }
updatePreview
275,218
void (@Nullable @NlsContexts.LinkLabel String text) { myNotificationLabel.setText(Objects.requireNonNullElse(text, "")); myNotificationLabel.setVisible(text != null); }
setExplanationHtml
275,219
void (@NotNull VisiblePack dataPack, boolean permGraphChanged) { myFilterUi.updateDataPack(dataPack); myGraphTable.updateDataPack(dataPack, permGraphChanged); myChangesBrowser.setAffectedPaths(VcsLogUtil.getAffectedPaths(dataPack)); }
updateDataPack
275,220
VcsLogGraphTable () { return myGraphTable; }
getGraphTable
275,221
VcsLogFilterUiEx () { return myFilterUi; }
getFilterUi
275,222
JComponent () { ActionManager actionManager = ActionManager.getInstance(); DefaultActionGroup toolbarGroup = (DefaultActionGroup)actionManager.getAction(VcsLogActionIds.TOOLBAR_ACTION_GROUP); DefaultActionGroup mainGroup = new DefaultActionGroup(); mainGroup.add(myFilterUi.createActionGroup()); mainGroup.addSeparator(); mainGroup.add(toolbarGroup); ActionToolbar toolbar = actionManager.createActionToolbar(ActionPlaces.VCS_LOG_TOOLBAR_PLACE, mainGroup, true); toolbar.setTargetComponent(this); Wrapper textFilter = new Wrapper(myFilterUi.getTextFilterComponent().getComponent()); textFilter.setVerticalSizeReferent(toolbar.getComponent()); String vcsDisplayName = VcsLogUtil.getVcsDisplayName(myLogData.getProject(), myLogData.getLogProviders().values()); textFilter.getAccessibleContext().setAccessibleName(VcsLogBundle.message("vcs.log.text.filter.accessible.name", vcsDisplayName)); DefaultActionGroup presentationSettingsGroup = (DefaultActionGroup)actionManager.getAction(VcsLogActionIds.PRESENTATION_SETTINGS_ACTION_GROUP); configureIntelliSortAction(presentationSettingsGroup); ActionGroup rightCornerGroup = (ActionGroup)Objects.requireNonNull( CustomActionsSchema.getInstance().getCorrectedAction(VcsLogActionIds.TOOLBAR_RIGHT_CORNER_ACTION_GROUP)); ActionToolbar rightCornerToolbar = actionManager.createActionToolbar(ActionPlaces.VCS_LOG_TOOLBAR_PLACE, rightCornerGroup, true); rightCornerToolbar.setTargetComponent(this); rightCornerToolbar.setReservePlaceAutoPopupIcon(false); JPanel panel = new JPanel(new MigLayout("ins 0, fill", "[left]0[left, fill]push[pref:pref, right]", "center")); GuiUtils.installVisibilityReferent(panel, toolbar.getComponent()); panel.add(textFilter); panel.add(toolbar.getComponent()); panel.add(rightCornerToolbar.getComponent()); return panel; }
createActionsToolbar
275,223
void (@NotNull DefaultActionGroup group) { AnAction intelliSortAction = ActionManager.getInstance().getAction(VcsLogActionIds.VCS_LOG_INTELLI_SORT_ACTION); if (BekUtil.isBekEnabled()) { if (BekUtil.isLinearBekEnabled()) { group.replaceAction(intelliSortAction, new IntelliSortChooserPopupAction()); } } else { // drop together with com.intellij.vcs.log.util.BekUtil.isBekEnabled group.remove(intelliSortAction); } }
configureIntelliSortAction
275,224
List<AnAction> (boolean originalProvider) { AnAction textFilterAction = ActionUtil.wrap(VcsLogActionIds.VCS_LOG_FOCUS_TEXT_FILTER); textFilterAction.getTemplatePresentation().setText(VcsLogBundle.message("vcs.log.text.filter.action.text")); List<AnAction> actions = new ArrayList<>(); actions.add(textFilterAction); actions.addAll(SimpleToolWindowPanel.collectActions(myToolbar)); return actions; }
getActions
275,225
JComponent () { return MainFrame.this; }
getComponent
275,226
Collection<VirtualFile> () { Collection<VirtualFile> roots = myLogData.getRoots(); if (roots.size() == 1) return roots; int[] selectedRows = myGraphTable.getSelectedRows(); if (selectedRows.length == 0 || selectedRows.length > VcsLogUtil.MAX_SELECTED_COMMITS) { return VcsLogUtil.getAllVisibleRoots(roots, myFilterUi.getFilters()); } return ContainerUtil.map2Set(Ints.asList(selectedRows), row -> myGraphTable.getModel().getRootAtRow(row)); }
getSelectedRoots
275,227
JComponent () { return myToolbar; }
getToolbar
275,228
VcsLogChangesBrowser () { return myChangesBrowser; }
getChangesBrowser
275,229
void (boolean state) { myDetailsSplitter.setSecondComponent(state ? myDetailsPanel : null); }
showDetails
275,230
void (@NotNull FilePath filePath, boolean requestFocus) { if (myIsLoading) { myPathToSelect = filePath; } else { myChangesBrowser.selectFile(filePath); myPathToSelect = null; } if (requestFocus) { myChangesBrowser.getViewer().requestFocus(); } }
selectFilePath
275,231
void () { myDetailsSplitter.dispose(); myChangesBrowserSplitter.dispose(); }
dispose
275,232
void () { myChangesBrowser.setSelectedDetails(Collections.emptyList()); }
onEmptySelection
275,233
void (@NotNull List<? extends VcsFullCommitDetails> detailsList) { int maxSize = VcsLogUtil.getMaxSize(detailsList); if (maxSize > VcsLogUtil.getShownChangesLimit()) { String sizeText = VcsLogUtil.getSizeText(maxSize); myChangesBrowser.setEmptyWithText(statusText -> { statusText.setText(VcsLogBundle.message("vcs.log.changes.too.many.status", detailsList.size(), sizeText)); statusText.appendSecondaryText(VcsLogBundle.message("vcs.log.changes.too.many.show.anyway.status.action"), SimpleTextAttributes.LINK_PLAIN_ATTRIBUTES, e -> myChangesBrowser.setSelectedDetails(detailsList)); }); } else { myChangesBrowser.setSelectedDetails(detailsList); } }
onDetailsLoaded
275,234
void () { myIsLoading = true; myPathToSelect = null; }
onLoadingScheduled
275,235
void () { myChangesLoadingPane.startLoading(); }
onLoadingStarted
275,236
void () { myChangesLoadingPane.stopLoading(); myIsLoading = false; if (myPathToSelect != null) { myChangesBrowser.selectFile(myPathToSelect); myPathToSelect = null; } }
onLoadingStopped
275,237
void (@NotNull Throwable error) { myChangesBrowser.setEmptyWithText(statusText -> statusText.setText(VcsLogBundle.message("vcs.log.error.loading.changes.status"))); }
onError
275,238
List<Component> () { return List.of(myGraphTable, myChangesBrowser.getPreferredFocusedComponent(), myDiffPreview.getPreviewDiff().getPreferredFocusedComponent(), myFilterUi.getTextFilterComponent().getFocusedComponent()); }
getOrderedComponents
275,239
boolean () { return Registry.is("vcs.log.speedsearch") && super.isSpeedSearchEnabled(); }
isSpeedSearchEnabled
275,240
void () { StatusText statusText = getEmptyText(); VisiblePack visiblePack = getModel().getVisiblePack(); DataPackBase dataPack = visiblePack.getDataPack(); if (dataPack instanceof DataPack.ErrorDataPack) { setErrorEmptyText(((DataPack.ErrorDataPack)dataPack).getError(), VcsLogBundle.message("vcs.log.error.loading.commits.status")); appendActionToEmptyText(VcsLogBundle.message("vcs.log.refresh.status.action"), () -> myLogData.refresh(myLogData.getLogProviders().keySet())); } else if (visiblePack instanceof VisiblePack.ErrorVisiblePack) { setErrorEmptyText(((VisiblePack.ErrorVisiblePack)visiblePack).getError(), VcsLogBundle.message("vcs.log.error.filtering.status")); if (visiblePack.getFilters().isEmpty()) { appendActionToEmptyText(VcsLogBundle.message("vcs.log.refresh.status.action"), myRefresh); } else { VcsLogUiUtil.appendResetFiltersActionToEmptyText(myFilterUi, getEmptyText()); } } else if (visiblePack.getVisibleGraph().getVisibleCommitCount() == 0) { if (visiblePack.getFilters().isEmpty()) { statusText.setText(VcsLogBundle.message("vcs.log.no.commits.status")). appendSecondaryText(VcsLogBundle.message("vcs.log.commit.status.action"), SimpleTextAttributes.LINK_PLAIN_ATTRIBUTES, ActionUtil.createActionListener(IdeActions.ACTION_CHECKIN_PROJECT, this, ActionPlaces.UNKNOWN)); String shortcutText = KeymapUtil.getFirstKeyboardShortcutText(IdeActions.ACTION_CHECKIN_PROJECT); if (!shortcutText.isEmpty()) { statusText.appendSecondaryText(" (" + shortcutText + ")", StatusText.DEFAULT_ATTRIBUTES, null); } } else { myFilterUi.setCustomEmptyText(getEmptyText()); } } else { statusText.setText(VcsLogBundle.message("vcs.log.default.status")); } }
updateEmptyText
275,241
void (@NotNull AnActionEvent e) { super.update(e); VcsLogData data = e.getData(VcsLogInternalDataKeys.LOG_DATA); VcsLogUi logUi = e.getData(VcsLogDataKeys.VCS_LOG_UI); if (data == null || logUi == null) { e.getPresentation().setEnabledAndVisible(false); return; } Map<VirtualFile, VcsLogProvider> providers = data.getLogProviders(); if (!isCommitDateSupported(providers.values())) { e.getPresentation().setEnabledAndVisible(false); return; } Set<VirtualFile> visibleRoots = e.getData(VcsLogInternalDataKeys.VCS_LOG_VISIBLE_ROOTS); if (visibleRoots == null) { e.getPresentation().setEnabledAndVisible(false); return; } Set<VcsLogProvider> visibleProviders = ContainerUtil.map2SetNotNull(visibleRoots, root -> providers.get(root)); if (!isDateDisplayed(e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES)) || !isCommitDateSupported(visibleProviders)) { e.getPresentation().setEnabled(false); } }
update
275,242
boolean (@NotNull Collection<? extends VcsLogProvider> providers) { return ContainerUtil.exists(providers, VcsLogProperties.HAS_COMMITTER::getOrDefault); }
isCommitDateSupported
275,243
boolean (@Nullable VcsLogUiProperties properties) { if (properties != null && supportsColumnsToggling(properties)) { return isVisible(Date.INSTANCE, properties); } return false; }
isDateDisplayed
275,244
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
275,245
void (@NotNull AnActionEvent e) { VcsLogUsageTriggerCollector.triggerUsage(e, this); Project project = e.getRequiredData(CommonDataKeys.PROJECT); VcsLogUiEx logUi = e.getRequiredData(VcsLogInternalDataKeys.LOG_UI_EX); VcsLogManager logManager = e.getRequiredData(VcsLogInternalDataKeys.LOG_MANAGER); Set<VirtualFile> visibleRoots = VcsLogUtil.getVisibleRoots(logUi); GoToHashOrRefPopup popup = new GoToHashOrRefPopup(project, logUi.getDataPack().getRefs(), visibleRoots, hash -> VcsLogNavigationUtil.jumpToRefOrHash(logUi, hash, false, true), reference -> VcsLogNavigationUtil.jumpToCommit(logUi, reference.getCommitHash(), reference.getRoot(), false, true), logManager.getColorManager(), new VcsGoToRefComparator(logUi.getDataPack().getLogProviders())); popup.show(logUi.getTable()); }
actionPerformed
275,246
void (@NotNull AnActionEvent e) { VcsLogUiEx logUi = e.getData(VcsLogInternalDataKeys.LOG_UI_EX); e.getPresentation().setEnabledAndVisible(e.getProject() != null && logUi != null); }
update
275,247
void (@NotNull AnActionEvent e) { super.update(e); if (!e.getPresentation().isEnabled()) return; if (!Registry.is("vcs.history.use.index")) { e.getPresentation().setEnabled(false); e.getPresentation().putClientProperty(ActionButton.CUSTOM_HELP_TOOLTIP, null); return; } Project project = e.getProject(); VcsLogManager logManager = e.getData(VcsLogInternalDataKeys.LOG_MANAGER); VcsLogUi logUi = e.getData(VcsLogDataKeys.VCS_LOG_UI); Set<VirtualFile> roots = e.getData(VcsLogInternalDataKeys.VCS_LOG_VISIBLE_ROOTS); if (project != null && logManager != null && logUi != null && roots != null && roots.size() == 1) { VcsLogIndex index = logManager.getDataManager().getIndex(); VirtualFile root = ContainerUtil.getOnlyItem(roots); if (!index.isIndexed(root)) { e.getPresentation().setEnabled(false); } HelpTooltip helpTooltip = getHelpTooltip(e.getPresentation(), logManager.getDataManager(), root); e.getPresentation().putClientProperty(ActionButton.CUSTOM_HELP_TOOLTIP, helpTooltip); } else { e.getPresentation().putClientProperty(ActionButton.CUSTOM_HELP_TOOLTIP, null); } }
update
275,248
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
275,249
boolean (@NotNull AnActionEvent e) { return e.getData(VcsLogDataKeys.VCS_LOG_COMMIT_SELECTION) != null && e.getData(ChangesBrowserBase.DATA_KEY) == null; }
isActive
275,250
void (@NotNull AnActionEvent e) { Project project = e.getProject(); VcsLogCommitSelection selection = e.getData(VcsLogDataKeys.VCS_LOG_COMMIT_SELECTION); if (project == null || selection == null) { e.getPresentation().setEnabledAndVisible(false); return; } if (selection.getSize() != 1) { e.getPresentation().setEnabledAndVisible(false); return; } e.getPresentation().setVisible(true); e.getPresentation().setEnabled(e.getData(VcsLogInternalDataKeys.LOG_DIFF_HANDLER) != null); }
update
275,251
void (@NotNull AnActionEvent e) { VcsLogUsageTriggerCollector.triggerUsage(e, this); Project project = e.getRequiredData(CommonDataKeys.PROJECT); VcsLogCommitSelection selection = e.getRequiredData(VcsLogDataKeys.VCS_LOG_COMMIT_SELECTION); List<CommitId> commits = selection.getCommits(); if (commits.size() != 1) return; CommitId commit = Objects.requireNonNull(getFirstItem(commits)); if (ChangeListManager.getInstance(project).isFreezedWithNotification(null)) return; VcsLogDiffHandler handler = e.getRequiredData(VcsLogInternalDataKeys.LOG_DIFF_HANDLER); handler.showDiffForPaths(commit.getRoot(), VcsLogUtil.getAffectedPaths(commit.getRoot(), e), commit.getHash(), null); }
actionPerformed
275,252
GraphAction () { return ourGraphAction; }
getGraphAction
275,253
void (@NotNull MainVcsLogUi vcsLogUi) { String title = vcsLogUi.getProperties().get(MainVcsLogUiProperties.BEK_SORT_TYPE) == PermanentGraph.SortType.LinearBek ? VcsLogBundle.message("action.process.collapsing.merges") : VcsLogBundle.message("action.process.collapsing.linear.branches"); performLongAction(vcsLogUi, getGraphAction(), title); }
executeAction
275,254
boolean (@NotNull AnActionEvent e) { VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); return properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE) && !properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE).equals(PermanentGraph.SortType.Normal); }
isSelected
275,255
void (@NotNull AnActionEvent e, boolean state) { VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); if (properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE)) { PermanentGraph.SortType bekSortType = state ? PermanentGraph.SortType.Bek : PermanentGraph.SortType.Normal; properties.set(MainVcsLogUiProperties.BEK_SORT_TYPE, bekSortType); } }
setSelected
275,256
void (@NotNull AnActionEvent e) { super.update(e); VcsLogUi logUI = e.getData(VcsLogDataKeys.VCS_LOG_UI); VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); Presentation presentation = e.getPresentation(); presentation.setVisible(BekUtil.isBekEnabled()); presentation.setEnabled(BekUtil.isBekEnabled() && logUI != null); if (properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE)) { String description; if (properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE) == PermanentGraph.SortType.Normal) { String localizedDescription = GraphSortPresentationUtil.getLocalizedDescription(PermanentGraph.SortType.Bek); description = VcsLogBundle.message("vcs.log.action.turn.intellisort.on", StringUtil.toLowerCase(localizedDescription)); } else { String localizedDescription = GraphSortPresentationUtil.getLocalizedDescription(PermanentGraph.SortType.Normal); description = VcsLogBundle.message("vcs.log.action.turn.intellisort.off", StringUtil.toLowerCase(localizedDescription)); } presentation.setDescription(description); } else { //noinspection DialogTitleCapitalization presentation.setDescription(VcsLogBundle.message("vcs.log.action.intellisort.description")); } }
update
275,257
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
275,258
boolean (@NotNull AnActionEvent e) { VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); if (properties == null || !properties.exists(getProperty())) return false; return properties.get(getProperty()); }
isSelected
275,259
void (@NotNull AnActionEvent e, boolean state) { VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); if (properties != null && properties.exists(getProperty())) { properties.set(getProperty(), state); } }
setSelected
275,260
void (@NotNull AnActionEvent e) { VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); e.getPresentation().setEnabledAndVisible(properties != null && properties.exists(getProperty())); super.update(e); }
update
275,261
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
275,262
void (@NotNull AnActionEvent e) { VcsLogUsageTriggerCollector.triggerUsage(e, this); VcsLogManager logManager = e.getRequiredData(VcsLogInternalDataKeys.LOG_MANAGER); // diagnostic for possible refresh problems VcsLogUi ui = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI); if (ui instanceof VcsLogUiEx) { VisiblePackRefresher refresher = ((VcsLogUiEx)ui).getRefresher(); if (!refresher.isValid()) { String message = "Trying to refresh invalid log tab '" + ui.getId() + "'."; if (!logManager.getDataManager().getProgress().isRunning()) { LOG.error(message, collectDiagnosticInformation(e.getProject(), logManager)); } else { LOG.warn(message); } refresher.setValid(true, false); } } logManager.getDataManager().refresh(VcsLogUtil.getVisibleRoots(ui)); }
actionPerformed
275,263
void (@NotNull AnActionEvent e) { VcsLogManager logManager = e.getData(VcsLogInternalDataKeys.LOG_MANAGER); e.getPresentation().setEnabledAndVisible(logManager != null && e.getData(VcsLogDataKeys.VCS_LOG_UI) != null); }
update
275,264
ActionUpdateThread () { return super.getActionUpdateThread(); }
getActionUpdateThread
275,265
void (@NotNull CompletionParameters parameters, @NotNull String prefix, @NotNull CompletionResultSet result) { addValues(result, sortVariants(collectSync(result))); Future<List<? extends T>> future = ApplicationManager.getApplication().executeOnPooledThread(() -> sortVariants(collectAsync(result))); while (true) { try { ProgressManager.checkCanceled(); List<? extends T> moreValues = future.get(TIMEOUT, TimeUnit.MILLISECONDS); if (moreValues != null) { addValues(result, moreValues); break; } } catch (InterruptedException | CancellationException e) { break; } catch (TimeoutException ignored) { } catch (ExecutionException e) { LOG.error(e); break; } catch (ProcessCanceledException e) { future.cancel(true); throw e; } } result.stopHere(); }
fillCompletionVariants
275,266
void (@NotNull CompletionResultSet result, @NotNull Collection<? extends T> values) { for (T completionVariant : values) { result.addElement(installInsertHandler(myDescriptor.createLookupBuilder(completionVariant))); } }
addValues
275,267
void (Color bg) { super.setBackground(bg); myProgressIcon.setBackground(bg); }
setBackground
275,268
boolean (KeyStroke ks, final KeyEvent e, int condition, boolean pressed) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { onOk(); return true; } return false; }
processKeyBinding
275,269
JComponent () { return myTextField; }
getPreferableFocusComponent
275,270
void () { myTextField.setEnabled(false); myProgressIcon.setVisible(true); }
showProgress
275,271
void () { myTextField.setEnabled(true); myProgressIcon.setVisible(false); }
hideProgress
275,272
String () { return myTextField.getText(); }
getText
275,273
void () { }
onOk
275,274
void (@NotNull AnActionEvent e) { VcsLogUsageTriggerCollector.triggerUsage(e, this); executeAction(e.getRequiredData(VcsLogInternalDataKeys.MAIN_UI)); }
actionPerformed
275,275
void (@NotNull AnActionEvent e) { MainVcsLogUi ui = e.getData(VcsLogInternalDataKeys.MAIN_UI); VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); boolean visible = ui != null && ui.getDataPack().getVisibleGraph().getActionController().isActionSupported(getGraphAction()); e.getPresentation().setVisible(visible); e.getPresentation().setEnabled(visible && !ui.getDataPack().isEmpty()); if (visible) { if (properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE) && properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE) == PermanentGraph.SortType.LinearBek) { e.getPresentation().setText(myMergesAction.get()); e.getPresentation().setDescription(myMergesDescription.get()); } else { e.getPresentation().setText(myLinearBranchesAction.get()); e.getPresentation().setDescription(myLinearBranchesDescription.get()); } } }
update
275,276
void (@NotNull MainVcsLogUi logUi, @NotNull GraphAction graphAction, @NotNull @NlsContexts.ProgressTitle String title) { VisiblePack dataPack = logUi.getDataPack(); ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> { ActionController<Integer> actionController = dataPack.getVisibleGraph().getActionController(); GraphAnswer<Integer> answer = actionController.performAction(graphAction); Runnable updater = answer.getGraphUpdater(); ApplicationManager.getApplication().invokeLater(() -> { assert updater != null : "Action:" + title + "\nController: " + actionController + "\nAnswer:" + answer; updater.run(); logUi.getTable().handleAnswer(answer); }); }, title, false, null, logUi.getMainComponent()); }
performLongAction
275,277
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
275,278
boolean () { return true; }
isPopup
275,279
void (@NotNull AnActionEvent e) { VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); e.getPresentation().setEnabled(properties != null); if (properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE)) { String sortName = GraphSortPresentationUtil.getLocalizedName(properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE)); String description = VcsLogBundle.message("vcs.log.action.intellisort.title", sortName); e.getPresentation().setDescription(description); e.getPresentation().setText(description); } }
update
275,280
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
275,281
void (@NotNull AnActionEvent e) { super.update(e); e.getPresentation().setEnabled(!myUI.getDataPack().isEmpty() && myProperties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE)); }
update
275,282
boolean (@NotNull AnActionEvent e) { return myProperties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE) && myProperties.get(MainVcsLogUiProperties.BEK_SORT_TYPE).equals(mySortType); }
isSelected
275,283
void (@NotNull AnActionEvent e, boolean state) { if (state && myProperties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE)) { myProperties.set(MainVcsLogUiProperties.BEK_SORT_TYPE, mySortType); } }
setSelected
275,284
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
275,285
void (@NotNull AnActionEvent e) { Project project = e.getProject(); VcsLogUi ui = e.getData(VcsLogDataKeys.VCS_LOG_UI); e.getPresentation().setEnabledAndVisible(project != null && ui instanceof MainVcsLogUi); }
update
275,286
void (@NotNull AnActionEvent e) { VcsLogUsageTriggerCollector.triggerUsage(e, this); MainVcsLogUi logUi = (MainVcsLogUi)e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI); Project project = e.getProject(); if (IdeFocusManager.getInstance(project).getFocusedDescendantFor(logUi.getToolbar()) != null) { IdeFocusManager.getInstance(project).requestFocus(logUi.getTable(), true); } else { IdeFocusManager.getInstance(project).requestFocus(logUi.getFilterUi().getTextFilterComponent().getFocusedComponent(), true); } }
actionPerformed
275,287
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
275,288
void (@NotNull AnActionEvent e) { super.update(e); e.getPresentation().setPopupGroup(isPopup(e)); e.getPresentation().setEnabledAndVisible(isEnabledAndVisible(e)); }
update
275,289
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
275,290
boolean (@NotNull AnActionEvent e) { return e.getData(VcsLogInternalDataKeys.FILE_HISTORY_UI) == null; }
isPopup
275,291
boolean (@NotNull AnActionEvent e) { VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); return properties != null && supportsColumnsToggling(properties); }
isEnabledAndVisible
275,292
boolean (@NotNull AnActionEvent e) { VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); if (properties != null) { return isVisible(myColumn, properties); } return false; }
isSelected
275,293
void (@NotNull AnActionEvent e, boolean state) { VcsLogUsageTriggerCollector.triggerUsage(e, this); VcsLogUiProperties properties = e.getRequiredData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); assert supportsColumnsToggling(properties); if (state) { addColumn(properties, myColumn); } else { removeColumn(properties, myColumn); } }
setSelected
275,294
void (@NotNull AnActionEvent e) { super.update(e); e.getPresentation().setEnabledAndVisible(isEnabledAndVisible(e)); }
update
275,295
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
275,296
void (@NotNull AnActionEvent e) { super.update(e); VcsLogUi ui = e.getData(VcsLogDataKeys.VCS_LOG_UI); VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); if (ui != null && properties != null && properties.exists(MainVcsLogUiProperties.TEXT_FILTER_MATCH_CASE)) { Presentation presentation = e.getPresentation(); boolean regexEnabled = properties.exists(MainVcsLogUiProperties.TEXT_FILTER_REGEX) && properties.get(MainVcsLogUiProperties.TEXT_FILTER_REGEX); if (!regexEnabled) { presentation.setText(VcsLogBundle.message("action.title.match.case")); } else { Collection<VcsLogProvider> providers = new LinkedHashSet<>(ui.getDataPack().getLogProviders().values()); List<VcsLogProvider> supported = ContainerUtil.filter(providers, VcsLogProperties.CASE_INSENSITIVE_REGEX::getOrDefault); presentation.setVisible(true); presentation.setEnabled(!supported.isEmpty()); if (providers.size() == supported.size() || supported.isEmpty()) { presentation.setText(VcsLogBundle.message("action.title.match.case")); } else { String supportedText = StringUtil.join(ContainerUtil.map(supported, p -> StringUtil.toLowerCase(p.getSupportedVcs().getName())), ", "); presentation.setText(VcsLogBundle.message("action.title.match.case.only.supported", supportedText)); } } } }
update
275,297
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
275,298
boolean (@NotNull AnActionEvent e) { return e.getData(VcsLogDataKeys.VCS_LOG_UI) != null; }
isActive
275,299
void (@NotNull AnActionEvent e) { Change[] changes = e.getData(VcsDataKeys.CHANGES); e.getPresentation().setEnabled(changes != null && changes.length > 0); }
update