Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
256,800
boolean () { return myDisposed; }
isDisposed
256,801
boolean () { return myContext.isWindowFocused(); }
tryRediffSynchronously
256,802
boolean () { // most of performRediff implementations take ReadLock inside. If EDT is holding write lock - this will never happen, // and diff will not be calculated. This could happen for diff from FileDocumentManager. return ApplicationManager.getApplication().isWriteAccessAllowed(); }
forceRediffSynchronously
256,803
List<AnAction> () { List<AnAction> group = new ArrayList<>(); group.add(ActionManager.getInstance().getAction(IdeActions.DIFF_VIEWER_TOOLBAR)); return group; }
createToolbarActions
256,804
List<AnAction> () { List<AnAction> group = new ArrayList<>(); group.add(ActionManager.getInstance().getAction(IdeActions.DIFF_VIEWER_POPUP)); return group; }
createPopupActions
256,805
JComponent () { return null; }
getStatusPanel
256,806
void () { }
onInit
256,807
void () { }
onSlowRediff
256,808
void () { }
onBeforeRediff
256,809
void () { }
onAfterRediff
256,810
void () { Disposer.dispose(myTaskAlarm); }
onDispose
256,811
Navigatable () { return null; }
getNavigatable
256,812
void (@NotNull DiffViewerListener listener) { myListeners.add(listener); }
addListener
256,813
void (@NotNull DiffViewerListener listener) { myListeners.remove(listener); }
removeListener
256,814
List<DiffViewerListener> () { return myListeners; }
getListeners
256,815
void (@NotNull EventType type) { for (DiffViewerListener listener : myListeners) { switch (type) { case INIT -> listener.onInit(); case DISPOSE -> listener.onDispose(); case BEFORE_REDIFF -> listener.onBeforeRediff(); case AFTER_REDIFF -> listener.onAfterRediff(); case REDIFF_ABORTED -> listener.onRediffAborted(); } } ...
fireEvent
256,816
Object (@NotNull @NonNls String dataId) { if (DiffDataKeys.NAVIGATABLE.is(dataId)) { return getNavigatable(); } else if (CommonDataKeys.PROJECT.is(dataId)) { return myProject; } else { return null; } }
getData
256,817
void () { super.onInit(); BulkFileListener fileListener = createFileListener(myRequest); if (fileListener != null) { ApplicationManager.getApplication().getMessageBus().connect(this) .subscribe(VirtualFileManager.VFS_CHANGES, fileListener); } DocumentListener documentListener = createDocumentListener(); List<Document> ...
onInit
256,818
DocumentListener () { return new DocumentListener() { @Override public void beforeDocumentChange(@NotNull DocumentEvent event) { onBeforeDocumentChange(event); } @Override public void documentChanged(@NotNull DocumentEvent event) { onDocumentChange(event); } }; }
createDocumentListener
256,819
void (@NotNull DocumentEvent event) { onBeforeDocumentChange(event); }
beforeDocumentChange
256,820
void (@NotNull DocumentEvent event) { onDocumentChange(event); }
documentChanged
256,821
BulkFileListener (@NotNull ContentDiffRequest request) { final List<VirtualFile> files = new ArrayList<>(0); for (DiffContent content : request.getContents()) { if (content instanceof FileContent && !(content instanceof DocumentContent)) { files.add(((FileContent)content).getFile()); } } if (files.isEmpty()) return nul...
createFileListener
256,822
void (@NotNull List<? extends @NotNull VFileEvent> events) { for (VFileEvent event : events) { if (event instanceof VFileContentChangeEvent || event instanceof VFilePropertyChangeEvent) { VirtualFile file = Objects.requireNonNull(event.getFile()); if (files.contains(file)) { onFileChange(file); } } } }
after
256,823
void (@NotNull DocumentEvent event) { scheduleRediff(); }
onDocumentChange
256,824
void (@NotNull DocumentEvent event) { }
onBeforeDocumentChange
256,825
void (@NotNull VirtualFile file) { scheduleRediff(); }
onFileChange
256,826
String () { return DiffBundle.message(myTextKey); }
getText
256,827
boolean () { return this != DO_NOT_HIGHLIGHT; }
isShouldCompare
256,828
boolean () { return getFragmentsPolicy() != InnerFragmentsPolicy.NONE; }
isFineFragments
256,829
boolean () { return this != BY_WORD_SPLIT; }
isShouldSquash
256,830
InnerFragmentsPolicy () { return switch (this) { case BY_WORD, BY_WORD_SPLIT -> InnerFragmentsPolicy.WORDS; case BY_CHAR -> InnerFragmentsPolicy.CHARS; case BY_LINE, DO_NOT_HIGHLIGHT -> InnerFragmentsPolicy.NONE; }; }
getFragmentsPolicy
256,831
void (@Nullable JComponent component) { myNorthPanel.setContent(component); }
setTopPanel
256,832
void (@Nullable JComponent component) { mySouthPanel.setContent(component); }
setBottomPanel
256,833
void (@NotNull String card) { setCurrentCard(card, true); }
setCurrentCard
256,834
void (@NotNull String card, boolean keepFocus) { if (Objects.equals(myCurrentCard, card)) return; Runnable task = () -> { myCardLayout.show(myContentPanel, card); myCurrentCard = card; UIUtil.layoutRecursively(myContentPanel); myContentPanel.repaint(); }; if (keepFocus) { DiffUtil.runPreservingFocus(myContext, task); }...
setCurrentCard
256,835
Object (@NotNull @NonNls String dataId) { return myDataProvider.getData(dataId); }
getData
256,836
void (@NotNull List<? extends JComponent> components) { myPersistentNotifications.clear(); myPersistentNotifications.addAll(components); updateNotifications(); }
setPersistentNotifications
256,837
void () { myNotifications.clear(); updateNotifications(); }
resetNotifications
256,838
void (@Nullable JComponent notification) { if (notification == null) return; myNotifications.add(notification); updateNotifications(); }
addNotification
256,839
void () { List<JComponent> notifications = new ArrayList<>(ContainerUtil.concat(myPersistentNotifications, myNotifications)); notifications = DiffUtil.wrapEditorNotificationBorders(notifications); myNotificationsPanel.setContent(DiffUtil.createStackedComponents(notifications, DiffUtil.TITLE_GAP)); validate(); repaint()...
updateNotifications
256,840
List<AnAction> () { List<AnAction> result = new ArrayList<>(); result.add(ActionManager.getInstance().getAction("CompareClipboardWithSelection")); result.add(Separator.getInstance()); ContainerUtil.addAll(result, ActionManager.getInstance().getAction(IdeActions.GROUP_DIFF_EDITOR_POPUP)); return result; }
createEditorPopupActions
256,841
TextDiffSettings (@NotNull DiffContext context) { TextDiffSettings settings = context.getUserData(TextDiffSettings.KEY); if (settings == null) { settings = TextDiffSettings.getSettings(context.getUserData(DiffUserDataKeys.PLACE)); context.putUserData(TextDiffSettings.KEY, settings); if (isUserDataFlagSet(DiffUserDataKe...
getTextSettings
256,842
void (@NotNull DocumentListener listener, @NotNull List<? extends Document> documents, @NotNull Disposable disposable) { for (Document document : new HashSet<>((Collection<? extends Document>)documents)) { document.addDocumentListener(listener, disposable); } }
installDocumentListeners
256,843
void (@NotNull ContentDiffRequest request) { // Actually, this should be a valid case. But it has little practical sense and will require explicit checks everywhere. // Some listeners will be processed once instead of 2 times, some listeners will cause illegal document modifications. List<DiffContent> contents = reques...
checkDifferentDocuments
256,844
JPanel (@NotNull List<? extends DocumentContent> contents) { boolean isPartialPreview = ContainerUtil.exists(contents, content -> FileDocumentManager.getInstance().isPartialPreviewOfALargeFile(content.getDocument())); if (isPartialPreview) return null; boolean equalCharsets = areEqualCharsets(contents); boolean equalSe...
createEqualContentsNotification
256,845
boolean (@NotNull List<? extends DiffContent> contents) { return areEqualDocumentContentProperties(contents, DocumentContent::getLineSeparator); }
areEqualLineSeparators
256,846
boolean (@NotNull List<? extends DiffContent> contents) { boolean sameCharset = areEqualDocumentContentProperties(contents, DocumentContent::getCharset); boolean sameBOM = areEqualDocumentContentProperties(contents, DocumentContent::hasBom); return sameCharset && sameBOM; }
areEqualCharsets
256,847
void (@NotNull Document document1, int line1, int line2, @NotNull Document document2, int oLine1, int oLine2, boolean isLocalChangeRevert) { DiffUtil.applyModification(document1, line1, line2, document2, oLine1, oLine2); if (isLocalChangeRevert) { DiffUtil.clearLineModificationFlags(document1, line1, line1 + (oLine2 - ...
applyModification
256,848
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
256,849
void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); presentation.setText(getText(getValue())); }
update
256,850
DefaultActionGroup (@NotNull JComponent button, @NotNull DataContext context) { return getActions(); }
createPopupActionGroup
256,851
DefaultActionGroup () { if (myActions == null) { myActions = new DefaultActionGroup(); for (T setting : getAvailableOptions()) { myActions.add(new MyAction(setting)); } } return myActions; }
getActions
256,852
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
256,853
void (@NotNull AnActionEvent e) { Toggleable.setSelected(e.getPresentation(), getValue() == myOption); }
update
256,854
void (@NotNull AnActionEvent e) { setValue(myOption); }
actionPerformed
256,855
void (@NotNull AnActionEvent e) { super.update(e); e.getPresentation().setEnabledAndVisible(myPolicies.length > 1); }
update
256,856
List<T> () { return ContainerUtil.sorted(Arrays.asList(myPolicies)); }
getAvailableOptions
256,857
T () { T value = getStoredValue(); if (ArrayUtil.contains(value, myPolicies)) return value; List<T> substitutes = getValueSubstitutes(value); for (T substitute : substitutes) { if (ArrayUtil.contains(substitute, myPolicies)) return substitute; } return myPolicies[0]; }
getValue
256,858
List<T> (@NotNull T value) { return Collections.emptyList(); }
getValueSubstitutes
256,859
void (@NotNull HighlightPolicy option) { if (getValue() == option) return; DiffUsageTriggerCollector.logToggleHighlightPolicy(option, mySettings.getPlace()); mySettings.setHighlightPolicy(option); }
setValue
256,860
HighlightPolicy () { return mySettings.getHighlightPolicy(); }
getStoredValue
256,861
List<HighlightPolicy> (@NotNull HighlightPolicy value) { if (value == HighlightPolicy.BY_WORD_SPLIT) { return Collections.singletonList(HighlightPolicy.BY_WORD); } if (value == HighlightPolicy.DO_NOT_HIGHLIGHT) { return Collections.singletonList(HighlightPolicy.BY_LINE); } return Collections.singletonList(HighlightPoli...
getValueSubstitutes
256,862
String (@NotNull HighlightPolicy option) { return option.getText(); }
getText
256,863
void (@NotNull IgnorePolicy option) { if (getValue() == option) return; DiffUsageTriggerCollector.logToggleIgnorePolicy(option, mySettings.getPlace()); mySettings.setIgnorePolicy(option); }
setValue
256,864
IgnorePolicy () { return mySettings.getIgnorePolicy(); }
getStoredValue
256,865
List<IgnorePolicy> (@NotNull IgnorePolicy value) { if (value == IgnorePolicy.IGNORE_WHITESPACES_CHUNKS) { return Collections.singletonList(IgnorePolicy.IGNORE_WHITESPACES); } if (value == IgnorePolicy.FORMATTING) { return Collections.singletonList(IgnorePolicy.TRIM_WHITESPACES); } return Collections.singletonList(Ignor...
getValueSubstitutes
256,866
String (@NotNull IgnorePolicy option) { return option.getText(); }
getText
256,867
boolean () { return super.isVisible() && !mySettings.isEnableAligningChangesMode(); }
isVisible
256,868
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
256,869
boolean (AnActionEvent e) { return mySettings.isEnableSyncScroll(); }
isSelected
256,870
void (AnActionEvent e, boolean state) { mySettings.setEnableSyncScroll(state); }
setSelected
256,871
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
256,872
boolean () { return mySettings.getContextRange() != -1; }
isVisible
256,873
boolean (AnActionEvent e) { return !mySettings.isExpandByDefault(); }
isSelected
256,874
void (AnActionEvent e, boolean state) { boolean expand = !state; if (mySettings.isExpandByDefault() == expand) return; mySettings.setExpandByDefault(expand); expandAll(expand); }
setSelected
256,875
void (boolean expand) { myFoldingSupport.expandAll(expand); }
expandAll
256,876
void () { if (isVisible()) { // apply default state setSelected(isSelected()); } }
applyDefaults
256,877
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
256,878
void (@NotNull AnActionEvent e) { if (!isVisible()) { e.getPresentation().setEnabledAndVisible(false); } else { super.update(e); } }
update
256,879
boolean (@NotNull AnActionEvent e) { return isSelected(); }
isSelected
256,880
void (@NotNull AnActionEvent e, boolean state) { setSelected(state); }
setSelected
256,881
boolean () { return myContext.getUserData(DiffUserDataKeysEx.SHOW_READ_ONLY_LOCK) == Boolean.TRUE && canEdit(); }
isVisible
256,882
void (@NotNull EditorEx editor, boolean readOnly) { if (readOnly) { EditorModificationUtil.setReadOnlyHint(editor, DiffBundle.message("editing.viewer.hint.enable.editing.text"), (e) -> { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { setSelected(false); } }); } else { EditorModificationUtil.setReadOnlyHi...
putEditorHint
256,883
void (boolean readOnly) { for (EditorEx editor : myEditableEditors) { editor.setViewer(readOnly); putEditorHint(editor, readOnly); } }
doApply
256,884
boolean () { return !myEditableEditors.isEmpty(); }
canEdit
256,885
void (@NotNull Disposable disposable) { if (myEditors.size() < 2) return; for (EditorEx editor : myEditors) { editor.addPropertyChangeListener(this, disposable); } }
install
256,886
void (PropertyChangeEvent evt) { if (myDuringUpdate) return; if (!EditorEx.PROP_FONT_SIZE_2D.equals(evt.getPropertyName())) return; if (evt.getOldValue().equals(evt.getNewValue())) return; float fontSize = ((Float)evt.getNewValue()).floatValue(); for (EditorEx editor : myEditors) { if (evt.getSource() != editor) update...
propertyChange
256,887
void (@NotNull EditorEx editor, float fontSize) { try { myDuringUpdate = true; editor.setFontSize(fontSize); } finally { myDuringUpdate = false; } }
updateEditor
256,888
void (@NotNull List<? extends EditorEx> editors, @NotNull JComponent component) { DiffUtil.recursiveRegisterShortcutSet(new DefaultActionGroup(myEditorPopupActions), component, null); EditorPopupHandler handler = new ContextMenuPopupHandler.Simple( myEditorPopupActions.isEmpty() ? null : new DefaultActionGroup(myEditor...
install
256,889
void (@NotNull DiffRequest request) { myScrollToChange = request.getUserData(DiffUserDataKeysEx.SCROLL_TO_CHANGE); myEditorsPosition = request.getUserData(EditorsVisiblePositions.KEY); myCaretPosition = request.getUserData(DiffUserDataKeysEx.EDITORS_CARET_POSITION); }
processContext
256,890
void (@NotNull DiffRequest request) { LogicalPosition[] carets = getCaretPositions(); EditorsVisiblePositions visiblePositions = getVisiblePositions(); request.putUserData(DiffUserDataKeysEx.SCROLL_TO_CHANGE, null); request.putUserData(EditorsVisiblePositions.KEY, visiblePositions); request.putUserData(DiffUserDataKeys...
updateContext
256,891
EditorsVisiblePositions () { return doGetVisiblePositions(getEditors()); }
getVisiblePositions
256,892
boolean () { List<? extends Editor> editors = getEditors(); if (myCaretPosition == null || myCaretPosition.length != editors.size()) return false; doMoveCaretsToPositions(myCaretPosition, editors); try { disableSyncScroll(true); if (myEditorsPosition != null && myEditorsPosition.isSame(myCaretPosition)) { doScrollToVis...
doScrollToPosition
256,893
void (@NotNull DiffRequest request) { super.processContext(request); myScrollToLine = request.getUserData(DiffUserDataKeys.SCROLL_TO_LINE); myNavigationContext = request.getUserData(DiffUserDataKeysEx.NAVIGATION_CONTEXT); }
processContext
256,894
void (@NotNull DiffRequest request) { super.updateContext(request); request.putUserData(DiffUserDataKeys.SCROLL_TO_LINE, null); request.putUserData(DiffUserDataKeysEx.NAVIGATION_CONTEXT, null); }
updateContext
256,895
void () { if (wasScrolled(getEditors())) myShouldScroll = false; if (myScrollToChange != null) return; ensureEditorSizeIsUpToDate(getEditors()); if (myShouldScroll) myShouldScroll = !doScrollToLine(); if (myNavigationContext != null) return; if (myShouldScroll) myShouldScroll = !doScrollToPosition(); }
onSlowRediff
256,896
void () { if (wasScrolled(getEditors())) myShouldScroll = false; ensureEditorSizeIsUpToDate(getEditors()); if (myShouldScroll) myShouldScroll = !doScrollToChange(); if (myShouldScroll) myShouldScroll = !doScrollToLine(); if (myShouldScroll) myShouldScroll = !doScrollToContext(); if (myShouldScroll) myShouldScroll = !do...
onRediff
256,897
void (@NotNull DiffRequest request) { super.processContext(request); myScrollToLine = request.getUserData(DiffUserDataKeys.SCROLL_TO_LINE_THREESIDE); }
processContext
256,898
void (@NotNull DiffRequest request) { super.updateContext(request); request.putUserData(DiffUserDataKeys.SCROLL_TO_LINE_THREESIDE, null); }
updateContext
256,899
void () { if (wasScrolled(getEditors())) myShouldScroll = false; if (myScrollToChange != null) return; ensureEditorSizeIsUpToDate(getEditors()); if (myShouldScroll) myShouldScroll = !doScrollToLine(); if (myShouldScroll) myShouldScroll = !doScrollToPosition(); }
onSlowRediff