Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
247,200
Icon (boolean expanded, boolean selected) { return !selected ? expanded ? expandedDefault : collapsedDefault : expanded ? expandedSelected : collapsedSelected; }
getIcon
247,201
int () { return Math.max( Math.max(expandedDefault.getIconWidth(), collapsedDefault.getIconWidth()), Math.max(expandedSelected.getIconWidth(), collapsedSelected.getIconWidth())); }
getWidth
247,202
int () { return Math.max( Math.max(expandedDefault.getIconHeight(), collapsedDefault.getIconHeight()), Math.max(expandedSelected.getIconHeight(), collapsedSelected.getIconHeight())); }
getHeight
247,203
void (@NotNull Component c, @NotNull Graphics g, int x, int y, int width, int height, boolean expanded, boolean selected) { Icon icon = getIcon(expanded, selected); icon.paintIcon(null, g, x + (width - icon.getIconWidth()) / 2, y + (height - icon.getIconHeight()) / 2); }
paint
247,204
Thread () { return isDispatchThread() ? null : Thread.currentThread(); }
getBackgroundThread
247,205
boolean () { Thread thread = getBackgroundThread(); if (thread == null) { background = null; // the background thread is not allowed after the first access from the EDT return true; // the EDT is always allowed } if (thread == background) { return true; // the background thread is allowed only before the first access f...
isValidThread
247,206
void () { setUI(new CommonButtonUI()); }
updateUI
247,207
boolean () { return false; }
isFocusable
247,208
void (MouseEvent e) { myHover = true; e.getComponent().repaint(); }
mouseEntered
247,209
void (MouseEvent e) { myHover = false; e.getComponent().repaint(); }
mouseExited
247,210
void (AbstractButton b) { super.installDefaults(b); b.setOpaque(false); Border border = b.getBorder(); if (border == null || border instanceof UIResource) { // TODO: This is only for 16x16 icon buttons b.setBorder(BorderFactory.createEmptyBorder(JBUIScale.scale(4), JBUIScale.scale(4), JBUIScale.scale(4), JBUIScale.scal...
installDefaults
247,211
void (AbstractButton b) { super.installListeners(b); b.addMouseListener(myAdapter); }
installListeners
247,212
void (AbstractButton b) { super.uninstallListeners(b); b.removeMouseListener(myAdapter); }
uninstallListeners
247,213
void (Graphics g, JComponent c) { AbstractButton b = (AbstractButton)c; // TODO: Create a unique style for showing focus on buttons, for now use the hover state visuals. if ((myHover && b.isEnabled()) || b.isSelected() || b.isFocusOwner()) { paintBackground(g, c); } super.paint(g, c); }
paint
247,214
FoldRegion[] (Editor editor, int offset) { List<FoldRegion> list = new ArrayList<>(); FoldRegion[] allRegions = editor.getFoldingModel().getAllFoldRegions(); for (FoldRegion region : allRegions) { if (region.getStartOffset() <= offset && offset <= region.getEndOffset()) { list.add(region); } } FoldRegion[] regions = li...
getFoldRegionsAtOffset
247,215
boolean (final Editor editor, final TextRange range) { final int offset = editor.getCaretModel().getOffset(); return range.contains(offset) && range.getStartOffset() != offset; }
caretInsideRange
247,216
boolean (@NotNull Editor editor, @NotNull RangeHighlighter highlighter) { int startOffset = highlighter instanceof RangeHighlighterEx ? ((RangeHighlighterEx)highlighter).getAffectedAreaStartOffset() : highlighter.getStartOffset(); int endOffset = highlighter instanceof RangeHighlighterEx ? ((RangeHighlighterEx)highligh...
isHighlighterFolded
247,217
boolean (@NotNull Editor editor, @NotNull TextRange range) { FoldRegion foldRegion = editor.getFoldingModel().getCollapsedRegionAtOffset(range.getStartOffset()); return foldRegion != null && range.getEndOffset() <= foldRegion.getEndOffset(); }
isTextRangeFolded
247,218
Iterator<FoldRegion> (@NotNull Editor editor) { final FoldRegion[] allRegions = editor.getFoldingModel().getAllFoldRegions(); return new Iterator<>() { private int sectionStart; private int current; private int sectionEnd; { advanceSection(); } private void advanceSection() { sectionStart = sectionEnd; //noinspection S...
createFoldTreeIterator
247,219
void () { sectionStart = sectionEnd; //noinspection StatementWithEmptyBody for (sectionEnd = sectionStart + 1; sectionEnd < allRegions.length && allRegions[sectionEnd].getStartOffset() == allRegions[sectionStart].getStartOffset(); sectionEnd++) { } current = sectionEnd; }
advanceSection
247,220
boolean () { return current > sectionStart || sectionEnd < allRegions.length; }
hasNext
247,221
FoldRegion () { if (!hasNext()) { throw new NoSuchElementException(); } if (current <= sectionStart) { advanceSection(); } return allRegions[--current]; }
next
247,222
void () { throw new UnsupportedOperationException(); }
remove
247,223
int (TooltipGroup tooltipGroup) { return myPriority - tooltipGroup.myPriority; }
compareTo
247,224
String () { return myName; }
toString
247,225
void (EditorEx editor, int startLine, int endLine, boolean showFolding, boolean showGutter) { FoldingModelEx foldingModel = editor.getFoldingModel(); boolean isFoldingEnabled = foldingModel.isFoldingEnabled(); if (!showFolding) { foldingModel.setFoldingEnabled(false); } int textImageWidth; int markersImageWidth; int te...
doInit
247,226
Dimension () { return new Dimension(textImageWidth + markersImageWidth, textImageHeight); }
getPreferredSize
247,227
void (Graphics graphics) { if (markersImage != null) { StartupUiUtil.drawImage(graphics, markersImage, 0, 0, null); StartupUiUtil.drawImage(graphics, textImage, rowHeader.getWidth(), 0, null); } else { StartupUiUtil.drawImage(graphics, textImage, 0, 0, null); } }
paintComponent
247,228
EditorEx () { return myEditor; }
getEditor
247,229
int () { return myStartLine; }
getStartLine
247,230
int () { return myEndLine; }
getEndLine
247,231
boolean () { return myShowFolding; }
showFolding
247,232
boolean () { return myShowGutter; }
showGutter
247,233
int (@NotNull Editor editor) { Component component = editor.getComponent(); int screenWidth = ScreenUtil.getScreenRectangle(component).width; if (screenWidth > 0) return screenWidth; Window window = SwingUtilities.getWindowAncestor(component); return window == null ? Integer.MAX_VALUE : window.getWidth(); }
getWidthLimit
247,234
EditorFragmentComponent (Editor editor, int startLine, int endLine, boolean showFolding, boolean showGutter) { return createEditorFragmentComponent(editor, startLine, endLine, showFolding, showGutter, true); }
createEditorFragmentComponent
247,235
EditorFragmentComponent (Editor editor, int startLine, int endLine, boolean showFolding, boolean showGutter, boolean useCaretRowBackground) { final EditorEx editorEx = (EditorEx)editor; final Color old = editorEx.getBackgroundColor(); Color backColor = getBackgroundColor(editor, useCaretRowBackground); editorEx.setBack...
createEditorFragmentComponent
247,236
Color (@NotNull Editor editor) { return getBackgroundColor(editor, true); }
getBackgroundColor
247,237
Color (@NotNull Editor editor, boolean useCaretRowBackground) { EditorColorsScheme colorsScheme = editor.getColorsScheme(); Color color = colorsScheme.getColor(EditorColors.CARET_ROW_COLOR); if (!useCaretRowBackground || color == null){ color = editor instanceof EditorEx ? ((EditorEx)editor).getBackgroundColor() : colo...
getBackgroundColor
247,238
CompoundBorder (@NotNull Editor editor) { Color borderColor = editor.getColorsScheme().getColor(EditorColors.SELECTED_TEARLINE_COLOR); Border outsideBorder = JBUI.Borders.customLine(borderColor, LINE_BORDER_THICKNESS); Border insideBorder = JBUI.Borders.empty(EMPTY_BORDER_THICKNESS); return BorderFactory.createCompound...
createEditorFragmentBorder
247,239
int (@NotNull Editor editor) { int availableVisualLines = 2; JComponent editorComponent = editor.getComponent(); Container editorComponentParent = editorComponent.getParent(); if (editorComponentParent != null) { JRootPane rootPane = editorComponent.getRootPane(); if (rootPane != null) { Container contentPane = rootPan...
getAvailableVisualLinesAboveEditor
247,240
void () { // needed for Alt-Q multiple times // Q: not good? SwingUtilities.invokeLater( () -> super.hide() ); }
hide
247,241
TooltipController () { return ApplicationManager.getApplication().getService(TooltipController.class); }
getInstance
247,242
void () { hideCurrentTooltip(); }
cancelTooltips
247,243
void (@NotNull TooltipGroup groupId, MouseEvent mouseEvent, boolean forced) { if (groupId.equals(myCurrentTooltipGroup) && (forced || !shouldSurvive(mouseEvent))) { cancelTooltips(); } }
cancelTooltip
247,244
void () { if (myCurrentTooltip != null) { LightweightHint currentTooltip = myCurrentTooltip; myCurrentTooltip = null; currentTooltip.hide(); myCurrentTooltipGroup = null; IdeTooltipManager.getInstance().hide(null); } }
hideCurrentTooltip
247,245
void (@NotNull Editor editor, @NotNull Point p, @NotNull @NlsContexts.Tooltip String text, boolean alignToRight, @NotNull TooltipGroup group) { TooltipRenderer tooltipRenderer = ((EditorMarkupModel)editor.getMarkupModel()).getErrorStripTooltipRendererProvider().calcTooltipRenderer(text); showTooltip(editor, p, tooltipR...
showTooltip
247,246
void (@NotNull Editor editor, @NotNull Point p, @NotNull @NlsContexts.Tooltip String text, int currentWidth, boolean alignToRight, @NotNull TooltipGroup group) { TooltipRenderer tooltipRenderer = ((EditorMarkupModel)editor.getMarkupModel()).getErrorStripTooltipRendererProvider().calcTooltipRenderer(text, currentWidth);...
showTooltip
247,247
void (@NotNull Editor editor, @NotNull Point p, @NotNull @NlsContexts.Tooltip String text, int currentWidth, boolean alignToRight, @NotNull TooltipGroup group, @NotNull HintHint hintHint) { TooltipRenderer tooltipRenderer = ((EditorMarkupModel)editor.getMarkupModel()).getErrorStripTooltipRendererProvider().calcTooltipR...
showTooltip
247,248
void (@NotNull Editor editor, @NotNull Point p, @NotNull TooltipRenderer tooltipRenderer, boolean alignToRight, @NotNull TooltipGroup group) { showTooltip(editor, p, tooltipRenderer, alignToRight, group, new HintHint(editor, p)); }
showTooltip
247,249
void (@NotNull Editor editor, @NotNull Point p, @NotNull TooltipRenderer tooltipRenderer, boolean alignToRight, @NotNull TooltipGroup group, @NotNull HintHint hintInfo) { doShowTooltip(editor, p, tooltipRenderer, alignToRight, group, hintInfo); }
showTooltip
247,250
boolean (MouseEvent e) { return myCurrentTooltip != null && myCurrentTooltip.canControlAutoHide(); }
shouldSurvive
247,251
void (@NotNull LightweightHint lightweightHint) { if (myCurrentTooltip != null && myCurrentTooltip.equals(lightweightHint)) { hideCurrentTooltip(); } }
hide
247,252
void () { myCurrentTooltip = null; myCurrentTooltipGroup = null; myCurrentTooltipObject = null; }
resetCurrent
247,253
LightweightHint (final @NotNull Editor editor, @NotNull Point p, boolean alignToRight, @NotNull TooltipGroup group, @NotNull HintHint intInfo) { final JComponent editorComponent = editor.getComponent(); TextRange range = myDocumentFragment.getTextRange(); int startOffset = range.getStartOffset(); int endOffset = range....
show
247,254
boolean (final @NotNull String ref, final @NotNull Editor editor) { return EP_NAME.computeSafeIfAny(ep -> { if (ref.startsWith(ep.prefix)) { String refSuffix = ref.substring(ep.prefix.length()); return ep.getInstance().handleLink(refSuffix.replaceAll("<br/>", "\n"), editor); } return null; }) == Boolean.TRUE; }
handleLink
247,255
String (@NotNull String ref, @NotNull Editor editor) { return Objects.requireNonNull(EP_NAME.computeSafeIfAny(ep -> { if (ref.startsWith(ep.prefix)) { String refSuffix = ref.substring(ep.prefix.length()); return ep.getInstance().getDescriptionTitle(refSuffix, editor); } return IdeBundle.message("inspection.message.insp...
getDescriptionTitle
247,256
JPanel (@NotNull HintHint hintHint, @NotNull JScrollPane pane, @NotNull JEditorPane editorPane, boolean highlightActions, boolean hasSeparators) { int leftBorder = 10; int rightBorder = 12; final class MyPanel extends JPanel implements WidthBasedLayout { private MyPanel() { super(new GridBagLayout()); } @Override publi...
createMainPanel
247,257
int () { return getPreferredSize().width; }
getPreferredWidth
247,258
int (int width) { Dimension size = editorPane.getSize(); int editorPaneInsets = leftBorder + rightBorder + getSideComponentWidth(); editorPane.setSize(width - editorPaneInsets, Math.max(1, size.height)); int height; try { height = getPreferredSize().height; if (width - editorPaneInsets < editorPane.getMinimumSize().wid...
getPreferredHeight
247,259
AccessibleContext () { return new AccessibleContextDelegate(editorPane.getAccessibleContext()) { @Override protected Container getDelegateParent() { return getParent(); } }; }
getAccessibleContext
247,260
Container () { return getParent(); }
getDelegateParent
247,261
int () { GridBagLayout layout = (GridBagLayout)getLayout(); Component sideComponent = null; GridBagConstraints sideComponentConstraints = null; boolean unsupportedLayout = false; for (Component component : getComponents()) { GridBagConstraints c = layout.getConstraints(component); if (c.gridx > 0) { if (sideComponent =...
getSideComponentWidth
247,262
LightweightHint (@NotNull Editor editor, @NotNull Point p, boolean alignToRight, @NotNull TooltipGroup group, @NotNull HintHint hintHint) { LightweightHint hint = createHint(editor, p, alignToRight, group, hintHint, true, true, null); if (hint != null) { HintManagerImpl.getInstanceImpl().showEditorHint(hint, editor, p,...
show
247,263
LightweightHint (@NotNull Editor editor, @NotNull Point p, boolean alignToRight, @NotNull TooltipGroup group, @NotNull HintHint hintHint, boolean highlightActions, boolean limitWidthToScreen, @Nullable TooltipReloader tooltipReloader) { if (myText == null) return null; //setup text //noinspection HardCodedStringLiteral...
createHint
247,264
Component (Container aContainer) { return editorPane; }
getDefaultComponent
247,265
boolean () { return true; }
getImplicitDownCycleTraversal
247,266
void () { super.hide(); for (AnAction action: actions) { action.unregisterCustomShortcutSet(contentComponent); } }
hide
247,267
boolean (TooltipEvent event) { if (!LineTooltipRenderer.this.canAutoHideOn(event)) { return false; } return super.canAutoHideOn(event); }
canAutoHideOn
247,268
void (HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.EXITED) { return; } if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { URL url = e.getURL(); if (url != null) { BrowserUtil.browse(url); hint.hide(); return; } String description = e.getDescription(); if (description != null && handle...
hyperlinkUpdate
247,269
String (@NotNull String html) { String body = UIUtil.getHtmlBody(html); List<String> parts = StringUtil.split(body, UIUtil.BORDER_LINE, true, false); if (parts.size() <= 1) return html; StringBuilder b = new StringBuilder(); for (String part : parts) { boolean addBorder = b.length() > 0; b.append("<div"); if (addBorder...
colorizeSeparators
247,270
boolean (@NotNull String dressedText) { return isActiveHtml(dressedText); }
isContentAction
247,271
boolean (@NotNull TooltipEvent event) { return true; }
canAutoHideOn
247,272
void (@NotNull LightweightHint hint, @NotNull Editor editor, @NotNull Point p, @NotNull JComponent pane, boolean alignToRight, @NotNull TooltipGroup group, @NotNull HintHint hintHint, boolean expand) { //required for immediately showing. Otherwise there are several concurrent issues hint.hide(); hintHint.setShowImmedia...
reloadFor
247,273
void (@NotNull Editor editor, @NotNull JPanel component, @NotNull LightweightHint hint, @NotNull HintHint hintHint, @NotNull List<? super AnAction> actions, @NotNull TooltipReloader expandCallback, boolean highlightActions) { if (!ExperimentalUI.isNewUI()) { hintHint.setComponentBorder(JBUI.Borders.empty()); hintHint.s...
fillPanel
247,274
boolean (@NotNull String ref, @NotNull Editor editor) { // @kirillk please don't remove this call anymore return TooltipLinkHandlerEP.handleLink(ref, editor); }
handle
247,275
void (@NotNull Editor editor, @NotNull JComponent tooltipComponent, @NotNull Point p, boolean alignToRight, boolean expanded, int currentWidth) { JComponent editorComponent = editor.getComponent(); JLayeredPane layeredPane = editorComponent.getRootPane().getLayeredPane(); int widthLimit = layeredPane.getWidth() - 10; i...
correctLocation
247,276
Dimension (@NotNull Editor editor, @NotNull Point p, boolean alignToRight, boolean expanded, @NotNull JComponent tooltipComponent, @NotNull JLayeredPane layeredPane, int widthLimit, int heightLimit, int currentWidth) { Dimension preferredSize = tooltipComponent.getPreferredSize(); int width = expanded ? 3 * currentWidt...
correctLocation
247,277
void (@NotNull Editor editor, @NotNull JComponent editorComponent, @NotNull Point p, int width, int height, int heightLimit) { PointerInfo pointerInfo = MouseInfo.getPointerInfo(); if (pointerInfo == null) return; Point mouse = pointerInfo.getLocation(); SwingUtilities.convertPointFromScreen(mouse, editorComponent); Re...
locateOutsideMouseCursor
247,278
LineTooltipRenderer (@Tooltip @Nullable String text, int width) { return new LineTooltipRenderer(text, width, getEqualityObjects()); }
createRenderer
247,279
boolean (@NotNull String html) { return html.contains("</a>"); }
isActiveHtml
247,280
void (@NotNull String text) { @NonNls String newBody; if (myText == null) { newBody = UIUtil.getHtmlBody(text); } else { String html1 = UIUtil.getHtmlBody(myText); String html2 = UIUtil.getHtmlBody(text); newBody = html1 + UIUtil.BORDER_LINE + html2; } myText = XmlStringUtil.wrapInHtml(newBody); }
addBelow
247,281
void (@NotNull AnActionEvent e) { // The tooltip gets the focus if using a screen reader and invocation through a keyboard shortcut. myHintHint.setRequestFocus(ScreenReader.isActive() && e.getInputEvent() instanceof KeyEvent); TooltipActionsLogger.logShowDescription(e.getProject(), TooltipActionsLogger.Source.Shortcut,...
actionPerformed
247,282
boolean (QuestionAction action) { ThreadingAssertions.assertEventDispatchThread(); return myQuestionAction == null || HintManagerImpl.getPriority(myQuestionAction) <= HintManagerImpl.getPriority(action); }
canShowQuestionAction
247,283
void (@NotNull CaretEvent e) { hideHints(HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_CARET_MOVE, false, false); }
caretPositionChanged
247,284
void (@NotNull SelectionEvent e) { hideHints(HintManager.HIDE_BY_CARET_MOVE, false, false); }
selectionChanged
247,285
void (@NotNull EditorMouseEvent event) { hideAllHints(); }
mousePressed
247,286
void (@NotNull DocumentEvent event) { if (event.getOldLength() != 0 || event.getNewLength() != 0) onDocumentChange(); }
documentChangedNonBulk
247,287
void (@NotNull Document document) { onDocumentChange(); }
bulkUpdateFinished
247,288
void () { EDT.assertIsEdt(); for (HintManagerImpl.HintInfo info : myHintsStack) { if (BitUtil.isSet(info.flags(), HintManager.HIDE_BY_TEXT_CHANGE)) { info.hint().hide(); myHintsStack.remove(info); } } if (myHintsStack.isEmpty()) { updateLastEditor(null); } }
onDocumentChange
247,289
void (boolean requestFocus) { myRequestFocusForNextHint = requestFocus; }
setRequestFocusForNextHint
247,290
boolean () { ThreadingAssertions.assertEventDispatchThread(); if (myQuestionAction != null && myQuestionHint != null) { if (myQuestionHint.isVisible()) { if (LOG.isDebugEnabled()) { LOG.debug("performing an action:" + myQuestionAction); } if (myQuestionAction.execute()) { if (myQuestionHint != null) { myQuestionHint.hi...
performCurrentQuestionAction
247,291
void (VisibleAreaEvent e) { EDT.assertIsEdt(); for (HintManagerImpl.HintInfo info : myHintsStack) { if (info.hint() != null && BitUtil.isSet(info.flags(), HintManager.UPDATE_BY_SCROLLING)) { HintManagerImpl.updateScrollableHintPosition(e, info.hint(), BitUtil.isSet(info.flags(), HintManager.HIDE_IF_OUT_OF_EDITOR)); } }...
updateScrollableHints
247,292
boolean (boolean willShowTooltip) { EDT.assertIsEdt(); for (HintManagerImpl.HintInfo hintInfo : myHintsStack) { if (hintInfo.hint().isVisible() && BitUtil.isSet(hintInfo.flags(), HintManager.HIDE_BY_OTHER_HINT)) return true; if (willShowTooltip && hintInfo.hint().isAwtTooltip()) { // only one AWT tooltip can be visible...
hasShownHintsThatWillHideByOtherHint
247,293
void (@NotNull LightweightHint hint, @NotNull Editor editor, @NotNull HintHint hintInfo, int lineNumber, int horizontalOffset, int flags, int timeout, boolean reviveOnEditorChange, @Nullable Runnable onHintHidden) { Point point = HintManagerImpl.getHintPosition(hint, editor, new LogicalPosition(lineNumber, 0), HintMana...
showGutterHint
247,294
void (@NotNull LightweightHint hint, @NotNull Editor editor, @NotNull HintHint hintInfo, @NotNull Point p, @HintManager.HideFlags int flags, int timeout, boolean reviveOnEditorChange, @Nullable Runnable onHintHidden) { EDT.assertIsEdt(); myHideAlarm.cancelAllRequests(); hideHints(HintManager.HIDE_BY_OTHER_HINT, false, ...
showEditorHint
247,295
void (MouseEvent e) { myHideAlarm.cancelAllRequests(); }
mousePressed
247,296
void (FocusEvent e) { myHideAlarm.cancelAllRequests(); }
focusGained
247,297
void (MouseEvent e) { hideHints(HintManager.HIDE_BY_MOUSEOVER, true, false); }
mouseMoved
247,298
void (final @NotNull JComponent component, @NotNull RelativePoint p, int flags, int timeout, @Nullable Runnable onHintHidden) { EDT.assertIsEdt(); myHideAlarm.cancelAllRequests(); hideHints(HintManager.HIDE_BY_OTHER_HINT, false, false); ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBu...
showHint
247,299
void (MouseEvent e) { myHideAlarm.cancelAllRequests(); }
mousePressed