@Override public void selectionChanged(final SelectionEvent e) { if (!Registry.is("debugger.valueTooltipAutoShowOnSelection") || myEditor.getCaretModel().getCaretCount() > 1) { return; } final String text = myEditor.getDocument().getText(e.getNewRange()); if (!StringUtil.isEmpty(text) && !(text.contains("exec(") || text.contains("++") || text.contains("--") || text.contains("="))) { final XDebugSession session = getSession(getTree()); if (session == null) return; XDebuggerEvaluator evaluator = myStackFrame.getEvaluator(); if (evaluator == null) return; TextRange range = e.getNewRange(); ExpressionInfo info = new ExpressionInfo(range); int offset = range.getStartOffset(); LogicalPosition pos = myEditor.offsetToLogicalPosition(offset); Point point = myEditor.logicalPositionToXY(pos); new XValueHint(myProject, myEditor, point, ValueHintType.MOUSE_OVER_HINT, info, evaluator, session).invokeHint(); } }
@Override public void removeBlockSelection() { myUnknownDirection = false; if (hasBlockSelection()) { myEditor.repaint(0, myEditor.getDocument().getTextLength()); final int[] oldStarts = getBlockSelectionStarts(); final int[] oldEnds = getBlockSelectionEnds(); myBlockStart = null; myBlockEnd = null; final int[] newStarts = getBlockSelectionStarts(); final int[] newEnds = getBlockSelectionEnds(); broadcastSelectionEvent(new SelectionEvent(myEditor, oldStarts, oldEnds, newStarts, newEnds)); } }
@Override public void selectionChanged(final SelectionEvent e) { if (!XDebuggerSettingsManager.getInstance().getDataViewSettings().isValueTooltipAutoShowOnSelection() || myEditor.getCaretModel().getCaretCount() > 1) { return; } final String text = myEditor.getDocument().getText(e.getNewRange()); if (!StringUtil.isEmpty(text) && !(text.contains("exec(") || text.contains("++") || text.contains("--") || text.contains("="))) { final XDebugSession session = getSession(getTree()); if (session == null) return; XDebuggerEvaluator evaluator = myStackFrame.getEvaluator(); if (evaluator == null) return; TextRange range = e.getNewRange(); ExpressionInfo info = new ExpressionInfo(range); int offset = range.getStartOffset(); LogicalPosition pos = myEditor.offsetToLogicalPosition(offset); Point point = myEditor.logicalPositionToXY(pos); new XValueHint(myProject, myEditor, point, ValueHintType.MOUSE_OVER_HINT, info, evaluator, session).invokeHint(); } }
void fireSelectionChanged(int oldSelectionStart, int oldSelectionEnd, int startOffset, int endOffset) { repaintBySelectionChange(oldSelectionStart, startOffset, oldSelectionEnd, endOffset); SelectionEvent event = new SelectionEvent(myEditor, oldSelectionStart, oldSelectionEnd, startOffset, endOffset); broadcastSelectionEvent(event); }
private void broadcastSelectionEvent(SelectionEvent event) { for (SelectionListener listener : mySelectionListeners) { try { listener.selectionChanged(event); } catch (Exception e) { LOG.error(e); } } }
private void fireSelectionChanged(int oldSelectionStart, int oldSelectionEnd, int startOffset, int endOffset) { repaintBySelectionChange(oldSelectionStart, startOffset, oldSelectionEnd, endOffset); SelectionEvent event = new SelectionEvent(myEditor, oldSelectionStart, oldSelectionEnd, startOffset, endOffset); broadcastSelectionEvent(event); }
@Override public void selectionChanged(SelectionEvent e) { updateResults(false); }
@Override public void selectionChanged(SelectionEvent e) { smartUpdate(); }