Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
244,800
int (String item1, String item2) { return StringUtil.compare(item1, item2, false); }
compare
244,801
Icon (@NotNull String item) { return myIcon; }
getIcon
244,802
String (@NotNull String item) { return item; }
getLookupString
244,803
void (@NotNull EditorEx editor, Color background) { JLabel label = ExpandableSupport.createLabel(createCollapseExtension()); label.setBorder(JBUI.Borders.empty(5, 3, 5, 7)); editor.getContentComponent().putClientProperty(Expandable.class, this); editor.getScrollPane().setHorizontalScrollBarPolicy(ScrollPaneConstants.HO...
initPopupEditor
244,804
void (@NotNull EditorEx editor, Color background) { editor.getContentComponent().putClientProperty(Expandable.class, this); ExtendableTextComponent.Extension extension = createExpandExtension(); ExtendableEditorSupport.setupExtension(editor, background, extension); }
initFieldEditor
244,805
void (@NotNull EditorEx editor) { FoldingModelEx model = editor.getFoldingModel(); CharSequence text = editor.getDocument().getCharsSequence(); model.runBatchFoldingOperation(() -> { model.clearFoldRegions(); for (int i = 0; i < text.length(); i++) { if (text.charAt(i) == '\n') { model.createFoldRegion(i, i + 1, " \u23...
updateFieldFolding
244,806
Content (@NotNull EditorTextField field, @NotNull Function<? super String, String> onShow) { EditorTextField popup = createPopupEditor(field, onShow.fun(field.getText())); Color background = field.getBackground(); popup.setBackground(background); popup.setOneLineMode(false); popup.setPreferredSize(new Dimension(field.g...
prepare
244,807
JComponent () { return popup; }
getContentComponent
244,808
JComponent () { return popup; }
getFocusableComponent
244,809
void (@NotNull Function<? super String, String> onHide) { field.setText(onHide.fun(popup.getText())); Editor editor = field.getEditor(); if (editor != null) copyCaretPosition(editor, popup.getEditor(), onHide); if (editor instanceof EditorEx) updateFieldFolding((EditorEx)editor); }
cancel
244,810
EditorTextField (@NotNull EditorTextField field, @NotNull String text) { if (Objects.equals(text, field.getText())) { return new EditorTextField(field.getDocument(), field.getProject(), field.getFileType()); } else { return new EditorTextField(text, field.getProject(), field.getFileType()); } }
createPopupEditor
244,811
void (@NotNull Editor destination, Editor source, Function<? super String, String> mapper) { if (source == null) return; // unexpected try { List<CaretState> states = source.getCaretModel().getCaretsAndSelections(); if (!mapper.equals(Functions.identity())) { states = extractStates(mapper.fun(injectStates(source.getDoc...
copyCaretPosition
244,812
List<CaretState> (String text) { int x = 0; int y = 0; List<LogicalPosition[]> list = new ArrayList<>(); for (int i = 0; i < text.length(); i++) { char c = text.charAt(i); if (c == '\0') { int next = text.indexOf('\0', i + 1); if (next != -1) { String tag = text.substring(i + 1, next); Matcher matcher = TAG_PATTERN.mat...
extractStates
244,813
String (String text, List<? extends CaretState> states) { if (states.isEmpty()) return text; record Point(int x, int y) { static Point from(LogicalPosition pos) { return new Point(pos.column, pos.line); } } Map<Point, String> tags = new HashMap<>(); for (int i = 0; i < states.size(); i++) { CaretState state = states.ge...
injectStates
244,814
Point (LogicalPosition pos) { return new Point(pos.column, pos.line); }
from
244,815
int () { return myRightMarginColumns; }
getRightMarginColumns
244,816
void (@NotNull EditorEx editor) { editor.getSettings().setRightMarginShown(isEnabled()); editor.getSettings().setRightMargin(getRightMarginColumns()); }
customize
244,817
void (Component component, FocusListener l) { UIUtil.uiTraverser(component).traverse().consumeEach(c -> c.addFocusListener(l)); }
addFocusListener
244,818
void (Component component, FocusListener l) { UIUtil.uiTraverser(component).traverse().consumeEach(c -> c.removeFocusListener(l)); }
removeFocusListener
244,819
void (Component component, MouseListener l) { UIUtil.uiTraverser(component).traverse().consumeEach(c -> c.addMouseListener(l)); }
addMouseListener
244,820
void (Component component, MouseListener l) { UIUtil.uiTraverser(component).traverse().consumeEach(c -> c.removeMouseListener(l)); }
removeMouseListener
244,821
void (Component component, ClickListener l) { UIUtil.uiTraverser(component).traverse().consumeEach(c -> l.installOn(c)); }
addClickListener
244,822
void (Component component, ClickListener l) { UIUtil.uiTraverser(component).traverse().consumeEach(c -> l.uninstall(c)); }
removeClickListener
244,823
void (Component component, MouseMotionListener l) { UIUtil.uiTraverser(component).traverse().consumeEach(c -> c.addMouseMotionListener(l)); }
addMouseMotionListener
244,824
void (Component component, MouseMotionListener l) { UIUtil.uiTraverser(component).traverse().consumeEach(c -> c.removeMouseMotionListener(l)); }
removeMouseMotionListener
244,825
void (Component component, KeyListener l) { UIUtil.uiTraverser(component).traverse().consumeEach(c -> c.addKeyListener(l)); }
addKeyListener
244,826
void (Component component, KeyListener l) { UIUtil.uiTraverser(component).traverse().consumeEach(c -> c.removeKeyListener(l)); }
removeKeyListener
244,827
void (final MouseEvent e) { _requestDefaultFocus(); }
mousePressed
244,828
void (@NotNull PrevNextActionsDescriptor installKeyboardNavigation) { myInstallKeyboardNavigation = installKeyboardNavigation; }
setKeyboardNavigation
244,829
JComponent () { return this; }
getComponent
244,830
void () { super.addNotify(); if (myInstallKeyboardNavigation != null) { installKeyboardNavigation(myInstallKeyboardNavigation); } }
addNotify
244,831
void () { super.removeNotify(); if (myInstallKeyboardNavigation != null) { uninstallKeyboardNavigation(); } }
removeNotify
244,832
void (final PrevNextActionsDescriptor installKeyboardNavigation) { myNextTabAction = new AnAction() { { setEnabledInModalContext(true); } @Override public void actionPerformed(final @NotNull AnActionEvent e) { int index = getSelectedIndex() + 1; if (index >= getTabCount()) { index = 0; } setSelectedIndex(index); } }; f...
installKeyboardNavigation
244,833
void (final @NotNull AnActionEvent e) { int index = getSelectedIndex() + 1; if (index >= getTabCount()) { index = 0; } setSelectedIndex(index); }
actionPerformed
244,834
void (final @NotNull AnActionEvent e) { int index = getSelectedIndex() - 1; if (index < 0) { index = getTabCount() - 1; } setSelectedIndex(index); }
actionPerformed
244,835
void () { if (myNextTabAction != null) { myNextTabAction.unregisterCustomShortcutSet(this); myNextTabAction = null; } if (myPreviousTabAction != null) { myPreviousTabAction.unregisterCustomShortcutSet(this); myPreviousTabAction = null; } }
uninstallKeyboardNavigation
244,836
void (final TabbedPaneUI ui) { super.setUI(ui); myScrollableTabSupport = ui instanceof BasicTabbedPaneUI ? new ScrollableTabSupport((BasicTabbedPaneUI)ui) : null; }
setUI
244,837
void (final int index) { if(myScrollableTabSupport==null|| WRAP_TAB_LAYOUT==getTabLayoutPolicy()){ // tab scrolling isn't supported by UI return; } final TabbedPaneUI tabbedPaneUI=getUI(); Rectangle tabBounds=tabbedPaneUI.getTabBounds(this,index); final int tabPlacement=getTabPlacement(); if(TOP==tabPlacement || BOTTOM...
scrollTabToVisible
244,838
void (final int index) { if (index >= getTabCount()) return; try { super.setSelectedIndex(index); } catch (ArrayIndexOutOfBoundsException e) { //http://www.jetbrains.net/jira/browse/IDEADEV-22331 //may happen on Mac OSX 10.5 return; } scrollTabToVisible(index); doLayout(); }
setSelectedIndex
244,839
void () { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == ChangeListener.class) { // Lazily create the event...
fireStateChanged
244,840
void (final int index) { super.removeTabAt (index); //This event should be fired necessarily because when swing fires an event // page to be removed is still in the tabbed pane. There can be a situation when // event fired according to swing event contains invalid information about selected page. fireStateChanged(); }
removeTabAt
244,841
void () { final Component selectedComponent = getSelectedComponent(); if (selectedComponent instanceof TabbedPaneWrapper.TabWrapper) { ((TabbedPaneWrapper.TabWrapper)selectedComponent).requestDefaultFocus(); } else { super.requestDefaultFocus(); } }
_requestDefaultFocus
244,842
int (final int x,final int y) { final TabbedPaneUI ui=getUI(); for (int i = 0; i < getTabCount(); i++) { final Rectangle bounds = ui.getTabBounds(this, i); if (bounds.contains(x, y)) { return i; } } return -1; }
getTabIndexAt
244,843
void (MouseEvent e) { if (myOn) { off(); } else { on(); } }
mouseReleased
244,844
void (MouseEvent e) { setCursor(new Cursor(Cursor.HAND_CURSOR)); }
mouseEntered
244,845
void (MouseEvent e) { setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }
mouseExited
244,846
void (@NlsContexts.Separator String text) { myLabel.setText(UIUtil.replaceMnemonicAmpersand(text)); }
setText
244,847
void () { if (myDetailsComponent != null) { myDetailsComponent.refresh(); return; } myDetailsComponent = createPanel(); }
initDetails
244,848
void () { initDetails(); myOn = true; myLabel.setIcon(myIconOpen); onImpl(); }
on
244,849
void () { initDetails(); myOn = true; myLabel.setIcon(myIconOpen); initOnImpl(); }
initOn
244,850
void () { myOn = false; myLabel.setIcon(myIcon); offImpl(); }
off
244,851
void (boolean strikeout) { myStrikeout = strikeout; }
setStrikeout
244,852
void (Graphics g) { super.paintComponent(g); if (myStrikeout){ Dimension size = getSize(); Dimension prefSize = getPreferredSize(); int width = Math.min(size.width, prefSize.width); int iconWidth = 0; Icon icon = getIcon(); if (icon != null){ iconWidth = icon.getIconWidth(); iconWidth += getIconTextGap(); } g.setColor(...
paintComponent
244,853
void (@NotNull AnActionEvent e) { final Project project = getEventProject(e); perform(project); }
actionPerformed
244,854
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
244,855
void (Project project) { new DialogWrapper(project, true) { { setTitle(IdeBundle.message("dialog.title.edit.laf.defaults")); setModal(false); init(); } private ShowUIDefaultsContent content; @Override protected void doOKAction() { super.doOKAction(); LafManager.getInstance().updateUI(); content.storeState(); } @Overrid...
perform
244,856
void () { super.doOKAction(); LafManager.getInstance().updateUI(); content.storeState(); }
doOKAction
244,857
JComponent () { final JBTable table = new JBTable(createFilteringModel()) { @Override public boolean editCellAt(int row, int column, EventObject e) { if (isCellEditable(row, column) && e instanceof MouseEvent) { var pair = (Pair<?, ?>)getValueAt(row, 0); Object key = pair.first; Object value = pair.second; final Ref<Bo...
createCenterPanel
244,858
boolean (int row, int column, EventObject e) { if (isCellEditable(row, column) && e instanceof MouseEvent) { var pair = (Pair<?, ?>)getValueAt(row, 0); Object key = pair.first; Object value = pair.second; final Ref<Boolean> changed = Ref.create(false); if (value instanceof Color) { ColorChooserService.getInstance().sho...
editCellAt
244,859
void (Color color, Object source) { if (color != null) { final ColorUIResource colorUIResource = new ColorUIResource(color); // MultiUIDefaults overrides remove but does not override put. // So to avoid duplications we should first remove the value and then put it again. updateValue(pair, colorUIResource, row, column);...
colorChanged
244,860
Component (JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { value = column == 0 ? ((Pair<?, ?>)value).first : ((Pair<?, ?>)value).second; if (value instanceof Boolean) { TableCellRenderer renderer = table.getDefaultRenderer(Boolean.class); if (renderer != null) { JCheckBox box = ...
getTableCellRendererComponent
244,861
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
244,862
Collection<String> () { List<String> result = new ArrayList<>(); String tail = rows.length > 1 ? "," : ""; for (int row : rows) { var pair = (Pair<?, ?>)content.table.getModel().getValueAt(row, 0); if (pair.second instanceof Color) { result.add("\"" + pair.first.toString() + "\": \"" + ColorUtil.toHtmlColor((Color)pair...
getTextLinesToCopy
244,863
boolean (String inputString) { try { parser.apply(inputString); return true; } catch (NumberFormatException nfe) { return false; } }
checkInput
244,864
boolean (String inputString) { return checkInput(inputString); }
canClose
244,865
boolean (String inputString) { return parseInsets(inputString) != null; }
checkInput
244,866
boolean (String inputString) { return checkInput(inputString); }
canClose
244,867
boolean (String inputString) { return parseDimension(inputString) != null; }
checkInput
244,868
boolean (String inputString) { return checkInput(inputString); }
canClose
244,869
boolean (String inputString) { return parseGrayFilter(inputString) != null; }
checkInput
244,870
boolean (String inputString) { return checkInput(inputString); }
canClose
244,871
boolean (String inputString) { return parseFontSize(font, inputString) != null; }
checkInput
244,872
boolean (String inputString) { return checkInput(inputString); }
canClose
244,873
FilteringTableModel<Object> () { DefaultTableModel model = new DefaultTableModel(getUIDefaultsData(), new Object[]{"Name", "Value"}) { @Override public boolean isCellEditable(int row, int column) { if (column != 1) return false; Object value = ((Pair<?, ?>)getValueAt(row, column)).second; return (value instanceof Color...
createFilteringModel
244,874
boolean (int row, int column) { if (column != 1) return false; Object value = ((Pair<?, ?>)getValueAt(row, column)).second; return (value instanceof Color || value instanceof Boolean || value instanceof Integer || value instanceof Float || value instanceof EmptyBorder || value instanceof Insets || value instanceof Gray...
isCellEditable
244,875
void (Component c, Graphics g, int x, int y) { try { myIcon.paintIcon(c, g, x, y); } catch (Exception e) { EmptyIcon.ICON_0.paintIcon(c, g, x, y); } }
paintIcon
244,876
int () { return myIcon.getIconWidth(); }
getIconWidth
244,877
int () { return myIcon.getIconHeight(); }
getIconHeight
244,878
boolean () { if (ApplicationManager.getApplication().isUnitTestMode()) { return false; } EDT.assertIsEdt(); Ole32 ole32 = Ole32.INSTANCE; ole32.CoInitializeEx(Pointer.NULL, Ole32.COINIT_APARTMENTTHREADED); Guid.GUID CLSID_TaskBarList = Ole32Util.getGUIDFromString("{56FDF344-FD6D-11d0-958A-006097C9A090}"); Guid.GUID IID...
initialize
244,879
void (@Nullable JFrame frame, double value, boolean isOk) { if (!ourInitialized || frame == null) { return; } WinDef.HWND handle = getHandle(frame); mySetProgressState.invokeInt(new Object[]{myInterfacePointer, handle, isOk ? TBPF_NORMAL : TBPF_ERROR}); mySetProgressValue.invokeInt(new Object[]{myInterfacePointer, hand...
setProgress
244,880
void (@NotNull JFrame frame) { if (!ourInitialized) { return; } mySetProgressState.invokeInt(new Object[]{myInterfacePointer, getHandle(frame), TBPF_NOPROGRESS}); }
hideProgress
244,881
void (@NotNull JFrame frame, WinDef.HICON icon, boolean dispose) { if (!ourInitialized) { return; } mySetOverlayIcon.invokeInt(new Object[]{myInterfacePointer, getHandle(frame), icon, Pointer.NULL}); if (dispose) { User32.INSTANCE.DestroyIcon(icon); } }
setOverlayIcon
244,882
void (@NotNull JFrame frame) { if (!ourInitialized) { return; } User32Ex.INSTANCE.FlashWindow(getHandle(frame), true); }
attention
244,883
void (@NotNull Window window) { if (!ourInitialized || !window.isShowing()) { return; } User32Ex.INSTANCE.SetForegroundWindow(getHandle(window)); }
setForegroundWindow
244,884
Insets (Component view) { return null; }
getResizeOffset
244,885
Insets (Component view) { return myBorder; }
getResizeBorder
244,886
boolean (Component view) { if (view instanceof Dialog && !((Dialog)view).isResizable()) return true; if (view instanceof Frame && !((Frame)view).isResizable()) return true; return super.isDisabled(view); }
isDisabled
244,887
int (int delta, int value, int min) { return delta + value < min ? min - value : delta; }
fixMinSize
244,888
String () { return getChildComponent().getText(); }
getText
244,889
void (Collection<String> items) { getChildComponent().setVariants(items); }
setAutoCompletionItems
244,890
void (String text) { getChildComponent().setText(text); }
setText
244,891
TreeSpeedSearch (@NotNull JTree tree, boolean canExpand, @NotNull Function<? super TreePath, String> presentableStringFunction) { TreeSpeedSearch search = new TreeSpeedSearch(tree, canExpand, null, presentableStringFunction); search.setupListeners(); return search; }
installOn
244,892
TreeSpeedSearch (@NotNull JTree tree) { return installOn(tree, false, TO_STRING); }
installOn
244,893
void () { super.setupListeners(); new MySelectAllAction(myComponent, this).registerCustomShortcutSet(myComponent, null); }
setupListeners
244,894
void (boolean canExpand) { myCanExpand = canExpand; }
setCanExpand
244,895
void (Object element, String selectedText) { TreeUtil.selectPath(myComponent, (TreePath)element); }
selectElement
244,896
int () { if (myCanExpand) { return allPaths().indexOf(Conditions.equalTo(myComponent.getSelectionPath())); } int[] selectionRows = myComponent.getSelectionRows(); return selectionRows == null || selectionRows.length == 0 ? -1 : selectionRows[0]; }
getSelectedIndex
244,897
ListIterator<Object> (int startingViewIndex) { return allPaths().addAllTo(new ArrayList<Object>()).listIterator(startingViewIndex); }
getElementIterator
244,898
int () { return allPaths().size(); }
getElementCount
244,899
JBIterable<TreePath> () { return allPaths(getComponent(), myCanExpand); }
allPaths