public void run() { if (autoScrollDirection == SWT.DOWN) { if (blockSelection) { int verticalScrollOffset = getVerticalScrollOffset(); int y = blockYLocation - verticalScrollOffset; int max = renderer.getHeight() - verticalScrollOffset - clientAreaHeight; int pixels = Math.min(autoScrollDistance, Math.max(0,max)); if (pixels != 0) { setBlockSelectionLocation(blockXLocation - horizontalScrollOffset, y + pixels, true); scrollVertical(pixels, true); } } else { doSelectionPageDown(autoScrollDistance); } display.timerExec(V_SCROLL_RATE, this); } } };
int maxY = renderer.getHeight() - bottomMargin; int maxX = Math.max(clientAreaWidth, renderer.getWidth()) - rightMargin; int anchorX = Math.max(minX, Math.min(maxX, x)) - horizontalScrollOffset;
int maxY = renderer.getHeight() - bottomMargin; int maxX = Math.max(clientAreaWidth, renderer.getWidth()) - rightMargin; int anchorX = Math.max(minX, Math.min(maxX, x)) - horizontalScrollOffset;
@Override public void run() { /* Bug 437357 - NPE in StyledText.getCaretLine * StyledText.content is null at times, probably because the * widget itself has been disposed. */ if (isDisposed()) return; if (autoScrollDirection == SWT.DOWN) { if (blockSelection) { int verticalScrollOffset = getVerticalScrollOffset(); int y = blockYLocation - verticalScrollOffset; int max = renderer.getHeight() - verticalScrollOffset - clientAreaHeight; int pixels = Math.min(autoScrollDistance, Math.max(0,max)); if (pixels != 0) { setBlockSelectionLocation(blockXLocation - horizontalScrollOffset, y + pixels, true); scrollVertical(pixels, true); } } else { doSelectionPageDown(autoScrollDistance); } display.timerExec(V_SCROLL_RATE, this); } } };
@Override public void run() { /* Bug 437357 - NPE in StyledText.getCaretLine * StyledText.content is null at times, probably because the * widget itself has been disposed. */ if (isDisposed()) return; if (autoScrollDirection == SWT.DOWN) { if (blockSelection) { int verticalScrollOffset = getVerticalScrollOffset(); int y = blockYLocation - verticalScrollOffset; int max = renderer.getHeight() - verticalScrollOffset - clientAreaHeight; int pixels = Math.min(autoScrollDistance, Math.max(0,max)); if (pixels != 0) { setBlockSelectionLocation(blockXLocation - horizontalScrollOffset, y + pixels, true); scrollVertical(pixels, true); } } else { doSelectionPageDown(autoScrollDistance); } display.timerExec(V_SCROLL_RATE, this); } } };
@Override public void run() { /* Bug 437357 - NPE in StyledText.getCaretLine * StyledText.content is null at times, probably because the * widget itself has been disposed. */ if (isDisposed()) return; if (autoScrollDirection == SWT.DOWN) { if (blockSelection) { int verticalScrollOffset = getVerticalScrollOffset(); int y = blockYLocation - verticalScrollOffset; int max = renderer.getHeight() - verticalScrollOffset - clientAreaHeight; int pixels = Math.min(autoScrollDistance, Math.max(0,max)); if (pixels != 0) { setBlockSelectionLocation(blockXLocation - horizontalScrollOffset, y + pixels, true); scrollVertical(pixels, true); } } else { doSelectionPageDown(autoScrollDistance); } display.timerExec(V_SCROLL_RATE, this); } } };
@Override public void run() { /* Bug 437357 - NPE in StyledText.getCaretLine * StyledText.content is null at times, probably because the * widget itself has been disposed. */ if (isDisposed()) return; if (autoScrollDirection == SWT.DOWN) { if (blockSelection) { int verticalScrollOffset = getVerticalScrollOffset(); int y = blockYLocation - verticalScrollOffset; int max = renderer.getHeight() - verticalScrollOffset - clientAreaHeight; int pixels = Math.min(autoScrollDistance, Math.max(0,max)); if (pixels != 0) { setBlockSelectionLocation(blockXLocation - horizontalScrollOffset, y + pixels, true); scrollVertical(pixels, true); } } else { doSelectionPageDown(autoScrollDistance); } display.timerExec(V_SCROLL_RATE, this); } } };
/** * Scrolls down the text to use new space made available by a resize or by * deleted lines. */ void claimBottomFreeSpace() { if (ime.getCompositionOffset() != -1) return; if (isFixedLineHeight()) { int newVerticalOffset = Math.max(0, renderer.getHeight() - clientAreaHeight); if (newVerticalOffset < getVerticalScrollOffset()) { scrollVertical(newVerticalOffset - getVerticalScrollOffset(), true); } } else { int bottomIndex = getPartialBottomIndex(); int height = getLinePixel(bottomIndex + 1); if (clientAreaHeight > height) { scrollVertical(-getAvailableHeightAbove(clientAreaHeight - height), true); } } } /**
/** * Scrolls down the text to use new space made available by a resize or by * deleted lines. */ void claimBottomFreeSpace() { if (ime.getCompositionOffset() != -1) return; if (isFixedLineHeight()) { int newVerticalOffset = Math.max(0, renderer.getHeight() - clientAreaHeight); if (newVerticalOffset < getVerticalScrollOffset()) { scrollVertical(newVerticalOffset - getVerticalScrollOffset(), true); } } else { int bottomIndex = getPartialBottomIndex(); int height = getLinePixel(bottomIndex + 1); if (clientAreaHeight > height) { scrollVertical(-getAvailableHeightAbove(clientAreaHeight - height), true); } } } /**
/** * Scrolls down the text to use new space made available by a resize or by * deleted lines. */ void claimBottomFreeSpace() { if (ime.getCompositionOffset() != -1) return; if (isFixedLineHeight()) { int newVerticalOffset = Math.max(0, renderer.getHeight() - clientAreaHeight); if (newVerticalOffset < getVerticalScrollOffset()) { scrollVertical(newVerticalOffset - getVerticalScrollOffset(), true); } } else { int bottomIndex = getPartialBottomIndex(); int height = getLinePixel(bottomIndex + 1); if (clientAreaHeight > height) { scrollVertical(-getAvailableHeightAbove(clientAreaHeight - height), true); } } } /**
/** * Scrolls down the text to use new space made available by a resize or by * deleted lines. */ void claimBottomFreeSpace() { if (ime.getCompositionOffset() != -1) return; if (isFixedLineHeight()) { int newVerticalOffset = Math.max(0, renderer.getHeight() - clientAreaHeight); if (newVerticalOffset < getVerticalScrollOffset()) { scrollVertical(newVerticalOffset - getVerticalScrollOffset(), true); } } else { int bottomIndex = getPartialBottomIndex(); int height = getLinePixel(bottomIndex + 1); if (clientAreaHeight > height) { scrollVertical(-getAvailableHeightAbove(clientAreaHeight - height), true); } } } /**
/** * Scrolls down the text to use new space made available by a resize or by * deleted lines. */ void claimBottomFreeSpace() { if (ime.getCompositionOffset() != -1) return; if (isFixedLineHeight()) { int newVerticalOffset = Math.max(0, renderer.getHeight() - clientAreaHeight); if (newVerticalOffset < getVerticalScrollOffset()) { scrollVertical(newVerticalOffset - getVerticalScrollOffset(), true); } } else { int bottomIndex = getPartialBottomIndex(); int height = getLinePixel(bottomIndex + 1); if (clientAreaHeight > height) { scrollVertical(-getAvailableHeightAbove(clientAreaHeight - height), true); } } } /**
/** * Selects all the text. * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void selectAll() { checkWidget(); if (blockSelection) { renderer.calculate(0, content.getLineCount()); setScrollBars(false); int verticalScrollOffset = getVerticalScrollOffset(); int left = leftMargin - horizontalScrollOffset; int top = topMargin - verticalScrollOffset; int right = renderer.getWidth() - rightMargin - horizontalScrollOffset; int bottom = renderer.getHeight() - bottomMargin - verticalScrollOffset; setBlockSelectionLocation(left, top, right, bottom, false); return; } setSelection(0, Math.max(getCharCount(),0)); } /**
/** * Selects all the text. * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void selectAll() { checkWidget(); if (blockSelection) { renderer.calculate(0, content.getLineCount()); setScrollBars(false); int verticalScrollOffset = getVerticalScrollOffset(); int left = leftMargin - horizontalScrollOffset; int top = topMargin - verticalScrollOffset; int right = renderer.getWidth() - rightMargin - horizontalScrollOffset; int bottom = renderer.getHeight() - bottomMargin - verticalScrollOffset; setBlockSelectionLocation(left, top, right, bottom, false); return; } setSelection(0, Math.max(getCharCount(),0)); } /**
/** * Selects all the text. * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void selectAll() { checkWidget(); if (blockSelection) { renderer.calculate(0, content.getLineCount()); setScrollBars(false); int verticalScrollOffset = getVerticalScrollOffset(); int left = leftMargin - horizontalScrollOffset; int top = topMargin - verticalScrollOffset; int right = renderer.getWidth() - rightMargin - horizontalScrollOffset; int bottom = renderer.getHeight() - bottomMargin - verticalScrollOffset; setBlockSelectionLocation(left, top, right, bottom, false); return; } setSelection(0, Math.max(getCharCount(),0)); } /**
/** * Selects all the text. * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void selectAll() { checkWidget(); if (blockSelection) { renderer.calculate(0, content.getLineCount()); setScrollBars(false); int verticalScrollOffset = getVerticalScrollOffset(); int left = leftMargin - horizontalScrollOffset; int top = topMargin - verticalScrollOffset; int right = renderer.getWidth() - rightMargin - horizontalScrollOffset; int bottom = renderer.getHeight() - bottomMargin - verticalScrollOffset; setBlockSelectionLocation(left, top, right, bottom, false); return; } setSelection(0, Math.max(getCharCount(),0)); } /**
/** * Selects all the text. * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void selectAll() { checkWidget(); if (blockSelection) { renderer.calculate(0, content.getLineCount()); setScrollBars(false); int verticalScrollOffset = getVerticalScrollOffset(); int left = leftMargin - horizontalScrollOffset; int top = topMargin - verticalScrollOffset; int right = renderer.getWidth() - rightMargin - horizontalScrollOffset; int bottom = renderer.getHeight() - bottomMargin - verticalScrollOffset; setBlockSelectionLocation(left, top, right, bottom, false); return; } setSelection(0, Math.max(getCharCount(),0)); } /**
setScrollBar(verticalBar, clientAreaHeight, renderer.getHeight(), topMargin + bottomMargin); setScrollBar(verticalBar, clientAreaHeight, renderer.getHeight(), topMargin + bottomMargin); if (verticalBar.getVisible()) { setScrollBar(horizontalBar, clientAreaWidth, renderer.getWidth(), leftMargin + rightMargin);
setScrollBar(verticalBar, clientAreaHeight, renderer.getHeight(), topMargin + bottomMargin); setScrollBar(verticalBar, clientAreaHeight, renderer.getHeight(), topMargin + bottomMargin); if (verticalBar.getVisible()) { setScrollBar(horizontalBar, clientAreaWidth, renderer.getWidth(), leftMargin + rightMargin);
setScrollBar(verticalBar, clientAreaHeight, renderer.getHeight(), topMargin + bottomMargin); setScrollBar(verticalBar, clientAreaHeight, renderer.getHeight(), topMargin + bottomMargin); if (verticalBar.getVisible()) { setScrollBar(horizontalBar, clientAreaWidth, renderer.getWidth(), leftMargin + rightMargin);