Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
256,100
Dimension (@Nullable Component component) { return component != null && component.isVisible() ? component.getPreferredSize() : new Dimension(); }
getPreferredSize
256,101
int () { int totalHeight = 0; for (JComponent component : mySyncComponents) { Dimension size = getPreferredSize(component); totalHeight = Math.max(size.height, totalHeight); } if (myLastPreferredHeight != totalHeight) { myLastPreferredHeight = totalHeight; SwingUtilities.invokeLater(this::revalidateAll); } return total...
preferredHeight
256,102
void () { for (JComponent component : mySyncComponents) { if (component != null) component.revalidate(); } }
revalidateAll
256,103
SyncHeightHolder () { return mySyncHeightHolder; }
getSyncHeightHolder
256,104
Dimension (Container parent) { int syncHeight = mySyncHeightHolder.preferredHeight(); int width = getPreferredSize(myComponent).width; return new Dimension(width, syncHeight); }
preferredLayoutSize
256,105
void (@NotNull Container parent) { if (myComponent == null) return; Dimension preferredSize = getPreferredSize(myComponent); int width = parent.getWidth(); int height = parent.getHeight(); myComponent.setBounds(0, 0, width, Math.min(height, preferredSize.height)); }
layoutContainer
256,106
EditorHighlighter (boolean forceEmpty) { if (!forceEmpty) { CharSequence text = myEditor.getDocument().getImmutableCharSequence(); EditorHighlighter highlighter = DiffUtil.initEditorHighlighter(myProject, myContent, text); if (highlighter != null) { return highlighter; } } return DiffUtil.createEmptyEditorHighlighter()...
createHighlighter
256,107
void (@NotNull EditorHighlighter highlighter) { super.setupHighlighter(highlighter); restartHighlighterFor(myProject, myEditor); }
setupHighlighter
256,108
void (@Nullable Project project, @NotNull Editor editor) { if (project == null) return; // rely on com.intellij.codeInsight.daemon.impl.EditorTracker if in focused window Window window = UIUtil.getWindow(editor.getComponent()); if (window == null || !window.isShowing() || UIUtil.isFocusAncestor(window)) return; PsiMana...
restartHighlighterFor
256,109
void () { myHighlighter.dispose(); }
dispose
256,110
void (boolean force) { if (!myHighlighter.isValid()) return; myHighlighter.setGutterIconRenderer(createRenderer()); }
update
256,111
int (@NotNull Editor editor, int line) { Document document = editor.getDocument(); return line == DiffUtil.getLineCount(document) ? document.getTextLength() : document.getLineStartOffset(line); }
lineToOffset
256,112
GutterIconRenderer () { return myBuilder.createRenderer(); }
createRenderer
256,113
void (boolean force) { boolean shouldUpdate = force || myCtrlPressed == myModifierProvider.isCtrlPressed() || myShiftPressed == myModifierProvider.isShiftPressed() || myAltPressed == myModifierProvider.isAltPressed(); if (!shouldUpdate) return; myCtrlPressed = myModifierProvider.isCtrlPressed(); myShiftPressed = myModi...
update
256,114
GutterIconRenderer () { return myBuilder.createRenderer(myCtrlPressed, myShiftPressed, myAltPressed); }
createRenderer
256,115
void () { if (myProgressIndicator != null) myProgressIndicator.cancel(); myProgressIndicator = null; }
abort
256,116
void (@NotNull Function<? super ProgressIndicator, ? extends Runnable> backgroundTask, @Nullable Runnable onSlowAction, long waitMillis) { executeAndTryWait(backgroundTask, onSlowAction, waitMillis, false); }
executeAndTryWait
256,117
void (@NotNull Function<? super ProgressIndicator, ? extends Runnable> backgroundTask, @Nullable Runnable onSlowAction, long waitMillis, boolean forceEDT) { abort(); myProgressIndicator = BackgroundTaskUtil.executeAndTryWait(backgroundTask, onSlowAction, waitMillis, forceEDT); }
executeAndTryWait
256,118
Icon () { return myIcon; }
getIcon
256,119
String () { return myTooltip; }
getTooltipText
256,120
boolean () { return true; }
isNavigateAction
256,121
boolean () { return true; }
isDumbAware
256,122
Alignment () { return Alignment.LEFT; }
getAlignment
256,123
AnAction () { return DumbAwareAction.create(e -> performAction(e)); }
getClickAction
256,124
boolean (Object obj) { return obj == this; }
equals
256,125
int () { return System.identityHashCode(this); }
hashCode
256,126
void (@NotNull AnActionEvent e) { MouseEvent mouseEvent = ObjectUtils.tryCast(e.getInputEvent(), MouseEvent.class); if (mouseEvent == null || mouseEvent.getButton() == MouseEvent.BUTTON1) { handleMouseClick(); } }
performAction
256,127
Graphics2D (@NotNull Graphics g, @NotNull Component divider, @NotNull Component base) { int width = divider.getWidth(); int editorHeight = base.getHeight(); int dividerOffset = divider.getLocationOnScreen().y; int editorOffset = base.getLocationOnScreen().y; return (Graphics2D)g.create(0, editorOffset - dividerOffset, ...
getDividerGraphics
256,128
void (@NotNull Graphics2D gg, int width, @NotNull Editor editor1, @NotNull Editor editor2, @NotNull DividerSeparatorPaintable paintable) { ReadAction.run(() -> { List<DividerSeparator> polygons = createVisibleSeparators(editor1, editor2, paintable); GraphicsConfig config = GraphicsUtil.setupAAPainting(gg); for (Divider...
paintSeparators
256,129
void (@NotNull Graphics2D gg, int width, @NotNull Editor editor1, @NotNull Editor editor2, @NotNull DividerPaintable paintable) { paintPolygons(gg, width, true, editor1, editor2, paintable); }
paintPolygons
256,130
void (@NotNull Graphics2D gg, int width, boolean curved, @NotNull Editor editor1, @NotNull Editor editor2, @NotNull DividerPaintable paintable) { ReadAction.run(() -> { List<DividerPolygon> polygons = createVisiblePolygons(editor1, editor2, paintable); GraphicsConfig config = GraphicsUtil.setupAAPainting(gg); for (Divi...
paintPolygons
256,131
List<DividerPolygon> (@NotNull Editor editor1, @NotNull Editor editor2, @NotNull DividerPaintable paintable) { if (editor1.isDisposed() || editor2.isDisposed()) return Collections.emptyList(); DividerPaintableHandlerImpl handler = new DividerPaintableHandlerImpl(editor1, editor2); paintable.process(handler); return han...
createVisiblePolygons
256,132
boolean (@NotNull Editor editor, int startLine, int endLine) { TextRange range = DiffUtil.getLinesRange(editor.getDocument(), startLine, endLine); return FoldingUtil.isTextRangeFolded(editor, range); }
isIntervalFolded
256,133
List<DividerSeparator> (@NotNull Editor editor1, @NotNull Editor editor2, @NotNull DividerSeparatorPaintable paintable) { if (editor1.isDisposed() || editor2.isDisposed()) return Collections.emptyList(); final List<DividerSeparator> separators = new ArrayList<>(); final LineRange leftInterval = getVisibleInterval(edito...
createVisibleSeparators
256,134
int (@NotNull final Editor editor) { final JComponent header = editor.getHeaderComponent(); int headerOffset = header == null ? 0 : header.getHeight(); return -editor.getScrollingModel().getVerticalScrollOffset() + headerOffset; }
getEditorTopOffset
256,135
MarkerRange (@NotNull Editor editor, int startLine, int endLine) { Pair<@NotNull Interval, @Nullable Interval> pair1 = EditorUtil.logicalLineToYRange(editor, startLine); Pair<@NotNull Interval, @Nullable Interval> pair2 = startLine == endLine ? pair1 : EditorUtil.logicalLineToYRange(editor, endLine - 1); int startOffse...
getDividerMarkerPaintRange
256,136
DividerSeparator (@NotNull Editor editor1, @NotNull Editor editor2, int line1, int line2, int height1, int height2, boolean isHovered, @Nullable EditorColorsScheme scheme) { int topOffset1 = getEditorTopOffset(editor1); int topOffset2 = getEditorTopOffset(editor2); int start1 = lineToY(editor1, line1) + topOffset1; int...
createSeparator
256,137
LineRange (Editor editor) { return ReadAction.compute(() -> { Rectangle area = editor.getScrollingModel().getVisibleArea(); if (area.height < 0) return new LineRange(0, 0); LogicalPosition position1 = editor.xyToLogicalPosition(new Point(0, area.y)); LogicalPosition position2 = editor.xyToLogicalPosition(new Point(0, a...
getVisibleInterval
256,138
List<DividerPolygon> () { return myPolygons; }
getPolygons
256,139
boolean (int startLine1, int endLine1, int startLine2, int endLine2, @NotNull TextDiffType type) { return process(startLine1, endLine1, startLine2, endLine2, new DefaultPainter(type)); }
process
256,140
boolean (int startLine1, int endLine1, int startLine2, int endLine2, @NotNull TextDiffType type, boolean resolved) { return process(startLine1, endLine1, startLine2, endLine2, new ResolvablePainter(type, resolved)); }
processResolvable
256,141
boolean (int startLine1, int endLine1, int startLine2, int endLine2, @NotNull TextDiffType type, boolean excluded, boolean skipped) { return process(startLine1, endLine1, startLine2, endLine2, new ExcludablePainter(type, excluded, skipped)); }
processExcludable
256,142
boolean (int startLine1, int endLine1, int startLine2, int endLine2, @NotNull TextDiffType type) { if (type == TextDiffType.INSERTED || type == TextDiffType.DELETED) { return process(startLine1, endLine1, startLine2, endLine2, new DefaultPainter(type), true); } else { return process(startLine1, endLine1, startLine2, en...
processAligned
256,143
boolean (int startLine1, int endLine1, int startLine2, int endLine2, @NotNull Painter painter) { return process(startLine1, endLine1, startLine2, endLine2, painter, false); }
process
256,144
boolean (int startLine1, int endLine1, int startLine2, int endLine2, @NotNull Painter painter, boolean withAlignedHeight) { if (myLeftInterval.start > endLine1 && myRightInterval.start > endLine2) return true; if (myLeftInterval.end < startLine1 && myRightInterval.end < startLine2) return false; DividerPolygon polygon ...
process
256,145
int (@NotNull Editor editor1, @NotNull Editor editor2, int startLine1, int startLine2, @NotNull TextDiffType type) { int visualStartLine1 = EditorUtil.logicalToVisualLine(editor1, startLine1); int visualStartLine2 = EditorUtil.logicalToVisualLine(editor2, startLine2); if (type == TextDiffType.INSERTED) { return EditorU...
getInlayOffset
256,146
DividerPolygon (@NotNull Editor editor1, @NotNull Editor editor2, int startLine1, int endLine1, int startLine2, int endLine2, @NotNull Painter painter) { int topOffset1 = getEditorTopOffset(editor1); int topOffset2 = getEditorTopOffset(editor2); boolean isFolded1 = isIntervalFolded(editor1, startLine1, endLine1); boole...
createPolygon
256,147
TextDiffType (@NotNull TextDiffType type, boolean isFolded) { if (isFolded && (type == TextDiffType.DELETED || type == TextDiffType.INSERTED)) return TextDiffType.MODIFIED; return type; }
correctType
256,148
boolean () { return false; }
isDottedBorder
256,149
boolean () { return true; }
isAlwaysVisible
256,150
TextDiffType () { return myType; }
getType
256,151
boolean () { return myResolved; }
isDottedBorder
256,152
boolean () { return !myResolved; }
isAlwaysVisible
256,153
TextDiffType () { return myType; }
getType
256,154
boolean () { return false; }
isDottedBorder
256,155
boolean () { return !mySkipped; }
isAlwaysVisible
256,156
TextDiffType () { return myType; }
getType
256,157
void (Graphics2D g, int width, boolean curve) { int startY1; int endY1; int startY2; int endY2; if (myEnd1 - myStart1 < 2) { startY1 = myStart1 - 1; endY1 = myStart1; } else { startY1 = myStart1; endY1 = myEnd1 - 1; } if (myEnd2 - myStart2 < 2) { startY2 = myStart2 - 1; endY2 = myStart2; } else { startY2 = myStart2; en...
paint
256,158
void (@NotNull Graphics2D g, int width, int startY1, int endY1, int startY2, int endY2, @Nullable Color fillColor, @Nullable Color borderColor, boolean curve) { if (curve) { DiffDrawUtil.drawCurveTrapezium(g, 0, width, startY1, endY1, startY2, endY2, fillColor, borderColor); } else { DiffDrawUtil.drawTrapezium(g, 0, wi...
drawTrapezium
256,159
DividerPolygon (int inlayOffset) { int delta = (myEnd2 - myStart2) - (myEnd1 - myStart1); if (delta == 0) return this; if (myStart2 == myEnd1 && myEnd1 == myEnd2) { //correspond to the last line DELETED change (e.g. last line deleted) return new DividerPolygon(myStart1, myStart2 - (myEnd2 - myStart1), myEnd1, myEnd2, m...
withAlignedHeight
256,160
String () { return "<" + myStart1 + ", " + myEnd1 + " : " + myStart2 + ", " + myEnd2 + "> " + myFillColor + ", " + myBorderColor; }
toString
256,161
void (Graphics2D g, int width) { DiffLineSeparatorRenderer.drawConnectorLine(g, 0, width, myStart1, myStart2, myEnd1 - myStart1, myIsHovered, myScheme); }
paint
256,162
String () { return "<" + myStart1 + ", " + myEnd1 + " : " + myStart2 + ", " + myEnd2 + "> "; }
toString
256,163
boolean (@NotNull Editor editor) { return editor.getEditorKind() == EditorKind.DIFF; }
isDiffEditor
256,164
boolean (@NotNull VirtualFile file) { if (file instanceof VirtualFileWithoutContent) return true; return false; }
isFileWithoutContent
256,165
EditorHighlighter (@Nullable Project project, @NotNull DocumentContent content, @NotNull CharSequence text) { EditorHighlighter highlighter = createEditorHighlighter(project, content); if (highlighter == null) return null; highlighter.setText(text); return highlighter; }
initEditorHighlighter
256,166
EditorHighlighter (@NotNull CharSequence text) { EditorHighlighter highlighter = createEmptyEditorHighlighter(); highlighter.setText(text); return highlighter; }
initEmptyEditorHighlighter
256,167
EditorHighlighter (@Nullable Project project, @NotNull DocumentContent content) { EditorHighlighterFactory highlighterFactory = EditorHighlighterFactory.getInstance(); VirtualFile file = FileDocumentManager.getInstance().getFile(content.getDocument()); FileType contentType = content.getContentType(); VirtualFile highli...
createEditorHighlighter
256,168
EditorHighlighter () { return new EmptyEditorHighlighter(EditorColorsManager.getInstance().getGlobalScheme().getAttributes(HighlighterColors.TEXT)); }
createEmptyEditorHighlighter
256,169
void (@Nullable Project project, @NotNull EditorEx editor, @NotNull DocumentContent content) { Disposable disposable = ((EditorImpl)editor).getDisposable(); if (project != null) { DiffEditorHighlighterUpdater updater = new DiffEditorHighlighterUpdater(project, disposable, editor, content); updater.updateHighlightersAsy...
setEditorHighlighter
256,170
void (@Nullable Project project, @NotNull EditorEx editor, @Nullable DocumentContent content) { if (project != null && content != null && editor.getVirtualFile() == null) { PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(content.getDocument()); CommonCodeStyleSettings.IndentOptions indentOptions = ...
setEditorCodeStyle
256,171
void (@NotNull EditorEx editor) { editor.getSettings().setFoldingOutlineShown(true); editor.getSettings().setAutoCodeFoldingEnabled(false); editor.getColorsScheme().setAttributes(EditorColors.FOLDED_TEXT_ATTRIBUTES, null); }
setFoldingModelSupport
256,172
EditorEx (@NotNull Document document, @Nullable Project project, boolean isViewer) { return createEditor(document, project, isViewer, false); }
createEditor
256,173
EditorEx (@NotNull Document document, @Nullable Project project, boolean isViewer, boolean enableFolding) { EditorFactory factory = EditorFactory.getInstance(); EditorKind kind = EditorKind.DIFF; EditorEx editor = (EditorEx)(isViewer ? factory.createViewer(document, project, kind) : factory.createEditor(document, proje...
createEditor
256,174
void (@NotNull EditorEx editor, @NotNull DocumentContent content, @Nullable Project project) { VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(content.getDocument()); if (virtualFile != null) { editor.setFile(virtualFile); } setEditorHighlighter(project, editor, content); setEditorCodeStyle(project,...
configureEditor
256,175
boolean (@NotNull Editor editor) { if (editor instanceof EditorEx) { return ((EditorEx)editor).getVerticalScrollbarOrientation() == EditorEx.VERTICAL_SCROLLBAR_LEFT; } return false; }
isMirrored
256,176
boolean (@Nullable Project project, @Nullable VirtualFile file) { if (project == null || project.isDefault()) return false; if (file == null || !file.isValid()) return false; if (OutsidersPsiFileSupport.isOutsiderFile(file)) return false; if (file.getUserData(TEMP_FILE_KEY) == Boolean.TRUE) return false; return true; }
canNavigateToFile
256,177
void (@NotNull EditorEx editor, @NotNull FoldingModelSupport foldingSupport) { assert foldingSupport.getCount() == 1; IntPredicate foldingLinePredicate = foldingSupport.hideLineNumberPredicate(0); editor.getGutter().setLineNumberConverter(new DiffLineNumberConverter(foldingLinePredicate, null)); }
installLineConvertor
256,178
void (@NotNull EditorEx editor, @NotNull DocumentContent content) { IntUnaryOperator contentLineConvertor = getContentLineConvertor(content); if (contentLineConvertor == null) { editor.getGutter().setLineNumberConverter(null); } else { editor.getGutter().setLineNumberConverter(new DiffLineNumberConverter(null, contentL...
installLineConvertor
256,179
void (@NotNull EditorEx editor, @Nullable DocumentContent content, @NotNull FoldingModelSupport foldingSupport, int editorIndex) { IntUnaryOperator contentLineConvertor = content != null ? getContentLineConvertor(content) : null; IntPredicate foldingLinePredicate = foldingSupport.hideLineNumberPredicate(editorIndex); e...
installLineConvertor
256,180
IntUnaryOperator (@NotNull DocumentContent content) { return content.getUserData(DiffUserDataKeysEx.LINE_NUMBER_CONVERTOR); }
getContentLineConvertor
256,181
IntUnaryOperator (@Nullable IntUnaryOperator convertor1, @Nullable IntUnaryOperator convertor2) { if (convertor1 == null && convertor2 == null) return null; if (convertor1 == null) return convertor2; if (convertor2 == null) return convertor1; return value -> { int value2 = convertor2.applyAsInt(value); return value2 >=...
mergeLineConverters
256,182
void (@NotNull EditorEx editor) { if (Registry.is("diff.divider.repainting.disable.blitting")) { editor.getScrollPane().getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); } }
disableBlitting
256,183
void (@Nullable final Editor editor, int line) { if (editor == null) return; editor.getSelectionModel().removeSelection(); editor.getCaretModel().removeSecondaryCarets(); editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(line, 0)); }
moveCaret
256,184
void (@Nullable final Editor editor, int line, boolean animated) { scrollEditor(editor, line, 0, animated); }
scrollEditor
256,185
void (@Nullable final Editor editor, int line, int column, boolean animated) { if (editor == null) return; editor.getSelectionModel().removeSelection(); editor.getCaretModel().removeSecondaryCarets(); editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(line, column)); scrollToCaret(editor, animated); }
scrollEditor
256,186
void (@Nullable Editor editor, @NotNull Point point, boolean animated) { if (editor == null) return; if (!animated) editor.getScrollingModel().disableAnimation(); editor.getScrollingModel().scrollHorizontally(point.x); editor.getScrollingModel().scrollVertically(point.y); if (!animated) editor.getScrollingModel().enabl...
scrollToPoint
256,187
void (@Nullable Editor editor, boolean animated) { if (editor == null) return; if (!animated) editor.getScrollingModel().disableAnimation(); editor.getScrollingModel().scrollToCaret(ScrollType.CENTER); if (!animated) editor.getScrollingModel().enableAnimation(); }
scrollToCaret
256,188
Point (@Nullable Editor editor) { if (editor == null) return new Point(0, 0); ScrollingModel model = editor.getScrollingModel(); return new Point(model.getHorizontalScrollOffset(), model.getVerticalScrollOffset()); }
getScrollingPosition
256,189
LogicalPosition (@Nullable Editor editor) { return editor != null ? editor.getCaretModel().getLogicalPosition() : new LogicalPosition(0, 0); }
getCaretPosition
256,190
void (@NotNull Editor editor, int startLine, int endLine) { int caretLine = editor.getCaretModel().getLogicalPosition().line; if (!isSelectedByLine(caretLine, startLine, endLine)) { editor.getSelectionModel().removeSelection(); editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(startLine, 0)); } }
moveCaretToLineRangeIfNeeded
256,191
Icon (@NotNull Side sourceSide) { return sourceSide.select(AllIcons.Diff.ArrowRight, AllIcons.Diff.Arrow); }
getArrowIcon
256,192
Icon (@NotNull Side sourceSide) { return sourceSide.select(AllIcons.Diff.ArrowRightDown, AllIcons.Diff.ArrowLeftDown); }
getArrowDownIcon
256,193
boolean (@NotNull AnActionEvent e) { String place = e.getPlace(); return ActionPlaces.KEYBOARD_SHORTCUT.equals(place) || ActionPlaces.MOUSE_SHORTCUT.equals(place); }
isFromShortcut
256,194
void (@NotNull AnAction action, @NotNull JComponent component) { action.registerCustomShortcutSet(action.getShortcutSet(), component); }
registerAction
256,195
void (@NotNull ActionGroup group, @NotNull JComponent component, @Nullable Disposable parentDisposable) { for (AnAction action : group.getChildren(null)) { if (action instanceof ActionGroup) { recursiveRegisterShortcutSet((ActionGroup)action, component, parentDisposable); } action.registerCustomShortcutSet(component, p...
recursiveRegisterShortcutSet
256,196
JPanel (@NotNull @Nls String message) { String text = StringUtil.replace(message, "\n", UIUtil.BR); JLabel label = new JBLabel(text) { @Override public Dimension getMinimumSize() { Dimension size = super.getMinimumSize(); size.width = Math.min(size.width, 200); size.height = Math.min(size.height, 100); return size; } }...
createMessagePanel
256,197
Dimension () { Dimension size = super.getMinimumSize(); size.width = Math.min(size.width, 200); size.height = Math.min(size.height, 100); return size; }
getMinimumSize
256,198
JPanel (@NotNull JComponent label) { Color commentFg = JBColor.lazy(() -> { EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); TextAttributes commentAttributes = scheme.getAttributes(DefaultLanguageHighlighterColors.LINE_COMMENT); Color commentAttributesForegroundColor = commentAttributes....
createMessagePanel
256,199
void (@NotNull DefaultActionGroup group, AnAction... actions) { addActionBlock(group, Arrays.asList(actions)); }
addActionBlock