Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
258,500
Border () { return new FilledRoundedBorder(UIUtil.getFocusedBorderColor(), ARC_SIZE, BORDER_SIZE, false); }
createFocusedBorder
258,501
Border () { return JBUI.Borders.empty(BORDER_SIZE); }
createUnfocusedBorder
258,502
void (@NotNull Runnable showPopupAction) { this.myShowPopupAction = showPopupAction; }
setShowPopupAction
258,503
Border (Border outerBorder) { return BorderFactory.createCompoundBorder(outerBorder, JBUI.Borders.empty(2)); }
wrapBorder
258,504
void (Component c, Graphics g, int x, int y, int width, int height) { GraphicsConfig config = GraphicsUtil.setupAAPainting(g); g.setColor(myColor); int thickness = JBUI.scale(myThinBorder ? 1 : myThickness); int arcSize = JBUI.scale(myArcSize); Area area = new Area(new RoundRectangle2D.Double(x, y, width, height, arcSi...
paintBorder
258,505
Insets (Component c) { return JBUI.insets(myThickness); }
getBorderInsets
258,506
boolean () { return false; }
isBorderOpaque
258,507
String () { //noinspection ConstantValue -- can be called during superclass initialization if (myText == null) return ""; return myText.get(); }
getText
258,508
AccessibleContext () { if (accessibleContext == null) { accessibleContext = new AccessibleVcsLogPopupComponent(super.getAccessibleContext()); } return accessibleContext; }
getAccessibleContext
258,509
Container () { return null; }
getDelegateParent
258,510
String () { return VcsLogBundle.message("vcs.log.filter.accessible.name", myDisplayName.get(), getCurrentText()); }
getAccessibleName
258,511
AccessibleRole () { return AccessibleRole.POPUP_MENU; }
getAccessibleRole
258,512
void (@NotNull DocumentEvent e) { updateTestButtonAvailability(); }
textChanged
258,513
BorderLayoutPanel () { return myErrorComponent; }
getErrorComponent
258,514
void () { if (myProjectPathCheckbox.isSelected()) { mySavedPath = getCurrentPath(); } else if (!Objects.equals(getCurrentPath(), mySavedPath)) { switch (Messages.showYesNoCancelDialog(myMainPanel, VcsBundle.message("executable.project.override.reset.message"), VcsBundle.message("executable.project.override.reset.title"...
handleProjectOverrideStateChanged
258,515
String () { return StringUtil.nullize(myPathSelector.getText().trim()); }
getCurrentPath
258,516
boolean () { return myProjectPathCheckbox.isSelected(); }
isOverridden
258,517
void (@Nullable @NlsSafe String autoDetectedPath) { StatusText emptyText = ((JBTextField)myPathSelector.getTextField()).getEmptyText(); emptyText.setText(autoDetectedPath != null ? VcsBundle.message("settings.auto.detected") + autoDetectedPath : VcsBundle.message("settings.auto.detected.progress")); myAutoDetectedPath ...
setAutoDetectedPath
258,518
void (@Nullable @NlsSafe String globalPath, boolean overridden, @Nullable @NlsSafe String projectPath) { myProjectPathCheckbox.setSelected(overridden); if (overridden) { mySavedPath = globalPath; myPathSelector.setText(projectPath); } else { myPathSelector.setText(globalPath); } }
reset
258,519
boolean (@Nullable String globalPath, boolean overridden, @Nullable String projectPath) { if (myProjectPathCheckbox.isSelected() != overridden) return true; if (myProjectPathCheckbox.isSelected()) { return !Objects.equals(getCurrentPath(), projectPath); } else { return !Objects.equals(getCurrentPath(), globalPath); } }
isModified
258,520
JPanel () { return myMainPanel; }
getMainPanel
258,521
String () { return ObjectUtils.chooseNotNull(getCurrentPath(), myAutoDetectedPath); }
getExecutablePath
258,522
void () { myTestButton.setEnabled(getExecutablePath() != null); }
updateTestButtonAvailability
258,523
void (@NotNull ExecutableHandler handler) { String executable = getExecutablePath(); if (executable != null) handler.testExecutable(executable); }
testExecutable
258,524
String (JTextField textField) { return textField.getText(); }
getText
258,525
void (JTextField textField, @NotNull String text) { String patchedText = myHandler.patchExecutable(text); textField.setText(patchedText != null ? patchedText : text); }
setText
258,526
void (HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED && isToTheLeftOrAboveTheText(e.getInputEvent())) { return; } HtmlPanel.this.hyperlinkUpdate(e); }
hyperlinkUpdate
258,527
boolean (InputEvent event) { if (event instanceof MouseEvent mouseEvent) { var insets = getInsets(); if (insets == null) { return false; } return mouseEvent.getX() < insets.left || mouseEvent.getY() < insets.top; } return false; }
isToTheLeftOrAboveTheText
258,528
void (HyperlinkEvent e) { BrowserHyperlinkListener.INSTANCE.hyperlinkUpdate(e); }
hyperlinkUpdate
258,529
String () { Document doc = getDocument(); int start = getSelectionStart(); int end = getSelectionEnd(); try { Position p0 = doc.createPosition(start); Position p1 = doc.createPosition(end); StringWriter sw = new StringWriter(p1.getOffset() - p0.getOffset()); getEditorKit().write(sw, doc, p0.getOffset(), p1.getOffset() ...
getSelectedText
258,530
void (@NotNull @Nls String text) { if (text.isEmpty()) { setText(""); } else { @NlsSafe String cssFontDeclaration = UIUtil.getCssFontDeclaration(getBodyFont()); setText(new HtmlBuilder() .append(HtmlChunk.raw(cssFontDeclaration).wrapWith("head")) .append(HtmlChunk.raw(text).wrapWith(HtmlChunk.body())) .wrapWith(HtmlChu...
setBody
258,531
Font () { return FontUtil.getCommitMessageFont(); }
getBodyFont
258,532
void () { super.updateUI(); DefaultCaret caret = (DefaultCaret)getCaret(); caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE); update(); }
updateUI
258,533
void () { setBody(getBody()); customizeLinksStyle(); revalidate(); repaint(); }
update
258,534
void () { Document document = getDocument(); if (document instanceof HTMLDocument) { StyleSheet styleSheet = ((HTMLDocument)document).getStyleSheet(); String linkColor = "#" + ColorUtil.toHex(JBUI.CurrentTheme.Link.Foreground.ENABLED); // NON-NLS styleSheet.addRule("a { color: " + linkColor + "; text-decoration: none;}...
customizeLinksStyle
258,535
void (@NotNull DialogWrapper dialog, @NotNull Runnable action) { Application application = ApplicationManager.getApplication(); if (application.isHeadlessEnvironment()) { // there's nothing to tie the action to, so we just schedule it as a next task application.invokeLater(action, ModalityState.any()); } else { dialog....
invokeLaterAfterDialogShown
258,536
void (WindowEvent e) { Window window = e.getWindow(); application.invokeLater(action, ModalityState.stateForComponent(window)); window.removeWindowListener(this); }
windowOpened
258,537
void (final T node) { myCache.remove(node); mySelected.remove(node); }
clear
258,538
void (final Processor<? super T> processor) { final Set<Map.Entry<T, TreeNodeState>> entries = myCache.entrySet(); for (Map.Entry<T, TreeNodeState> entry: entries){ if(processor.process(entry.getKey())) { myCache.remove(entry.getKey()); } } }
clearAllCachedMatching
258,539
void (final T node) { mySelected.remove(node); myCache.remove(node); }
remove
258,540
TreeNodeState (final T node, final @NotNull TreeNodeState state) { if (TreeNodeState.SELECTED.equals(state)) { mySelected.add(node); myCache.remove(node); } else { mySelected.remove(node); myCache.put(node, state); } return state; }
putAndPass
258,541
boolean () { return mySelected.size() < mySelectedSize; }
canAddSelection
258,542
Set<T> () { return Collections.unmodifiableSet(new HashSet<>(mySelected)); }
getSelected
258,543
void (Collection<? extends T> files) { mySelected.clear(); mySelected.addAll(files); }
setSelection
258,544
void (final DefaultMutableTreeNode node) { final StateWorker stateWorker = new StateWorker(node, myNodeConvertor); final VirtualFile vf = stateWorker.getVf(); if (vf == null) return; final TreeNodeState state = getStateImpl(stateWorker); if (TreeNodeState.HAVE_SELECTED_ABOVE.equals(state)) return; if (TreeNodeState.CLE...
toggleSelection
258,545
boolean () { return myState.canAddSelection(); }
canAddSelection
258,546
void (Collection<? extends VirtualFile> files) { myState.setSelection(files); for (VirtualFile file : files) { if (mySelectionChangeListener != null) { mySelectionChangeListener.plus(file); } } }
setSelection
258,547
TreeNodeState (final DefaultMutableTreeNode node) { return getStateImpl(new StateWorker(node, myNodeConvertor)); }
getState
258,548
TreeNodeState (final StateWorker stateWorker) { if (stateWorker.getVf() == null) return TreeNodeState.CLEAR; final TreeNodeState stateSelf = myState.get(stateWorker.getVf()); if (stateSelf != null) return stateSelf; final Ref<TreeNodeState> result = new Ref<>(); stateWorker.iterateParents(myState, (virtualFile, state) ...
getStateImpl
258,549
void (final VirtualFile elementAt) { myState.remove(elementAt); myState.clearAllCachedMatching(f -> VfsUtilCore.isAncestor(f, elementAt, false) || VfsUtilCore.isAncestor(elementAt, f, false)); if (mySelectionChangeListener != null) { mySelectionChangeListener.minus(elementAt); } }
removeSelection
258,550
VirtualFile () { return myVf; }
getVf
258,551
void (final SelectedState<? super VirtualFile> states, final PairProcessor<? super VirtualFile, ? super TreeNodeState> parentsProcessor) { DefaultMutableTreeNode current = (DefaultMutableTreeNode) myNode.getParent(); // up cycle while (current != null) { final VirtualFile file = myConvertor.convert(current); if (file =...
iterateParents
258,552
void (@Nullable PlusMinus<? super VirtualFile> selectionChangeListener) { mySelectionChangeListener = selectionChangeListener; }
setSelectionChangeListener
258,553
void (final VirtualFile vf) { if (myProgressIndicator == null) return; myProgressIndicator.checkCanceled(); if (myInText2) { myProgressIndicator.setText2(myPrefix + getFileDescriptionForProgress(vf)); } else { myProgressIndicator.setText(myPrefix + getFileDescriptionForProgress(vf)); } myProgressIndicator.setFraction(m...
updateIndicator
258,554
String (final VirtualFile file) { final VirtualFile parent = file.getParent(); return file.getName() + " (" + (parent == null ? file.getPresentableUrl() : parent.getPresentableUrl()) + ")"; }
getFileDescriptionForProgress
258,555
void (boolean inText2) { myInText2 = inText2; }
setInText2
258,556
String (@NotNull Collection<? extends AbstractVcs> vcses) { String operationName = null; for (AbstractVcs vcs : vcses) { final RollbackEnvironment rollbackEnvironment = vcs.getRollbackEnvironment(); if (rollbackEnvironment != null) { if (operationName == null) { operationName = rollbackEnvironment.getRollbackOperationN...
getRollbackOperationName
258,557
String (@NotNull Project project) { return getRollbackOperationName(asList(ProjectLevelVcsManager.getInstance(project).getAllActiveVcss())); }
getRollbackOperationName
258,558
void (final Project project, @DialogMessage String message, @DialogTitle String title) { Runnable task = () -> Messages.showErrorDialog(project, message, title); WaitForProgressToShow.runOrInvokeLaterAboveProgress(task, null, project); }
showErrorMessage
258,559
String (@NotNull Project project, @NotNull VirtualFile root) { return VcsUtil.getShortVcsRootName(project, root); }
getShortVcsRootName
258,560
IgnoredFileContentProvider (@NotNull AbstractVcs vcs) { return findIgnoredFileContentProvider(vcs.getProject(), vcs.getKeyInstanceMethod()); }
findIgnoredFileContentProvider
258,561
IgnoredFileContentProvider (@NotNull Project project, @NotNull VcsKey vcsKey) { IgnoredFileContentProvider ignoreContentProvider = null; for (IgnoredFileContentProvider provider : IgnoredFileContentProvider.IGNORE_FILE_CONTENT_PROVIDER.getExtensionList(project)) { if (provider.getSupportedVcs().equals(vcsKey)) { ignore...
findIgnoredFileContentProvider
258,562
void (@NotNull Project project, @NotNull AbstractVcs vcs, @NotNull VirtualFile ignoreFileRoot) { generateIgnoreFile(project, vcs, ignoreFileRoot, true); }
proposeUpdateIgnoreFile
258,563
void (@NotNull Project project, @NotNull AbstractVcs vcs, @NotNull VirtualFile ignoreFileRoot) { generateIgnoreFile(project, vcs, ignoreFileRoot, false); }
generateIgnoreFileIfNeeded
258,564
void (@NotNull Project project, @NotNull AbstractVcs vcs, @NotNull VirtualFile ignoreFileRoot, boolean notify) { IgnoredFileGenerator ignoredFileGenerator = project.getService(IgnoredFileGenerator.class); if (ignoredFileGenerator == null) { LOG.debug("Cannot find ignore file ignoredFileGenerator for " + vcs.getName() +...
generateIgnoreFile
258,565
boolean (@NotNull Project project, @NotNull ChangeListManager changeListManager, @NotNull String filePath) { VirtualFile file = LocalFileSystem.getInstance().findFileByPath(filePath); if (file == null) return false; FileStatus fileStatus = changeListManager.getStatus(file); return isFileUnderVcs(project, filePath) && (...
isFileSharedInVcs
258,566
boolean (@NotNull Project project) { return ReadAction.compute(() -> { if (project.isDisposed()) return false; @SystemIndependent String projectFilePath = project.getProjectFilePath(); ChangeListManagerEx changeListManager = ChangeListManagerEx.getInstanceEx(project); return !changeListManager.isInUpdate() && (projectF...
isProjectSharedInVcs
258,567
String (@Nullable Project project, byte @NotNull [] bytes, @NotNull FilePath filePath) { Charset charset = DiffContentFactoryImpl.guessCharset(project, bytes, filePath); return CharsetToolkit.decodeString(bytes, charset); }
loadTextFromBytes
258,568
VirtualFile (@NotNull FilePath filePath) { VirtualFile result = filePath.getVirtualFile(); if (result != null) return result; String path = filePath.getPath(); if (!ApplicationManager.getApplication().isReadAccessAllowed()) { result = LocalFileSystem.getInstance().refreshAndFindFileByPath(path); if (result != null) ret...
findValidParentAccurately
258,569
Boolean (@Nullable String password, boolean rememberByDefault) { // if password saving is disabled, don't show the checkbox. if (PasswordSafe.getInstance().isMemoryOnly()) { return null; } // if password is prefilled, it is expected to continue remembering it. if (!StringUtil.isEmptyOrSpaces(password)) { return true; }...
decideOnShowRememberPasswordOption
258,570
JComponent () { return authPanel; }
createCenterPanel
258,571
JComponent () { return authPanel.getPreferredFocusedComponent(); }
getPreferredFocusedComponent
258,572
String () { return authPanel.getLogin(); }
getUsername
258,573
String () { return String.valueOf(authPanel.getPassword()); }
getPassword
258,574
boolean () { return authPanel.isRememberPassword(); }
isRememberPassword
258,575
List<List<String>> (@NotNull List<String> arguments) { return chunkArguments(arguments, 1); }
chunkArguments
258,576
List<List<String>> (@NotNull List<String> arguments, int groupSize) { assert arguments.size() % groupSize == 0 : "Arguments size should be divisible by group size"; ArrayList<List<String>> rc = new ArrayList<>(); int start = 0; int size = 0; int i = 0; for (; i < arguments.size(); i += groupSize) { int length = 0; for ...
chunkArguments
258,577
List<List<String>> (VirtualFile root, Collection<? extends FilePath> files) { return chunkArguments(toRelativePaths(root, files)); }
chunkPaths
258,578
List<List<String>> (@NotNull VirtualFile root, @NotNull Collection<? extends VirtualFile> files) { return chunkArguments(toRelativeFiles(root, files)); }
chunkFiles
258,579
String (VirtualFile file, @NotNull final VirtualFile baseDir) { return getRelativeFilePath(file.getPath(), baseDir); }
getRelativeFilePath
258,580
String (String file, @NotNull final VirtualFile baseDir) { if (SystemInfo.isWindows) { file = file.replace('\\', '/'); } final String basePath = baseDir.getPath(); if (!file.startsWith(basePath)) { return file; } else if (file.equals(basePath)) return "."; return file.substring(baseDir.getPath().length() + 1); }
getRelativeFilePath
258,581
boolean (char ch) { return '0' <= ch && ch <= '7'; }
isOctal
258,582
String (final VirtualFile root, FilePath path) { return relativePath(VfsUtilCore.virtualToIoFile(root), path.getIOFile()); }
relativePath
258,583
String (final File root, FilePath path) { return relativePath(root, path.getIOFile()); }
relativePath
258,584
String (final File root, VirtualFile file) { return relativePath(root, VfsUtilCore.virtualToIoFile(file)); }
relativePath
258,585
String (final VirtualFile root, VirtualFile file) { return relativePath(VfsUtilCore.virtualToIoFile(root), VfsUtilCore.virtualToIoFile(file)); }
relativePath
258,586
String (final VirtualFile root, VirtualFile file) { if (root == null) { file.getPath(); } return relativePath(VfsUtilCore.virtualToIoFile(root), VfsUtilCore.virtualToIoFile(file)); }
relativeOrFullPath
258,587
String (@NotNull FilePath root, @NotNull FilePath file) { return relativePath(root.getIOFile(), file.getIOFile()); }
relativePath
258,588
String (final File root, File path) { String rc = FileUtil.getRelativePath(root, path); if (rc == null) { throw new IllegalArgumentException("The file " + path + " cannot be made relative to " + root); } return rc.replace(File.separatorChar, '/'); }
relativePath
258,589
List<String> (@NotNull VirtualFile root, @NotNull final Collection<? extends FilePath> filePaths) { ArrayList<String> rc = new ArrayList<>(filePaths.size()); for (FilePath path : filePaths) { rc.add(relativePath(root, path)); } return rc; }
toRelativePaths
258,590
List<String> (@NotNull VirtualFile root, @NotNull final Collection<? extends VirtualFile> files) { ArrayList<String> rc = new ArrayList<>(files.size()); for (VirtualFile file : files) { rc.add(relativePath(root, file)); } return rc; }
toRelativeFiles
258,591
void (@NotNull Project project, @NotNull Collection<? extends VirtualFile> affectedFiles) { final VcsDirtyScopeManager dirty = VcsDirtyScopeManager.getInstance(project); for (VirtualFile file : affectedFiles) { if (file.isDirectory()) { dirty.dirDirtyRecursively(file); } else { dirty.fileDirty(file); } } }
markFilesDirty
258,592
void (@NotNull Project project, @NotNull List<? extends FilePath> affectedFiles) { final VcsDirtyScopeManager dirty = VcsDirtyScopeManager.getInstance(project); for (FilePath file : affectedFiles) { if (file.isDirectory()) { dirty.dirDirtyRecursively(file); } else { dirty.fileDirty(file); } } }
markFilesDirty
258,593
void (@NotNull Project project, VirtualFile... virtualFiles) { addFilesToVcsWithConfirmation(project, Arrays.asList(virtualFiles)); }
addFilesToVcsWithConfirmation
258,594
void (@NotNull Project project, @NotNull Collection<? extends VirtualFile> virtualFiles) { if (virtualFiles.isEmpty()) { return; } ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project); Multimap<AbstractVcs, VirtualFile> vcsMap = ArrayListMultimap.create(); for (VirtualFile createdFile : virtu...
addFilesToVcsWithConfirmation
258,595
void (@NotNull AbstractVcs vcs, @NotNull List<? extends VirtualFile> value) { CheckinEnvironment checkinEnvironment = vcs.getCheckinEnvironment(); if (checkinEnvironment != null) { checkinEnvironment.scheduleUnversionedFilesForAddition(value); } }
performAdditions
258,596
boolean (@NotNull @SystemIndependent String ancestor, @NotNull @SystemIndependent String path, boolean strict) { return FileUtil.startsWith(path, ancestor, SystemInfo.isFileSystemCaseSensitive, strict); }
isAncestor
258,597
boolean (@NotNull FilePath ancestor, @NotNull FilePath path, boolean strict) { return isAncestor(ancestor.getPath(), path.getPath(), strict); }
isAncestor
258,598
boolean (@NotNull VirtualFile root, @NotNull FilePath path) { return isAncestor(root.getPath(), path.getPath(), false); }
isAncestor
258,599
boolean (FilePath path1, FilePath path2) { if (path1 == path2) return true; if (path1 == null || path2 == null) return false; if (path1.isDirectory() != path2.isDirectory()) return false; String canonical1 = path1.getPath(); String canonical2 = path2.getPath(); return canonical1.equals(canonical2); }
equals