Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
245,500
Content (String displayName) { for (Content content : contents) { if (content.getDisplayName().equals(displayName)) { return content; } } return null; }
findContent
245,501
Content (int index) { return index >= 0 && index < contents.size() ? contents.get(index) : null; }
getContent
245,502
Content (@NotNull JComponent component) { Content[] contents = getContents(); for (Content content : contents) { if (SwingUtilities.isDescendingFrom(component, content.getComponent())) { return content; } } return null; }
getContent
245,503
int (@NotNull Content content) { return contents.indexOf(content); }
getIndexOfContent
245,504
String () { return myUI.getCloseActionName(); }
getCloseActionName
245,505
String () { return myUI.getCloseAllButThisActionName(); }
getCloseAllButThisActionName
245,506
String () { return myUI.getPreviousContentActionName(); }
getPreviousContentActionName
245,507
String () { return myUI.getNextContentActionName(); }
getNextContentActionName
245,508
List<AnAction> (final @NotNull Content content) { return Collections.emptyList(); }
getAdditionalPopupActions
245,509
boolean () { if (!canCloseContents()) { return false; } for (Content content : contents) { if (content.isCloseable()) { return true; } } return false; }
canCloseAllContents
245,510
void (final @NotNull Content content) { if (!checkSelectionChangeShouldBeProcessed(content, false)) return; if (getIndexOfContent(content) == -1) { throw new IllegalArgumentException("content not found: " + content); } if (!isSelected(content)) { mySelection.add(content); fireSelectionChanged(content, ContentManagerEve...
addSelectedContent
245,511
boolean (@NotNull Content content, boolean implicit) { if (!myUI.canChangeSelectionTo(content, implicit)) { return false; } boolean result = !isSelected(content) || myContentWithChangedComponent.contains(content); myContentWithChangedComponent.remove(content); return result; }
checkSelectionChangeShouldBeProcessed
245,512
void (@NotNull Content content) { if (!isSelected(content)) return; mySelection.remove(content); fireSelectionChanged(content, ContentManagerEvent.ContentOperation.remove); }
removeFromSelection
245,513
boolean (@NotNull Content content) { return mySelection.contains(content); }
isSelected
245,514
void (@NotNull Content content, boolean requestFocus) { setSelectedContentCB(content, requestFocus); }
setSelectedContent
245,515
ActionCallback (final @NotNull Content content, final boolean requestFocus) { return setSelectedContentCB(content, requestFocus, true); }
setSelectedContentCB
245,516
void (@NotNull Content content, boolean requestFocus, boolean forcedFocus) { setSelectedContentCB(content, requestFocus, forcedFocus); }
setSelectedContent
245,517
ActionCallback (final @NotNull Content content, final boolean requestFocus, final boolean forcedFocus) { return setSelectedContent(content, requestFocus, forcedFocus, false); }
setSelectedContentCB
245,518
ActionCallback (final @NotNull Content content, final boolean requestFocus, final boolean forcedFocus, boolean implicit) { mySelectionHistory.remove(content); mySelectionHistory.add(0, content); if (isSelected(content) && requestFocus) { requestFocusWithFallback(content); return ActionCallback.DONE; } if (!checkSelecti...
setSelectedContent
245,519
boolean () { boolean focused = false; final Content[] selection = getSelectedContents(); for (Content each : selection) { if (isFocusAncestorStrict(each.getComponent())) { focused = true; break; } } return focused; }
isSelectionHoldsFocus
245,520
boolean (JComponent component) { Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (owner == null) return false; return SwingUtilities.isDescendingFrom(owner, component); }
isFocusAncestorStrict
245,521
ActionCallback (@NotNull Content content) { return setSelectedContentCB(content, false); }
setSelectedContentCB
245,522
void (@NotNull Content content) { setSelectedContentCB(content); }
setSelectedContent
245,523
ActionCallback () { int contentCount = getContentCount(); LOG.assertTrue(contentCount > 1); Content selectedContent = getSelectedContent(); int index = selectedContent == null ? -1 : getIndexOfContent(selectedContent); index = (index - 1 + contentCount) % contentCount; final Content content = getContent(index); if (con...
selectPreviousContent
245,524
ActionCallback () { int contentCount = getContentCount(); LOG.assertTrue(contentCount > 1); Content selectedContent = getSelectedContent(); int index = selectedContent == null ? -1 : getIndexOfContent(selectedContent); index = (index + 1) % contentCount; final Content content = getContent(index); if (content == null) {...
selectNextContent
245,525
void (@NotNull ContentManagerListener l) { if (Registry.is("ide.content.manager.listeners.order.fix")) { myDispatcher.getListeners().add(l); return; } myDispatcher.getListeners().add(0, l); }
addContentManagerListener
245,526
void (@NotNull ContentManagerListener l) { myDispatcher.removeListener(l); }
removeContentManagerListener
245,527
void (@NotNull Content content, int newIndex) { ContentManagerEvent e = new ContentManagerEvent(this, content, newIndex, ContentManagerEvent.ContentOperation.add); myDispatcher.getMulticaster().contentAdded(e); }
fireContentAdded
245,528
void (@NotNull Content content, int oldIndex) { ContentManagerEvent e = new ContentManagerEvent(this, content, oldIndex, ContentManagerEvent.ContentOperation.remove); myDispatcher.getMulticaster().contentRemoved(e); }
fireContentRemoved
245,529
void (@NotNull Content content, ContentManagerEvent.ContentOperation operation) { ContentManagerEvent e = new ContentManagerEvent(this, content, getIndexOfContent(content), operation); myDispatcher.getMulticaster().selectionChanged(e); }
fireSelectionChanged
245,530
boolean (@NotNull Content content, int oldIndex) { ContentManagerEvent event = new ContentManagerEvent(this, content, oldIndex, ContentManagerEvent.ContentOperation.undefined); for (ContentManagerListener listener : myDispatcher.getListeners()) { listener.contentRemoveQuery(event); if (event.isConsumed()) { return fals...
fireContentRemoveQuery
245,531
ActionCallback (final Content content, final boolean forced) { final Content toSelect = content == null ? getSelectedContent() : content; if (toSelect == null) return ActionCallback.REJECTED; assert contents.contains(toSelect); JComponent preferredFocusableComponent = toSelect.getPreferredFocusableComponent(); return p...
requestFocus
245,532
void (Content content) { requestFocus(content, true).doWhenRejected(() -> { getFocusManager().requestFocusInProject(getComponent(), myProject); }); }
requestFocusWithFallback
245,533
IdeFocusManager () { return IdeFocusManager.getInstance(myProject); }
getFocusManager
245,534
void (final @NotNull DataProvider provider) { dataProviders.add(provider); }
addDataProvider
245,535
void (@NotNull PropertyChangeEvent event) { if (Content.PROP_COMPONENT.equals(event.getPropertyName())) { myContentWithChangedComponent.add((Content)event.getSource()); } }
propertyChange
245,536
ContentFactory () { return ContentFactory.getInstance(); }
getFactory
245,537
void () { if (!myDisposed) { myUI.beforeDispose(); } }
beforeTreeDispose
245,538
void () { if (myDisposed) return; myDisposed = true; contents.clear(); myNestedManagers.clear(); mySelection.clear(); myContentWithChangedComponent.clear(); myUI = null; myDispatcher.getListeners().clear(); dataProviders.clear(); myComponent = null; }
dispose
245,539
boolean () { return myDisposed; }
isDisposed
245,540
boolean () { return myUI.isSingleSelection(); }
isSingleSelection
245,541
boolean () { return SystemInfo.isMac && Registry.is("ide.mac.native.pipette") && JnaLoader.isLoaded(); }
canUseMacPipette
245,542
void () { PointerInfo pointerInfo = MouseInfo.getPointerInfo(); Color pixelColor = getPixelColor(pointerInfo.getLocation()); cancelPipette(); notifyListener(pixelColor, 0); setInitialColor(pixelColor); }
pickAndClose
245,543
Color (Point location) { if (SystemInfo.isMac) { BufferedImage image = MacColorPipette.captureScreen(myPickerFrame, new Rectangle(location.x, location.y, 1, 1)); if (image != null) { //noinspection UseJBColor return new Color(image.getRGB(0, 0)); } } return myRobot.getPixelColor(location.x, location.y); }
getPixelColor
245,544
void (@Nullable Color initialColor) { myInitialColor = initialColor; setColor(initialColor); }
setInitialColor
245,545
void (@Nullable Color color) { myCurrentColor = color; }
setColor
245,546
Dialog () { Dialog picker = getOrCreatePickerDialog(); updateLocation(); picker.setVisible(true); return picker; }
show
245,547
Dialog () { if (myPickerFrame == null) { Window owner = SwingUtilities.getWindowAncestor(myParent); if (owner instanceof Dialog) { myPickerFrame = new JDialog((Dialog)owner); } else if (owner instanceof Frame) { myPickerFrame = new JDialog((Frame)owner); } else { myPickerFrame = new JDialog(new JFrame()); } myPickerFra...
getOrCreatePickerDialog
245,548
void (MouseEvent e) { e.consume(); pickAndClose(); }
mousePressed
245,549
void (MouseEvent e) { e.consume(); }
mouseClicked
245,550
void (KeyEvent e) { switch (e.getKeyCode()) { case KeyEvent.VK_ESCAPE -> cancelPipette(); case KeyEvent.VK_ENTER -> pickAndClose(); } }
keyPressed
245,551
void (final @NotNull Color c, int delayMillis) { if (!myColorListenersNotifier.isDisposed()) { myColorListenersNotifier.cancelAllRequests(); myColorListenersNotifier.addRequest(() -> myColorListener.colorChanged(c, this), delayMillis); } }
notifyListener
245,552
boolean (Image image, int i, int i1, int i2, int i3, int i4) { return false; }
imageUpdate
245,553
void () { Dialog pickerDialog = getPickerDialog(); if (pickerDialog != null) { pickerDialog.setVisible(false); } Color initialColor = getInitialColor(); if (initialColor != null) { notifyListener(initialColor, 0); } }
cancelPipette
245,554
void () { UIUtil.dispose(myPickerFrame); myPickerFrame = null; setInitialColor(null); setColor(null); }
dispose
245,555
Dialog () { Dialog pickerDialog = getPickerDialog(); if (pickerDialog == null) { pickerDialog = super.getOrCreatePickerDialog(); pickerDialog.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent event) { super.keyPressed(event); int diff = BitUtil.isSet(event.getModifiers(), Event.SHIFT_MASK) ? 1...
getOrCreatePickerDialog
245,556
void (KeyEvent event) { super.keyPressed(event); int diff = BitUtil.isSet(event.getModifiers(), Event.SHIFT_MASK) ? 10 : 1; Point location = updateLocation(); if (myRobot != null && location != null) { switch (event.getKeyCode()) { case KeyEvent.VK_DOWN -> myRobot.mouseMove(location.x, location.y + diff); case KeyEvent...
keyPressed
245,557
void (Graphics g) { applyRenderingHints(g); Dialog pickerDialog = getPickerDialog(); if (pickerDialog != null && pickerDialog.isShowing()) { Point mouseLoc = updateLocation(); if (mouseLoc == null) return; //final int pixels = UIUtil.isRetina(graphics2d) ? PIXELS / 2 + 1 : PIXELS; int left = PIXELS / 2 + 1; Rectangle c...
paint
245,558
void (@NotNull Graphics graphics) { if (!(graphics instanceof Graphics2D g2d)) { return; } GraphicsUtil.applyRenderingHints(g2d); g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIAL...
applyRenderingHints
245,559
void (@NotNull Graphics2D graphics, @NotNull Point offset, @NotNull Color currentColor) { graphics.setColor(Gray._0.withAlpha(150)); int x = SIZE / 4 + offset.x; int y = SIZE * 3 / 4 + offset.y; int width = SIZE / 2; int height = SIZE / 8; graphics.fillRoundRect(x, y, width, height, 10, 10); graphics.setColor(Gray._255...
drawCurrentColorRectangle
245,560
void (@NotNull Graphics2D graphics, @NotNull Point offset, @NotNull Color currentColor) { graphics.setColor(ColorUtil.isDark(currentColor) ? Gray._255.withAlpha(150) : Gray._0.withAlpha(150)); graphics.drawRect((SIZE - ZOOM) / 2 + offset.x, (SIZE - ZOOM) / 2 + offset.y, ZOOM, ZOOM); }
drawCenterPixel
245,561
void (@NotNull Graphics2D graphics, @NotNull Point offset) { graphics.setColor(Gray._0.withAlpha(10)); for (int i = 0; i < PIXELS; i++) { int cellOffset = i * ZOOM; graphics.drawLine(cellOffset + offset.x, offset.y, cellOffset + offset.x, SIZE + offset.y); graphics.drawLine(offset.x, cellOffset + offset.y, SIZE + offse...
drawPixelGrid
245,562
void (@NotNull Color currentColor, @NotNull Graphics2D graphics, @NotNull Point offset) { graphics.setColor(currentColor.darker()); graphics.setStroke(new BasicStroke(5)); graphics.draw(new Ellipse2D.Double(offset.x, offset.y, SIZE, SIZE)); }
drawMagnifierBorder
245,563
boolean () { return captureScreen(null, new Rectangle(0, 0, 1, 1)) != null; }
isAvailable
245,564
Builder (Project project) { this.project = project; return this; }
withParent
245,565
Builder (Component parent) { this.parent = parent; return this; }
withParent
245,566
Builder (@NotNull @Nls String text) { cancelText = text; return this; }
withCancelText
245,567
Builder (@NotNull @Nls String text, int exitCode) { assert exitCode >= DialogWrapper.NEXT_USER_EXIT_CODE; customAction = pair(text, exitCode); return this; }
withCustomAction
245,568
int () { LegalNoticeDialog dialog = new LegalNoticeDialog(this); dialog.show(); return dialog.getExitCode(); }
show
245,569
Builder (@NotNull @NlsContexts.DialogTitle String title, @NotNull @NlsContexts.DialogMessage String message) { return new Builder(title, message); }
build
245,570
JComponent () { JPanel iconPanel = new JPanel(new BorderLayout()); iconPanel.add(new JBLabel(AllIcons.General.WarningDialog), BorderLayout.NORTH); JEditorPane messageArea = new JEditorPane(); messageArea.setEditorKit(HTMLEditorKitBuilder.simple()); messageArea.setEditable(false); messageArea.setPreferredSize(JBUI.size(...
createCenterPanel
245,571
void (@NotNull AnActionEvent e) { super.update(e); final String tooltip = myConfiguration.getTooltip(); if (tooltip != null) { e.getPresentation().setText(getTemplatePresentation().getText() + " (" + tooltip + ")"); e.getPresentation().setDescription(getTemplatePresentation().getDescription() + " (" + tooltip + ")"); }...
update
245,572
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
245,573
void (@NotNull AnActionEvent e) { final JPanel result = new JPanel(new BorderLayout()); final JLabel label = new JLabel(myConfiguration.getSelectText()); label.setBorder(BorderFactory.createEmptyBorder(4, 4, 0, 0)); JPanel wrapper = new JPanel(new BorderLayout()); wrapper.add(label, BorderLayout.NORTH); final Map<Integ...
actionPerformed
245,574
Dimension () { final Dimension size = super.getPreferredSize(); if (myWidth == null) { myWidth = 10; final FontMetrics fm = getFontMetrics(getFont()); for (JLabel confLabel : map.values()) { String text = confLabel.getText(); myWidth += fm.stringWidth(text + "W"); } } return new Dimension(myWidth, size.height); }
getPreferredSize
245,575
void (ActionEvent e) { saveSelection.run(); popupRef.get().closeOk(null); }
actionPerformed
245,576
void (ActionEvent e) { saveSelection.run(); popup.closeOk(null); }
actionPerformed
245,577
void (AnActionEvent e, JPanel result, JBPopup popup, InputEvent inputEvent) { if (inputEvent instanceof MouseEvent inputEvent1) { int width = result.getPreferredSize().width; Point point1 = new Point(inputEvent1.getX() - width / 2, inputEvent1.getY()); RelativePoint point = new RelativePoint(inputEvent1.getComponent(),...
show
245,578
JLabel (final @Nls String text) { JLabel label = new JLabel(text); label.setFont(StartupUiUtil.getLabelFont()); return label; }
markLabel
245,579
int () { return mySelected; }
getSelected
245,580
int () { return myMin; }
getMin
245,581
int () { return myMax; }
getMax
245,582
boolean () { return showOk; }
isShowOk
245,583
void (boolean showOk) { this.showOk = showOk; }
setShowOk
245,584
void (Component comp, Object constraints, int index) { if (myIsLocked) throw new UnsupportedOperationException(); super.addImpl(comp, constraints, index); }
addImpl
245,585
Dimension (final @NotNull Container parent) { Dimension size = new Dimension(); Dimension leftSize = myLeft.getPreferredSize(); Dimension rightSize = myRight.getPreferredSize(); size.width = leftSize.width + rightSize.width; size.height = Math.max(leftSize.height, rightSize.height); JBInsets.addTo(size, parent.getInset...
preferredLayoutSize
245,586
void (final @NotNull Container parent) { Insets insets = parent.getInsets(); Dimension size = parent.getSize(); Dimension prefSize = parent.getPreferredSize(); if (prefSize.width <= size.width) { myLeft.setBounds(insets.left, insets.top, myLeft.getPreferredSize().width, parent.getHeight() - insets.bottom); Dimension ri...
layoutContainer
245,587
void (JComponent comp, Container parent) { final Rectangle compBounds = comp.getBounds(); Insets insets = parent.getInsets(); int compHeight = comp.getPreferredSize().height; final int parentHeight = parent.getHeight() - insets.top - insets.bottom; if (compHeight > parentHeight) { compHeight = parentHeight; } int y = (...
toMakeVerticallyInCenter
245,588
Divider () { return new OnePixelDivider(isVertical(), this) { @Override public void paint(Graphics g) { final Rectangle bounds = g.getClipBounds(); g.setColor(myTable.getShowVerticalLines() ? myTable.getGridColor() : myTable.getBackground()); g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height); JTableHeader hea...
createDivider
245,589
void (Graphics g) { final Rectangle bounds = g.getClipBounds(); g.setColor(myTable.getShowVerticalLines() ? myTable.getGridColor() : myTable.getBackground()); g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height); JTableHeader header = myTreeTableHeader; Rectangle rect = header.getHeaderRect(0); g.setClip(rect.x,...
paint
245,590
void (ComponentEvent e) { tablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); }
componentShown
245,591
void (ComponentEvent e) { tablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); }
componentHidden
245,592
Component (JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { TreeColumnModel cm = (TreeColumnModel) myTreeTableHeader.getColumnModel(); TableCellRenderer renderer = getDefaultRenderer(TreeTableModel.class); return renderer.getTableCellRendererComponent(myTable, val...
getTreeCellRendererComponent
245,593
Tree () { return myTree; }
getTree
245,594
JBTable () { return myTable; }
getTable
245,595
void (@NotNull Class<?> columnClass, @NotNull TableCellRenderer renderer) { myTable.setDefaultRenderer(columnClass,renderer); }
setDefaultRenderer
245,596
TableCellRenderer (@NotNull Class<?> columnClass) { return myTable.getDefaultRenderer(columnClass); }
getDefaultRenderer
245,597
void (@NotNull TreeTableModel model) { myModel = model; myTree.setModel(model); myTable.setModel(new TreeTableModelAdapter(model, myTree, myTable)); TreeColumnModel tcm = (TreeColumnModel) myTreeTableHeader.getColumnModel(); if (tcm.treeColumnIndex >= 0) { myTable.removeColumn(myTable.getColumnModel().getColumn(tcm.tre...
setModel
245,598
void (float columnProportion) { myColumnProportion = columnProportion; split.setProportion(1f - ((myModel.getColumnCount() - 1) * columnProportion)); }
setColumnProportion
245,599
float () { return myColumnProportion; }
getColumnProportion