Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
241,400
float () { return UISettingsUtils.getInstance().getPresentationModeFontSize(); }
getFontSize
241,401
void (float fontSize) { int fs = (int)fontSize; for (Editor editor : EditorFactory.getInstance().getAllEditors()) { if (editor instanceof EditorEx) { ((EditorEx)editor).setFontSize(fs); } } }
setFontSize
241,402
String (float fontSize) { return IdeBundle.message("action.reset.font.size", fontSize); }
getText
241,403
Strategy (EditorEx editor, boolean forceGlobal) { if (editor instanceof EditorImpl) { if (forceGlobal) { return new AllEditorsStrategy(editor); } if (UISettings.getInstance().getPresentationMode()) { return new PresentationModeStrategy(); } if (EditorSettingsExternalizable.getInstance().isWheelFontChangePersistent()) {...
getStrategy
241,404
void (@NotNull AnActionEvent e) { Editor editor = e.getData(CommonDataKeys.EDITOR); if (e.getPlace().equals(ActionPlaces.POPUP) && editor != null) { if (!(editor instanceof EditorEx editorEx)) { return; } Strategy strategy = getStrategy(editorEx, myGlobal); float toReset = strategy.getFontSize(); //noinspection DialogT...
update
241,405
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { if (!(editor instanceof EditorEx)) { return; } getStrategy((EditorEx)editor, myGlobal).reset(); }
doExecute
241,406
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { final Document doc = editor.getDocument(); LogicalPosition caretPosition = caret.getLogicalPosition(); int startLine = caretPosition.line; int endLine = startLine + 1; if (caret.hasSelection()) { startLine = doc.getLineNumber(caret.getSelect...
executeWriteAction
241,407
void (@NotNull AnActionEvent e, boolean state) { final EditorEx editor = getEditor(e); final SelectionModel selectionModel = editor.getSelectionModel(); final CaretModel caretModel = editor.getCaretModel(); if (state) { caretModel.removeSecondaryCarets(); boolean hasSelection = selectionModel.hasSelection(); int selSta...
setSelected
241,408
boolean (@NotNull AnActionEvent e) { final EditorEx ex = getEditor(e); return ex != null && ex.isColumnMode(); }
isSelected
241,409
EditorEx (@NotNull AnActionEvent e) { return (EditorEx)e.getData(CommonDataKeys.EDITOR); }
getEditor
241,410
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
241,411
void (@NotNull AnActionEvent e) { EditorEx editor = getEditor(e); if (editor == null || editor.isOneLineMode()) { e.getPresentation().setEnabledAndVisible(false); } else { e.getPresentation().setEnabledAndVisible(true); super.update(e); } }
update
241,412
void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); DataContext dataContext = e.getDataContext(); Editor editor = CommonDataKeys.EDITOR.getData(dataContext); if (editor == null || SystemInfo.isWindows || SystemInfo.isMac) { presentation.setEnabled(false); } else { boolean rightPlace = tru...
update
241,413
Transferable (Editor editor, DataContext dataContext) { Clipboard clip = editor.getComponent().getToolkit().getSystemSelection(); if (clip == null) return null; try { return clip.getContents(null); } catch (Exception e) { LOG.info(e); return null; } }
getContentsToPaste
241,414
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { EditorActionUtil.moveCaretPageTop(editor, true); }
doExecute
241,415
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return editor instanceof EditorEx; }
isEnabledForCaret
241,416
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { new Task.Modal(editor.getProject(), EditorBundle.message("fonts.used.by.editor.progress"), true) { private @Nls String textToShow; @Override public void run(@NotNull ProgressIndicator indicator) { Set<@NlsSafe String> fontNames = ReadAction...
doExecute
241,417
void (@NotNull ProgressIndicator indicator) { Set<@NlsSafe String> fontNames = ReadAction.compute(() -> collectFontNames((EditorEx)editor)); textToShow = StringUtil.join(fontNames, "\n"); }
run
241,418
void () { if (textToShow != null) { new MyDialog(textToShow).show(); } }
onSuccess
241,419
void (@NotNull Set<? super String> result, @NotNull CharSequence text, int startOffset, int endOffset, @NotNull FontFallbackIterator ffi) { if (startOffset >= endOffset) return; ffi.start(text, startOffset, endOffset); while (!ffi.atEnd()) { ProgressManager.checkCanceled(); Font font = ffi.getFont(); List<String> compo...
collectFontNames
241,420
void (double progress) { ProgressIndicator indicator = ProgressIndicatorProvider.getGlobalProgressIndicator(); if (indicator != null) { indicator.setFraction(progress); } }
setProgress
241,421
JComponent () { return new JBScrollPane(myTextArea); }
createCenterPanel
241,422
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { final Document document = editor.getDocument(); final int caretOffset = editor.getCaretModel().getOffset(); if (caretOffset < 1) { return; } final SelectionModel selectionModel = editor.getSelectionModel(); final CharSequence text = document...
executeWriteAction
241,423
void (final @NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { if (caret == null && editor.getCaretModel().getCaretCount() > 1) { editor.getCaretModel().runForEachCaret(c -> c.setSelection(c.getOffset(), getEndOffset(c))); // We don't support kill-ring operations for multiple carets currently Edi...
executeWriteAction
241,424
int (@NotNull Caret caret) { Document document = caret.getEditor().getDocument(); int startOffset = caret.getOffset(); int endOffset = DocumentUtil.getLineEndOffset(startOffset, document); if (endOffset < document.getTextLength() && CharArrayUtil.isEmptyOrSpaces(document.getImmutableCharSequence(), startOffset, endOffs...
getEndOffset
241,425
void (@NotNull AnActionEvent e, boolean state) { final Editor editor = getEditor(e); assert editor != null; setOption(editor, state); editor.getComponent().repaint(); }
setSelected
241,426
boolean (@NotNull AnActionEvent e) { Editor editor = getEditor(e); return editor != null && getOption(editor); }
isSelected
241,427
void (@NotNull AnActionEvent e) { super.update(e); e.getPresentation().setEnabled(getEditor(e) != null); }
update
241,428
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
241,429
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { if (!caret.hasSelection()) { return; } final int start = caret.getSelectionStart(); final int end = caret.getSelectionEnd(); boolean moveToEnd = caret.getOffset() == start; if (editor instanceof EditorEx editorEx) { if (editorEx.isStickySele...
doExecute
241,430
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { EditorActionUtil.moveCaretToTextEnd(editor, CommonDataKeys.PROJECT.getData(dataContext)); }
doExecute
241,431
void (@NotNull Editor editor, Caret caret, DataContext dataContext) { boolean camelMode = editor.getSettings().isCamelWords(); int startOffset = editor.getCaretModel().getOffset(); int endOffset = EditorActionUtil.getNextCaretStopOffset(editor, WORD_END_IGNORE_LINE_BREAK, camelMode, true); if (startOffset != endOffset)...
executeWriteAction
241,432
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { if (caret == editor.getCaretModel().getPrimaryCaret()) { EditorActionUtil.moveCaretRelativelyAndScroll(editor, 0, 1, true); } else { editor.getCaretModel().moveCaretRelatively(0, 1, true, false, false); } }
doExecute
241,433
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { if (caret == editor.getCaretModel().getPrimaryCaret()) { EditorActionUtil.moveCaretRelativelyAndScroll(editor, 0, -1, true); } else { editor.getCaretModel().moveCaretRelatively(0, -1, true, false, false); } }
doExecute
241,434
void (@NotNull AnActionEvent e) { final EditorImpl editor = getEditor(e); if (editor != null) { float step = myStep; if (myGlobal) { step *= UISettingsUtils.getInstance().getCurrentIdeScale(); } final float size = editor.getFontSize2D() + step; final float unscaledSize = UISettingsUtils.scaleFontSize(size, 1 / UISettin...
actionPerformed
241,435
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
241,436
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(getEditor(e) != null); }
update
241,437
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { if (caret == editor.getCaretModel().getPrimaryCaret()) { EditorActionUtil.moveCaretRelativelyAndScroll(editor, 0, -1, false); } else { editor.getCaretModel().moveCaretRelatively(0, -1, false, false, false); } }
doExecute
241,438
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { boolean savedSetting = EditorSettingsExternalizable.getInstance().isRefrainFromScrolling(); boolean overriddenInEditor = false; try { EditorSettingsExternalizable.getInstance().setRefrainFromScrolling(false); if (editor.getSettings().isRefr...
doExecute
241,439
void () { getHandler().runForAllCarets(); // triggers DynamicEditorActionHandler.getHandlerChain }
ensureHandlerChainIsLoaded
241,440
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
241,441
void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { EditorActionUtil.moveCaretPageUp(editor, false); }
doExecute
241,442
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return !editor.isOneLineMode(); }
isEnabledForCaret
241,443
boolean (@NotNull AnActionEvent e) { return EditorSettingsExternalizable.getInstance().isLineNumbersShown(); }
isSelected
241,444
void (@NotNull AnActionEvent e, boolean state) { EditorSettingsExternalizable.getInstance().setLineNumbersShown(state); Editor editor = e.getData(CommonDataKeys.EDITOR); if (editor != null && editor.getSettings().isLineNumbersShown() != state) { editor.getSettings().setLineNumbersShown(state); } EditorFactory.getInstan...
setSelected
241,445
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
241,446
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { editor.getScrollingModel().scrollTo(editor.offsetToLogicalPosition(editor.getDocument().getTextLength()), ScrollType.CENTER); }
doExecute
241,447
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { editor.getScrollingModel().scrollVertically(0); }
doExecute
241,448
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
241,449
void (@NotNull AnActionEvent e) { VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY); String fromWhere = computeFromWhere(files); boolean enabled = fromWhere != null; e.getPresentation().setEnabled(enabled); e.getPresentation().setVisible(enabled || ActionPlaces.isMainMenuOrActionSearch(e.getPlace())); ...
update
241,450
String (VirtualFile[] files) { if (files == null || files.length == 0) { return null; } String fromWhere = null; for (VirtualFile file : files) { if (file.isDirectory()) { // Accurate calculation is very costly especially in presence of excluded directories! fromWhere = "all files in '" + file.getName() + "' directory ...
computeFromWhere
241,451
void (@NotNull AnActionEvent e) { VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY); if (files == null) { return; } List<VirtualFile> filesToProcess = getFilesWithBom(files); if (filesToProcess.isEmpty()) return; List<VirtualFile> filesUnableToProcess = new ArrayList<>(); new Task.Backgroundable(getEve...
actionPerformed
241,452
void (@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(false); for (int i = 0; i < filesToProcess.size(); i++) { ProgressManager.checkCanceled(); VirtualFile virtualFile = filesToProcess.get(i); indicator.setFraction(i*1.0/filesToProcess.size()); indicator.setText2(StringUtil.shortenPathWithEllipsis(v...
run
241,453
boolean (@NotNull VirtualFile file) { return CharsetToolkit.getMandatoryBom(file.getCharset()) != null; }
isBOMMandatory
241,454
void (@NotNull VirtualFile virtualFile, byte @NotNull [] bom) { virtualFile.setBOM(null); try { byte[] bytes = virtualFile.contentsToByteArray(); byte[] contentWithStrippedBom = Arrays.copyOfRange(bytes, bom.length, bytes.length); WriteAction.runAndWait(() -> virtualFile.setBinaryContent(contentWithStrippedBom)); } cat...
doRemoveBOM
241,455
List<VirtualFile> (VirtualFile @NotNull [] roots) { List<VirtualFile> result = new ArrayList<>(); for (VirtualFile root : roots) { VfsUtilCore.visitChildrenRecursively(root, new VirtualFileVisitor<Void>() { @Override public boolean visitFile(@NotNull VirtualFile file) { if (!file.isDirectory() && file.getBOM() != null)...
getFilesWithBom
241,456
boolean (@NotNull VirtualFile file) { if (!file.isDirectory() && file.getBOM() != null) { result.add(file); } return true; }
visitFile
241,457
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { IdeFocusManager.getGlobalInstance().requestFocus(((EditorImpl)editor).getGutterComponentEx(), true); }
doExecute
241,458
boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { return ScreenReader.isActive(); }
isEnabledForCaret
241,459
void (final @NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { final SelectionModel selectionModel = editor.getSelectionModel(); int changedLines = 0; if (selectionModel.hasSelection()) { changedLines = performAction(editor, new TextRange(selectionModel.getSelectionStart(), selectionModel.getSele...
executeWriteAction
241,460
void (@NotNull Document document, int startOffset, int endOffset) { try { document.deleteString(startOffset, endOffset); } catch (ReadOnlyFragmentModificationException ex) { RangeMarker block = ex.getGuardedBlock(); if (block.getEndOffset() < endOffset) { throw ex; } CharSequence blockPrefix = document.getImmutableChar...
deleteString
241,461
void (@NotNull Document document, int offset, @NotNull CharSequence s) { try { document.insertString(offset, s); } catch (ReadOnlyFragmentModificationException ex) { String blockPrefix = document.getImmutableCharSequence().subSequence(ex.getGuardedBlock().getStartOffset(), offset).toString(); if (!blockPrefix.isEmpty()...
insertString
241,462
void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { EditorActionUtil.scrollRelatively(editor, 1, 0, false); }
doExecute
241,463
void (@NotNull AnActionEvent e) { // actual logic is implemented in EditorImpl }
actionPerformed
241,464
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
241,465
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(false); }
update
241,466
void (final int columnShift, final int lineShift, final boolean withSelection, final boolean blockSelection, final boolean scrollToCaret) { if (lineShift == 0 && !withSelection && !blockSelection) { moveToOffset(getOffset() + columnShift); if (scrollToCaret) { myEditor.getScrollingModel().scrollToCaret(ScrollType.RELAT...
moveCaretRelatively
241,467
void (final @NotNull CaretListener listener) { throw new UnsupportedOperationException("Not implemented"); }
addCaretListener
241,468
void (final @NotNull CaretListener listener) { throw new UnsupportedOperationException("Not implemented"); }
removeCaretListener
241,469
TextAttributes () { return null; }
getTextAttributes
241,470
boolean () { return false; }
supportsMultipleCarets
241,471
int () { return 1; }
getMaxCaretCount
241,472
Caret () { return myCaret; }
getCurrentCaret
241,473
Caret () { return myCaret; }
getPrimaryCaret
241,474
int () { return 1; }
getCaretCount
241,475
List<Caret> () { return Collections.singletonList(myCaret); }
getAllCarets
241,476
boolean (@NotNull Caret caret) { return false; }
removeCaret
241,477
void () { }
removeSecondaryCarets
241,478
void (@NotNull List<? extends CaretState> caretStates) { if (caretStates.size() < 1) throw new IllegalArgumentException("Empty list"); CaretState state = caretStates.get(0); if (state != null) { if (state.getCaretPosition() != null) moveToLogicalPosition(state.getCaretPosition()); if (state.getSelectionStart() != null ...
setCaretsAndSelections
241,479
void (@NotNull List<? extends CaretState> caretStates, boolean updateSystemSelection) { setCaretsAndSelections(caretStates); }
setCaretsAndSelections
241,480
List<CaretState> () { return Collections.singletonList(new CaretState(getLogicalPosition(), myEditor.offsetToLogicalPosition(myEditor.getSelectionModel().getSelectionStart()), myEditor.offsetToLogicalPosition(myEditor.getSelectionModel().getSelectionEnd()))); }
getCaretsAndSelections
241,481
void (@NotNull CaretAction action) { myCaretActionListeners.getMulticaster().beforeAllCaretsAction(); action.perform(myCaret); myCaretActionListeners.getMulticaster().afterAllCaretsAction(); }
runForEachCaret
241,482
void (@NotNull CaretAction action, boolean reverseOrder) { runForEachCaret(action); }
runForEachCaret
241,483
void (@NotNull CaretActionListener listener, @NotNull Disposable disposable) { myCaretActionListeners.addListener(listener, disposable); }
addCaretActionListener
241,484
void (@NotNull Runnable runnable) { runnable.run(); }
runBatchCaretOperation
241,485
CharSequence () { try { final Document document = myTextComponent.getDocument(); return document.getText(0, document.getLength()); } catch (BadLocationException e) { throw new RuntimeException(e); } }
getImmutableCharSequence
241,486
String (@NotNull TextRange range) { try { final Document document = myTextComponent.getDocument(); return document.getText(range.getStartOffset(), range.getLength()); } catch (BadLocationException e) { throw new RuntimeException(e); } }
getText
241,487
int () { return myTextComponent.getDocument().getLength(); }
getTextLength
241,488
int () { return 1; }
getLineCount
241,489
int (final int offset) { return 0; }
getLineNumber
241,490
int (final int line) { return 0; }
getLineStartOffset
241,491
int (final int line) { return getTextLength(); }
getLineEndOffset
241,492
void (final int offset, final @NotNull CharSequence s) { try { myTextComponent.getDocument().insertString(offset, s.toString(), null); } catch (BadLocationException e) { throw new RuntimeException(e); } }
insertString
241,493
void (final int startOffset, final int endOffset) { try { myTextComponent.getDocument().remove(startOffset, endOffset - startOffset); } catch (BadLocationException e) { throw new RuntimeException(e); } }
deleteString
241,494
void (final int startOffset, final int endOffset, final @NotNull CharSequence s) { final Document document = myTextComponent.getDocument(); try { document.remove(startOffset, endOffset-startOffset); document.insertString(startOffset, s.toString(), null); } catch (BadLocationException e) { throw new RuntimeException(e);...
replaceString
241,495
boolean () { return true; }
isWritable
241,496
RangeMarker (int startOffset, int endOffset, boolean surviveOnExternalChange) { throw new UnsupportedOperationException("Not implemented"); }
createRangeMarker
241,497
RangeMarker (int startOffset, int endOffset) { throw new UnsupportedOperationException("Not implemented"); }
createGuardedBlock
241,498
void (@NotNull CharSequence text) { throw new UnsupportedOperationException("Not implemented"); }
setText
241,499
long () { throw new UnsupportedOperationException("Not implemented"); }
getModificationStamp