Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
276,000
boolean () { return false; }
hasIncomingCommits
276,001
boolean () { return false; }
hasOutgoingCommits
276,002
Icon () { return ExperimentalUI.isNewUI() ? IconManager.getInstance().createRowIcon(DvcsImplIcons.Incoming, DvcsImplIcons.Outgoing) : DvcsImplIcons.IncomingOutgoing; }
getIncomingOutgoingIcon
276,003
int (@NotNull List<? extends BranchActionGroup> branchActions) { return ContainerUtil.count(branchActions, BranchActionGroup::isFavorite); }
getNumOfFavorites
276,004
int (@NotNull List<? extends BranchActionGroup> branchActions) { int numOfFavorites = getNumOfFavorites(branchActions); if (branchActions.size() > MAX_NUM) { if (numOfFavorites > 0) return numOfFavorites; return DEFAULT_NUM; } return MAX_NUM; }
getNumOfTopShownBranches
276,005
void () { LOG.debug("repository mappings changed"); updateLater(); }
mappingChanged
276,006
void (@NotNull FileEditorManagerEvent event) { LOG.debug("selection changed"); updateLater(); }
selectionChanged
276,007
void (@NotNull FileEditorManager source, @NotNull VirtualFile file) { LOG.debug("file opened"); updateLater(); }
fileOpened
276,008
void (@NotNull FileEditorManager source, @NotNull VirtualFile file) { LOG.debug("file closed"); updateLater(); }
fileClosed
276,009
void (@NotNull StatusBar statusBar) { super.install(statusBar); updateLater(); }
install
276,010
WidgetPresentation () { return this; }
getPresentation
276,011
void () { myText = null; myTooltip = null; myIcon = null; myRepository = null; }
clearStatus
276,012
void () { UIUtil.invokeLaterIfNeeded(() -> { if (isDisposed()) { return; } VirtualFile selectedFile = DvcsUtil.getSelectedFile(getProject()); myUpdateBackgroundAlarm.cancelAllRequests(); myUpdateBackgroundAlarm.addRequest(() -> { if (isDisposed()) { clearStatus(); return; } if (!ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(() -> { updateOnBackground(selectedFile); })) { updateLater(); } }, 10); }); }
updateLater
276,013
void (VirtualFile selectedFile) { T repository; try { Project project = getProject(); repository = guessCurrentRepository(project, selectedFile); if (repository == null) { clearStatus(); return; } } catch (ProcessCanceledException e) { // do nothing - a new update task is scheduled, or widget is disposed return; } catch (Throwable t) { LOG.error(t); clearStatus(); return; } myText = DvcsBranchUtil.shortenBranchName(getFullBranchName(repository)); myTooltip = getToolTip(repository); myIcon = getIcon(repository); myRepository = repository; if (myStatusBar != null) { myStatusBar.updateWidget(ID()); } rememberRecentRoot(repository.getRoot().getPath()); }
updateOnBackground
276,014
void (@NotNull Project project, @NotNull MultiMap<Repo, VcsFullCommitDetails> grouped) { Map<Repo, VcsFullCommitDetails> singleElementMap = convertToSingleElementMap(grouped); assert singleElementMap != null; actionPerformed(project, singleElementMap); }
actionPerformed
276,015
boolean (@NotNull MultiMap<Repo, Hash> grouped) { return allValuesAreSingletons(grouped); }
isEnabled
276,016
boolean (@NotNull MultiMap<Repo, Hash> grouped) { return ContainerUtil.and(grouped.entrySet(), entry -> entry.getValue().size() == 1); }
allValuesAreSingletons
276,017
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
276,018
void (@NotNull AnActionEvent e) { DvcsUtil.disableActionIfAnyRepositoryIsFresh(e, myRepositories, DvcsBundle.message("action.not.possible.in.fresh.repo.new.branch")); }
update
276,019
ValidationInfo (@NotNull String path) { try { Path directoryPath = Paths.get(path); if (!directoryPath.toFile().exists()) { Files.createDirectories(directoryPath); } else if (!directoryPath.toFile().isDirectory()) { return new ValidationInfo(DvcsBundle.message("clone.destination.directory.error.access")).withOKEnabled(); } return null; } catch (InvalidPathException e) { return new ValidationInfo(DvcsBundle.message("clone.destination.directory.error.invalid")); } catch (Exception e) { return new ValidationInfo(DvcsBundle.message("clone.destination.directory.error.access")).withOKEnabled(); } }
createDestination
276,020
ValidationInfo (@NotNull String directoryPath, @NotNull JComponent component) { if (directoryPath.length() == 0) { return new ValidationInfo(""); } try { Path path = Paths.get(directoryPath); if (!path.toFile().exists()) { return null; } else if (!path.toFile().isDirectory()) { return new ValidationInfo(DvcsBundle.message("clone.destination.directory.error.not.directory"), component); } else if (!isDirectoryEmpty(path)) { return new ValidationInfo(DvcsBundle.message("clone.destination.directory.error.exists"), component); } } catch (InvalidPathException | IOException e) { return new ValidationInfo(DvcsBundle.message("clone.destination.directory.error.invalid"), component); } return null; }
checkDirectory
276,021
ValidationInfo (JComponent component, String repository) { if (repository.length() == 0) { return new ValidationInfo(DvcsBundle.message("clone.repository.url.error.empty"), component); } repository = sanitizeCloneUrl(repository); // Is it a proper URL? try { if (new URI(repository).isAbsolute()) { return null; } } catch (URISyntaxException urlExp) { // do nothing } // Is it SSH URL? if (SSH_URL_PATTERN.matcher(repository).matches()) { return null; } // Is it FS URL? try { Path path = Paths.get(repository); if (path.toFile().exists()) { if (!path.toFile().isDirectory()) { return new ValidationInfo(DvcsBundle.message("clone.repository.url.error.not.directory"), component); } return null; } } catch (Exception fileExp) { // do nothing } return new ValidationInfo(DvcsBundle.message("clone.repository.url.error.invalid"), component); }
checkRepositoryURL
276,022
String (@NotNull String urlText) { return removePrefix(removePrefix(urlText.trim(), "git clone"), "hg clone").trim(); //NON-NLS }
sanitizeCloneUrl
276,023
void (@NotNull JList<? extends Repository> list, Repository value, int index, boolean selected, boolean hasFocus) { setText(DvcsUtil.getShortRepositoryName(value)); }
customize
276,024
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
276,025
void (@NotNull AnAction action) { add(action); }
addAction
276,026
void (@NotNull AnAction action) { myChildren.add(action); }
add
276,027
void (@NotNull ActionGroup group) { addAll(group.getChildren(null)); }
addAll
276,028
void (AnAction @NotNull ... actions) { myChildren.addAll(Arrays.asList(actions)); }
addAll
276,029
void (@NotNull List<? extends AnAction> actions) { myChildren.addAll(actions); }
addAll
276,030
void () { add(Separator.create()); }
addSeparator
276,031
void (@Nullable @Nls String separatorText) { add(Separator.create(separatorText)); }
addSeparator
276,032
JComponent () { SimpleAsyncChangesBrowser changesBrowser = new SimpleAsyncChangesBrowser(myHelper.getProject(), false, true); myHeadToBranchListPanel = new CommitListPanel( getHeadToBranchCommits(myInitialRepo), DvcsBundle.message("label.branch.fully.merged.to.branch", myBranchName, myCurrentBranchName)); myBranchToHeadListPanel = new CommitListPanel( getBranchToHeadCommits(myInitialRepo), DvcsBundle.message("label.branch.fully.merged.to.branch", myCurrentBranchName, myBranchName)); addSelectionListener(myHeadToBranchListPanel, myBranchToHeadListPanel, changesBrowser); addSelectionListener(myBranchToHeadListPanel, myHeadToBranchListPanel, changesBrowser); myHeadToBranchListPanel.registerDiffAction(changesBrowser.getDiffAction()); myBranchToHeadListPanel.registerDiffAction(changesBrowser.getDiffAction()); JPanel htb = layoutCommitListPanel(true); JPanel bth = layoutCommitListPanel(false); JPanel listPanel = switch (getInfoType()) { case HEAD_TO_BRANCH -> htb; case BRANCH_TO_HEAD -> bth; case BOTH -> { Splitter lists = new Splitter(true, 0.5f); lists.setFirstComponent(htb); lists.setSecondComponent(bth); yield lists; } }; Splitter rootPanel = new Splitter(false, 0.7f); rootPanel.setSecondComponent(changesBrowser); rootPanel.setFirstComponent(listPanel); return rootPanel; }
createCenterPanel
276,033
JComponent () { final ComboBox<Repository> repoSelector = new ComboBox<>(myCompareInfo.getRepositories().toArray(new Repository[0])); repoSelector.setRenderer(new RepositoryComboboxListCellRenderer()); repoSelector.setSelectedItem(myInitialRepo); repoSelector.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Repository selectedRepo = (Repository)repoSelector.getSelectedItem(); myHeadToBranchListPanel.setCommits(getHeadToBranchCommits(selectedRepo)); myBranchToHeadListPanel.setCommits(getBranchToHeadCommits(selectedRepo)); } }); JPanel repoSelectorPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); JBLabel label = new JBLabel(DvcsBundle.message("label.repository") + " "); label.setLabelFor(repoSelectorPanel); label.setDisplayedMnemonic(KeyEvent.VK_R); repoSelectorPanel.add(label); repoSelectorPanel.add(repoSelector); if (myCompareInfo.getRepositories().size() < 2) { repoSelectorPanel.setVisible(false); } return repoSelectorPanel; }
createNorthPanel
276,034
void (ActionEvent e) { Repository selectedRepo = (Repository)repoSelector.getSelectedItem(); myHeadToBranchListPanel.setCommits(getHeadToBranchCommits(selectedRepo)); myBranchToHeadListPanel.setCommits(getBranchToHeadCommits(selectedRepo)); }
actionPerformed
276,035
List<VcsFullCommitDetails> (Repository selectedRepo) { return myCompareInfo.getBranchToHeadCommits(selectedRepo); }
getBranchToHeadCommits
276,036
List<VcsFullCommitDetails> (Repository selectedRepo) { return myCompareInfo.getHeadToBranchCommits(selectedRepo); }
getHeadToBranchCommits
276,037
void (@NotNull CommitListPanel sourcePanel, @NotNull CommitListPanel otherPanel, @NotNull SimpleAsyncChangesBrowser changesBrowser) { sourcePanel.addListMultipleSelectionListener(changes -> { changesBrowser.setChangesToDisplay(changes); otherPanel.clearSelection(); }); }
addSelectionListener
276,038
JPanel (boolean forward) { String desc = makeDescription(forward); JPanel bth = new JPanel(new BorderLayout()); JBLabel descriptionLabel = new JBLabel(desc, UIUtil.ComponentStyle.SMALL); descriptionLabel.setBorder(JBUI.Borders.emptyBottom(5)); bth.add(descriptionLabel, BorderLayout.NORTH); bth.add(forward ? myHeadToBranchListPanel : myBranchToHeadListPanel); return bth; }
layoutCommitListPanel
276,039
String (boolean forward) { String firstBranch = forward ? myCurrentBranchName : myBranchName; String secondBranch = forward ? myBranchName : myCurrentBranchName; return new HtmlBuilder().appendRaw( DvcsBundle.message("compare.branches.commits.that.exist.in.branch.but.not.in.branch.vcs.command", HtmlChunk.text(secondBranch).bold().code(), HtmlChunk.text(firstBranch).bold().code(), HtmlChunk.text(myHelper.formatLogCommand(firstBranch, secondBranch)).bold().code())) .wrapWithHtmlBody().toString(); }
makeDescription
276,040
void () { String path = myDirectoryField.getText(); new Task.Modal(myProject, DvcsBundle.message("progress.title.creating.destination.directory"), true) { private ValidationInfo error = null; @Override public void run(@NotNull ProgressIndicator indicator) { error = CloneDvcsValidationUtils.createDestination(path); } @Override public void onSuccess() { if (error == null) { CloneDvcsDialog.super.doOKAction(); } else { myCreateDirectoryValidationInfo = error; startTrackingValidation(); } } }.queue(); }
doOKAction
276,041
void (@NotNull ProgressIndicator indicator) { error = CloneDvcsValidationUtils.createDestination(path); }
run
276,042
void () { if (error == null) { CloneDvcsDialog.super.doOKAction(); } else { myCreateDirectoryValidationInfo = error; startTrackingValidation(); } }
onSuccess
276,043
String () { return getCurrentUrlText(); }
getSourceRepositoryURL
276,044
String () { Path parent = Paths.get(myDirectoryField.getText()).toAbsolutePath().getParent(); return Objects.requireNonNull(parent).toAbsolutePath().toString(); }
getParentDirectory
276,045
String () { return Paths.get(myDirectoryField.getText()).getFileName().toString(); }
getDirectoryName
276,046
void (@Nullable String defaultUrl) { myRepositoryUrlComboboxModel = new CollectionComboBoxModel<>(); myRepositoryUrlField = TextFieldWithAutoCompletion.create(myProject, myRepositoryUrlComboboxModel.getItems(), false, ""); JLabel repositoryUrlFieldSpinner = new JLabel(new AnimatedIcon.Default()); repositoryUrlFieldSpinner.setVisible(false); mySpinnerProgressManager = new ComponentVisibilityProgressManager(repositoryUrlFieldSpinner); Disposer.register(getDisposable(), mySpinnerProgressManager); myRepositoryUrlCombobox = new ComboBox<>(); myRepositoryUrlCombobox.setEditable(true); myRepositoryUrlCombobox.setEditor(ComboBoxCompositeEditor.withComponents(myRepositoryUrlField, repositoryUrlFieldSpinner)); myRepositoryUrlCombobox.setModel(myRepositoryUrlComboboxModel); myRepositoryUrlField.addDocumentListener(new DocumentListener() { @Override public void documentChanged(@NotNull com.intellij.openapi.editor.event.DocumentEvent event) { myDirectoryField.trySetChildPath(defaultDirectoryPath(myRepositoryUrlField.getText().trim())); } }); myRepositoryUrlField.addDocumentListener(new DocumentListener() { @Override public void documentChanged(@NotNull com.intellij.openapi.editor.event.DocumentEvent event) { myRepositoryTestValidationInfo = null; } }); myTestButton = new JButton(DvcsBundle.message("clone.repository.url.test.label")); myTestButton.addActionListener(e -> test()); FileChooserDescriptor fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor(); fcd.setShowFileSystemRoots(true); fcd.setHideIgnored(false); myDirectoryField = new MyTextFieldWithBrowseButton(ClonePathProvider.defaultParentDirectoryPath(myProject, getRememberedInputs())); myDirectoryField.addBrowseFolderListener(DvcsBundle.message("clone.destination.directory.browser.title"), DvcsBundle.message("clone.destination.directory.browser.description"), myProject, fcd); if (defaultUrl != null) { myRepositoryUrlField.setText(defaultUrl); myRepositoryUrlField.selectAll(); myTestButton.setEnabled(true); } }
initComponents
276,047
void (@NotNull com.intellij.openapi.editor.event.DocumentEvent event) { myDirectoryField.trySetChildPath(defaultDirectoryPath(myRepositoryUrlField.getText().trim())); }
documentChanged
276,048
void (@NotNull com.intellij.openapi.editor.event.DocumentEvent event) { myRepositoryTestValidationInfo = null; }
documentChanged
276,049
void () { String testUrl = getCurrentUrlText(); if (myRepositoryTestProgressIndicator != null) { myRepositoryTestProgressIndicator.cancel(); myRepositoryTestProgressIndicator = null; } myRepositoryTestProgressIndicator = mySpinnerProgressManager .run(new Task.Backgroundable(myProject, DvcsBundle.message("clone.repository.url.test.title", testUrl), true) { private TestResult myTestResult; @Override public void run(@NotNull ProgressIndicator indicator) { myTestResult = test(testUrl); } @Override public void onSuccess() { if (myTestResult.isSuccess()) { myRepositoryTestValidationInfo = null; Disposable dialogDisposable = getDisposable(); if (Disposer.isDisposed(dialogDisposable)) return; JBPopupFactory.getInstance() .createBalloonBuilder(new JLabel(DvcsBundle.message("clone.repository.url.test.success.message"))) .setDisposable(dialogDisposable) .createBalloon() .show(new RelativePoint(myTestButton, new Point(myTestButton.getWidth() / 2, myTestButton.getHeight())), Balloon.Position.below); } else { myRepositoryTestValidationInfo = new ValidationInfo(DvcsBundle.message("clone.repository.url.test.failed.message", XmlStringUtil.escapeString(myTestResult.myErrorMessage)), myRepositoryUrlCombobox); startTrackingValidation(); } myRepositoryTestProgressIndicator = null; } }); }
test
276,050
void (@NotNull ProgressIndicator indicator) { myTestResult = test(testUrl); }
run
276,051
void () { if (myTestResult.isSuccess()) { myRepositoryTestValidationInfo = null; Disposable dialogDisposable = getDisposable(); if (Disposer.isDisposed(dialogDisposable)) return; JBPopupFactory.getInstance() .createBalloonBuilder(new JLabel(DvcsBundle.message("clone.repository.url.test.success.message"))) .setDisposable(dialogDisposable) .createBalloon() .show(new RelativePoint(myTestButton, new Point(myTestButton.getWidth() / 2, myTestButton.getHeight())), Balloon.Position.below); } else { myRepositoryTestValidationInfo = new ValidationInfo(DvcsBundle.message("clone.repository.url.test.failed.message", XmlStringUtil.escapeString(myTestResult.myErrorMessage)), myRepositoryUrlCombobox); startTrackingValidation(); } myRepositoryTestProgressIndicator = null; }
onSuccess
276,052
List<ValidationInfo> () { ValidationInfo urlValidation = CloneDvcsValidationUtils.checkRepositoryURL(myRepositoryUrlCombobox, getCurrentUrlText()); ValidationInfo directoryValidation = CloneDvcsValidationUtils.checkDirectory(myDirectoryField.getText(), myDirectoryField.getTextField()); myTestButton.setEnabled(urlValidation == null); List<ValidationInfo> infoList = new ArrayList<>(); ContainerUtil.addIfNotNull(infoList, myRepositoryTestValidationInfo); ContainerUtil.addIfNotNull(infoList, myCreateDirectoryValidationInfo); ContainerUtil.addIfNotNull(infoList, urlValidation); ContainerUtil.addIfNotNull(infoList, directoryValidation); return infoList; }
doValidateAll
276,053
String () { return FileUtil.expandUserHome(myRepositoryUrlField.getText().trim()); }
getCurrentUrlText
276,054
void (final @NotNull String item) { myRepositoryUrlComboboxModel.add(item); }
prependToHistory
276,055
void () { final DvcsRememberedInputs rememberedInputs = getRememberedInputs(); rememberedInputs.addUrl(getSourceRepositoryURL()); rememberedInputs.setCloneParentDir(getParentDirectory()); }
rememberSettings
276,056
String (final @NotNull String url) { return StringUtil.trimEnd(ClonePathProvider.relativeDirectoryPathForVcsUrl(myProject, url), myVcsDirectoryName); }
defaultDirectoryPath
276,057
JComponent () { JPanel panel = PanelFactory.grid() .add(PanelFactory.panel(JBUI.Panels.simplePanel(UIUtil.DEFAULT_HGAP, UIUtil.DEFAULT_VGAP) .addToCenter(myRepositoryUrlCombobox) .addToRight(myTestButton)) .withLabel(DvcsBundle.message("clone.repository.url.label"))) .add(PanelFactory.panel(myDirectoryField) .withLabel(DvcsBundle.message("clone.destination.directory.label"))) .createPanel(); panel.setPreferredSize(new JBDimension(500, 50, true)); return panel; }
createCenterPanel
276,058
boolean () { return myErrorMessage == null; }
isSuccess
276,059
void (@NotNull DocumentEvent e) { myModifiedByUser = true; }
textChanged
276,060
void (@NotNull String child) { if (!myModifiedByUser) { try { setText(myDefaultParentPath.resolve(child).toString()); } catch (InvalidPathException ignored) { } finally { myModifiedByUser = false; } } }
trySetChildPath
276,061
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
276,062
void (@NotNull AnActionEvent e) { Project project = e.getRequiredData(CommonDataKeys.PROJECT); VcsLogCommitSelection selection = e.getRequiredData(VcsLogDataKeys.VCS_LOG_COMMIT_SELECTION); CommitId commit = ContainerUtil.getFirstItem(selection.getCommits()); assert commit != null; Repo repository = getRepositoryForRoot(project, commit.getRoot()); assert repository != null; actionPerformed(repository, commit.getHash()); }
actionPerformed
276,063
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; } List<CommitId> commits = selection.getCommits(); if (commits.isEmpty()) { e.getPresentation().setEnabledAndVisible(false); return; } CommitId commit = ContainerUtil.getFirstItem(commits); assert commit != null; Repo repository = getRepositoryForRoot(project, commit.getRoot()); if (repository == null) { e.getPresentation().setEnabledAndVisible(false); return; } e.getPresentation().setVisible(isVisible(project, repository, commit.getHash())); e.getPresentation().setEnabled(commits.size() == 1 && isEnabled(repository, commit.getHash())); }
update
276,064
boolean (@NotNull Repo repository, @NotNull Hash commit) { return true; }
isEnabled
276,065
boolean (@NotNull final Project project, @NotNull Repo repository, @NotNull Hash hash) { return !getRepositoryManager(project).isExternal(repository); }
isVisible
276,066
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
276,067
String () { return myBranchText; }
getInfoText
276,068
String (@Nullable final String initialDimensionKey) { if (initialDimensionKey == null) return null; return ExperimentalUI.isNewUI() ? initialDimensionKey + EXPERIMENTAL_UI_DIMENSION_KEY_SUFFIX : initialDimensionKey; }
buildDimensionKey
276,069
void (@NotNull String dimensionKey) { ActionGroup actionGroup = new LightActionGroup() { @Override public AnAction @NotNull [] getChildren(@Nullable AnActionEvent e) { return myToolbarActions.toArray(AnAction.EMPTY_ARRAY); } }; AnAction restoreSizeButton = new DumbAwareAction(DvcsBundle.messagePointer("action.BranchActionGroupPopup.Anonymous.text.restore.size"), FitContent) { @Override public void actionPerformed(@NotNull AnActionEvent e) { WindowStateService.getInstance(myProject).putSizeFor(myProject, dimensionKey, null); myInternalSizeChanged = true; pack(true, true); } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.EDT; } @Override public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabled(myUserSizeChanged); } }; ActionGroup settingsGroup = new ActionGroup(DvcsBundle.message("action.BranchActionGroupPopup.settings.text"), true) { @Override public AnAction @NotNull [] getChildren(@Nullable AnActionEvent e) { return mySettingsActions.toArray(AnAction.EMPTY_ARRAY); } }; settingsGroup.getTemplatePresentation().setHideGroupIfEmpty(true); settingsGroup.getTemplatePresentation().setIcon(AllIcons.General.GearPlain); myToolbarActions.add(restoreSizeButton); myToolbarActions.add(settingsGroup); ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(BRANCH_POPUP, actionGroup, true); toolbar.setTargetComponent(getList()); toolbar.setReservePlaceAutoPopupIcon(false); toolbar.getComponent().setOpaque(false); getTitle().setButtonComponent(new ActiveComponent.Adapter() { @NotNull @Override public JComponent getComponent() { return toolbar.getComponent(); } }, JBUI.Borders.emptyRight(2)); }
createTitlePanelToolbar
276,070
void (@NotNull AnActionEvent e) { WindowStateService.getInstance(myProject).putSizeFor(myProject, dimensionKey, null); myInternalSizeChanged = true; pack(true, true); }
actionPerformed
276,071
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
276,072
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(myUserSizeChanged); }
update
276,073
JComponent () { return toolbar.getComponent(); }
getComponent
276,074
void (@Nullable String dimensionKey) { Window popupWindow = getPopupWindow(); if (popupWindow == null) return; ComponentListener windowListener = new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { if (myShown) { processOnSizeChanged(); } } }; popupWindow.addComponentListener(windowListener); addListener(new JBPopupListener() { @Override public void onClosed(@NotNull LightweightWindowEvent event) { popupWindow.removeComponentListener(windowListener); } }); }
trackDimensions
276,075
void (ComponentEvent e) { if (myShown) { processOnSizeChanged(); } }
componentResized
276,076
void (@NotNull LightweightWindowEvent event) { popupWindow.removeComponentListener(windowListener); }
onClosed
276,077
void () { if (myKey != null && myUserSizeChanged) { super.storeDimensionSize(); } }
storeDimensionSize
276,078
void () { Dimension newSize = Objects.requireNonNull(getSize()); int preferredHeight = getComponent().getPreferredSize().height; int realHeight = getComponent().getHeight(); boolean shouldExpand = preferredHeight + myMeanRowHeight < realHeight; boolean sizeWasIncreased = myPrevSize.height < newSize.height; if (!myInternalSizeChanged && sizeWasIncreased && shouldExpand) { List<MoreAction> mores = getMoreActions(); for (MoreAction more : mores) { if (!getList().getScrollableTracksViewportHeight()) break; if (!more.isExpanded()) { more.setExpanded(true); getListModel().refilter(); } } } myPrevSize = newSize; //ugly properties to distinguish user size changed from pack method call after Restore Size action performed myUserSizeChanged = !myInternalSizeChanged; myInternalSizeChanged = false; }
processOnSizeChanged
276,079
List<MoreAction> () { List<MoreAction> result = new ArrayList<>(); ListPopupModel model = getListModel(); for (int i = 0; i < model.getSize(); i++) { MoreAction moreAction = getSpecificAction(model.getElementAt(i), MoreAction.class); if (moreAction != null) { result.add(moreAction); } } return result; }
getMoreActions
276,080
void (@NotNull AnAction action, boolean underSettingsPopup) { if (underSettingsPopup) { mySettingsActions.add(action); } else { myToolbarActions.add(0, action); } }
addToolbarAction
276,081
void () { getContent().revalidate(); getContent().repaint(); }
update
276,082
ActionGroup (@NotNull ActionGroup actions) { LightActionGroup group = new LightActionGroup(); group.add(actions); group.addAll(createSpeedSearchActions(actions, true)); return group; }
createBranchSpeedSearchActionGroup
276,083
boolean () { return true; }
isResizable
276,084
void () { super.afterShow(); myShown = true; Dimension size = getSize(); if (size != null) { myPrevSize = size; } trackDimensions(myKey); }
afterShow
276,085
List<AnAction> (@NotNull ActionGroup parentActionGroup, boolean isFirstLevel) { if (parentActionGroup instanceof HideableActionGroup) { parentActionGroup = ((HideableActionGroup)parentActionGroup).getDelegate(); } if (parentActionGroup instanceof BranchActionGroup) return Collections.emptyList(); // add per repository branches into the model as Speed Search elements and show them only if regular items were not found by mask; List<AnAction> speedSearchActions = new ArrayList<>(); if (!isFirstLevel) speedSearchActions.add(new Separator(parentActionGroup.getTemplatePresentation().getText())); for (AnAction child : parentActionGroup.getChildren(null)) { if (child instanceof ActionGroup childGroup) { if (childGroup instanceof HideableActionGroup) { childGroup = ((HideableActionGroup)childGroup).getDelegate(); } if (isFirstLevel) { speedSearchActions.addAll(createSpeedSearchActions(childGroup, false)); } else if (childGroup instanceof BranchActionGroup) { speedSearchActions.add(createSpeedSearchActionGroupWrapper(childGroup)); } } } return speedSearchActions; }
createSpeedSearchActions
276,086
void (boolean handleFinalChoices) { super.handleSelect(handleFinalChoices, null); if (getSpecificAction(getList().getSelectedValue(), MoreAction.class) != null) { getListModel().refilter(); } }
handleSelect
276,087
void (boolean handleFinalChoices, InputEvent e) { BranchActionGroup branchActionGroup = getSelectedBranchGroup(); if (branchActionGroup != null && e instanceof MouseEvent && myListElementRenderer.isIconAt(((MouseEvent)e).getPoint())) { branchActionGroup.toggle(); getList().repaint(); } else { super.handleSelect(handleFinalChoices, e); } }
handleSelect
276,088
void (@Nullable InputEvent inputEvent) { BranchActionGroup branchActionGroup = getSelectedBranchGroup(); if (branchActionGroup != null) { branchActionGroup.toggle(); getList().repaint(); } else { super.handleToggleAction(inputEvent); } }
handleToggleAction
276,089
BranchActionGroup () { return getSpecificAction(getList().getSelectedValue(), BranchActionGroup.class); }
getSelectedBranchGroup
276,090
void () { String newFilter = mySpeedSearch.getFilter(); if (newFilter.endsWith(" ")) { mySpeedSearch.updatePattern(newFilter.trim()); return; } super.onSpeedSearchPatternChanged(); ScrollingUtil.ensureSelectionExists(getList()); }
onSpeedSearchPatternChanged
276,091
boolean () { return false; }
shouldUseStatistics
276,092
boolean (@NotNull AnAction action) { if (!super.shouldBeShowing(action)) return false; if (getSpeedSearch().isHoldingFilter()) return !(action instanceof MoreAction); if (action instanceof MoreHideableActionGroup) return ((MoreHideableActionGroup)action).shouldBeShown(); return true; }
shouldBeShowing
276,093
WizardPopup (WizardPopup parent, PopupStep step, Object parentValue) { return createListPopupStep(parent, step, parentValue); }
createPopup
276,094
WizardPopup (WizardPopup parent, PopupStep<?> step, Object parentValue) { if (step instanceof ListPopupStep) { return new BranchActionGroupPopup(parent, (ListPopupStep<?>)step, parentValue); } return super.createPopup(parent, step, parentValue); }
createListPopupStep
276,095
MyPopupListElementRenderer () { if (myListElementRenderer == null) { myListElementRenderer = new MyPopupListElementRenderer(this); } return myListElementRenderer; }
getListElementRenderer
276,096
void (JList list, Object value, boolean isSelected) { MoreAction more = getSpecificAction(value, MoreAction.class); if (more != null) { myTextLabel.setForeground(JBColor.gray); } super.customizeComponent(list, value, isSelected); if (mySeparatorComponent.isVisible()) { boolean hideLineAboveCaption = !ExperimentalUI.isNewUI() && StringUtil.isNotEmpty(mySeparatorComponent.getCaption()); ((GroupHeaderSeparator)mySeparatorComponent).setHideLine(myCurrentIndex == 0 || hideLineAboveCaption); } CustomIconProvider actionWithIconProvider = getSpecificAction(value, CustomIconProvider.class); myTextLabel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); myTextLabel.setIcon(actionWithIconProvider != null ? actionWithIconProvider.getRightIcon() : null); PopupElementWithAdditionalInfo additionalInfoAction = getSpecificAction(value, PopupElementWithAdditionalInfo.class); updateInfoComponent(myInfoLabel, additionalInfoAction != null ? additionalInfoAction.getInfoText() : null, isSelected); }
customizeComponent
276,097
void (@NotNull ErrorLabel infoLabel, @Nullable @Nls String infoText, boolean isSelected) { if (infoText != null) { infoLabel.setVisible(true); infoLabel.setText(infoText); if (isSelected) { setSelected(infoLabel); } else { infoLabel.setBackground(getBackground()); infoLabel.setForeground(JBColor.GRAY); // different foreground than for other elements } } else { infoLabel.setVisible(false); } }
updateInfoComponent
276,098
JComponent () { myTextLabel = new ErrorLabel(); myTextLabel.setOpaque(true); myTextLabel.setBorder(JBUI.Borders.empty(1)); myInfoLabel = new ErrorLabel(); myInfoLabel.setOpaque(true); myInfoLabel.setBorder(JBUI.Borders.empty(1, DEFAULT_HGAP, 1, 1)); myInfoLabel.setFont(FontUtil.minusOne(myInfoLabel.getFont())); JPanel compoundPanel = new OpaquePanel(new BorderLayout(), JBColor.WHITE); myIconLabel = new IconComponent(); myInfoLabel.setHorizontalAlignment(SwingConstants.RIGHT); JPanel compoundTextPanel = new OpaquePanel(new BorderLayout(), compoundPanel.getBackground()); JPanel textPanel = new OpaquePanel(new BorderLayout(), compoundPanel.getBackground()); compoundPanel.add(myIconLabel, BorderLayout.WEST); textPanel.add(myTextLabel, BorderLayout.WEST); textPanel.add(myInfoLabel, BorderLayout.CENTER); compoundTextPanel.add(textPanel, BorderLayout.CENTER); compoundPanel.add(compoundTextPanel, BorderLayout.CENTER); return layoutComponent(compoundPanel); }
createItemComponent
276,099
void (@NotNull AnActionEvent e) { setExpanded(!myIsExpanded); InputEvent event = e.getInputEvent(); if (event == null) { return; // Enter - 'KeepingPopupOpenAction' logic should refilter the list } Object source = event.getSource(); if (source instanceof JList) { ListModel<?> model = ((JList<?>)source).getModel(); if (model instanceof ListPopupModel) { ((ListPopupModel<?>)model).refilter(); return; } } LOG.warn("Can't' refilter popup after 'More branches' toggle, event: " + event); }
actionPerformed