Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
244,300 | void () { if (myDocument != null && !myDocumentListeners.isEmpty() && !myIsListenerInstalled) { myIsListenerInstalled = true; myDocument.addDocumentListener(this); } } | installDocumentListener |
244,301 | void (boolean force) { if (myDocument != null && myIsListenerInstalled && (force || myDocumentListeners.isEmpty())) { myIsListenerInstalled = false; myDocument.removeDocumentListener(this); } } | uninstallDocumentListener |
244,302 | void (final String text) { ApplicationManager.getApplication().runWriteAction(() -> CommandProcessor.getInstance().executeCommand(getProject(), () -> { myDocument.replaceString(0, myDocument.getTextLength(), text); if (myEditorField != null && myEditorField.getEditor() != null) { myEditorField.getCaretModel().moveToOff... | setText |
244,303 | void () { if (myEditorField != null) { final Editor editor = myEditorField.getEditor(); if (editor != null) { editor.getSelectionModel().removeSelection(); } } } | removeSelection |
244,304 | CaretModel () { return myEditorField.getCaretModel(); } | getCaretModel |
244,305 | void (final String[] history) { setModel(new DefaultComboBoxModel(history)); } | setHistory |
244,306 | void (String item) { ArrayList<Object> objects = new ArrayList<>(); objects.add(item); int count = getItemCount(); for (int i = 0; i < count; i++) { final Object itemAt = getItemAt(i); if (!item.equals(itemAt)) { objects.add(itemAt); } } setModel(new DefaultComboBoxModel(ArrayUtil.toObjectArray(objects))); } | prependItem |
244,307 | void (String item) { ArrayList<Object> objects = new ArrayList<>(); int count = getItemCount(); for (int i = 0; i < count; i++) { objects.add(getItemAt(i)); } if (!objects.contains(item)) { objects.add(item); } setModel(new DefaultComboBoxModel(ArrayUtil.toObjectArray(objects))); } | appendItem |
244,308 | void (ActionListener l) { } | addActionListener |
244,309 | Component () { return myEditorField; } | getEditorComponent |
244,310 | Object () { return myDocument.getText(); } | getItem |
244,311 | void (ActionListener l) { } | removeActionListener |
244,312 | void () { if (myEditorField != null) { final Editor editor = myEditorField.getEditor(); if (editor != null) { editor.getSelectionModel().setSelection(0, myDocument.getTextLength()); } } } | selectAll |
244,313 | void (Object anObject) { if (anObject != null) { EditorComboBox.this.setText(anObject.toString()); } else { EditorComboBox.this.setText(""); } } | setItem |
244,314 | void () { releaseEditor(); setEditor(); super.addNotify(); myEditorField.getFocusTarget().addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { EditorComboBox.this.repaint(); } @Override public void focusLost(FocusEvent e) { EditorComboBox.this.repaint(); } }); } | addNotify |
244,315 | void (FocusEvent e) { EditorComboBox.this.repaint(); } | focusGained |
244,316 | void (FocusEvent e) { EditorComboBox.this.repaint(); } | focusLost |
244,317 | void () { myEditorField = createEditorTextField(myDocument, myProject, myFileType, myIsViewer); final ComboBoxEditor editor = new MyEditor(); setEditor(editor); setRenderer(new EditorComboBoxRenderer(editor)); } | setEditor |
244,318 | ComboboxEditorTextField (Document document, Project project, FileType fileType, boolean isViewer) { return new ComboboxEditorTextField(document, project, fileType, isViewer); } | createEditorTextField |
244,319 | void () { super.removeNotify(); releaseEditor(); myEditorField = null; } | removeNotify |
244,320 | void () { if (myEditorField != null) { myEditorField.releaseEditorLater(); } } | releaseEditor |
244,321 | void (Font font) { super.setFont(font); if (myEditorField != null && myEditorField.getEditor() != null) { setupEditorFont((EditorEx)myEditorField.getEditor()); } } | setFont |
244,322 | void (final EditorEx editor) { if (myInheritSwingFont) { editor.getColorsScheme().setEditorFontName(getFont().getFontName()); editor.getColorsScheme().setEditorFontSize(getFont().getSize()); } } | setupEditorFont |
244,323 | boolean () { return true; } | shouldHaveBorder |
244,324 | void (boolean enabled) { super.setEnabled(enabled); if (myEditorField == null) { return; } myEditorField.setEnabled(enabled); } | setEnabled |
244,325 | Dimension () { if (UIUtil.isUnderIntelliJLaF() || StartupUiUtil.isUnderDarcula()) { return super.getPreferredSize(); } if (myEditorField != null) { final Dimension preferredSize = new Dimension(myEditorField.getComponent().getPreferredSize()); JBInsets.addTo(preferredSize, getInsets()); return preferredSize; } return n... | getPreferredSize |
244,326 | boolean (KeyStroke ks, KeyEvent e, int condition, boolean pressed) { if (!((EditorEx)myEditorField.getEditor()).processKeyTyped(e)) { return super.processKeyBinding(ks, e, condition, pressed); } return true; } | processKeyBinding |
244,327 | EditorEx () { return myEditorField != null ? (EditorEx)myEditorField.getEditor() : null; } | getEditorEx |
244,328 | void (ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; updateSelection(table); } | valueChanged |
244,329 | void (PropertyChangeEvent evt) { if (evt.getOldValue() != null) { ((ListSelectionModel)evt.getOldValue()).removeListSelectionListener(selectionListener); } if (evt.getNewValue() != null) { ((ListSelectionModel)evt.getNewValue()).addListSelectionListener(selectionListener); } } | propertyChange |
244,330 | void (PropertyChangeEvent evt) { if (evt.getOldValue() != null) { ((TableColumnModel)evt.getOldValue()).getSelectionModel().removeListSelectionListener(selectionListener); } if (evt.getNewValue() != null) { ((TableColumnModel)evt.getNewValue()).getSelectionModel().addListSelectionListener(selectionListener); } } | propertyChange |
244,331 | void (final TableModelEvent e) { // This method may be called from TableModelListener (before selection model update) // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4730055 SwingUtilities.invokeLater(() -> updateSelection(table)); } | tableChanged |
244,332 | void (PropertyChangeEvent evt) { updateSelection(table); if (evt.getOldValue() != null) { ((TableModel)evt.getOldValue()).removeTableModelListener(modelListener); } if (evt.getNewValue() != null) { ((TableModel)evt.getNewValue()).addTableModelListener(modelListener); } } | propertyChange |
244,333 | void (JTable table) { int row = table.getSelectedRowCount() == 1 ? table.getSelectedRow() : -1; int column = table.getSelectedColumnCount() == 1 ? table.getSelectedColumn() : -1; handleSelectionChange((row == -1 || column == -1) ? null : new TableCell(row, column)); } | updateSelection |
244,334 | Rectangle (TableCell tableCellKey) { return myComponent.getCellRect(tableCellKey.row, tableCellKey.column, false); } | getCellRect |
244,335 | Rectangle (TableCell key) { Rectangle columnVisibleRect = myComponent.getVisibleRect(); Rectangle cellRect = getCellRect(key); int visibleRight = Math.min(columnVisibleRect.x + columnVisibleRect.width, cellRect.x + cellRect.width); columnVisibleRect.x = Math.min(columnVisibleRect.x, cellRect.x); columnVisibleRect.width... | getVisibleRect |
244,336 | boolean () { // tables without scroll pane do not repaint rows correctly (BasicTableUI.paint:1868-1872) return super.isEnabled() && myComponent.getParent() instanceof JViewport; } | isEnabled |
244,337 | void (boolean enabled) { super.setEnabled(enabled); JTableHeader header = myComponent.getTableHeader(); if (header instanceof ComponentWithExpandableItems<?>) { ((ComponentWithExpandableItems<?>)header).setExpandableItemsEnabled(enabled); } } | setEnabled |
244,338 | TableCell (Point point) { int rowIndex = myComponent.rowAtPoint(point); if (rowIndex == -1) { return null; } int columnIndex = myComponent.columnAtPoint(point); // column index in visible coordinates if (columnIndex == -1) { return null; } return new TableCell(rowIndex, columnIndex); } | getCellKeyForPoint |
244,339 | boolean () { JTableHeader header = myComponent.getTableHeader(); return header != null && (header.getResizingColumn() != null || header.getDraggedColumn() != null); } | hasDraggingOrResizingColumn |
244,340 | JComponent (@NlsContexts.Tooltip String text, HyperlinkListener hyperlinkListener) { JEditorPane pane = IdeTooltipManager.initPane(text, new HintHint().setAwtTooltip(true), null); pane.addHyperlinkListener(hyperlinkListener); return pane; } | createTipComponent |
244,341 | boolean (TooltipEvent event) { return !event.isIsEventInsideBalloon(); } | canAutohideOn |
244,342 | void (@NotNull HyperlinkEvent e) { BrowserUtil.browse(e.getURL()); } | hyperlinkActivated |
244,343 | EditorTextFieldProvider () { return ApplicationManager.getApplication().getService(EditorTextFieldProvider.class); } | getInstance |
244,344 | Dimension () { Dimension size = super.getPreferredSize(); UIThemeLookAndFeelInfo info = LafManager.getInstance().getCurrentUIThemeLookAndFeel(); if (info != null && info.getName().contains("Windows")) { size.width += 10; } return size; } | getPreferredSize |
244,345 | void (ActionEvent e) { PropertiesComponent.getInstance().setValue(HSB_PROPERTY, String.valueOf(!isRGBMode()), Boolean.FALSE.toString()); myR.setText(IdeBundle.message(isRGBMode() ? "colorpicker.label.red" : "colorpicker.label.hue")); myR_after.setText(isRGBMode() ? " " : "\u00B0"); myG.setText(IdeBundle.message(isRGBMo... | actionPerformed |
244,346 | void (Color color, Object source) { setColor(color, source); } | colorChanged |
244,347 | void (Color color, Object source) { setColor(color, source); } | colorChanged |
244,348 | boolean () { return myFormat.getSelectedIndex() == 0; } | isRGBMode |
244,349 | JTextField (boolean hex) { NumberDocument doc = new NumberDocument(hex); JTextField field = new JTextField(""); field.setDocument(doc); doc.setSource(field); field.getDocument().addDocumentListener(this); field.addFocusListener(new FocusAdapter() { @Override public void focusGained(final FocusEvent e) { field.selectAll... | createColorField |
244,350 | void (final FocusEvent e) { field.selectAll(); } | focusGained |
244,351 | void (FocusEvent event) { myUpdateQueue.cancelAllRequests(); validateAndUpdatePreview(field); } | focusLost |
244,352 | JComponent () { return myHex; } | getPreferredFocusedComponent |
244,353 | void (Color color, Object src) { colorChanged(color, src); myColorWheelPanel.setColor(color, src); } | setColor |
244,354 | void () { myRecentColorsComponent.appendColor(myColor); } | appendRecentColor |
244,355 | void () { myRecentColorsComponent.saveColors(); } | saveRecentColors |
244,356 | Color () { if (myColorWheelPanel.myColorWheel.myOpacity == 255) { return myColor; } else { //noinspection UseJBColor return new Color(myColor.getRed(), myColor.getGreen(), myColor.getBlue(), myColorWheelPanel.myColorWheel.myOpacity); } } | getColor |
244,357 | void (DocumentEvent e) { update(((NumberDocument)e.getDocument()).mySrc); } | insertUpdate |
244,358 | void (final JTextField src) { if (!src.hasFocus()) return; myUpdateQueue.cancelAllRequests(); myUpdateQueue.addRequest(() -> validateAndUpdatePreview(src), 300); } | update |
244,359 | void (DocumentEvent e) { update(((NumberDocument)e.getDocument()).mySrc); } | removeUpdate |
244,360 | void (DocumentEvent e) { // ignore } | changedUpdate |
244,361 | void (JTextField src) { boolean fromHex = src == myHex; Color color; if (fromHex) { Color c = ColorUtil.fromHex(myHex.getText(), null); color = c != null ? ColorUtil.toAlpha(c, myColorWheelPanel.myColorWheel.myOpacity) : null; } else { color = gatherRGB(); } if (color != null) { if (myColorWheelPanel.myOpacityComponent... | validateAndUpdatePreview |
244,362 | void (Color color, boolean fromHex) { if (color != null && !color.equals(myColor)) { myColor = color; myPreviewComponent.setColor(color); myColorWheelPanel.setColor(color, fromHex ? myHex : null); if (fromHex) { applyColor(color); } else { applyColorToHEX(color); } fireColorChanged(color); } } | updatePreview |
244,363 | void (Color color, Object source) { if (color != null && !color.equals(myColor)) { myColor = color; applyColor(color); if (source != myHex) { applyColorToHEX(color); } myPreviewComponent.setColor(color); fireColorChanged(color); } } | colorChanged |
244,364 | void (Color color) { if (myExternalListeners == null) return; for (ColorPickerListener listener : myExternalListeners) { listener.colorChanged(color); } } | fireColorChanged |
244,365 | void (@Nullable Color color) { if (myExternalListeners == null) return; for (ColorPickerListener listener : myExternalListeners) { listener.closed(color); } } | fireClosed |
244,366 | void (final Color c) { myHex.setText(String.format("%06X", (0xFFFFFF & c.getRGB()))); } | applyColorToHEX |
244,367 | void (final Color color) { myRed.setText(String.valueOf(color.getRed())); myGreen.setText(String.valueOf(color.getGreen())); myBlue.setText(String.valueOf(color.getBlue())); } | applyColorToRGB |
244,368 | void (final Color c) { final float[] hbs = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null); myRed.setText(String.valueOf(((int)(360f * hbs[0])))); myGreen.setText(String.valueOf(((int)(100f * hbs[1])))); myBlue.setText(String.valueOf(((int)(100f * hbs[2])))); } | applyColorToHSB |
244,369 | void (final Color color) { if (isRGBMode()) { applyColorToRGB(color); } else { applyColorToHSB(color); } } | applyColor |
244,370 | void (@Nullable Project project, @Nullable Color currentColor, @Nullable Editor editor, @NotNull ColorListener listener) { showColorPickerPopup(project, currentColor, listener, bestLocationForColorPickerPopup(editor), currentColor != null && currentColor.getAlpha() != 255); } | showColorPickerPopup |
244,371 | void (@Nullable Project project, @Nullable Color currentColor, @NotNull ColorListener listener) { showColorPickerPopup(project, currentColor, listener, null); } | showColorPickerPopup |
244,372 | void (@Nullable Project project, @Nullable Color currentColor, @NotNull ColorListener listener, @Nullable RelativePoint location) { showColorPickerPopup(project, currentColor, listener, location, false); } | showColorPickerPopup |
244,373 | void (final @Nullable Project project, @Nullable Color currentColor, final @NotNull ColorListener listener, @Nullable RelativePoint location, boolean showAlpha) { showColorPickerPopup(project, currentColor, listener, location, showAlpha, false, null); } | showColorPickerPopup |
244,374 | void (final @Nullable Project project, @Nullable Color currentColor, final @NotNull ColorListener listener, @Nullable RelativePoint location, boolean showAlpha, boolean showAlphaAsPercent, final @Nullable ColorPickerPopupCloseListener popupCloseListener) { if( !isEnoughSpaceToShowPopup() || !Registry.is("ide.new.color.... | showColorPickerPopup |
244,375 | void (final Color color, final Object source) { Runnable apply = () -> CommandProcessor.getInstance().executeCommand(project, () -> listener.colorChanged(color, source), IdeBundle.message("command.name.apply.color"), groupId); alarm.cancelAllRequests(); Runnable request = () -> ApplicationManager.getApplication().invok... | colorChanged |
244,376 | JComponent (@NotNull ColorPickerModel colorPickerModel) { return new RecentColorsPalette(colorPickerModel, recentColors); } | createComponent |
244,377 | void (Color color, Object source) { updatePointer(ref); } | colorChanged |
244,378 | void (Color color, Object source) { RecentColorsComponent.saveRecentColors(RecentColorsComponent.appendColor(color, recentColors, 20)); } | colorChanged |
244,379 | boolean () { DialogWrapper currentDialog = DialogWrapper.findInstanceFromFocus(); if (currentDialog != null && (currentDialog.getWindow().getWidth() < 500 || currentDialog.getWindow().getHeight() < 500)) { return false; } return true; } | isEnoughSpaceToShowPopup |
244,380 | void (Ref<LightCalloutPopup> ref) { LightCalloutPopup popup = ref.get(); Balloon balloon = popup.getBalloon(); if (balloon instanceof BalloonImpl) { RelativePoint showingPoint = ((BalloonImpl)balloon).getShowingPoint(); Color c = popup.getPointerColor(showingPoint, ((BalloonImpl)balloon).getComponent()); if (c != null)... | updatePointer |
244,381 | AbstractAction (Ref<LightCalloutPopup> ref) { return new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { final LightCalloutPopup popup = ref.get(); if (popup != null) { popup.cancel(); } } }; } | cancelPopup |
244,382 | void (ActionEvent e) { final LightCalloutPopup popup = ref.get(); if (popup != null) { popup.cancel(); } } | actionPerformed |
244,383 | AbstractAction (Ref<LightCalloutPopup> ref) { return new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { final LightCalloutPopup popup = ref.get(); if (popup != null) { popup.close(); } } }; } | applyColor |
244,384 | void (ActionEvent e) { final LightCalloutPopup popup = ref.get(); if (popup != null) { popup.close(); } } | actionPerformed |
244,385 | void (ActionEvent e) { myPicker.setInitialColor(getColor()); myPicker.show(); } | actionPerformed |
244,386 | void (Color color, Object source) { float[] hsb = new float[3]; Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsb); myBrightnessComponent.setValue(255 - (int)(hsb[2] * 255)); myBrightnessComponent.repaint(); myColorWheel.dropImage(); if (myOpacityComponent != null && source instanceof ColorPicker) {... | setColor |
244,387 | void (ComponentEvent e) { myShouldInvalidate = true; } | componentResized |
244,388 | void (MouseEvent e) { final int x = e.getX(); final int y = e.getY(); int mx = myWheel.x + myWheel.width / 2; int my = myWheel.y + myWheel.height / 2; double s; double h; s = Math.sqrt((x - mx) * (x - mx) + (y - my) * (y - my)) / (myWheel.height / 2); h = -Math.atan2(y - my, x - mx) / (2 * Math.PI); if (h < 0) h += 1.0... | mouseDragged |
244,389 | void (MouseEvent e) { final int x = e.getX(); final int y = e.getY(); int mx = myWheel.x + myWheel.width / 2; int my = myWheel.y + myWheel.height / 2; double s; double h; s = Math.sqrt((x - mx) * (x - mx) + (y - my) * (y - my)) / (myWheel.height / 2); h = -Math.atan2(y - my, x - mx) / (2 * Math.PI); if (h < 0) h += 1.0... | mousePressed |
244,390 | void (float h, float s, float b, int opacity) { //noinspection UseJBColor Color rgb = new Color(Color.HSBtoRGB(h, s, b)); setColor(ColorUtil.toAlpha(rgb, opacity), this); } | setHSBValue |
244,391 | void (Color color, Object source) { float[] hsb = new float[3]; Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsb); myColor = color; myHue = hsb[0]; mySaturation = hsb[1]; myBrightness = hsb[2]; myOpacity = color.getAlpha(); fireColorChanged(source); repaint(); } | setColor |
244,392 | void (ColorListener listener) { myListeners.add(listener); } | addListener |
244,393 | void (Object source) { for (ColorListener listener : myListeners) { listener.colorChanged(myColor, source); } } | fireColorChanged |
244,394 | void (float brightness) { if (brightness != myBrightness) { myImage = null; setHSBValue(myHue, mySaturation, brightness, myOpacity); } } | setBrightness |
244,395 | void (int opacity) { if (opacity != myOpacity) { setHSBValue(myHue, mySaturation, myBrightness, opacity); } } | setOpacity |
244,396 | Dimension () { return getMinimumSize(); } | getPreferredSize |
244,397 | Dimension () { return JBUI.size(300, 300); } | getMinimumSize |
244,398 | void (Graphics g) { Graphics2D g2d = (Graphics2D)g; final Dimension size = getSize(); int _size = Math.min(size.width, size.height); _size = Math.min(_size, 600); if (myImage != null && myShouldInvalidate) { if (myImage.getWidth(null) != _size) { myImage = null; } } myShouldInvalidate = false; if (myImage == null) { my... | paintComponent |
244,399 | void () { myImage = null; } | dropImage |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.