Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
296,500
void () { myCachedText = ""; myTextViewer.setViewer(true); myTextViewer.removeSelection(); mySetValueModeEnabled = false; myToolbar.updateActionsImmediately(); }
disableSetValueMode
296,501
boolean (AnAction action) { boolean isSetValueModeAction = action instanceof XDebuggerTextPopup.SetTextValueAction || action instanceof XDebuggerTextPopup.CancelSetValue; return isSetValueModeAction && mySetValueModeEnabled || !isSetValueModeAction && !mySetValueModeEnabled; }
shouldBeVisible
296,502
int (Rectangle screenRectangle) { return Math.min(screenRectangle.width / 2, MAX_POPUP_WIDTH); }
getMaxPopupWidth
296,503
int (Rectangle screenRectangle) { return Math.min(screenRectangle.height / 2, MAX_POPUP_HEIGHT); }
getMaxPopupHeight
296,504
int (Rectangle screenRectangle) { return Math.max(screenRectangle.width / 5, MIN_POPUP_WIDTH); }
getMinPopupWidth
296,505
int (Rectangle screenRectangle) { return Math.max(screenRectangle.height / 7, MIN_POPUP_HEIGHT); }
getMinPopupHeight
296,506
int () { return MED_TEXT_VIEWER_SIZE; }
getMediumTextViewerHeight
296,507
boolean (@NotNull XValueNodeImpl node) { @NotNull XValue value = node.getValueContainer(); return value instanceof XValueTextProvider && ((XValueTextProvider)value).shouldShowTextValue() && value.getModifier() instanceof XStringValueModifier; }
canSetTextValue
296,508
void (Disposable disposable, Tree tree) { if (tree instanceof Disposable) { Disposer.register(disposable, (Disposable)tree); } }
registerTreeDisposable
296,509
void (@NotNull AnActionEvent e) { Runnable hideTreeRunnable = myHideRunnable == null ? null : () -> { myTreePopupIsShown = false; myHideRunnable.run(); }; showTreePopup(hideTreeRunnable); myTreePopupIsShown = true; hideTextPopup(); }
actionPerformed
296,510
void (@NotNull AnActionEvent e) { @Nullable XValueNodeImpl node = getValueNode(); Presentation presentation = e.getPresentation(); presentation.setEnabledAndVisible(node != null && canSetTextValue(node)); }
update
296,511
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
296,512
void (@NotNull AnActionEvent e) { @Nullable XValueNodeImpl node = getValueNode(); if (node != null && canSetTextValue(node)) { setTextValue(node, myTextViewer.getText()); disableSetValueMode(); } }
actionPerformed
296,513
void (@NotNull XValueNodeImpl node, @NotNull String text) { @NotNull XValue value = node.getValueContainer(); @Nullable XValueModifier modifier = value.getModifier(); if (modifier instanceof XStringValueModifier) { XExpression expression = ((XStringValueModifier)modifier).stringToXExpression(text); Consumer<? super Str...
setTextValue
296,514
void (@NotNull AnActionEvent e) { @Nullable XValueNodeImpl node = getValueNode(); Presentation presentation = e.getPresentation(); presentation.setEnabledAndVisible(node != null && canSetTextValue(node)); }
update
296,515
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
296,516
void (@NotNull AnActionEvent e) { enableSetValueMode(); }
actionPerformed
296,517
void (@NotNull AnActionEvent e) { myTextViewer.setText(myCachedText); disableSetValueMode(); }
actionPerformed
296,518
JComponent (Tree tree) { tree.setBackground(ExperimentalUI.isNewUI() ? JBUI.CurrentTheme.Popup.BACKGROUND : UIUtil.getToolTipBackground()); return ScrollPaneFactory.createScrollPane(tree, true); }
createPopupContent
296,519
JBPopup (@NotNull D selectedItem) { return showTreePopup(myTreeCreator.createTree(selectedItem)); }
show
296,520
DefaultActionGroup () { DefaultActionGroup toolbarActions = new DefaultActionGroup(); toolbarActions.add(new EnableSetValueMode()); toolbarActions.add(new SetValue()); toolbarActions.add(new CancelSetValue()); toolbarActions.addAll(getCustomizedActionGroup(XDebuggerActions.WATCHES_INLINE_POPUP_GROUP)); return toolbarAc...
getToolbarActions
296,521
FocusListener () { return new FocusListener() { @Override public void focusGained(FocusEvent e) { if (mySetValueModeEnabled) { disableSetValueMode(); } } @Override public void focusLost(FocusEvent e) { // do nothing } }; }
createTreeFocusListener
296,522
void (FocusEvent e) { if (mySetValueModeEnabled) { disableSetValueMode(); } }
focusGained
296,523
void (FocusEvent e) { // do nothing }
focusLost
296,524
TreeModelListener (final Tree tree) { return new TreeModelAdapter() { @Override public void treeStructureChanged(TreeModelEvent e) { resize(e.getTreePath(), tree); } }; }
createTreeModelListener
296,525
void (TreeModelEvent e) { resize(e.getTreePath(), tree); }
treeStructureChanged
296,526
JBPopup (final Tree tree) { if (myPopup != null) { myPopup.cancel(); } tree.getModel().addTreeModelListener(createTreeModelListener(tree)); FocusListener focusListener = createTreeFocusListener(); tree.addFocusListener(focusListener); JComponent popupContent = createPopupContent(tree); setContent(popupContent, getToolb...
showTreePopup
296,527
void (@NotNull LightweightWindowEvent event) { tree.removeFocusListener(focusListener); if (myHideRunnable != null) { myHideRunnable.run(); } }
onClosed
296,528
void (final TreePath path, JTree tree) { if (myPopup == null || !myPopup.isVisible() || myPopup.isDisposed()) return; final Window popupWindow = SwingUtilities.windowForComponent(myPopup.getContent()); if (popupWindow == null) return; final Dimension size = tree.getPreferredSize(); final Point location = popupWindow.ge...
resize
296,529
void () { mySetValueModeEnabled = true; myToolbar.updateActionsImmediately(); }
enableSetValueMode
296,530
void () { mySetValueModeEnabled = false; myToolbar.updateActionsImmediately(); }
disableSetValueMode
296,531
boolean (AnAction action) { boolean isSetValueModeAction = action instanceof XDebuggerTreePopup.SetValue || action instanceof XDebuggerTreePopup.CancelSetValue; return isSetValueModeAction && mySetValueModeEnabled || !isSetValueModeAction && !mySetValueModeEnabled; }
shouldBeVisible
296,532
void (Disposable disposable, Tree tree) { if (tree instanceof Disposable) { Disposer.register(disposable, (Disposable)tree); } }
registerTreeDisposable
296,533
void (Tree tree, JComponent myToolbar, JBPopup myPopup) { Ref<Boolean> canShrink = Ref.create(true); ((XDebuggerTree)tree).addTreeListener(new XDebuggerTreeListener() { @Override public void childrenLoaded(@NotNull XDebuggerTreeNode node, @NotNull List<? extends XValueContainerNode<?>> children, boolean last) { if (las...
setAutoResize
296,534
void (@NotNull XDebuggerTreeNode node, @NotNull List<? extends XValueContainerNode<?>> children, boolean last) { if (last) { updateDebugPopupBounds(tree, myToolbar, myPopup, canShrink.get()); canShrink.set(false); } }
childrenLoaded
296,535
void (@NotNull RestorableStateNode node, @NotNull String name) { updateDebugPopupBounds(tree, myToolbar, myPopup, false); }
nodeLoaded
296,536
void (final Tree tree, JComponent toolbar, JBPopup popup, boolean canShrink) { final Window popupWindow = SwingUtilities.windowForComponent(popup.getContent()); if (popupWindow == null) return; final Dimension size = tree.getPreferredSize(); int hMargin = JBUI.scale(30); int vMargin = JBUI.scale(30); int width = Math.m...
updateDebugPopupBounds
296,537
void (@NotNull AnActionEvent e) { Component focusedComponent = IdeFocusManager.findInstance().getFocusOwner(); KeyEvent event = new KeyEvent(focusedComponent, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, KeyEvent.VK_ESCAPE, KeyEvent.CHAR_UNDEFINED); myContent.dispatchEvent(event); }
actionPerformed
296,538
void (@NotNull AnActionEvent e) { super.update(e); Presentation presentation = e.getPresentation(); presentation.setText(XDebuggerBundle.message("xdebugger.enable.set.action.title")); }
update
296,539
void (@NotNull AnActionEvent e) { enableSetValueMode(); super.actionPerformed(e); }
actionPerformed
296,540
void (@NotNull AnActionEvent e) { Component focusedComponent = IdeFocusManager.findInstance().getFocusOwner(); KeyEvent event = new KeyEvent(focusedComponent, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, KeyEvent.VK_ENTER, '\n'); myContent.dispatchEvent(event); }
actionPerformed
296,541
void (KeyEvent e) { if (!isAltMask(e.getModifiers())) { ValueLookupManager.getInstance(myProject).hideHint(); } }
keyReleased
296,542
boolean () { return true; }
canShowHint
296,543
int (@NotNull Editor editor, @NotNull Point point) { return editor.logicalPositionToOffset(editor.xyToLogicalPosition(point)); }
calculateOffset
296,544
void () { myHintHidden = true; myCurrentRange = null; if (myCursorSet) { myCursorSet = false; if (myEditor instanceof EditorEx) ((EditorEx)myEditor).setCustomCursor(AbstractValueHint.class, null); if (LOG.isDebugEnabled()) { LOG.debug("restore cursor in editor"); } myEditor.getContentComponent().removeKeyListener(myEdi...
hideHint
296,545
void () { invokeHint(null); }
invokeHint
296,546
void (Runnable hideRunnable) { myHideRunnable = hideRunnable; if (!canShowHint() || !isCurrentRangeValid()) { hideHint(); return; } createHighlighter(); if (myType != ValueHintType.MOUSE_ALT_OVER_HINT) { evaluateAndShowHint(); } }
invokeHint
296,547
void () { if (myHighlighter != null) { TextAttributes attributes = myHighlighter.getUserData(HINT_TEXT_ATTRIBUTES); if (attributes != null) { ((RangeHighlighterEx)myHighlighter).setTextAttributes(attributes); } } }
setHighlighterAttributes
296,548
void () { TextAttributes attributes; if (myType == ValueHintType.MOUSE_ALT_OVER_HINT) { attributes = myEditor.getColorsScheme().getAttributes(EditorColors.REFERENCE_HYPERLINK_COLOR); attributes = NavigationUtil.patchAttributesColor(attributes, myCurrentRange, myEditor); } else { attributes = new TextAttributes(); // re...
createHighlighter
296,549
Cursor () { return Cursor.getPredefinedCursor(Cursor.HAND_CURSOR); }
hintCursor
296,550
Project () { return myProject; }
getProject
296,551
Editor () { return myEditor; }
getEditor
296,552
ValueHintType () { return myType; }
getType
296,553
void () { EDT.assertIsEdt(); if (myCurrentHint != null) { myCurrentHint.hide(); myCurrentHint = null; } if (myCurrentPopup != null) { myCurrentPopup.cancel(); myCurrentPopup = null; } }
hideCurrentHint
296,554
void () { if (!myInsideShow) { if (myHideRunnable != null) { myHideRunnable.run(); } myHintHidden = true; } disposeHighlighter(); if (getEditor().getUserData(HINT_KEY) == this) { getEditor().putUserData(HINT_KEY, null); } onHintHidden(); }
processHintHidden
296,555
void () { AbstractValueHint prev = getEditor().getUserData(HINT_KEY); if (prev != null) { prev.hideHint(); } getEditor().putUserData(HINT_KEY, this); }
setCurrentEditorHint
296,556
boolean (final JComponent component) { myInsideShow = true; try { hideCurrentHint(); BorderLayoutPanel content = JBUI.Panels.simplePanel(); content.setBackground(component.getBackground()); content.setBorder(JBUI.Borders.empty(10)); content.addToCenter(component); myCurrentHint = new LightweightHint(content) { @Overrid...
showHint
296,557
boolean (TooltipEvent event) { InputEvent inputEvent = event.getInputEvent(); if (inputEvent instanceof MouseEvent) { Component comp = inputEvent.getComponent(); if (comp instanceof EditorComponentImpl) { EditorImpl editor = ((EditorComponentImpl)comp).getEditor(); return !isInsideCurrentRange(editor, ((MouseEvent)inpu...
canAutoHideOn
296,558
void (@NotNull EventObject event) { processHintHidden(); }
hintHidden
296,559
boolean () { return myCurrentRange != null && DocumentUtil.isValidOffset(myCurrentRange.getEndOffset(), myEditor.getDocument()); }
isCurrentRangeValid
296,560
void () { }
onHintHidden
296,561
boolean () { return myHintHidden; }
isHintHidden
296,562
JComponent (@Nullable Icon icon, final SimpleColoredText text, final Runnable expand, @Nullable XFullValueEvaluator evaluator) { SimpleColoredComponent component = HintUtil.createInformationComponent(); component.setIcon(icon != null ? IconManager.getInstance().createRowIcon(UIUtil.getTreeCollapsedIcon(), icon) : UIUti...
createExpandableHintComponent
296,563
boolean (@NotNull MouseEvent e, int clickCount) { if (SwingUtilities.isLeftMouseButton(e)) { Object tag = ((SimpleColoredComponent)e.getSource()).getFragmentTagAt(e.getX()); if (tag != null) { if (tag instanceof Consumer consumer) { //noinspection unchecked consumer.accept(e); } else { ((Runnable)tag).run(); } } else {...
onClick
296,564
void (@Nullable XFullValueEvaluator evaluator, SimpleColoredComponent component) { if (evaluator != null) { component.append( evaluator.getLinkText(), XDebuggerTreeNodeHyperlink.TEXT_ATTRIBUTES, (Consumer<MouseEvent>)event -> { if (evaluator.isShowValuePopup()) { DebuggerUIUtil.showValuePopup(evaluator, event, getProje...
appendEvaluatorLink
296,565
TextRange () { return myCurrentRange; }
getCurrentRange
296,566
boolean (@JdkConstants.InputEventMask int modifiers) { return KeymapUtil.matchActionMouseShortcutsModifiers(KeymapManager.getInstance().getActiveKeymap(), modifiers, XDebuggerActions.QUICK_EVALUATE_EXPRESSION); }
isAltMask
296,567
ValueHintType (final EditorMouseEvent e) { int modifiers = e.getMouseEvent().getModifiers(); if (modifiers == 0) { return ValueHintType.MOUSE_OVER_HINT; } else if (isAltMask(modifiers)) { return ValueHintType.MOUSE_ALT_OVER_HINT; } return null; }
getHintType
296,568
boolean () { return myCurrentHint != null || myCurrentPopup != null; }
isShowing
296,569
boolean (Editor editor, Point point) { return myCurrentHint != null && myCurrentHint.isInsideHint(new RelativePoint(editor.getContentComponent(), point)); }
isInsideHint
296,570
void (Function<Point, @Nullable JBPopup> popupPresenter) { EDT.assertIsEdt(); myInsideShow = true; try { if (myEditor.isDisposed() || !isCurrentRangeValid()) { hideHint(); return; } hideCurrentHint(); createHighlighter(); setHighlighterAttributes(); // align the popup with the bottom of the line Point point = myEditor....
showPopup
296,571
void (@NotNull CaretEvent event) { hideCurrentHint(); }
caretPositionChanged
296,572
void (@NotNull CaretEvent event) { hideCurrentHint(); }
caretAdded
296,573
void (@NotNull CaretEvent event) { hideCurrentHint(); }
caretRemoved
296,574
void (@NotNull LightweightWindowEvent event) { processHintHidden(); }
onClosed
296,575
void (@NotNull XDebuggerTreeCreator creator, @NotNull Pair<XValue, String> descriptor, @NotNull String initialText, @Nullable XFullValueEvaluator evaluator) { showPopup(point -> new XDebuggerTextPopup<>(evaluator, descriptor.first, creator, descriptor, myEditor, point, myProject, null) .show(initialText) ); }
showTextPopup
296,576
void (JComponent component) { showPopup(point -> new XDebuggerTooltipPopup(myEditor, point).show(component, myEditorMouseEvent)); }
showTooltipPopup
296,577
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AbstractValueHint hint = (AbstractValueHint)o; if (!myProject.equals(hint.myProject)) return false; if (!myEditor.equals(hint.myEditor)) return false; if (myType != hint.myType) return false; if (!Objects.equals(...
equals
296,578
int () { return Objects.hash(myProject, myEditor, myType, myCurrentRange); }
hashCode
296,579
void () { if (!myListening) { myListening = true; EditorEventMulticaster multicaster = EditorFactory.getInstance().getEventMulticaster(); multicaster.addEditorMouseMotionListener(this, myProject); multicaster.addEditorMouseListener(this, myProject); } }
startListening
296,580
void (@NotNull EditorMouseEvent event) { Inlay inlay = event.getInlay(); if (lastHoveredInlay != null) { InlineDebugRenderer renderer = (InlineDebugRenderer)lastHoveredInlay.getRenderer(); if (lastHoveredInlay != event.getInlay()) { renderer.onMouseExit(lastHoveredInlay); } lastHoveredInlay = null; } if (inlay != null)...
mouseMoved
296,581
void (@NotNull EditorMouseEvent event) { if (event.isConsumed()) return; Inlay inlay = event.getInlay(); if (inlay != null && inlay.getRenderer() instanceof InlineDebugRenderer) { ((InlineDebugRenderer)inlay.getRenderer()).onClick(inlay, event); event.consume(); } }
mouseClicked
296,582
DebuggerInlayListener (Project project) { return project.getService(DebuggerInlayListener.class); }
getInstance
296,583
DefaultActionGroup () { DefaultActionGroup toolbarActions = super.getToolbarActions(); if (Registry.is("debugger.watches.inline.enabled")) { AnAction watchAction = myValueNode instanceof InlineWatchNodeImpl ? new EditInlineWatch() : new AddInlineWatch(); toolbarActions.add(watchAction, Constraints.LAST); } return toolb...
getToolbarActions
296,584
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
296,585
void (XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) { node.calculateEvaluationExpression() .thenAsync(expr -> { if (expr == null && node != myValueNode) { return myValueNode.calculateEvaluationExpression(); } else { return Promises.resolvedPromise(expr); } }).onSuccess(expr -> { AppUIUtil.invokeOnEdt(...
perform
296,586
boolean () { return true; }
displayTextInToolbar
296,587
void (@NotNull AnActionEvent e) { InlineWatchNodeImpl watch = (InlineWatchNodeImpl)myValueNode; XDebuggerWatchesManager watchesManager = ((XDebuggerManagerImpl)XDebuggerManager.getInstance(mySession.getProject())).getWatchesManager(); XDebugSession session = DebuggerUIUtil.getSession(e); if (session != null) { if (myPo...
actionPerformed
296,588
void () { }
beforeShow
296,589
JComponent () { myInplaceEditor = new XDebuggerExpressionComboBox(mySession.getProject(), mySession.getDebugProcess().getEditorsProvider(), "inlineWatch", mySession.getCurrentPosition(), false, true); if (myInitialExpression != null) { myInplaceEditor.setExpression(myInitialExpression); } return myInplaceEditor.getComp...
createInplaceEditorComponent
296,590
JComponent () { return myInplaceEditor.getPreferredFocusedComponent(); }
getPreferredFocusedComponent
296,591
Editor () { return myInplaceEditor.getEditor(); }
getEditor
296,592
JComponent () { return myInplaceEditor.getEditorComponent(); }
getEditorComponent
296,593
XExpression () { return myInplaceEditor.getExpression(); }
getExpression
296,594
void () { XExpression expression = getExpression(); myInplaceEditor.saveTextInHistory(); super.doOKAction(); if (!XDebuggerUtilImpl.isEmptyExpression(expression)) { XDebuggerWatchesManager watchesManager = ((XDebuggerManagerImpl)XDebuggerManager.getInstance(mySession.getProject())).getWatchesManager(); watchesManager.a...
doOKAction
296,595
void () { super.cancelEditing(); if (myInitialExpression != null) { XDebuggerWatchesManager watchesManager = ((XDebuggerManagerImpl)XDebuggerManager.getInstance(mySession.getProject())).getWatchesManager(); watchesManager.addInlineWatchExpression(myInitialExpression, -1, myPresentationPosition, false); } }
cancelEditing
296,596
JComponent () { return myHostEditor.getContentComponent(); }
getHostComponent
296,597
Project () { return mySession.getProject(); }
getProject
296,598
Rectangle () { int caretOffset = myHostEditor.getCaretModel().getOffset(); Point caretPoint = myHostEditor.offsetToXY(caretOffset); int width = myHostEditor.getContentComponent().getWidth() - (caretPoint.x - myHostEditor.getContentComponent().getX()); int height = myHostEditor.getLineHeight(); Rectangle bounds = myHost...
getEditorBounds
296,599
XValue () { return myValueContainer; }
getValueContainer