Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
241,300
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return editor.getCaretModel().supportsMultipleCarets() && (!ModifierKeyDoubleClickHandler.getInstance().isRunningAction() || EditorSettingsExternalizable.getInstance().addCaretsOnDoubleCtrl()); }
isEnabledForCaret
241,301
void (@NotNull Editor editor, @Nullable Caret targetCaret, DataContext dataContext) { if (targetCaret != null) { if (!EditorUtil.checkMaxCarets(editor)) { targetCaret.clone(myCloneAbove); } return; } int currentLevel = 0; List<Caret> currentCarets = new ArrayList<>(); for (Caret caret : editor.getCaretModel().getAllCar...
doExecute
241,302
void (boolean value) { myRepeatedInvocation = value; }
setRepeatedInvocation
241,303
int (Caret caret) { if (isRepeatedActionInvocation()) { Integer value = caret.getUserData(LEVEL); return value == null ? 0 : value; } else { caret.putUserData(LEVEL, null); return 0; } }
getLevel
241,304
boolean () { if (myRepeatedInvocation) return true; String lastActionId = EditorLastActionTracker.getInstance().getLastActionId(); return lastActionId != null && isSuitableLastAction(lastActionId); }
isRepeatedActionInvocation
241,305
boolean (@NotNull String lastActionId) { return OUR_ACTIONS.contains(lastActionId); }
isSuitableLastAction
241,306
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { if (editor instanceof EditorEx editorEx) { if (editorEx.isStickySelection()) { editorEx.setStickySelection(false); } } boolean scrollNeeded = editor.getCaretModel().getCaretCount() > 1; retainOldestCaret(editor.getCaretModel()); editor.getS...
doExecute
241,307
void (CaretModel caretModel) { while(caretModel.getCaretCount() > 1) { caretModel.removeCaret(caretModel.getPrimaryCaret()); } }
retainOldestCaret
241,308
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { if (editor.isOneLineMode() && Boolean.TRUE.equals(PlatformCoreDataKeys.IS_MODAL_CONTEXT.getData(dataContext))) return false; SelectionModel selectionModel = editor.getSelectionModel(); CaretModel caretModel = editor.getCaretModel(); retur...
isEnabledForCaret
241,309
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return getEnterHandler().isEnabled(editor, caret, dataContext); }
isEnabledForCaret
241,310
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { CopyPasteManager.getInstance().stopKillRings(); if (editor.getDocument().getLineCount() != 0) { editor.getSelectionModel().removeSelection(); LogicalPosition caretPosition = editor.getCaretModel().getLogicalPosition(); int lineEndOffset = ed...
executeWriteAction
241,311
EditorActionHandler () { return EditorActionManager.getInstance().getActionHandler(IdeActions.ACTION_EDITOR_ENTER); }
getEnterHandler
241,312
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
241,313
int (Editor editor, TextRange textRange) { return ConvertIndentsUtil.convertIndentsToTabs(editor.getDocument(), editor.getSettings().getTabSize(editor.getProject()), textRange); }
performAction
241,314
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { EditorActionUtil.moveCaretPageBottom(editor, true); }
doExecute
241,315
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return getEnterHandler().isEnabled(editor, caret, dataContext) && !((EditorEx)editor).isEmbeddedIntoDialogWrapper(); }
isEnabledForCaret
241,316
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { CopyPasteManager.getInstance().stopKillRings(); final Document document = editor.getDocument(); final RangeMarker rangeMarker = document.createRangeMarker(editor.getCaretModel().getOffset(), editor.getCaretModel().getOffset() ); final CharSe...
executeWriteAction
241,317
EditorActionHandler () { return EditorActionManager.getInstance().getActionHandler(IdeActions.ACTION_EDITOR_ENTER); }
getEnterHandler
241,318
void (Editor editor, boolean state) { editor.getSettings().setWhitespacesShown(state); }
setOption
241,319
boolean (Editor editor) { return editor.getSettings().isWhitespacesShown(); }
getOption
241,320
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { EditorActionUtil.moveCaretToTextStart(editor, CommonDataKeys.PROJECT.getData(dataContext)); }
doExecute
241,321
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { EditorEx editorex = (EditorEx) editor; editorex.setInsertMode(!editorex.isInsertMode()); }
doExecute
241,322
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return !ModifierKeyDoubleClickHandler.getInstance().isRunningAction() || EditorSettingsExternalizable.getInstance().addCaretsOnDoubleCtrl(); }
isEnabledForCaret
241,323
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { EditorActionUtil.moveCaretToLineEnd(editor, true, !(editor instanceof TextComponentEditor)); }
doExecute
241,324
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { if (CtrlYActionChooser.isCurrentShortcutOk(dataContext)) super.doExecute(editor, caret, dataContext); }
doExecute
241,325
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { myOriginal.executeWriteAction(editor, caret, dataContext); }
executeWriteAction
241,326
void (final @NotNull Editor editor, Caret caret, DataContext dataContext) { CommandProcessor.getInstance().setCurrentCommandGroupId(EditorActionUtil.DELETE_COMMAND_GROUP); CopyPasteManager.getInstance().stopKillRings(); final Document document = editor.getDocument(); final List<Caret> carets = caret == null ? editor.ge...
executeWriteAction
241,327
TextRange (Editor editor, Caret caret) { int selectionStart = caret.getSelectionStart(); int selectionEnd = caret.getSelectionEnd(); int startOffset = EditorUtil.getNotFoldedLineStartOffset(editor, selectionStart, true); // There is a possible case that selection ends at the line start, i.e. something like below ([...]...
getRangeToDelete
241,328
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { EditorUIUtil.hideCursorInEditor(editor); CommandProcessor.getInstance().setCurrentCommandGroupId(EditorActionUtil.DELETE_COMMAND_GROUP); CopyPasteManager.getInstance().stopKillRings(); if (editor.getInlayModel().hasInlineElementAt(editor.get...
executeWriteAction
241,329
int (Editor editor) { Document document = editor.getDocument(); if (document.getLineCount() == 0) { return 0; } int lineNumber = editor.getCaretModel().getLogicalPosition().line; if (lineNumber >= document.getLineCount()) { return 0; } return document.getLineEndOffset(lineNumber) - document.getLineStartOffset(lineNumbe...
getCaretLineLength
241,330
int (Editor editor) { Document document = editor.getDocument(); if (document.getLineCount() == 0) { return 0; } int lineNumber = editor.getCaretModel().getLogicalPosition().line; if (lineNumber >= document.getLineCount()) { return document.getLineStartOffset(document.getLineCount() - 1); } return document.getLineStartO...
getCaretLineStart
241,331
void (Editor editor) { int lineNumber = editor.getCaretModel().getLogicalPosition().line; int afterLineEnd = EditorModificationUtil.calcAfterLineEnd(editor); Document document = editor.getDocument(); int offset = editor.getCaretModel().getOffset(); if (afterLineEnd < 0 // There is a possible case that caret is located ...
deleteCharAtCaret
241,332
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return getTargetLineRange(caret) != null; }
isEnabledForCaret
241,333
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { if (caret == null) caret = editor.getCaretModel().getPrimaryCaret(); Document document = editor.getDocument(); Couple<Integer> lineRange = getTargetLineRange(caret); if (lineRange == null) { return; } int startLine = lineRange.first; int en...
executeWriteAction
241,334
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return getHandler(IdeActions.ACTION_EDITOR_ENTER).isEnabled(editor, caret, dataContext); }
isEnabledForCaret
241,335
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { editor.getSelectionModel().removeSelection(); LogicalPosition caretPosition = editor.getCaretModel().getLogicalPosition(); final int line = caretPosition.line; int lineStartOffset = editor.getDocument().getLineStartOffset(line); editor.getCa...
executeWriteAction
241,336
EditorActionHandler (@NotNull String actionId) { return EditorActionManager.getInstance().getActionHandler(actionId); }
getHandler
241,337
void () { String text = getSelectedText(); if (!text.isEmpty()) { CopyPasteManager.getInstance().setContents(new StringSelection(text)); } }
doCopyToClipboardAction
241,338
void (@Nullable Icon icon) { myListEntryIcon = icon; }
setContentIcon
241,339
void (boolean vertical) { mySplitter.setOrientation(vertical); }
setSplitterOrientation
241,340
void (boolean useNumbering) { myUseNumbering = useNumbering; }
setUseNumbering
241,341
JComponent () { return myList; }
getPreferredFocusedComponent
241,342
JComponent () { final int selectionMode = myAllowMultipleSelections ? ListSelectionModel.MULTIPLE_INTERVAL_SELECTION : ListSelectionModel.SINGLE_SELECTION; myList.setSelectionMode(selectionMode); if (myUseIdeaEditor) { EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme(); myList.setFont(schem...
createCenterPanel
241,343
boolean (@NotNull MouseEvent e) { close(OK_EXIT_CODE); return true; }
onDoubleClick
241,344
void (KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_DELETE) { int newSelectionIndex = -1; for (Item o : myList.getSelectedValuesList()) { int i = o.index; removeContentAt(myAllContents.get(i)); if (newSelectionIndex < 0) { newSelectionIndex = i; } } rebuildListContent(); if (myAllContents.isEmpty()) { close(CANCEL_EX...
keyPressed
241,345
void (KeyEvent e) { // we handle keyPressed for numbers and close dialog but we have to handle typed and released events too if (doConsume) { e.consume(); } }
keyTyped
241,346
void (KeyEvent e) { // we handle keyPressed for numbers and close dialog but we have to handle typed and released events too if (doConsume) { e.consume(); } }
keyReleased
241,347
void (ComponentEvent e) { FontMetrics metrics = myList.getFontMetrics(myList.getFont()); int charWidth = metrics.charWidth('i'); renderer.previewChars = myList.getParent().getParent().getWidth() / charWidth + 10; }
componentResized
241,348
void (ListSelectionEvent e) { if (myUpdateAlarm.isDisposed()) return; myUpdateAlarm.cancelAllRequests(); myUpdateAlarm.addRequest(() -> updateViewerForSelection(), 100); }
valueChanged
241,349
String () { return getClass().getName(); // store different values for multi-paste, history and commit messages }
getDimensionServiceKey
241,350
void () { if (getSelectedIndex() < 0) return; super.doOKAction(); }
doOKAction
241,351
void () { if (myAllContents.isEmpty()) return; @NonNls String fullString = getSelectedText(); if (myViewer != null) { EditorFactory.getInstance().releaseEditor(myViewer); } if (myUseIdeaEditor) { myViewer = createIdeaEditor(fullString); JComponent component = myViewer.getComponent(); component.setPreferredSize(JBUI.siz...
updateViewerForSelection
241,352
Editor (String text) { Document doc = EditorFactory.getInstance().createDocument(text); Editor editor = EditorFactory.getInstance().createViewer(doc, myProject); editor.getSettings().setFoldingOutlineShown(false); editor.getSettings().setLineNumbersShown(false); editor.getSettings().setLineMarkerAreaShown(false); edito...
createIdeaEditor
241,353
void () { super.dispose(); SplitterProportionsData d = new SplitterProportionsDataImpl(); d.externalizeToDimensionService(getClass().getName()); d.saveSplitterProportions(mySplitter); if (myViewer != null) { EditorFactory.getInstance().releaseEditor(myViewer); myViewer = null; } }
dispose
241,354
void () { List<Item> items = new ArrayList<>(); int index = 0; List<Data> contents = new ArrayList<>(getContents()); for (Data content : contents) { String longText = getStringRepresentationFor(content); if (!StringUtil.isEmpty(longText)) { items.add(new Item(index, longText)); } index++; } myAllContents = contents; Fi...
rebuildListContent
241,355
int () { Item o = myList.getSelectedValue(); return o == null? -1 : o.index; }
getSelectedIndex
241,356
void (int index) { myList.setSelectedIndex(index); ScrollingUtil.ensureIndexIsVisible(myList, index, 0); updateViewerForSelection(); }
setSelectedIndex
241,357
List<Data> () { return JBIterable.from(myList.getSelectedValuesList()).map(o -> myAllContents.get(o.index)).toList(); }
getSelectedContents
241,358
List<Data> () { return myAllContents; }
getAllContents
241,359
String () { StringBuilder sb = new StringBuilder(); boolean first = true; for (Item o : myList.getSelectedValuesList()) { if (first) first = false; else sb.append("\n"); String s = o.longText; sb.append(StringUtil.convertLineSeparators(s)); } return sb.toString(); }
getSelectedText
241,360
void (@NotNull JList list, Item value, int index, boolean selected, boolean hasFocus) { setIcon(myListEntryIcon); if (myUseIdeaEditor && myUseNumbering) { int max = list.getModel().getSize(); String indexString = String.valueOf(index + 1); int count = String.valueOf(max).length() - indexString.length(); String prefix =...
customizeCellRenderer
241,361
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { SelectionModel selectionModel = editor.getSelectionModel(); if (!selectionModel.hasSelection()) { return; } final int start = selectionModel.getSelectionStart(); final int end = selectionModel.getSelectionEnd(); if (start >= end) { return; ...
doExecute
241,362
void () { editor.getDocument().deleteString(start, end); }
run
241,363
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return !myRemove || editor.getDocument().isWritable(); }
isEnabledForCaret
241,364
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { final SelectionModel selectionModel = editor.getSelectionModel(); final CaretModel caretModel = editor.getCaretModel(); ScrollingModel scrollingModel = editor.getScrollingModel(); if (selectionModel.hasSelection() && (!(editor instanceof Edi...
doExecute
241,365
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return !ModifierKeyDoubleClickHandler.getInstance().isRunningAction() || EditorSettingsExternalizable.getInstance().addCaretsOnDoubleCtrl(); }
isEnabledForCaret
241,366
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { VisualPosition currentPosition = caret.getVisualPosition(); if (caret.isAtBidiRunBoundary() && (myMoveRight ^ currentPosition.leansRight)) { int selectionStartToUse = caret.getLeadSelectionOffset(); VisualPosition selectionStartPositionToUse...
doExecute
241,367
void (Editor editor, boolean state) { editor.getSettings().setLineNumbersShown(state); }
setOption
241,368
boolean (Editor editor) { return editor.getSettings().isLineNumbersShown(); }
getOption
241,369
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { int endOffset = editor.getDocument().getTextLength(); List<Caret> carets = editor.getCaretModel().getAllCarets(); if (editor.isColumnMode() && editor.getCaretModel().supportsMultipleCarets()) { if (caret == null) { // normally we're always ...
doExecute
241,370
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { Project project = CommonDataKeys.PROJECT.getData(dataContext); if (isEnabled(editor, caret, dataContext)) { indentSelection(editor, project); } }
executeWriteAction
241,371
void (Editor editor, Presentation presentation, DataContext dataContext) { presentation.setEnabled(originalIsEnabled(editor, true)); }
update
241,372
void (Editor editor, Presentation presentation, DataContext dataContext) { presentation.setEnabled(isEnabled(editor, dataContext)); }
updateForKeyboardAccess
241,373
boolean (Editor editor, DataContext dataContext) { return originalIsEnabled(editor, true); }
isEnabled
241,374
boolean (Editor editor, boolean wantSelection) { return (!wantSelection || hasSuitableSelection(editor)) && !editor.isOneLineMode() && !editor.isViewer(); }
originalIsEnabled
241,375
boolean (Editor editor) { if (!editor.getSelectionModel().hasSelection()) { return false; } Document document = editor.getDocument(); int selectionStart = editor.getSelectionModel().getSelectionStart(); int selectionEnd = editor.getSelectionModel().getSelectionEnd(); return !CharArrayUtil.containsOnlyWhiteSpaces(docume...
hasSuitableSelection
241,376
void (Editor editor, Project project) { int oldSelectionStart = editor.getSelectionModel().getSelectionStart(); int oldSelectionEnd = editor.getSelectionModel().getSelectionEnd(); if (!editor.getSelectionModel().hasSelection()) { oldSelectionStart = editor.getCaretModel().getOffset(); oldSelectionEnd = oldSelectionStar...
indentSelection
241,377
void (final int endIndex, final int startIndex, final Document document, final Project project, final Editor editor, final int blockIndent) { final int[] caretOffset = {editor.getCaretModel().getOffset()}; SelectionModel selectionModel = editor.getSelectionModel(); boolean extendSelection = selectionModel.hasSelection(...
doIndent
241,378
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { EditorUIUtil.hideCursorInEditor(editor); CommandProcessor.getInstance().setCurrentCommandGroupId(EditorActionUtil.DELETE_COMMAND_GROUP); if (editor instanceof EditorWindow) { // manipulate actual document/editor instead of injected // since ...
executeWriteAction
241,379
void (@NotNull Editor editor) { VisualPosition caretPosition = editor.getCaretModel().getVisualPosition(); if (caretPosition.column > 0 && editor.getInlayModel().hasInlineElementAt(new VisualPosition(caretPosition.line, caretPosition.column - 1))) { editor.getCaretModel().moveCaretRelatively(-1, 0, false, false, Editor...
doBackSpaceAtCaret
241,380
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { CommandProcessor.getInstance().setCurrentCommandGroupId(EditorActionUtil.DELETE_COMMAND_GROUP); CopyPasteManager.getInstance().stopKillRings(); boolean camelMode = editor.getSettings().isCamelWords(); if (myNegateCamelMode) { camelMode = !ca...
executeWriteAction
241,381
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
241,382
void (@NotNull AnActionEvent e) { Editor editor = e.getData(CommonDataKeys.EDITOR); if (editor == null || editor.getEditorKind() != EditorKind.PREVIEW) { e.getPresentation().setEnabledAndVisible(false); return; } super.update(e); }
update
241,383
boolean (@NotNull AnActionEvent e) { Editor editor = e.getData(CommonDataKeys.EDITOR); return editor != null && editor.getSettings().isUseSoftWraps(); }
isSelected
241,384
void (@NotNull AnActionEvent e, boolean state) { Editor editor = e.getData(CommonDataKeys.EDITOR); if (editor != null) AbstractToggleUseSoftWrapsAction.toggleSoftWraps(editor, SoftWrapAppliancePlaces.PREVIEW, state); }
setSelected
241,385
void (String @NotNull [] lines) { Arrays.parallelSort(lines); }
permute
241,386
void (@NotNull Editor editor, Caret caret, DataContext dataContext) { boolean camelMode = editor.getSettings().isCamelWords(); int endOffset = editor.getCaretModel().getOffset(); int startOffset = EditorActionUtil.getPreviousCaretStopOffset(editor, WORD_START_IGNORE_LINE_BREAK, camelMode, true); if (startOffset != endO...
executeWriteAction
241,387
void (@NotNull Editor editor, Caret caret, DataContext dataContext) { TextRange range = null; if (myTransferable != null) { TextRange[] ranges = EditorCopyPasteHelper.getInstance().pasteTransferable(editor, myTransferable); if (ranges != null && ranges.length == 1) { range = ranges[0]; } } editor.putUserData(EditorEx.L...
executeWriteAction
241,388
void (@NotNull AnActionEvent e) { // actual logic is implemented in EditorImpl }
actionPerformed
241,389
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
241,390
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(false); }
update
241,391
void (String @NotNull [] lines) { int halfSize = lines.length / 2; for (int i = 0; i < halfSize; i++) { int oppositeI = lines.length - 1 - i; String tmp = lines[i]; lines[i] = lines[oppositeI]; lines[oppositeI] = tmp; } }
permute
241,392
float () { UISettingsUtils uiSettings = UISettingsUtils.getInstance(); return ConsoleViewUtil.isConsoleViewEditor(myEditorEx) ? uiSettings.getScaledConsoleFontSize() : uiSettings.getScaledEditorFontSize(); }
getFontSize
241,393
void (float fontSize) { myEditorEx.setFontSize(fontSize); }
setFontSize
241,394
String (float fontSize) { return IdeBundle.message("action.reset.font.size", fontSize); }
getText
241,395
float () { return UISettingsUtils.getInstance().scaleFontSize(getUnscaledFontSize()); }
getFontSize
241,396
float () { PropertiesComponent propertyComponent = PropertiesComponent.getInstance(); if (ConsoleViewUtil.isConsoleViewEditor(myEditorEx)) { return propertyComponent.getFloat(UNSCALED_FONT_SIZE_TO_RESET_CONSOLE, -1); } return propertyComponent.getFloat(UNSCALED_FONT_SIZE_TO_RESET_EDITOR, -1); }
getUnscaledFontSize
241,397
void () { setFontSize(getUnscaledFontSize()); }
reset
241,398
void (float fontSize) { EditorColorsManager.getInstance().getGlobalScheme().setEditorFontSize(fontSize); ApplicationManager.getApplication().getMessageBus().syncPublisher(EditorColorsManager.TOPIC).globalSchemeChange(null); }
setFontSize
241,399
String (float fontSize) { return IdeBundle.message("action.reset.font.size.all.editors", fontSize); }
getText