Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
255,700
String () { return myAction.getTemplatePresentation().getText(); }
getTooltipText
255,701
boolean () { return true; }
isNavigateAction
255,702
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GutterActionRenderer that = (GutterActionRenderer)o; if (!myAction.equals(that.myAction)) return false; return true; }
equals
255,703
int () { return myAction.hashCode(); }
hashCode
255,704
void (@NotNull JComponent component, @NotNull JComponent titleComponent) { myMainComponent = component; removeAll(); JPanel title = new JPanel(new BorderLayout()); title.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); title.add(titleComponent); revalidate(); final JPanel p = new JPanel(new BorderLayout()); if (...
setComponent
255,705
void (JComponent title) { setComponent(myMainComponent, title); }
updateTitle
255,706
void () { if (myUpdating.get()) { myUpdating.set(false); } }
stopUpdating
255,707
void () { final List<DirDiffElementImpl> selectedElements = getSelectedElements(); myUpdating.set(true); myElements.removeIf(element -> switch (element.getType()) { case SOURCE -> !mySettings.showNewOnSource; case TARGET -> !mySettings.showNewOnTarget; case SEPARATOR, ERROR -> false; case CHANGED -> !mySettings.showDif...
applyRemove
255,708
void () { if (myElements.size() > 0) { int row = myElements.get(0).isSeparator() ? 1 : 0; if (row < myTable.getRowCount()) { myTable.getSelectionModel().setSelectionInterval(row, row); TableUtil.scrollSelectionToVisible(myTable); } } }
selectFirstRow
255,709
void (DirDiffPanel panel) { myPanel = panel; }
setPanel
255,710
void () { getSettings().setFilter(myPanel.getFilter()); myPanel.update(false); }
updateFromUI
255,711
boolean () { return !myDisposed && mySettings.enableOperations && mySource.isOperationsEnabled() && myTarget.isOperationsEnabled(); }
isOperationsEnabled
255,712
List<DirDiffElementImpl> () { return myElements; }
getElements
255,713
void (DirDiffElementImpl source, @Nullable DirDiffElementImpl target) { setReplacement(source.getParentNode().getPath(), source.getSourceName(), target == null ? null : target.getTargetName()); }
setReplacement
255,714
void (@NotNull String path, @Nullable String sourceName, @Nullable String targetName) { BiMap<String, String> map = mySourceToReplacingTarget.computeIfAbsent(path, (p) -> HashBiMap.create()); if (targetName != null) { map.forcePut(sourceName, targetName); } else { map.remove(sourceName); } }
setReplacement
255,715
String (DirDiffElementImpl source) { BiMap<String, String> map = mySourceToReplacingTarget.get(source.getParentNode().getPath()); return map != null ? map.get(source.getSourceName()) : null; }
getReplacementName
255,716
String (String text) { final int LEN = EMPTY_STRING.length(); String right; if (text == null) { right = EMPTY_STRING; } else if (text.length() == LEN) { right = text; } else if (text.length() < LEN) { right = text + EMPTY_STRING.substring(0, LEN - text.length()); } else { right = "..." + text.substring(text.length() - ...
prepareText
255,717
void (boolean userForcedRefresh) { fireUpdateStarted(); myUpdating.set(true); myTable.getEmptyText().setText(StatusText.getDefaultEmptyText()); JBLoadingPanel loadingPanel = getLoadingPanel(); loadingPanel.startLoading(); ModalityState modalityState = ModalityState.current(); ApplicationManager.getApplication().execute...
reloadModel
255,718
void () { myUpdating.set(true); try { fireUpdateStarted(); myTree = new DTree(null, "", true); mySource.refresh(true); myTarget.refresh(true); scan(mySource, myTree, true); scan(myTarget, myTree, false); } catch (final IOException e) { LOG.warn(e); reportException(DiffBundle.message("refresh.failed.message", StringUtil...
reloadModelSynchronously
255,719
void (@Nullable @Nls String htmlContent) { if (myDisposed || htmlContent == null) return; Runnable balloonShower = () -> { Balloon balloon = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(htmlContent, MessageType.WARNING, null). setShowCallout(false).setHideOnClickOutside(true).setHideOnAction(true).setHideO...
reportException
255,720
JBLoadingPanel () { return ComponentUtil.getClientProperty(myTable, DECORATOR_KEY); }
getLoadingPanel
255,721
void () { if (!myUpdating.get()) myUpdating.set(true); JBLoadingPanel loadingPanel = getLoadingPanel(); if (!loadingPanel.isLoading()) { loadingPanel.startLoading(); if (myUpdater == null) { startAndSetUpdater(new Updater(loadingPanel, 100)); } } Application app = ApplicationManager.getApplication(); app.executeOnPoole...
applySettings
255,722
void (DTree tree, List<? super DirDiffElementImpl> elements) { if (!myUpdating.get()) return; boolean separatorAdded = tree.getParent() == null; text.set(prepareText(tree.getPath())); for (DTree child : tree.getChildren()) { if (!myUpdating.get()) return; if (!child.isContainer()) { if (child.isVisible()) { if (!separa...
fillElements
255,723
void () { if (!myElements.isEmpty()) { final int size = myElements.size(); myElements.clear(); fireTableRowsDeleted(0, size - 1); } }
clear
255,724
String () { if (myDisposed) return DiffBundle.message("diff.files.dialog.title"); if (mySource instanceof VirtualFileDiffElement && myTarget instanceof VirtualFileDiffElement) { VirtualFile srcFile = ((VirtualFileDiffElement)mySource).getValue(); VirtualFile trgFile = ((VirtualFileDiffElement)myTarget).getValue(); retu...
getTitle
255,725
DirDiffElementImpl (int index) { return 0 <= index && index < myElements.size() ? myElements.get(index) : null; }
getElementAt
255,726
DiffElement () { return mySource; }
getSourceDir
255,727
DiffElement () { return myTarget; }
getTargetDir
255,728
void (DiffElement src) { mySource = src; }
setSourceDir
255,729
void (DiffElement trg) { myTarget = trg; }
setTargetDir
255,730
int () { return myElements.size(); }
getRowCount
255,731
int () { int count = 3; if (mySettings.showDate) count += 2; if (mySettings.showSize) count += 2; return count; }
getColumnCount
255,732
JBTable () { return myTable; }
getTable
255,733
void (JBTable table) { myTable = table; }
setTable
255,734
Object (int rowIndex, int columnIndex) { try { final DirDiffElementImpl element = myElements.get(rowIndex); if (element.isSeparator()) { return columnIndex == 0 ? element.getName() : null; } final ColumnType columnType = getColumnType(columnIndex); boolean isSrc = columnIndex < getColumnCount() / 2; if (columnType == C...
getValueAt
255,735
List<DirDiffElementImpl> () { final int[] rows = myTable.getSelectedRows(); final ArrayList<DirDiffElementImpl> elements = new ArrayList<>(); for (int row : rows) { final DirDiffElementImpl element = getElementAt(row); if (element == null || element.isSeparator()) continue; elements.add(element); } return elements; }
getSelectedElements
255,736
ColumnType (int column) { final int count = (getColumnCount() - 1) / 2; if (column == count) return ColumnType.OPERATION; if (column > count) { column = getColumnCount() - 1 - column; } return switch (column) { case 0 -> ColumnType.NAME; case 1 -> mySettings.showSize ? ColumnType.SIZE : ColumnType.DATE; case 2 -> Colum...
getColumnType
255,737
String (int column) { ColumnType type = getColumnType(column); return switch (type) { case OPERATION -> "*"; // NON-NLS case NAME -> DiffBundle.message("column.dirdiff.name"); case SIZE -> DiffBundle.message("column.dirdiff.size"); case DATE -> DiffBundle.message("column.dirdiff.date"); }; }
getColumnName
255,738
Project () { return myProject; }
getProject
255,739
boolean () { return mySettings.showEqual; }
isShowEqual
255,740
void (boolean show) { mySettings.showEqual = show; }
setShowEqual
255,741
boolean () { return mySettings.showDifferent; }
isShowDifferent
255,742
void (boolean show) { mySettings.showDifferent = show; }
setShowDifferent
255,743
boolean () { return mySettings.showNewOnSource; }
isShowNewOnSource
255,744
void (boolean show) { mySettings.showNewOnSource = show; }
setShowNewOnSource
255,745
boolean () { return mySettings.showNewOnTarget; }
isShowNewOnTarget
255,746
void (boolean show) { mySettings.showNewOnTarget = show; }
setShowNewOnTarget
255,747
boolean () { return myUpdating.get(); }
isUpdating
255,748
void (DirDiffSettings.CompareMode mode) { mySettings.compareMode = mode; }
setCompareMode
255,749
void () { myDisposed = true; myListeners.clear(); myElements.clear(); mySource = null; myTarget = null; myTree = null; }
dispose
255,750
DirDiffSettings () { return mySettings; }
getSettings
255,751
void (final DirDiffElementImpl element) { DiffElement<?> source = element.getSource(); if (source != null) { String path = element.getParentNode().getPath(); if (source instanceof AsyncDiffElement) { ((AsyncDiffElement)source).copyToAsync(myTarget, element.getTarget(), path) .onError(error -> reportException(error == n...
performCopyTo
255,752
void (DirDiffElementImpl element, DiffElement newElement) { ThreadingAssertions.assertEventDispatchThread(); if (myDisposed) return; if (newElement == null && element.getTarget() != null) { final int row = myElements.indexOf(element); element.updateTargetData(); fireTableRowsUpdated(row, row); } refreshElementAfterCopy...
refreshAfterCopyTo
255,753
void (DiffElement<?> newElement, DirDiffElementImpl element) { if (newElement != null) { DTree node = element.getNode(); node.setType(DiffType.EQUAL); node.setTarget(newElement); int row = myElements.indexOf(element); if (getSettings().showEqual) { element.updateSourceFromTarget(newElement); fireTableRowsUpdated(row, r...
refreshElementAfterCopyTo
255,754
void (@NotNull DirDiffElementImpl element) { DiffElement<?> target = element.getTarget(); if (target != null) { String path = element.getParentNode().getPath(); if (target instanceof AsyncDiffElement) { ((AsyncDiffElement)target).copyToAsync(mySource, element.getSource(), path) .onError(error -> reportException(error =...
performCopyFrom
255,755
void (@NotNull DirDiffElementImpl element, DiffElement newElement) { if (myDisposed) return; ThreadingAssertions.assertEventDispatchThread(); refreshElementAfterCopyFrom(element, newElement); }
refreshAfterCopyFrom
255,756
void (DirDiffElementImpl element, DiffElement<?> newElement) { if (newElement != null) { final DTree node = element.getNode(); node.setType(DiffType.EQUAL); node.setSource(newElement); final int row = myElements.indexOf(element); if (getSettings().showEqual) { element.updateTargetFromSource(newElement); fireTableRowsUp...
refreshElementAfterCopyFrom
255,757
void (DirDiffElementImpl element, boolean removeFromTree) { int row = myElements.indexOf(element); if (row != -1) { final DTree node = element.getNode(); if (removeFromTree) { final DTree parentNode = element.getParentNode(); parentNode.remove(node); } myElements.remove(row); int start = row; if (row > 0 && row == myEl...
removeElement
255,758
void (@NotNull DirDiffElementImpl element) { DiffElement<?> source = element.getSource(); DiffElement<?> target = element.getTarget(); LOG.assertTrue(source == null || target == null); if (source instanceof AsyncDiffElement || target instanceof AsyncDiffElement) { ((AsyncDiffElement)(source != null ? source : target))....
performDelete
255,759
void () { List<DirDiffElementImpl> selectedElements = getSelectedElements(); if (!checkCanDelete(selectedElements)) { return; } rememberSelection(); sync(selectedElements); restoreSelection(); }
synchronizeSelected
255,760
void () { if (mySelectionConfig != null) { mySelectionConfig.restore(); } }
restoreSelection
255,761
void () { List<DirDiffElementImpl> elements = new ArrayList<>(myElements); if (!checkCanDelete(elements)) { return; } sync(elements); selectFirstRow(); }
synchronizeAll
255,762
void (List<DirDiffElementImpl> elements) { for (DirDiffElementImpl element : elements) { syncElement(element); } }
sync
255,763
boolean (List<DirDiffElementImpl> elements) { if (WarnOnDeletion.isWarnWhenDeleteItems()) { int count = 0; for (DirDiffElementImpl element : elements) { if (element.getOperation() == DirDiffOperation.DELETE) { count++; } } if (count > 0) { if (!confirmDeletion(count)) { return false; } } } return true; }
checkCanDelete
255,764
boolean (int count) { return MessageDialogBuilder.yesNo(DiffBundle.message("confirm.delete"), DiffBundle.message("delete.0.items", count)) .yesText(CommonBundle.message("button.delete")) .noText(CommonBundle.getCancelButtonText()) .doNotAsk(new DoNotAskOption() { @Override public boolean isToBeShown() { return WarnOnDe...
confirmDeletion
255,765
boolean () { return WarnOnDeletion.isWarnWhenDeleteItems(); }
isToBeShown
255,766
void (boolean value, int exitCode) { WarnOnDeletion.setWarnWhenDeleteItems(value); }
setToBeShown
255,767
boolean () { return true; }
canBeHidden
255,768
boolean () { return true; }
shouldSaveOptionsOnCancel
255,769
String () { return DiffBundle.message("do.not.ask.me.again"); }
getDoNotShowMessage
255,770
void (DirDiffElementImpl element) { final DirDiffOperation operation = element.getOperation(); if (operation == null) return; switch (operation) { case COPY_TO -> performCopyTo(element); case COPY_FROM -> performCopyFrom(element); case DELETE -> performDelete(element); case MERGE, EQUAL, NONE -> { } } }
syncElement
255,771
void () { if (!myDisposed && myLoadingPanel.isLoading()) { TimeoutUtil.sleep(mySleep); ApplicationManager.getApplication().invokeLater(() -> { final String s = text.get(); if (s != null && myLoadingPanel.isLoading()) { myLoadingPanel.setLoadingText(s); } }, ModalityState.stateForComponent(myLoadingPanel)); startAndSetU...
run
255,772
void (Updater updater) { updater.start(); myUpdater = updater; }
startAndSetUpdater
255,773
void () { mySelectionConfig = new TableSelectionConfig(); }
rememberSelection
255,774
Component (final JTable table, Object value, boolean isSelected, boolean hasFocus, final int row, final int column) { final DirDiffTableModel model = (DirDiffTableModel)table.getModel(); final DirDiffElementImpl element = model.getElementAt(row); if (element == null) return super.getTableCellRendererComponent(table, va...
getTableCellRendererComponent
255,775
void (Graphics2D g) { int offset = 0; int i = 0; final TableColumnModel columnModel = table.getColumnModel(); while (i < column) { offset += columnModel.getColumn(i).getWidth(); i++; } g.translate(-offset, 0); super.doPaint(g); g.translate(offset, 0); }
doPaint
255,776
void (@NotNull final DiffElement dir1, @NotNull final DiffElement dir2, final DirDiffSettings settings, @Nullable final Runnable onWindowClosing) { showDiff(settings, new DirDiffTableModel(myProject, dir1, dir2, settings), onWindowClosing); }
showDiff
255,777
void (final DirDiffSettings settings, DirDiffTableModel model, @Nullable final Runnable onWindowClosing) { if (settings.showInFrame) { DirDiffFrame frame = new DirDiffFrame(myProject, model); setWindowListener(onWindowClosing, frame.getFrame()); frame.show(); } else { DirDiffDialog dirDiffDialog = new DirDiffDialog(myP...
showDiff
255,778
boolean (Project project) { final Component owner = IdeFocusManager.getInstance(project).getFocusOwner(); if (owner != null) { final DialogWrapper instance = DialogWrapper.findInstance(owner); return instance != null && instance.isModal(); } return false; }
isFromModalDialog
255,779
void (final Runnable onWindowClosing, final Window window) { if (onWindowClosing != null) { window.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { onWindowClosing.run(); window.removeWindowListener(this); } }); } }
setWindowListener
255,780
void (WindowEvent e) { onWindowClosing.run(); window.removeWindowListener(this); }
windowClosing
255,781
void (@NotNull DiffElement dir1, @NotNull DiffElement dir2, DirDiffSettings settings) { showDiff(dir1, dir2, settings, null); }
showDiff
255,782
void (@NotNull DiffElement dir1, @NotNull DiffElement dir2) { showDiff(dir1, dir2, new DirDiffSettings()); }
showDiff
255,783
boolean (@NotNull DiffElement dir1, @NotNull DiffElement dir2) { return dir1.isContainer() && dir2.isContainer(); }
canShow
255,784
DiffElement (Object obj) { //TODO make EP if (obj instanceof VirtualFile) { return VirtualFileDiffElement.createElement((VirtualFile)obj); } return null; }
createDiffElement
255,785
DirDiffModel (DiffElement e1, DiffElement e2, DirDiffSettings settings) { DirDiffTableModel newModel = new DirDiffTableModel(myProject, e1, e2, settings); newModel.reloadModelSynchronously(); return newModel; }
createDiffModel
255,786
String () { return mySource == null ? "" : getLastModification(mySource); }
getSourceModificationDate
255,787
String () { return myTarget == null ? "" : getLastModification(myTarget); }
getTargetModificationDate
255,788
void () { if (myTarget != null && !myTarget.isContainer()) { myTargetLength = myTarget.getSize(); } else { myTargetLength = -1; } }
updateTargetData
255,789
String (DiffElement file) { final long timeStamp = file.getTimeStamp(); return timeStamp < 0 ? "" : DateFormatUtil.formatDateTime(timeStamp); }
getLastModification
255,790
DirDiffElementImpl (DTree parent, @NotNull DiffElement source, @NotNull DiffElement target, @Nullable DirDiffSettings.CustomSourceChooser customSourceChooser) { DirDiffOperation defaultOperation = null; if (customSourceChooser != null) { DiffElement chosenSource = customSourceChooser.chooseSource(source, target); if (c...
createChange
255,791
DirDiffElementImpl (DTree parent, @Nullable DiffElement source, @Nullable DiffElement target) { return new DirDiffElementImpl(parent, source, target, DiffType.ERROR, source == null ? target.getPresentableName() : source.getPresentableName(), null); }
createError
255,792
DirDiffElementImpl (DTree parent, @NotNull DiffElement source) { return new DirDiffElementImpl(parent, source, null, DiffType.SOURCE, null, null); }
createSourceOnly
255,793
DirDiffElementImpl (DTree parent, @NotNull DiffElement target) { return new DirDiffElementImpl(parent, null, target, DiffType.TARGET, null, null); }
createTargetOnly
255,794
DirDiffElementImpl (DTree parent, DiffElement src, DiffElement trg, @Nls String name) { return new DirDiffElementImpl(parent, src, trg, DiffType.SEPARATOR, name, null); }
createDirElement
255,795
DirDiffElementImpl (DTree parent, @NotNull DiffElement source, @NotNull DiffElement target) { return new DirDiffElementImpl(parent, source, target, DiffType.EQUAL, source.getPresentableName(), null); }
createEqual
255,796
DiffType () { return myType; }
getType
255,797
DiffElement () { return mySource; }
getSource
255,798
DiffElement () { return myTarget; }
getTarget
255,799
String () { return myName; }
getName