Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
294,900 | void () { getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); setCellRenderer(createListRenderer()); getEmptyText().setText(XDebuggerBundle.message("debugger.frames.not.available")); } | doInit |
294,901 | void (ListModel model) { // do not allow to change model (e.g. to FilteringListModel) } | setModel |
294,902 | CollectionListModel () { return (CollectionListModel)super.getModel(); } | getModel |
294,903 | void () { getModel().removeAll(); } | clear |
294,904 | int () { return getModel().getSize(); } | getElementCount |
294,905 | String () { return XDebuggerBundle.message("action.next.frame.text"); } | getNextOccurenceActionName |
294,906 | String () { return XDebuggerBundle.message("action.previous.frame.text"); } | getPreviousOccurenceActionName |
294,907 | OccurenceInfo () { return goOccurrence(1); } | goNextOccurence |
294,908 | OccurenceInfo () { return goOccurrence(-1); } | goPreviousOccurence |
294,909 | OccurenceInfo (int step) { setSelectedIndex(getSelectedIndex() + step); return getOccurenceInfo(); } | goOccurrence |
294,910 | OccurenceInfo () { Navigatable navigatable = getSelectedFrameNavigatable(); return new OccurenceInfo(navigatable, -1, -1); } | getOccurenceInfo |
294,911 | boolean () { return getSelectedIndex() < getElementCount() - 1; } | hasNextOccurence |
294,912 | boolean () { return getSelectedIndex() > 0; } | hasPreviousOccurence |
294,913 | int (String prefix, int startIndex, Position.Bias bias) { return -1; // disable built-in search completely to avoid calling toString for every item } | getNextMatch |
294,914 | int (Point location) { if (location.y <= getPreferredSize().height) { return super.locationToIndex(location); } return -1; } | locationToIndex |
294,915 | void () { AppUIUtil.invokeLaterIfProjectAlive(getTree().getProject(), () -> buildTreeAndRestoreState(myStackFrame)); } | rebuildView |
294,916 | void (@NotNull SessionEvent event, @NotNull XDebugSession session) { } | processSessionEvent |
294,917 | void (@NotNull XDebugView debugView, @NotNull XDebugSession session) { session.addSessionListener(new XDebugViewSessionListener(debugView, session), debugView); } | attach |
294,918 | void (@NotNull XDebugView.SessionEvent event) { myDebugView.processSessionEvent(event, mySession); } | onSessionEvent |
294,919 | void () { onSessionEvent(XDebugView.SessionEvent.PAUSED); } | sessionPaused |
294,920 | void () { onSessionEvent(XDebugView.SessionEvent.RESUMED); } | sessionResumed |
294,921 | void () { onSessionEvent(XDebugView.SessionEvent.STOPPED); } | sessionStopped |
294,922 | void () { onSessionEvent(XDebugView.SessionEvent.FRAME_CHANGED); } | stackFrameChanged |
294,923 | void () { onSessionEvent(XDebugView.SessionEvent.BEFORE_RESUME); } | beforeSessionResume |
294,924 | void () { onSessionEvent(XDebugView.SessionEvent.SETTINGS_CHANGED); } | settingsChanged |
294,925 | ValueMarkup (@NotNull XValue value) { Class<V> valueClass = myProvider.getValueClass(); if (!valueClass.isInstance(value)) return null; V v = valueClass.cast(value); if (!myProvider.canMark(v)) return null; M m = myProvider.getMarker(v); if (m == null) return null; return myMarkers.get(m); } | getMarkup |
294,926 | boolean (@NotNull XValue value) { Class<V> valueClass = myProvider.getValueClass(); if (!valueClass.isInstance(value)) return false; return myProvider.canMark(valueClass.cast(value)); } | canMarkValue |
294,927 | Promise<Object> (@NotNull XValue value, @NotNull ValueMarkup markup) { synchronized (myMarkers) { // remove the existing label if any myMarkers.entrySet().stream() .filter(entry -> markup.getText().equals(entry.getValue().getText())) .findFirst() .ifPresent(entry -> myMarkers.remove(entry.getKey())); } //noinspection unchecked Promise<M> promise = myProvider.markValueAsync((V)value); return promise.then(m -> { myMarkers.put(m, markup); return null; }); } | markValue |
294,928 | Promise<Object> (@NotNull XValue value) { //noinspection unchecked final V v = (V)value; M m = myProvider.getMarker(v); if (m != null) { return myProvider.unmarkValueAsync(v, m) .onSuccess(__ -> myMarkers.remove(m)); } else { return Promises.resolvedPromise(); } } | unmarkValue |
294,929 | void () { myMarkers.clear(); } | clear |
294,930 | void () { List items = getModel().getItems(); if (!items.isEmpty()) { StringBuilder plainBuf = new StringBuilder(); TextTransferable.ColoredStringBuilder coloredTextContainer = new TextTransferable.ColoredStringBuilder(); for (Object value : items) { if (value instanceof ItemWithSeparatorAbove item) { if (item.hasSeparatorAbove()) { String caption = " - " + StringUtil.notNullize(item.getCaptionAboveOf()); plainBuf.append(caption).append('\n'); } } if (value != null) { if (value instanceof XStackFrame) { ((XStackFrame)value).customizePresentation(coloredTextContainer); coloredTextContainer.appendTo(plainBuf); } else { String text = value.toString(); plainBuf.append(text); } } plainBuf.append('\n'); } // remove the last newline plainBuf.setLength(plainBuf.length() - 1); String plainText = plainBuf.toString(); CopyPasteManager.getInstance().setContents( new TextTransferable("<html><body><pre>\n" + XmlStringUtil.escapeString(plainText) + "\n</pre></body></html>", plainText)); } } | copyStack |
294,931 | void (MouseEvent e) { var list = ObjectUtils.tryCast(e.getComponent(), XDebuggerFramesList.class); if (list != null && XDebuggerFrameListMouseListener.getResetIconHovered(list)) { ActionManager.getInstance().tryToExecute( resetFrameAction, e, list, "XDebuggerFramesList", true ); } } | mousePressed |
294,932 | Object (@NotNull XStackFrame frame, @NonNls String dataId) { if (CommonDataKeys.NAVIGATABLE.is(dataId)) { return getFrameNavigatable(frame, true); } if (CommonDataKeys.VIRTUAL_FILE.is(dataId)) { return getFile(frame); } if (CommonDataKeys.PSI_FILE.is(dataId)) { VirtualFile file = getFile(frame); if (file != null && file.isValid()) { return PsiManager.getInstance(myProject).findFile(file); } } return null; } | getSlowData |
294,933 | void () { super.clear(); } | clear |
294,934 | boolean (@NotNull XStackFrame toSelect) { //noinspection unchecked if (!Objects.equals(getSelectedValue(), toSelect) && getModel().contains(toSelect)) { setSelectedValue(toSelect, true); return true; } return false; } | selectFrame |
294,935 | boolean (int indexToSelect) { if (getSelectedIndex() != indexToSelect && getElementCount() > indexToSelect && getModel().getElementAt(indexToSelect) != null) { setSelectedIndex(indexToSelect); return true; } return false; } | selectFrame |
294,936 | VirtualFile (XStackFrame frame) { XSourcePosition position = frame.getSourcePosition(); return position != null ? position.getFile() : null; } | getFile |
294,937 | ListCellRenderer () { return new XDebuggerGroupedFrameListRenderer(); } | createListRenderer |
294,938 | String (Object value) { return null; } | getTextFor |
294,939 | String (Object value) { return value instanceof ItemWithSeparatorAbove ? ((ItemWithSeparatorAbove)value).getCaptionAboveOf() : null; } | getCaptionAboveOf |
294,940 | boolean (Object value) { return value instanceof ItemWithSeparatorAbove && ((ItemWithSeparatorAbove)value).hasSeparatorAbove(); } | hasSeparatorAboveOf |
294,941 | Component (JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { if (myDescriptor.hasSeparatorAboveOf(value)) { Component component = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (hasSeparator(value, index)) { setSeparatorFont(list.getFont()); } ((XDebuggerFrameListRenderer)getItemComponent()).getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); return component; } else { return myOriginalRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); } } | getListCellRendererComponent |
294,942 | JComponent () { createLabel(); return new XDebuggerFrameListRenderer(); } | createItemComponent |
294,943 | void (@NotNull final JList list, final Object value, final int index, final boolean selected, final boolean hasFocus) { if (value == null) { append(XDebuggerBundle.message("stack.frame.loading.text"), SimpleTextAttributes.GRAY_ATTRIBUTES); return; } if (value instanceof String) { append((String)value, SimpleTextAttributes.ERROR_ATTRIBUTES); return; } XStackFrame stackFrame = (XStackFrame)value; var loc = XDebuggerFrameListMouseListener.getMouseLocation(list); var bounds = XDebuggerFrameListMouseListener.getHoveredCellBounds(list); var hoveredIndex = XDebuggerFrameListMouseListener.getHoveredIndex(list); var iconHovered = isIconHovered(loc, bounds); var hovered = index == hoveredIndex; boolean canDropSomething = XDebuggerFrameListMouseListener.getCanDropFrame(list); if (!selected) { Color c = getFrameBgColor(stackFrame); if (index <= hoveredIndex && canDropSomething && iconHovered) { setBackground(RenderingUtil.getHoverBackground(list)); } else if (c != null) { setBackground(c); } } else { setBackground(UIUtil.getListSelectionBackground(hasFocus)); setForeground(NamedColorUtil.getListSelectionForeground(hasFocus)); mySelectionForeground = getForeground(); } stackFrame.customizePresentation(this); // override icon which is set by customizePresentation if needed if ((hovered && canDropSomething) || (selected && hoveredIndex < 0 && canDropSelectedFrame(list))) { setIcon(myPopFrameIcon); if (iconHovered && selected) { myPopFrameIcon.setBackground(ColorUtil.withAlpha(NamedColorUtil.getListSelectionForeground(true), 0.2)); } else { myPopFrameIcon.setBackground(null); } myPopFrameIcon.setSelected(selected && hasFocus); } } | customizeCellRenderer |
294,944 | boolean (JList list) { if (!(list instanceof XDebuggerFramesList)) { return false; } var selectedValue = list.getSelectedValue(); if (!(selectedValue instanceof XStackFrame)) { return false; } try { var dropFrameHandler = findDropFrameHandler((XDebuggerFramesList)list); if (dropFrameHandler == null) { return false; } return dropFrameHandler.canDrop((XStackFrame)selectedValue); } catch (Throwable ignore) { } return false; } | canDropSelectedFrame |
294,945 | CharSequence (boolean mainOnly) { // Copy action for JBList queries only "main" part of item, which is decided to be the first one. // But for frame items full description is needed, so let's assume that all parts of entry are "main" return super.getCharSequence(false); } | getCharSequence |
294,946 | boolean (@Nullable Point p, @Nullable Rectangle bounds) { if (p == null || bounds == null) { return false; } var leftPadding = this.getIpad().left; var iconWidth = myPopFrameIcon.getIconWidth(); return new Rectangle(leftPadding, 0, iconWidth, bounds.height).contains(p); } | isIconHovered |
294,947 | void (@NotNull AnActionEvent e) { XDebuggerFramesList framesList = e.getData(FRAMES_LIST); e.getPresentation().setEnabledAndVisible(framesList != null && ContainerUtil.getLastItem(framesList.getModel().getItems()) != null); } | update |
294,948 | ActionUpdateThread () { return ActionUpdateThread.EDT; } | getActionUpdateThread |
294,949 | void (@NotNull AnActionEvent e) { XDebuggerFramesList framesList = e.getData(FRAMES_LIST); if (framesList != null) { framesList.copyStack(); } } | actionPerformed |
294,950 | void (@NotNull XDebuggerFramesList list) { addTo(list); var helpTooltip = new HelpTooltip() .setTitle(XDebuggerBundle.message("debugger.frame.list.help.title")) .setDescription(XDebuggerBundle.message("debugger.frame.list.help.description")); Shortcut[] shortcuts = CommonShortcuts.getDelete().getShortcuts(); if (shortcuts.length > 0) { helpTooltip.setShortcut(shortcuts[0]); } helpTooltip.installOn(list); HelpTooltip.setMasterPopupOpenCondition(list, () -> { return ClientProperty.isTrue(list, RESET_ICON_HOVERED); }); } | installListeners |
294,951 | int (@NotNull Component component) { return Optional.ofNullable(ClientProperty.get(component, HOVER_INDEX)).orElse(-1); } | getHoveredIndex |
294,952 | boolean (@NotNull Component component) { return ClientProperty.isTrue(component, CAN_DROP_FRAME); } | getCanDropFrame |
294,953 | boolean (@NotNull Component component) { return ClientProperty.isTrue(component, RESET_ICON_HOVERED); } | getResetIconHovered |
294,954 | void (@NotNull Component component, @Nullable Point point) { if (!(component instanceof XDebuggerFramesList list)) return; var oldHoverIndex = getHoveredIndex(component); ClientProperty.put(list, HOVER_POSITION, null); ClientProperty.put(list, HOVER_BOUNDS, null); ClientProperty.put(list, HOVER_INDEX, -1); ClientProperty.put(list, CAN_DROP_FRAME, false); ClientProperty.put(list, RESET_ICON_HOVERED, false); boolean resetHoverActions = true; if (point != null) { var renderer = getFrameListRenderer(list, point); var index = list.locationToIndex(point); var bounds = list.getCellBounds(index, index); var pointInCellBounds = bounds == null ? point : new Point(point.x - bounds.x, point.y - bounds.y); if (oldHoverIndex != index) { HelpTooltip.hide(list); } if (bounds != null) { ClientProperty.put(list, HOVER_POSITION, pointInCellBounds); ClientProperty.put(list, HOVER_BOUNDS, bounds); } ClientProperty.put(list, HOVER_INDEX, index); if (index >= 0 && index < list.getModel().getSize()) { var value = list.getModel().getElementAt(index); if (value instanceof XStackFrame) { var dropFrameHandler = findDropFrameHandler(list); ClientProperty.put(list, CAN_DROP_FRAME, dropFrameHandler != null && dropFrameHandler.canDrop((XStackFrame)value)); } } if (renderer != null && getCanDropFrame(list)) { boolean isHovered = renderer.isIconHovered(pointInCellBounds, bounds); if (isHovered) { list.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); ClientProperty.put(list, RESET_ICON_HOVERED, true); resetHoverActions = false; } } } if (resetHoverActions) { list.setCursor(Cursor.getDefaultCursor()); HelpTooltip.hide(list); } component.repaint(); } | updateHover |
294,955 | void (@NotNull Component component, int x, int y) { updateHover(component, new Point(x, y)); } | mouseEntered |
294,956 | void (@NotNull Component component, int x, int y) { updateHover(component, new Point(x, y)); } | mouseMoved |
294,957 | void (@NotNull Component component) { updateHover(component, null); } | mouseExited |
294,958 | XDebuggerPopFrameIcon (@NotNull IconReplacer replacer) { XDebuggerPopFrameIcon icon = new XDebuggerPopFrameIcon(replacer.replaceIcon(myIcon), replacer.replaceIcon(mySelectedIcon), myIconWidth, myIconHeight); icon.isSelected = isSelected; return icon; } | replaceBy |
294,959 | void (@Nullable Color background) { myBackground = background; } | setBackground |
294,960 | boolean () { return isSelected; } | isSelected |
294,961 | void (boolean selected) { isSelected = selected; } | setSelected |
294,962 | void (Component c, Graphics g, int x, int y) { Color background = getBackground(); if (background != null) { if (g instanceof Graphics2D) { ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); } g.setColor(background); int arc = (int)Math.ceil(scaleVal(5)); g.fillRoundRect(x, y, getIconWidth(), getIconHeight(), arc, arc); } var icon = (!isSelected() || mySelectedIcon == null || ExperimentalUI.isNewUI()) ? myIcon : mySelectedIcon; icon.paintIcon(c, g, x + (getIconWidth() - icon.getIconWidth()) / 2, y + (getIconHeight() - icon.getIconHeight()) / 2); } | paintIcon |
294,963 | int () { return (int)Math.ceil(scaleVal(myIconWidth)); } | getIconWidth |
294,964 | int () { return (int)Math.ceil(scaleVal(myIconHeight)); } | getIconHeight |
294,965 | void (@NotNull AnActionEvent e) { var inputEvent = e.getInputEvent(); var list = e.getData(FRAMES_LIST); if (inputEvent == null || list == null) { return; } var index = -1; var event = ObjectUtils.tryCast(inputEvent, MouseEvent.class); if (event != null) { if (UIUtil.isActionClick(event, MouseEvent.MOUSE_PRESSED) && XDebuggerFrameListMouseListener.getResetIconHovered(list)) { index = XDebuggerFrameListMouseListener.getHoveredIndex(list); } } else { index = list.getSelectedIndex(); } var model = list.getModel(); if (index >= 0 && index < model.getSize()) { var handler = findDropFrameHandler(list); var frame = ObjectUtils.tryCast(model.getElementAt(index), XStackFrame.class); if (frame != null && handler != null && handler.canDrop(frame)) { handler.drop(frame); inputEvent.consume(); } } } | actionPerformed |
294,966 | void (@NotNull AnActionEvent e) { Object contents = CopyPasteManager.getInstance().getContents(XWatchTransferable.EXPRESSIONS_FLAVOR); if (contents instanceof List) { for (Object item : ((List)contents)){ if (item instanceof XExpression) { addWatchExpression(((XExpression)item), -1, true); } } } } | actionPerformed |
294,967 | JPanel (@NotNull JComponent localsPanelComponent) { var top = createTopPanel(); if (top == null) { return super.createMainPanel(localsPanelComponent); } var layout = localsPanelComponent.getLayout(); boolean canAddComponentToTheRightOfToolbar = layout instanceof BorderLayout; if (canAddComponentToTheRightOfToolbar) { var panel = new BorderLayoutPanel() .addToCenter(((BorderLayout)layout).getLayoutComponent(BorderLayout.CENTER)) .addToTop(top); localsPanelComponent.add(panel, BorderLayout.CENTER); return super.createMainPanel(localsPanelComponent); } else { return new BorderLayoutPanel() .addToCenter(localsPanelComponent) .addToTop(top); } } | createMainPanel |
294,968 | ComboBox<XExpression> (CollectionComboBoxModel<XExpression> model, int width) { AnAction addToWatchesAction = new DumbAwareAction(ActionsBundle.actionText(XDebuggerActions.ADD_TO_WATCH), null, AllIcons.Debugger.AddToWatch) { @Override public void actionPerformed(@NotNull AnActionEvent e) { myEvaluateComboBox.saveTextInHistory(); addWatchExpression(getExpression(), -1, false); DebuggerEvaluationStatisticsCollector.WATCH_FROM_INLINE_ADD.log(e); } @Override public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabled(!XDebuggerUtilImpl.isEmptyExpression(getExpression())); } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.BGT; } }; ActionToolbarImpl toolbar = (ActionToolbarImpl)ActionManager.getInstance() .createActionToolbar("DebuggerVariablesEvaluate", new DefaultActionGroup(addToWatchesAction), true); addToWatchesActionRef.set(addToWatchesAction); toolbar.setOpaque(false); toolbar.setReservePlaceAutoPopupIcon(false); toolbar.setTargetComponent(tree); XDebuggerEmbeddedComboBox<XExpression> comboBox = new XDebuggerEmbeddedComboBox<>(model, width); comboBox.setExtension(toolbar); return comboBox; } | createComboBox |
294,969 | void (@NotNull AnActionEvent e) { myEvaluateComboBox.saveTextInHistory(); addWatchExpression(getExpression(), -1, false); DebuggerEvaluationStatisticsCollector.WATCH_FROM_INLINE_ADD.log(e); } | actionPerformed |
294,970 | void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(!XDebuggerUtilImpl.isEmptyExpression(getExpression())); } | update |
294,971 | ActionUpdateThread () { return ActionUpdateThread.BGT; } | getActionUpdateThread |
294,972 | void (EditorEx editor) { super.prepareEditor(editor); editor.setPlaceholder(XDebuggerBundle.message( "debugger.evaluate.expression.or.add.a.watch.hint", KeymapUtil.getShortcutText(new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), null)), KeymapUtil.getShortcutText(new KeyboardShortcut(XDebuggerEvaluationDialog.ADD_WATCH_KEYSTROKE, null)) )); editor.addFocusListener(new FocusChangeListener() { private static final Set<FocusEvent.Cause> myCauses = Set.of( FocusEvent.Cause.UNKNOWN, FocusEvent.Cause.TRAVERSAL_FORWARD, FocusEvent.Cause.TRAVERSAL_BACKWARD ); @Override public void focusGained(@NotNull Editor editor, @NotNull FocusEvent event) { if (myCauses.contains(event.getCause())) { boolean shouldBeIgnored = myEvaluateComboBox.getComboBox().isPopupVisible(); if (!shouldBeIgnored) { DebuggerEvaluationStatisticsCollector.INPUT_FOCUS.log(getTree().getProject()); } } } }); } | prepareEditor |
294,973 | void (@NotNull Editor editor, @NotNull FocusEvent event) { if (myCauses.contains(event.getCause())) { boolean shouldBeIgnored = myEvaluateComboBox.getComboBox().isPopupVisible(); if (!shouldBeIgnored) { DebuggerEvaluationStatisticsCollector.INPUT_FOCUS.log(getTree().getProject()); } } } | focusGained |
294,974 | void (ActionEvent e) { // This listener overrides one from BasicComboBoxUI$Actions // Close popup manually instead of default handler if (myEvaluateComboBox.getComboBox().isPopupVisible()) { myEvaluateComboBox.getComboBox().setPopupVisible(false); } else { addExpressionResultNode(); } } | actionPerformed |
294,975 | void (PopupMenuEvent e) { selectedIndexOnPopupOpen = myEvaluateComboBox.getComboBox().getSelectedIndex(); myEvaluateComboBox.requestFocusInEditor(); DebuggerEvaluationStatisticsCollector.HISTORY_SHOW.log(getTree().getProject()); } | popupMenuWillBecomeVisible |
294,976 | void (PopupMenuEvent e) { if (myEvaluateComboBox.getComboBox().getSelectedIndex() != selectedIndexOnPopupOpen) { DebuggerEvaluationStatisticsCollector.HISTORY_CHOOSE.log(getTree().getProject()); } } | popupMenuWillBecomeInvisible |
294,977 | void (@NotNull SessionEvent event) { if (event != SessionEvent.SETTINGS_CHANGED) { myRootNode.removeResultNode(); } } | beforeTreeBuild |
294,978 | void () { XExpression expression = myEvaluateComboBox.getExpression(); if (!XDebuggerUtilImpl.isEmptyExpression(expression)) { myEvaluateComboBox.saveTextInHistory(); XDebugSession session = getSession(getTree()); myRootNode.addResultNode(session != null ? session.getCurrentStackFrame() : null, expression); DebuggerEvaluationStatisticsCollector.INLINE_EVALUATE.log(getTree().getProject()); } } | addExpressionResultNode |
294,979 | void (@NotNull XStackFrame stackFrame) { super.buildTreeAndRestoreState(stackFrame); if (myEvaluateComboBox != null) { myEvaluateComboBox.setSourcePosition(stackFrame.getSourcePosition()); } } | buildTreeAndRestoreState |
294,980 | void () { final XDebuggerTree watchTree = getTree(); final Alarm quitePeriod = new Alarm(); final Alarm editAlarm = new Alarm(); final ClickListener mouseListener = new ClickListener() { @Override public boolean onClick(@NotNull MouseEvent event, int clickCount) { if (!SwingUtilities.isLeftMouseButton(event) || ((event.getModifiers() & (InputEvent.SHIFT_MASK | InputEvent.ALT_MASK | InputEvent.CTRL_MASK | InputEvent.META_MASK)) !=0) ) { return false; } boolean sameRow = isAboveSelectedItem(event, watchTree, false); if (!sameRow || clickCount > 1) { editAlarm.cancelAllRequests(); return false; } final AnAction editWatchAction = ActionManager.getInstance().getAction(XDebuggerActions.XEDIT_WATCH); Presentation presentation = editWatchAction.getTemplatePresentation().clone(); DataContext context = DataManager.getInstance().getDataContext(watchTree); final AnActionEvent actionEvent = new AnActionEvent(null, context, "WATCH_TREE", presentation, ActionManager.getInstance(), 0); Runnable runnable = () -> editWatchAction.actionPerformed(actionEvent); if (editAlarm.isEmpty() && quitePeriod.isEmpty()) { editAlarm.addRequest(runnable, UIUtil.getMultiClickInterval()); } else { editAlarm.cancelAllRequests(); } return false; } }; final ClickListener mouseEmptySpaceListener = new DoubleClickListener() { @Override protected boolean onDoubleClick(@NotNull MouseEvent event) { if (!isAboveSelectedItem(event, watchTree, true)) { myRootNode.addNewWatch(); return true; } return false; } }; ListenerUtil.addClickListener(watchTree, mouseListener); ListenerUtil.addClickListener(watchTree, mouseEmptySpaceListener); final FocusListener focusListener = new FocusListener() { @Override public void focusGained(@NotNull FocusEvent e) { quitePeriod.addRequest(EmptyRunnable.getInstance(), UIUtil.getMultiClickInterval()); } @Override public void focusLost(@NotNull FocusEvent e) { editAlarm.cancelAllRequests(); } }; ListenerUtil.addFocusListener(watchTree, focusListener); final TreeSelectionListener selectionListener = new TreeSelectionListener() { @Override public void valueChanged(@NotNull TreeSelectionEvent e) { quitePeriod.addRequest(EmptyRunnable.getInstance(), UIUtil.getMultiClickInterval()); } }; watchTree.addTreeSelectionListener(selectionListener); myDisposables.add(new Disposable() { @Override public void dispose() { ListenerUtil.removeClickListener(watchTree, mouseListener); ListenerUtil.removeClickListener(watchTree, mouseEmptySpaceListener); ListenerUtil.removeFocusListener(watchTree, focusListener); watchTree.removeTreeSelectionListener(selectionListener); } }); } | installEditListeners |
294,981 | boolean (@NotNull MouseEvent event, int clickCount) { if (!SwingUtilities.isLeftMouseButton(event) || ((event.getModifiers() & (InputEvent.SHIFT_MASK | InputEvent.ALT_MASK | InputEvent.CTRL_MASK | InputEvent.META_MASK)) !=0) ) { return false; } boolean sameRow = isAboveSelectedItem(event, watchTree, false); if (!sameRow || clickCount > 1) { editAlarm.cancelAllRequests(); return false; } final AnAction editWatchAction = ActionManager.getInstance().getAction(XDebuggerActions.XEDIT_WATCH); Presentation presentation = editWatchAction.getTemplatePresentation().clone(); DataContext context = DataManager.getInstance().getDataContext(watchTree); final AnActionEvent actionEvent = new AnActionEvent(null, context, "WATCH_TREE", presentation, ActionManager.getInstance(), 0); Runnable runnable = () -> editWatchAction.actionPerformed(actionEvent); if (editAlarm.isEmpty() && quitePeriod.isEmpty()) { editAlarm.addRequest(runnable, UIUtil.getMultiClickInterval()); } else { editAlarm.cancelAllRequests(); } return false; } | onClick |
294,982 | boolean (@NotNull MouseEvent event) { if (!isAboveSelectedItem(event, watchTree, true)) { myRootNode.addNewWatch(); return true; } return false; } | onDoubleClick |
294,983 | void (@NotNull FocusEvent e) { quitePeriod.addRequest(EmptyRunnable.getInstance(), UIUtil.getMultiClickInterval()); } | focusGained |
294,984 | void (@NotNull FocusEvent e) { editAlarm.cancelAllRequests(); } | focusLost |
294,985 | void (@NotNull TreeSelectionEvent e) { quitePeriod.addRequest(EmptyRunnable.getInstance(), UIUtil.getMultiClickInterval()); } | valueChanged |
294,986 | void () { ListenerUtil.removeClickListener(watchTree, mouseListener); ListenerUtil.removeClickListener(watchTree, mouseEmptySpaceListener); ListenerUtil.removeFocusListener(watchTree, focusListener); watchTree.removeTreeSelectionListener(selectionListener); } | dispose |
294,987 | void () { Disposer.dispose(myDisposables); DnDManager.getInstance().unregisterTarget(this, getTree()); super.dispose(); } | dispose |
294,988 | boolean (MouseEvent event, XDebuggerTree watchTree, boolean fullWidth) { Rectangle bounds = watchTree.getRowBounds(watchTree.getLeadSelectionRow()); if (bounds != null) { if (fullWidth) { bounds.x = 0; } bounds.width = watchTree.getWidth(); if (bounds.contains(event.getPoint())) { return true; } } return false; } | isAboveSelectedItem |
294,989 | void (@NotNull XExpression expression, int index, final boolean navigateToWatchNode) { addWatchExpression(expression, index, navigateToWatchNode, false); } | addWatchExpression |
294,990 | void (@NotNull XExpression expression, int index, final boolean navigateToWatchNode, boolean noDuplicates) { ThreadingAssertions.assertEventDispatchThread(); XDebugSession session = getSession(getTree()); boolean found = false; if (noDuplicates) { for (WatchNode child : myRootNode.getWatchChildren()) { if (child.getExpression().equals(expression)) { TreeUtil.selectNode(getTree(), child); found = true; } } } if (!found) { myRootNode.addWatchExpression(session != null ? session.getCurrentStackFrame() : null, expression, index, navigateToWatchNode); updateSessionData(); } if (navigateToWatchNode && session != null) { XDebugSessionTab.showWatchesView((XDebugSessionImpl)session); } } | addWatchExpression |
294,991 | void () { myRootNode.computeWatches(); } | computeWatches |
294,992 | XValueContainerNode (@Nullable XStackFrame stackFrame) { if (inlineWatchesEnabled) { myRootNode = new InlineWatchesRootNode(getTree(), this, getExpressions(), getInlineExpressions(), stackFrame, myWatchesInVariables); } else { myRootNode = new WatchesRootNode(getTree(), this, getExpressions(), stackFrame, myWatchesInVariables); } return myRootNode; } | doCreateNewRootNode |
294,993 | List<InlineWatch> () { return getWatchesManager().getInlineWatches(); } | getInlineExpressions |
294,994 | XDebuggerWatchesManager () { return ((XDebuggerManagerImpl)XDebuggerManager.getInstance(getTree().getProject())) .getWatchesManager(); } | getWatchesManager |
294,995 | void (@NotNull InlineWatch watch, int index, boolean navigateToWatchNode) { ThreadingAssertions.assertEventDispatchThread(); XDebugSession session = getSession(getTree()); ((InlineWatchesRootNode)myRootNode).addInlineWatchExpression(session != null ? session.getCurrentStackFrame() : null, watch, index, navigateToWatchNode); if (navigateToWatchNode && session != null) { XDebugSessionTab.showWatchesView((XDebugSessionImpl)session); } } | addInlineWatchExpression |
294,996 | void (Collection<InlineWatch> watches) { InlineWatchesRootNode rootNode = (InlineWatchesRootNode)myRootNode; @SuppressWarnings("unchecked") List<? extends XDebuggerTreeNode> nodesToRemove = (List<? extends XDebuggerTreeNode>)ContainerUtil.filter(rootNode.getInlineWatchChildren(), node -> watches.contains(node.getWatch())); if (!nodesToRemove.isEmpty()) { removeInlineNodes(nodesToRemove, false); } } | removeInlineWatches |
294,997 | void (List<? extends XDebuggerTreeNode> inlineWatches, boolean updateManager) { InlineWatchesRootNode rootNode = (InlineWatchesRootNode)myRootNode; List<? extends InlineWatchNode> inlineWatchChildren = rootNode.getInlineWatchChildren(); final int[] minIndex = {Integer.MAX_VALUE}; List<InlineWatchNode> toRemoveInlines = new ArrayList<>(); inlineWatches.forEach((node) -> { int index = inlineWatchChildren.indexOf(node); if (index != -1) { toRemoveInlines.add((InlineWatchNode)node); minIndex[0] = Math.min(minIndex[0], index); } }); rootNode.removeInlineChildren(toRemoveInlines); List<? extends InlineWatchNode> newChildren = rootNode.getInlineWatchChildren(); if (!newChildren.isEmpty()) { InlineWatchNode node = newChildren.get(Math.min(minIndex[0], newChildren.size() - 1)); TreeUtil.selectNode(getTree(), node); } if (updateManager) { getWatchesManager().inlineWatchesRemoved(ContainerUtil.map(toRemoveInlines, node -> node.getWatch()), this); } } | removeInlineNodes |
294,998 | void (XValueContainerNode root) { if (myWatchesInVariables) { super.addEmptyMessage(root); } } | addEmptyMessage |
294,999 | List<XExpression> () { XDebuggerTree tree = getTree(); XDebugSession session = getSession(tree); List<XExpression> expressions; if (session != null) { expressions = ((XDebugSessionImpl)session).getSessionData().getWatchExpressions(); } else { XDebuggerTreeNode root = tree.getRoot(); expressions = root instanceof WatchesRootNode ? ((WatchesRootNode)root).getWatchExpressions() : Collections.emptyList(); } return expressions; } | getExpressions |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.