Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
281,300
void (@NotNull Container container) { assert SwingUtilities.isEventDispatchThread(); AWTAccessor.getComponentAccessor().setParent(container, null); container.removeAll(); for (ComponentListener c : container.getComponentListeners()) container.removeComponentListener(c); for (FocusListener c : container.getFocusListeners()) container.removeFocusListener(c); for (HierarchyListener c : container.getHierarchyListeners()) container.removeHierarchyListener(c); for (HierarchyBoundsListener c : container.getHierarchyBoundsListeners()) container.removeHierarchyBoundsListener(c); for (KeyListener c : container.getKeyListeners()) container.removeKeyListener(c); for (MouseListener c : container.getMouseListeners()) container.removeMouseListener(c); for (MouseMotionListener c : container.getMouseMotionListeners()) container.removeMouseMotionListener(c); for (MouseWheelListener c : container.getMouseWheelListeners()) container.removeMouseWheelListener(c); for (InputMethodListener c : container.getInputMethodListeners()) container.removeInputMethodListener(c); for (PropertyChangeListener c : container.getPropertyChangeListeners()) container.removePropertyChangeListener(c); for (ContainerListener c : container.getContainerListeners()) container.removeContainerListener(c); }
removePotentiallyLeakingReferences
281,301
void () { super.createComponent(); TextFieldWithBrowseButton.MyDoClickAction doClickAction = getDoClickAction(); if (doClickAction != null) { doClickAction.registerShortcut(getTextField()); } myTextField.getDocument().addDocumentListener(new DocumentAdapter() { @Override public void textChanged(@NotNull DocumentEvent event) { if (getChangeListener() != null) { getChangeListener().run(); } } }); }
createComponent
281,302
void (@NotNull DocumentEvent event) { if (getChangeListener() != null) { getChangeListener().run(); } }
textChanged
281,303
String () { return myTextField.getText(); }
getText
281,304
void (String text) { myTextField.setText(text); }
setText
281,305
JTextField () { return myTextField; }
getTextField
281,306
FieldPanel (@NlsContexts.Label String labelText, @NlsContexts.DialogTitle String viewerDialogTitle) { return create(labelText, viewerDialogTitle, null, null); }
create
281,307
FieldPanel (@NlsContexts.Label String labelText, @NlsContexts.DialogTitle String viewerDialogTitle) { return withPaths(labelText, viewerDialogTitle, null, null); }
withPaths
281,308
FieldPanel (@NlsContexts.Label String labelText, @NlsContexts.DialogTitle String viewerDialogTitle, ActionListener browseButtonActionListener, Runnable documentListener) { FieldPanel fieldPanel = create(labelText, viewerDialogTitle, browseButtonActionListener, documentListener); InsertPathAction.addTo(fieldPanel.myTextField); return fieldPanel; }
withPaths
281,309
FieldPanel (@NlsContexts.Label String labelText, @NlsContexts.DialogTitle String viewerDialogTitle, ActionListener browseButtonActionListener, Runnable documentListener) { return new FieldPanel(labelText, viewerDialogTitle, browseButtonActionListener, documentListener); }
create
281,310
void (boolean editable) { myTextField.setEditable(editable); for (JButton button : myButtons) { button.setEnabled(editable); } }
setEditable
281,311
EnumSet<E> (@NotNull Class<E> en) { return EnumSet.allOf(en); }
createEnumSet
281,312
int () { return myList.size(); }
getSize
281,313
E (int index) { return myList.get(index); }
getElementAt
281,314
void (Object item) { @SuppressWarnings("unchecked") E e = (E)item; setSelectedItem(e); }
setSelectedItem
281,315
void (E item) { mySelected = item; fireContentsChanged(this, 0, getSize()); }
setSelectedItem
281,316
E () { return mySelected; }
getSelectedItem
281,317
Insets (Component c) { return myGearLabel.getIcon() == null ? super.getBorderInsets(c) : new JBInsets(0, 5, 0, 0); }
getBorderInsets
281,318
void (Component component, Graphics graphics, int x, int y) { if (!StringUtil.isEmpty(myLabel.getText())) { icon.paintIcon(component, graphics, x, y); } }
paintIcon
281,319
int () { return icon.getIconWidth(); }
getIconWidth
281,320
int () { return icon.getIconHeight(); }
getIconHeight
281,321
Dimension () { Dimension size = super.getPreferredSize(); if (myGearLabel.getIcon() == null && (myCloseButton == null || !myCloseButton.isVisible())) { size.width = 0; } return size; }
getPreferredSize
281,322
Insets (Component c) { return myGearLabel.getIcon() == null && (myCloseButton == null || !myCloseButton.isVisible()) ? super.getBorderInsets(c) : new JBInsets(0, 16, 0, 0); }
getBorderInsets
281,323
NamedBorder () { return withName(JBUI.Borders.empty(JBUI.CurrentTheme.Editor.Notification.borderInsetsWithoutStatus()), BORDER_WITHOUT_STATUS); }
borderWithoutStatus
281,324
NamedBorder () { return withName(JBUI.Borders.empty(JBUI.CurrentTheme.Editor.Notification.borderInsets()), BORDER_WITH_STATUS); }
borderWithStatus
281,325
void () { String borderName = null; if (getBorder() instanceof NamedBorder border) { borderName = border.getName(); } setUI(new BasicPanelUI() { @Override protected void installDefaults(JPanel p) {} }); Border updatedBorder = null; if (borderName != null) { updatedBorder = switch (borderName) { case BORDER_WITHOUT_STATUS -> borderWithoutStatus(); case BORDER_WITH_STATUS -> borderWithStatus(); default -> null; // Someone set their own border, leave it alone. }; } if (updatedBorder != null) { setBorder(updatedBorder); } }
updateUI
281,326
Color () { return ObjectUtils.notNull(getOverriddenBackgroundColor(), ObjectUtils.notNull(mySchemeSupplier.get().getColor(getBackgroundColorKey()), getFallbackBackgroundColor())); }
getBackground
281,327
Color () { return UIUtil.getToolTipBackground(); }
getFallbackBackgroundColor
281,328
void (@NotNull Consumer<? super Class<?>> classConsumer) { myClassConsumer = classConsumer; }
setClassConsumer
281,329
Color () { return UIUtil.getPanelBackground(); }
getToolbarBackground
281,330
void (@NotNull @Label String text) { myLabel.setText(text); }
setText
281,331
EditorNotificationPanel (@NotNull @Label String text) { myLabel.setText(text); return this; }
text
281,332
EditorNotificationPanel (@NotNull Icon icon) { myLabel.setIcon(icon); return this; }
icon
281,333
EditorNotificationPanel () { myLabel.setIcon(null); return this; }
noIcon
281,334
HyperlinkLabel (@NotNull @LinkLabel String text, @NotNull @NonNls String actionId) { return createActionLabel(text, actionId, true); }
createActionLabel
281,335
HyperlinkLabel (@NotNull @LinkLabel String text, @NotNull @NonNls String actionId, boolean showInIntentionMenu) { return createActionLabel(text, () -> executeAction(actionId), showInIntentionMenu); }
createActionLabel
281,336
HyperlinkLabel (@NotNull @LinkLabel String text, @NotNull Runnable action) { return createActionLabel(text, action, true); }
createActionLabel
281,337
Icon () { if (CLOSE_ICON == null) { CLOSE_ICON = ExpUiIcons.General.Close; } return CLOSE_ICON; }
getCloseIcon
281,338
InplaceButton (@NotNull Runnable action) { myCloseAction = action; if (myCloseButton == null) { myCloseButton = new InplaceButton(IdeBundle.message("editor.banner.close.tooltip"), getCloseIcon(), e -> { myCloseAction.run(); }); myCloseButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); if (myLastPanel == null) { myLinksPanel.add(myCloseButton); } else { myLastPanel.add(myCloseButton); } } return myCloseButton; }
setCloseAction
281,339
HyperlinkLabel (@NotNull @LinkLabel String text, @NotNull Runnable action, boolean showInIntentionMenu) { return new ActionHyperlinkLabel(text, withLogNotifications(action), showInIntentionMenu); }
createActionLabel
281,340
HyperlinkLabel (@NotNull @LinkLabel String text, @NotNull ActionHandler handler, boolean showInIntentionMenu) { return new ActionHyperlinkLabel(text, withNotifications(handler), showInIntentionMenu); }
createActionLabel
281,341
void () { myLabel.setText(""); myLinksPanel.removeAll(); }
clear
281,342
void (@NonNls String actionId) { AnAction action = ActionManager.getInstance().getAction(actionId); DataContext dataContext = DataManager.getInstance().getDataContext(this); AnActionEvent event = AnActionEvent.createFromAnAction(action, null, getActionPlace(), dataContext); if (ActionUtil.lastUpdateAndCheckDumb(action, event, true)) { ActionUtil.performActionDumbAwareWithCallbacks(action, event); } }
executeAction
281,343
String () { return ActionPlaces.UNKNOWN; }
getActionPlace
281,344
double () { return (this.getClass().hashCode() % Integer.MAX_VALUE) / (double) Integer.MAX_VALUE; }
getWeight
281,345
void (@NotNull Object handlerClass) { myClassConsumer.accept(handlerClass.getClass()); }
logNotificationActionInvocation
281,346
void (@NotNull EditorNotificationPanel panel, @NotNull HyperlinkEvent e) { logNotificationActionInvocation(action); action.run(); }
handlePanelActionClick
281,347
void (@NotNull Editor editor, @NotNull PsiFile file) { logNotificationActionInvocation(action); action.run(); }
handleQuickFixClick
281,348
void (@NotNull EditorNotificationPanel panel, @NotNull HyperlinkEvent e) { logNotificationActionInvocation(handler); handler.handlePanelActionClick(panel, e); }
handlePanelActionClick
281,349
void (@NotNull Editor editor, @NotNull PsiFile file) { logNotificationActionInvocation(handler); handler.handleQuickFixClick(editor, file); }
handleQuickFixClick
281,350
void (@NotNull HyperlinkEvent e) { myHandler.handlePanelActionClick(EditorNotificationPanel.this, e); }
hyperlinkActivated
281,351
int (@Nls String text, FontMetrics fm) { if (mySizeLabel == null) { mySizeLabel = new JLabel(); } mySizeLabel.setText(text); mySizeLabel.setFont(fm.getFont()); return mySizeLabel.getPreferredSize().width; }
getStringWidth
281,352
boolean () { return myOptions.get(0).startInWriteAction(); }
startInWriteAction
281,353
List<IntentionAction> () { return myOptions.isEmpty() ? Collections.emptyList() : myOptions.subList(1, myOptions.size()); }
getOptions
281,354
String () { String textOverride = getIntentionActionText(); if (textOverride != null) { return textOverride; } if (!myOptions.isEmpty()) { return myOptions.get(0).getText(); } String text = myLabel.getText(); return StringUtil.isEmpty(text) ? EditorBundle.message("editor.notification.default.action.name") : StringUtil.shortenTextWithEllipsis(text, 50, 0); }
getText
281,355
Priority () { return getIntentionActionPriority(); }
getPriority
281,356
boolean (@NotNull Project project, Editor editor, PsiFile file) { return true; }
isAvailable
281,357
Icon (@IconFlags int flags) { return AllIcons.Actions.IntentionBulb; }
getIcon
281,358
boolean (@NotNull Project project, Editor editor, PsiFile file) { return true; }
isAvailable
281,359
boolean () { return false; }
startInWriteAction
281,360
boolean (@NotNull Project project, Editor editor, PsiFile file) { return true; }
isAvailable
281,361
boolean () { return false; }
startInWriteAction
281,362
Icon (@IconFlags int flags) { return myLabel.getIcon(); }
getIcon
281,363
Icon () { // todo it can be different in PyCharm Pro return AllIcons.Ultimate.Lock; }
getPromoIcon
281,364
Icon () { return icon.get(); }
getIcon
281,365
void (Graphics g, double x1d, double y1d, double x2d, double y2d, Color color) { final Color oldColor = g.getColor(); g.setColor(color); int x1 = (int)Math.round(x1d); int x2 = (int)Math.round(x2d); int y1 = (int)Math.round(y1d); int y2 = (int)Math.round(y2d); LinePainter2D.paint((Graphics2D)g, x1 + 1, y1, x2 - 1, y1); LinePainter2D.paint((Graphics2D)g, x1 + 1, y2, x2 - 1, y2); LinePainter2D.paint((Graphics2D)g, x1, y1 + 1, x1, y2 - 1); LinePainter2D.paint((Graphics2D)g, x2, y1 + 1, x2, y2 - 1); g.setColor(oldColor); }
drawRoundRect
281,366
void (Graphics g, int x1, int y1, int x2, int y2) { LinePainter2D.paint((Graphics2D)g, x1, y1, x2 - 1, y1); LinePainter2D.paint((Graphics2D)g, x2, y1, x2, y2 - 1); LinePainter2D.paint((Graphics2D)g, x1 + 1, y2, x2, y2); LinePainter2D.paint((Graphics2D)g, x1, y1 + 1, x1, y2); }
drawPlainRect
281,367
boolean () { return Registry.is("ui.no.bangs.and.whistles", false) || Registry.is("ui.simplified", false) || RemoteDesktopService.isRemoteSession() || PowerSaveMode.isEnabled(); }
isSimplifiedUI
281,368
void (Component comp, int x, int y) { }
invokePopup
281,369
void (MouseEvent e) { if (e.isPopupTrigger()) { invokePopup(e.getComponent(), e.getX(), e.getY()); e.consume(); } }
mouseClicked
281,370
void (MouseEvent e) { if (e.isPopupTrigger()) { invokePopup(e.getComponent(), e.getX(), e.getY()); e.consume(); } }
mousePressed
281,371
void (MouseEvent e) { if (e.isPopupTrigger()) { invokePopup(e.getComponent(), e.getX(), e.getY()); e.consume(); } }
mouseReleased
281,372
void (@NotNull JComponent component, @NotNull String groupId, @NotNull String place) { installPopupMenu(component, groupId, place); }
installPopupHandler
281,373
PopupHandler (@NotNull JComponent component, @NotNull String groupId, @NotNull String place) { return installPopupMenu(component, place, null, null, am -> { AnAction action = am.getAction(groupId); if (action instanceof ActionGroup) { return (ActionGroup)action; } LOG.warn("'" + groupId + "' invoked at '" + place + "' is " + (action == null ? "null" : "not an action group")); return null; }); }
installPopupMenu
281,374
MouseListener (@NotNull JComponent component, @NotNull ActionGroup group, @NotNull String place) { return installPopupMenu(component, place, null, null, __ -> group); }
installPopupHandler
281,375
PopupHandler (@NotNull JComponent component, @NotNull ActionGroup group, @NotNull String place) { return installPopupMenu(component, place, null, null, __ -> group); }
installPopupMenu
281,376
PopupHandler (@NotNull JComponent component, @NotNull ActionGroup group, @NotNull String place, @Nullable PopupMenuListener menuListener) { return installPopupMenu(component, place, null, menuListener, __ -> group); }
installPopupMenu
281,377
MouseListener (@NotNull JComponent component, @NotNull ActionGroup group, @NotNull String place, @Nullable ActionManager actionManager) { return installPopupMenu(component, place, actionManager, null, __ -> group); }
installPopupHandler
281,378
MouseListener (@NotNull JComponent component, @NotNull ActionGroup group, @NotNull String place, @Nullable ActionManager actionManager, @Nullable PopupMenuListener menuListener) { return installPopupMenu(component, place, actionManager, menuListener, __ -> group); }
installPopupHandler
281,379
PopupHandler (@NotNull JComponent component, @NotNull String place, @Nullable ActionManager actionManager, @Nullable PopupMenuListener menuListener, @NotNull Function<? super ActionManager, ? extends ActionGroup> group) { if (ApplicationManager.getApplication() == null) { return EMPTY_HANDLER; } PopupHandler popupHandler = new PopupHandler() { @Override public void invokePopup(Component comp, int x, int y) { ActionManager manager = actionManager == null ? ActionManager.getInstance() : actionManager; ActionGroup actionGroup = group.apply(manager); if (actionGroup == null) return; ActionPopupMenu popupMenu = manager.createActionPopupMenu(place, actionGroup); popupMenu.setTargetComponent(component); JPopupMenu menu = popupMenu.getComponent(); if (menuListener != null) { menu.addPopupMenuListener(menuListener); } menu.show(comp, x, y); } }; component.addMouseListener(popupHandler); return popupHandler; }
installPopupMenu
281,380
void (Component comp, int x, int y) { ActionManager manager = actionManager == null ? ActionManager.getInstance() : actionManager; ActionGroup actionGroup = group.apply(manager); if (actionGroup == null) return; ActionPopupMenu popupMenu = manager.createActionPopupMenu(place, actionGroup); popupMenu.setTargetComponent(component); JPopupMenu menu = popupMenu.getComponent(); if (menuListener != null) { menu.addPopupMenuListener(menuListener); } menu.show(comp, x, y); }
invokePopup
281,381
PopupHandler (@NotNull JTree tree, @NotNull ActionGroup group, @NotNull String place) { return installConditionalPopup(tree, group, place, null, (comp, x, y) -> { return tree.getPathForLocation(x, y) != null && Arrays.binarySearch(Objects.requireNonNull(tree.getSelectionRows()), tree.getRowForLocation(x, y)) > -1; }); }
installFollowingSelectionTreePopup
281,382
PopupHandler (@NotNull JTable table, @NotNull ActionGroup group, @NotNull String place) { return installConditionalPopup(table, group, place, null, (comp, x, y) -> Arrays.binarySearch(table.getSelectedRows(), table.rowAtPoint(new Point(x, y))) > -1); }
installRowSelectionTablePopup
281,383
PopupHandler (@NotNull JList<?> list, @NotNull ActionGroup group, @NotNull String place) { return installConditionalPopup(list, group, place, null, (comp, x, y) -> ListUtil.isPointOnSelection(list, x, y)); }
installSelectionListPopup
281,384
PopupHandler (@NotNull JComponent component, @NotNull ActionGroup group, @NotNull String place, @Nullable ActionManager actionManager, @NotNull ShowPopupPredicate condition) { if (ApplicationManager.getApplication() == null) { return EMPTY_HANDLER; } PopupHandler handler = new PopupHandler() { @Override public void invokePopup(Component comp, int x, int y) { if (condition.shouldShowPopup(comp, x, y)) { ActionManager manager = actionManager == null ? ActionManager.getInstance() : actionManager; ActionPopupMenu popupMenu = manager.createActionPopupMenu(place, group); popupMenu.getComponent().show(comp, x, y); } } }; component.addMouseListener(handler); return handler; }
installConditionalPopup
281,385
void (Component comp, int x, int y) { if (condition.shouldShowPopup(comp, x, y)) { ActionManager manager = actionManager == null ? ActionManager.getInstance() : actionManager; ActionPopupMenu popupMenu = manager.createActionPopupMenu(place, group); popupMenu.getComponent().show(comp, x, y); } }
invokePopup
281,386
MouseListener (JComponent component, ActionGroup group, ActionManager actionManager) { return installPopupMenu(component, ActionPlaces.UNKNOWN, actionManager, null, __ -> group); }
installUnknownPopupHandler
281,387
MouseListener (JComponent component, ActionGroup group) { return installPopupMenu(component, ActionPlaces.UNKNOWN, null, null, __ -> group); }
installUnknownPopupHandler
281,388
StatusText () { return myList.getEmptyText(); }
getEmptyText
281,389
JPanel () { return myContentPane; }
getContentPane
281,390
void (int index, boolean value) { final Pair<T, Boolean> pair = myWorkingList.remove(index); myWorkingList.add(index, Pair.create(pair.first, value)); }
checkBoxSelectionChanged
281,391
void () { myList = new CheckBoxList(this); myList.setBorder(null); myListModel = (DefaultListModel)myList.getModel(); }
createUIComponents
281,392
void () { myWorkingList = new ArrayList<>(myInitialList); refresh(); }
reset
281,393
int () { return myList.getSelectedIndex(); }
getSelectedIndex
281,394
void (final int index) { myList.setSelectedIndex(index); }
setSelectedIndex
281,395
boolean (final int index) { getCurrentModel().remove(index); refresh(); if (index < getCurrentModel().size()) { setSelectedIndex(index); return true; } else if (index > 0) { setSelectedIndex(index - 1); return true; } return false; }
removeAt
281,396
boolean () { final int selectedIndex = getSelectedIndex(); // selected index if (selectedIndex != -1) { return removeAt(selectedIndex); } return false; }
removeSelected
281,397
boolean () { return !myWorkingList.equals(myInitialList); }
isModified
281,398
void (final @NotNull List<Pair<T, Boolean>> list) { myInitialList = list; }
setInitialList
281,399
void () { myInitialList.clear(); myInitialList.addAll(myWorkingList); }
apply