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 String> errorConsumer = (@NlsContexts.DialogMessage String errorMessage) -> Messages.showErrorDialog(node.getTree(), errorMessage); DebuggerUIUtil.setTreeNodeValue(node, expression, errorConsumer); } }
|
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 toolbarActions; }
|
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, getToolbarActions(), ACTION_PLACE, tree); myPopup = JBPopupFactory.getInstance().createComponentPopupBuilder(myContent, tree) .setRequestFocus(true) .setResizable(true) .setModalContext(false) .setMovable(true) .setDimensionServiceKey(myProject, DIMENSION_SERVICE_KEY, false) .setMayBeParent(true) .setCancelOnOtherWindowOpen(true) .setCancelKeyEnabled(false) .setKeyEventHandler(event -> { if (!mySetValueModeEnabled && event.getKeyCode() == KeyEvent.VK_F2) { enableSetValueMode(); } else if (AbstractPopup.isCloseRequest(event)) { // Do not process a close request if the tree shows a speed search popup or 'set value' action is in process SpeedSearchBase speedSearch = ((SpeedSearchBase)SpeedSearchSupply.getSupply(tree)); if (speedSearch != null && speedSearch.isPopupActive()) { speedSearch.hidePopup(); return true; } else if (IdeFocusManager.getInstance(myProject).getFocusOwner() == tree) { myPopup.cancel(); return true; } return false; } return false; }) .addListener(new JBPopupListener() { @Override public void onClosed(@NotNull LightweightWindowEvent event) { tree.removeFocusListener(focusListener); if (myHideRunnable != null) { myHideRunnable.run(); } } }) .setCancelCallback(() -> { Window parent = SwingUtilities.getWindowAncestor(tree); if (parent != null) { for (Window child : parent.getOwnedWindows()) { if (child.isShowing()) { return false; } } } return true; }) .createPopup(); registerTreeDisposable(myPopup, tree); //Editor may be disposed before later invokator process this action if (myEditor.isDisposed()) { myPopup.cancel(); return null; } myPopup.setSize(new Dimension(0, 0)); setAutoResizeUntilToolbarNotFull(() -> updateDebugPopupBounds(tree, myToolbar, myPopup, false), myPopup); myPopup.show(new RelativePoint(myEditor.getContentComponent(), myPoint)); setAutoResize(tree, myToolbar, myPopup); return myPopup; }
|
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.getLocation(); final Rectangle windowBounds = popupWindow.getBounds(); final Rectangle bounds = tree.getPathBounds(path); if (bounds == null) return; final Rectangle targetBounds = new Rectangle(location.x, location.y, Math.max(Math.max(size.width, bounds.width) + 20, windowBounds.width), Math.max(tree.getRowCount() * bounds.height + 55, windowBounds.height)); ScreenUtil.cropRectangleToFitTheScreen(targetBounds); popupWindow.setBounds(targetBounds); popupWindow.validate(); popupWindow.repaint(); }
|
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 (last) { updateDebugPopupBounds(tree, myToolbar, myPopup, canShrink.get()); canShrink.set(false); } } @Override public void nodeLoaded(@NotNull RestorableStateNode node, @NotNull String name) { updateDebugPopupBounds(tree, myToolbar, myPopup, false); } }); updateDebugPopupBounds(tree, myToolbar, myPopup, canShrink.get()); }
|
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.max(size.width, toolbar.getPreferredSize().width) + hMargin; Rectangle bounds = tree.getRowBounds(tree.getRowCount() - 1); int height = toolbar.getHeight() + vMargin + (bounds == null ? 0 : bounds.y + bounds.height); Rectangle screenRectangle = ScreenUtil.getScreenRectangle(toolbar); int maxWidth = screenRectangle.width / 2; int maxHeight = screenRectangle.height / 2; int newWidth = Math.min(width, maxWidth); int newHeight = Math.min(height, maxHeight); if (!canShrink) { newWidth = Math.max(newWidth, popupWindow.getWidth()); newHeight = Math.max(newHeight, popupWindow.getHeight()); } updatePopupBounds(popupWindow, newWidth, newHeight); }
|
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(myEditorKeyListener); } hideCurrentHint(); disposeHighlighter(); }
|
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(); // real attributes will be stored in user data } disposeHighlighter(); myHighlighter = myEditor.getMarkupModel().addRangeHighlighter(myCurrentRange.getStartOffset(), myCurrentRange.getEndOffset(), HighlighterLayer.SELECTION, attributes, HighlighterTargetArea.EXACT_RANGE); if (myType == ValueHintType.MOUSE_ALT_OVER_HINT) { myEditor.getContentComponent().addKeyListener(myEditorKeyListener); if (myEditor instanceof EditorEx) ((EditorEx)myEditor).setCustomCursor(AbstractValueHint.class, hintCursor()); if (LOG.isDebugEnabled()) { LOG.debug("set hint cursor to editor"); } myCursorSet = true; } else { TextAttributesKey attributesKey = DebuggerColors.EVALUATED_EXPRESSION_ATTRIBUTES; MarkupModel model = DocumentMarkupModel.forDocument(myEditor.getDocument(), myProject, false); if (model != null && !((MarkupModelEx)model).processRangeHighlightersOverlappingWith( myCurrentRange.getStartOffset(), myCurrentRange.getEndOffset(), h -> !ExecutionPointHighlighter.EXECUTION_POINT_HIGHLIGHTER_TOP_FRAME_KEY.get(h, false))) { attributesKey = DebuggerColors.EVALUATED_EXPRESSION_EXECUTION_LINE_ATTRIBUTES; } myHighlighter.putUserData(HINT_TEXT_ATTRIBUTES, myEditor.getColorsScheme().getAttributes(attributesKey)); } }
|
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) { @Override protected boolean canAutoHideOn(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)inputEvent).getPoint()); } } return true; } }; myCurrentHint.setForceShowAsPopup(true); myCurrentHint.addHintListener(new HintListener() { @Override public void hintHidden(@NotNull EventObject event) { processHintHidden(); } }); // editor may be disposed before later invokator process this action if (myEditor.isDisposed()) { return false; } AppUIUtil.targetToDevice(myCurrentHint.getComponent(), myEditor.getComponent()); Point p = HintManagerImpl.getHintPosition(myCurrentHint, myEditor, myEditor.xyToLogicalPosition(myPoint), HintManager.UNDER); HintHint hint = HintManagerImpl.createHintHint(myEditor, p, myCurrentHint, HintManager.UNDER, true); hint.setShowImmediately(true); HintManagerImpl.getInstanceImpl().showEditorHint(myCurrentHint, myEditor, p, HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE | HintManager.HIDE_BY_SCROLLING, 0, false, hint); if (myHighlighter == null && isCurrentRangeValid()) { // hint text update createHighlighter(); } setHighlighterAttributes(); setCurrentEditorHint(); } finally { myInsideShow = false; } return true; }
|
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)inputEvent).getPoint()); } } return true; }
|
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) : UIUtil.getTreeCollapsedIcon()); component.setCursor(hintCursor()); text.appendToComponent(component); appendEvaluatorLink(evaluator, component); new ClickListener() { @Override public boolean onClick(@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 { hideCurrentHint(); expand.run(); } return true; } return false; } }.installOn(component); return component; }
|
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 { hideCurrentHint(); expand.run(); } return true; } return false; }
|
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, getProject(), getEditor()); } else { new HeadlessValueEvaluationCallbackBase(getProject()).startFetchingValue(evaluator); } } ); } }
|
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.visualPositionToXY(myEditor.xyToVisualPosition(myPoint)); point.translate(0, myEditor.getLineHeight()); JBPopup popup = popupPresenter.apply(point); if (popup != null) { myCurrentPopup = popup; myEditor.getScrollingModel().addVisibleAreaListener(e -> { if (!Objects.equals(e.getOldRectangle(), e.getNewRectangle())) { hideCurrentHint(); } }, popup); myEditor.getCaretModel().addCaretListener(new CaretListener() { @Override public void caretPositionChanged(@NotNull CaretEvent event) { hideCurrentHint(); } @Override public void caretAdded(@NotNull CaretEvent event) { hideCurrentHint(); } @Override public void caretRemoved(@NotNull CaretEvent event) { hideCurrentHint(); } }, popup); popup.addListener(new JBPopupListener() { @Override public void onClosed(@NotNull LightweightWindowEvent event) { processHintHidden(); } }); setCurrentEditorHint(); } } finally { myInsideShow = false; } }
|
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(myCurrentRange, hint.myCurrentRange)) return false; return true; }
|
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) { if (inlay.getRenderer() instanceof InlineDebugRenderer) { ((InlineDebugRenderer)inlay.getRenderer()).onMouseMove(inlay, event); lastHoveredInlay = inlay; } else { lastHoveredInlay = 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 toolbarActions; }
|
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(() -> { XDebuggerWatchesManager manager = ((XDebuggerManagerImpl)XDebuggerManager.getInstance(mySession.getProject())).getWatchesManager(); manager.showInplaceEditor(myPresentationPosition, myEditor, mySession, expr); }); }); }
|
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 (myPopup != null) { myPopup.cancel(); } watchesManager.inlineWatchesRemoved(Collections.singletonList(watch.getWatch()), null); watchesManager.showInplaceEditor(watch.getPosition(), myEditor, session, watch.getExpression()); } }
|
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.getComponent(); }
|
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.addInlineWatchExpression(expression, -1, myPresentationPosition, false); } }
|
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 = myHostEditor.getContentComponent().getVisibleRect(); Rectangle lineBounds = new Rectangle(caretPoint.x, caretPoint.y, width, height); if (bounds == null) { return null; } if (bounds.y > lineBounds.y || bounds.y + bounds.height < lineBounds.y + lineBounds.height) { return null; } bounds.y = lineBounds.y; bounds.height = lineBounds.height; if(lineBounds.x > bounds.x) { bounds.width = bounds.width - lineBounds.x + bounds.x - UIUtil.getScrollBarWidth(); bounds.x = lineBounds.x; } return bounds; }
|
getEditorBounds
|
296,599
|
XValue () { return myValueContainer; }
|
getValueContainer
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.