Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
278,200 | int (boolean fillVertically) { return fillVertically ? 1 : 0; } | getWeightY |
278,201 | JPanel () { return myPanel; } | getPanel |
278,202 | int () { return myLineCount; } | getLineCount |
278,203 | FormBuilder (boolean alignLabelOnRight) { myAlignLabelOnRight = alignLabelOnRight; return this; } | setAlignLabelOnRight |
278,204 | FormBuilder (boolean vertical) { myVertical = vertical; return this; } | setVertical |
278,205 | FormBuilder (int verticalGap) { myVerticalGap = verticalGap; return this; } | setVerticalGap |
278,206 | FormBuilder (int horizontalGap) { myHorizontalGap = horizontalGap; return this; } | setHorizontalGap |
278,207 | FormBuilder (int formLeftIndent) { myFormLeftIndent = formLeftIndent; return this; } | setFormLeftIndent |
278,208 | void () { myComponent.addMouseListener(new MyMouseListener()); myComponent.addMouseMotionListener(new MyMouseMotionListener()); myComponent.addKeyListener(new PressedKeyListener()); myComponent.addFocusListener(new ButtonFocusListener()); setActionTrigger(MouseEvent.MOUSE_RELEASED); } | setupListeners |
278,209 | void (int trigger) { assert trigger == MouseEvent.MOUSE_PRESSED || trigger == MouseEvent.MOUSE_RELEASED || trigger == MOUSE_PRESSED_RELEASED; myActionTrigger = trigger; } | setActionTrigger |
278,210 | boolean () { return myHovered; } | isHovered |
278,211 | void (boolean hovered) { myHovered = hovered; repaintComponent(); } | setHovered |
278,212 | boolean () { return myFocused; } | isFocused |
278,213 | void (boolean isFocused) { myFocused = isFocused; repaintComponent(); } | setFocused |
278,214 | boolean () { return myPressedByMouse; } | isPressedByMouse |
278,215 | void (boolean pressedByMouse) { myPressedByMouse = pressedByMouse; repaintComponent(); } | setPressedByMouse |
278,216 | boolean () { return myPressedByKeyboard; } | isPressedByKeyboard |
278,217 | void (boolean isPressedByKeyboard) { myPressedByKeyboard = isPressedByKeyboard; repaintComponent(); } | setPressedByKeyboard |
278,218 | void (final TimedDeadzone.Length deadZone) { myMouseDeadzone.setLength(deadZone); } | setMouseDeadzone |
278,219 | void () { repaint(myComponent); } | repaintComponent |
278,220 | void (Component c) { c.repaint(); } | repaint |
278,221 | void (MouseEvent e) { myMouseDeadzone.enter(e); setHovered(true); repaintComponent(); } | mouseEntered |
278,222 | void (MouseEvent e) { myMouseDeadzone.clear(); setHovered(false); setPressedByMouse(false); repaintComponent(); } | mouseExited |
278,223 | void (MouseEvent e) { Component owner = IdeFocusManager.getInstance(null).getFocusOwner(); myWasPressedOnFocusTransfer = owner == null; if (isDeadZone()) return; if (myActionTrigger == MouseEvent.MOUSE_RELEASED && UIUtil.isActionClick(e, MouseEvent.MOUSE_PRESSED)) { setPressedByMouse(true); } if (passIfNeeded(e)) return; if (myActionTrigger == MouseEvent.MOUSE_PRESSED || myActionTrigger == MOUSE_PRESSED_RELEASED) { execute(e); } else { repaintComponent(); } } | mousePressed |
278,224 | void (MouseEvent e) { try { if (isDeadZone()) return; if (UIUtil.isActionClick(e, MouseEvent.MOUSE_RELEASED)) { setPressedByMouse(false); } if (passIfNeeded(e)) return; if (myActionTrigger == MouseEvent.MOUSE_RELEASED || myActionTrigger == MOUSE_PRESSED_RELEASED) { execute(e); } else { repaintComponent(); } } finally { myWasPressedOnFocusTransfer = false; } } | mouseReleased |
278,225 | boolean (MouseEvent e) { Point point = e.getPoint(); if (point.x < 0 || point.x > myComponent.getWidth()) return true; if (point.y < 0 || point.y > myComponent.getHeight()) return true; repaintComponent(); BaseButtonBehavior.this.execute(e); ApplicationManager.getApplication().invokeLater(() -> { if (!myComponent.isShowing()) { setHovered(false); myMouseDeadzone.clear(); } }); return false; } | execute |
278,226 | boolean (final MouseEvent e) { boolean actionClick = myActionTrigger == MOUSE_PRESSED_RELEASED ? UIUtil.isActionClick(e, MouseEvent.MOUSE_PRESSED) || UIUtil.isActionClick(e, MouseEvent.MOUSE_RELEASED) : UIUtil.isActionClick(e, myActionTrigger); if (actionClick) return false; pass(e); return true; } | passIfNeeded |
278,227 | boolean () { boolean considerDeadZone = !myWasPressedOnFocusTransfer; return considerDeadZone && myMouseDeadzone.isWithin(); } | isDeadZone |
278,228 | void (final MouseEvent e) { myMouseDeadzone.enter(e); } | mouseMoved |
278,229 | void (KeyEvent e) { if (e.getModifiers() == 0 && e.getKeyCode() == KeyEvent.VK_SPACE) { setPressedByKeyboard(true); repaintComponent(); } } | keyPressed |
278,230 | void (KeyEvent e) { if (e.getModifiers() == 0 && e.getKeyCode() == KeyEvent.VK_SPACE) { e.consume(); RelativePoint point = RelativePoint.getCenterOf(myComponent); execute(point.toMouseEvent()); setPressedByKeyboard(false); repaintComponent(); return; } super.keyReleased(e); } | keyReleased |
278,231 | void (FocusEvent e) { setFocused(true); repaintComponent(); } | focusGained |
278,232 | void (FocusEvent e) { setFocused(false); setPressedByKeyboard(false); repaintComponent(); } | focusLost |
278,233 | void (MouseEvent e) { } | pass |
278,234 | void (final List<? extends Segment> markers) { removeHighlights(); myMarkers.clear(); stopBlinking(); myMarkers.addAll(markers); show = true; } | resetMarkers |
278,235 | void () { MarkupModel markupModel = myEditor.getMarkupModel(); RangeHighlighter[] allHighlighters = markupModel.getAllHighlighters(); for (RangeHighlighter highlighter : myAddedHighlighters) { if (ArrayUtil.indexOf(allHighlighters, highlighter) != -1) { highlighter.dispose(); } } myAddedHighlighters.clear(); } | removeHighlights |
278,236 | void () { Project project = myEditor.getProject(); if (ApplicationManager.getApplication().isDisposed() || myEditor.isDisposed() || project != null && project.isDisposed()) { return; } MarkupModel markupModel = myEditor.getMarkupModel(); if (show) { for (Segment segment : myMarkers) { if (segment.getEndOffset() > myEditor.getDocument().getTextLength()) continue; RangeHighlighter highlighter = markupModel.addRangeHighlighter(segment.getStartOffset(), segment.getEndOffset(), HighlighterLayer.ADDITIONAL_SYNTAX, myAttributes, HighlighterTargetArea.EXACT_RANGE); myAddedHighlighters.add(highlighter); } } else { removeHighlights(); } stopBlinking(); myBlinkingAlarm.addRequest(() -> { if (myTimeToLive > 0 || show) { myTimeToLive--; show = !show; startBlinking(); } }, 400); } | startBlinking |
278,237 | void () { myBlinkingAlarm.cancelAllRequests(); } | stopBlinking |
278,238 | void (@NotNull JList<? extends T> list, T value, int index, boolean selected, boolean hasFocus) { setText(value.getPresentableText()); } | customize |
278,239 | boolean () { return false; } | isComboboxEditable |
278,240 | boolean () { final JComboBox comboBox = (JComboBox)editorComponent; comboBox.removeActionListener(delegate); final boolean result = super.stopCellEditing(); comboBox.addActionListener(delegate); return result; } | stopCellEditing |
278,241 | Component (JTable table, Object value, boolean isSelected, int row, int column) { String currentValue = (String)value; final JComboBox component = (JComboBox)super.getTableCellEditorComponent(table, value, isSelected, row, column); component.removeActionListener(delegate); component.setBorder(null); component.removeAllItems(); final List<String> items = getComboBoxItems(); int selected = -1; for (int i = 0; i < items.size(); i++) { final String item = items.get(i); component.addItem(item); if (Objects.equals(item, currentValue)) { selected = i; } } if (selected == -1) { component.setEditable(true); component.setSelectedItem(currentValue); component.setEditable(false); } else { component.setSelectedIndex(selected); } component.setEditable(isComboboxEditable()); component.addActionListener(delegate); return component; } | getTableCellEditorComponent |
278,242 | void (int frame, int totalFrames, int cycle) { int len = AnimatedIcon.this.icons.length; currentIconIndex = frame < 0 ? 0 : frame >= len ? len - 1 : frame; paintImmediately(0, 0, getWidth(), getHeight()); } | paintNow |
278,243 | void () { if (isRunning) { ensureAnimation(true); } } | showNotify |
278,244 | void () { ensureAnimation(false); } | hideNotify |
278,245 | Dimension () { Dimension dimension = new Dimension(); for (Icon each : icons) { dimension.width = Math.max(each.getIconWidth(), dimension.width); dimension.height = Math.max(each.getIconHeight(), dimension.height); } return new Dimension(Math.max(passiveIcon.getIconWidth(), dimension.width), Math.max(passiveIcon.getIconHeight(), dimension.height)); } | calcPreferredSize |
278,246 | void () { super.updateUI(); if (getParent() != null) preferredSize = calcPreferredSize(); } | updateUI |
278,247 | void (boolean paintPassive) { isPaintPassive = paintPassive; } | setPaintPassiveIcon |
278,248 | boolean (boolean running) { boolean changes = animator.isRunning() != running; if (running) { animator.resume(); } else { animator.suspend(); } return changes; } | ensureAnimation |
278,249 | void () { isRunning = true; ensureAnimation(true); } | resume |
278,250 | void () { isRunning = false; if (ensureAnimation(false)) { repaint(); } } | suspend |
278,251 | void () { Disposer.dispose(animator); } | dispose |
278,252 | Dimension () { Insets insets = getInsets(); return new Dimension(preferredSize.width + insets.left + insets.right, preferredSize.height + insets.top + insets.bottom); } | getPreferredSize |
278,253 | Dimension () { return getPreferredSize(); } | getMinimumSize |
278,254 | Dimension () { return getPreferredSize(); } | getMaximumSize |
278,255 | void (Graphics g) { //if (myPaintingBgNow) return; if (isOpaque()) { Container parent = getParent(); JComponent opaque = null; if (parent instanceof JComponent) { opaque = (JComponent)UIUtil.findNearestOpaque(parent); } Color bg = opaque == null ? UIUtil.getPanelBackground() : opaque.getBackground(); g.setColor(bg); g.fillRect(0, 0, getWidth(), getHeight()); } Icon icon; if (animator.isRunning()) { icon = icons[currentIconIndex]; } else { icon = getPassiveIcon(); } Rectangle bounds = new Rectangle(getWidth(), getHeight()); JBInsets.removeFrom(bounds, getInsets()); bounds.x += (bounds.width - icon.getIconWidth()) / 2; bounds.y += (bounds.height - icon.getIconHeight()) / 2; paintIcon(g, icon, bounds.x, bounds.y); } | paintComponent |
278,256 | void (Graphics g, Icon icon, int x, int y) { icon.paintIcon(this, g, x, y); } | paintIcon |
278,257 | Icon () { return isPaintPassive ? passiveIcon : emptyPassiveIcon; } | getPassiveIcon |
278,258 | boolean () { return animator.isRunning(); } | isRunning |
278,259 | String () { return name + " isRunning=" + isRunning + " isOpaque=" + isOpaque() + " paintPassive=" + isPaintPassive; } | toString |
278,260 | void (ChangeEvent e) { refresh(); } | stateChanged |
278,261 | void (@NotNull JSpinner spinner) { JSpinner.DefaultEditor editor = ObjectUtils.tryCast(spinner.getEditor(), JSpinner.DefaultEditor.class); if (editor == null) return; JFormattedTextField field = editor.getTextField(); field.getInputMap(WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), INCREASE_NUMBER_ID); field.getInputMap(WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), DECREASE_NUMBER_ID); field.getActionMap().put(INCREASE_NUMBER_ID, getIncAction(spinner, field, 1)); field.getActionMap().put(DECREASE_NUMBER_ID, getIncAction(spinner, field, -1)); } | registerUpAndDownKeys |
278,262 | AbstractAction (@NotNull JSpinner spinner, @NotNull JFormattedTextField field, int inc) { return new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { int newValue = getIntValue(spinner) + inc; SpinnerNumberModel model = (SpinnerNumberModel)spinner.getModel(); if (newValue <= (Integer)model.getMaximum() && newValue >= (Integer)model.getMinimum()) { boolean hasSelection = field.getSelectionStart() != field.getSelectionEnd(); model.setValue(newValue); if (hasSelection) field.selectAll(); } } }; } | getIncAction |
278,263 | void (ActionEvent e) { int newValue = getIntValue(spinner) + inc; SpinnerNumberModel model = (SpinnerNumberModel)spinner.getModel(); if (newValue <= (Integer)model.getMaximum() && newValue >= (Integer)model.getMinimum()) { boolean hasSelection = field.getSelectionStart() != field.getSelectionEnd(); model.setValue(newValue); if (hasSelection) field.selectAll(); } } | actionPerformed |
278,264 | void (@NotNull JSpinner spinner) { JSpinner.DefaultEditor editor = ObjectUtils.tryCast(spinner.getEditor(), JSpinner.DefaultEditor.class); if (editor == null) return; editor.getTextField().addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { ApplicationManager.getApplication().invokeLater(() -> { editor.getTextField().selectAll(); }); } @Override public void focusLost(FocusEvent e) { } }); } | selectAllOnFocusGained |
278,265 | void (FocusEvent e) { ApplicationManager.getApplication().invokeLater(() -> { editor.getTextField().selectAll(); }); } | focusGained |
278,266 | void (FocusEvent e) { } | focusLost |
278,267 | Calendar () { return myCalendar; } | getCalendar |
278,268 | void () { DateFormatSymbols dateFormatSymbols = new DateFormatSymbols(Locale.getDefault()); for (int i = Calendar.JANUARY; i <= Calendar.DECEMBER; i++) myMonths.addItem(dateFormatSymbols.getMonths()[i]); myMonths.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { refresh(); } }); } | fillMonths |
278,269 | void (ActionEvent e) { refresh(); } | actionPerformed |
278,270 | void (Date date) { myCalendar.setTime(date); myYears.setValue(Integer.valueOf(myCalendar.get(Calendar.YEAR))); myMonths.setSelectedIndex(myCalendar.get(Calendar.MONTH)); myDays.setSelectedIndex(myCalendar.get(Calendar.DAY_OF_MONTH) - 1); myHours.setValue(Integer.valueOf(myCalendar.get(Calendar.HOUR_OF_DAY))); myMinutes.setValue(Integer.valueOf(myCalendar.get(Calendar.MINUTE))); mySeconds.setValue(Integer.valueOf(myCalendar.get(Calendar.SECOND))); } | setDate |
278,271 | JComponent () { return myDays; } | getDaysCombo |
278,272 | void () { JPanel timePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); timePanel.add(myHours); timePanel.add(new JLabel(" : ")); timePanel.add(myMinutes); timePanel.add(new JLabel(" : ")); timePanel.add(mySeconds); add(timePanel); } | addTimeFields |
278,273 | void () { JPanel datePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); datePanel.add(myDays); datePanel.add(myMonths); datePanel.add(myYears); add(datePanel); } | addDateFields |
278,274 | void () { int days = DAYS_IN_THE_MONTH[myMonths.getSelectedIndex()]; if (days > 0) fillDays(days); else fillDays(daysInTheFebruary()); } | refresh |
278,275 | void (int days) { int selectedDayIndex = myDays.getSelectedIndex(); myDays.removeAllItems(); for (int i = 0; i < days; i++) myDays.addItem(String.valueOf(i + 1)); if (selectedDayIndex < myDays.getItemCount()) myDays.setSelectedIndex(selectedDayIndex); else myDays.setSelectedIndex(myDays.getItemCount() - 1); } | fillDays |
278,276 | int () { int year = Integer.parseInt(myYears.getValue().toString()); if (year % 4 > 0) return 29; if (year % 100 > 0) return 29; return 28; } | daysInTheFebruary |
278,277 | Date () { commitSpinners(); //noinspection MagicConstant myCalendar.set(getIntValue(myYears), myMonths.getSelectedIndex(), myDays.getSelectedIndex() + 1, getIntValue(myHours), getIntValue(myMinutes), getIntValue(mySeconds)); return myCalendar.getTime(); } | getDate |
278,278 | int (JSpinner spinner) { return ((Number)spinner.getModel().getValue()).intValue(); } | getIntValue |
278,279 | void (final Runnable runnable) { new AnAction() { @Override public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabled(!myMonths.isPopupVisible() && !myDays.isPopupVisible()); } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.EDT; } @Override public void actionPerformed(@NotNull AnActionEvent e) { runnable.run(); } }.registerCustomShortcutSet(KeyEvent.VK_ENTER, 0, this); } | registerEnterHandler |
278,280 | void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(!myMonths.isPopupVisible() && !myDays.isPopupVisible()); } | update |
278,281 | ActionUpdateThread () { return ActionUpdateThread.EDT; } | getActionUpdateThread |
278,282 | void (@NotNull AnActionEvent e) { runnable.run(); } | actionPerformed |
278,283 | void () { try { myYears.commitEdit(); myHours.commitEdit(); myMinutes.commitEdit(); mySeconds.commitEdit(); } catch (ParseException ignore) { } } | commitSpinners |
278,284 | boolean (@NotNull Object owner, @NotNull String property) { Boolean value = ReflectionUtil.getField(owner.getClass(), owner, boolean.class, property); if (value == null) { throw new IllegalArgumentException("Property '" + property + "' not found in " + owner + " (" + owner.getClass() + ")"); } return value; } | getBooleanPropertyValue |
278,285 | Dimension () { return new Dimension(passiveIcon.getIconWidth(), passiveIcon.getIconHeight()); } | calcPreferredSize |
278,286 | void (@NotNull JComponent container) { Rectangle newBounds = calculateBounds(container); if (!newBounds.equals(getBounds())) { setBounds(newBounds); // painting problems with scrollpane // repaint shouldn't be called from paint method SwingUtilities.invokeLater(() -> container.repaint()); } } | updateLocation |
278,287 | Rectangle (@NotNull JComponent container) { Rectangle rec = container.getVisibleRect(); Dimension iconSize = getPreferredSize(); return new Rectangle(rec.x + rec.width - iconSize.width, rec.y, iconSize.width, iconSize.height); } | calculateBounds |
278,288 | AnimatedIcon (@NonNls String name) { return new AsyncProcessIcon(name, com.intellij.ui.AnimatedIcon.Big.ICONS, AllIcons.Process.Big.Step_passive); } | createBig |
278,289 | AnimatedIcon (@NotNull CoroutineScope coroutineScope) { return new AsyncProcessIcon(null, com.intellij.ui.AnimatedIcon.Big.ICONS, AllIcons.Process.Big.Step_passive, coroutineScope); } | createBig |
278,290 | Rectangle (@NotNull JComponent container) { Dimension size = container.getSize(); Dimension iconSize = getPreferredSize(); return new Rectangle((size.width - iconSize.width) / 2, (size.height - iconSize.height) / 2, iconSize.width, iconSize.height); } | calculateBounds |
278,291 | boolean () { return animator.isDisposed(); } | isDisposed |
278,292 | void (@NotNull AbstractButton button) { setTextWithMnemonic(button, button.getText(), UIUtil.MNEMONIC); } | registerMnemonic |
278,293 | void (@NotNull AbstractButton button, char mn) { setTextWithMnemonic(button, button.getText(), mn); } | registerMnemonic |
278,294 | void (@NotNull AbstractButton button, @NlsContexts.Button String text) { setTextWithMnemonic(button, text, UIUtil.MNEMONIC); } | setTextWithMnemonic |
278,295 | void (@NotNull AbstractButton button, @NlsContexts.Button String text, char mn) { if (text != null) { @Nls StringBuilder realText = new StringBuilder(); char mnemonic = '\0'; int index = -1; for (int i = 0; i < text.length(); i++) { final char ch = text.charAt(i); if (ch != mn) { realText.append(ch); } else if (i + 1 < text.length()) { mnemonic = text.charAt(i + 1); index = realText.length(); } } if (mnemonic != '\0') { button.setText(realText.toString()); if (LoadingState.CONFIGURATION_STORE_INITIALIZED.isOccurred() && UISettings.getInstance().getDisableMnemonicsInControls()) { button.setMnemonic(0); button.setDisplayedMnemonicIndex(-1); button.setFocusable(true); } else { button.setMnemonic(mnemonic); button.setDisplayedMnemonicIndex(index); } } } } | setTextWithMnemonic |
278,296 | void (JLabel label, @Nullable JComponent target) { registerMnemonic(label, target, UIUtil.MNEMONIC); } | registerMnemonic |
278,297 | void (JLabel label, @Nullable JComponent target, char mn) { String text = label.getText(); if (text != null) { @Nls StringBuilder realText = new StringBuilder(text.length()); char mnemonic = '\0'; int index = -1; for (int i = 0; i < text.length(); i++) { char ch = text.charAt(i); if (ch != mn || i + 1 == text.length() || text.charAt(i + 1) == ' ') { realText.append(ch); } else { mnemonic = text.charAt(i + 1); index = realText.length(); } } if (mnemonic != '\0') { label.setText(realText.toString()); if (UISettings.getShadowInstance().getDisableMnemonicsInControls()) { label.setDisplayedMnemonic(0); label.setDisplayedMnemonicIndex(-1); } else { label.setDisplayedMnemonic(mnemonic); label.setDisplayedMnemonicIndex(index); } if (target != null) { label.setLabelFor(target); } } } } | registerMnemonic |
278,298 | boolean () { return OptionsDialog.this.isToBeShown(); } | isToBeShown |
278,299 | void (boolean value, int exitCode) { OptionsDialog.this.setToBeShown(value, DialogWrapper.CANCEL_EXIT_CODE != exitCode); } | setToBeShown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.