congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
TextViewer.revealRange
Code IndexAdd Tabnine to your IDE (free)

How to use
revealRange
method
in
org.eclipse.jface.text.TextViewer

Best Java code snippets using org.eclipse.jface.text.TextViewer.revealRange (Showing top 4 results out of 315)

origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * Updates the viewport, trying to keep the
 * {@linkplain StyledText#getLinePixel(int) line pixel} of the caret line stable. If the
 * selection has been updated while in redraw(false) mode, the new selection is revealed.
 */
private void updateViewport() {
  if (fSelectionSet) {
    revealRange(fSelection.getOffset(), fSelection.getLength());
  } else if (fStableLine != null) {
    int stableLine;
    try {
      stableLine= fUpdaterDocument.getLineOfOffset(fStableLine.getOffset());
    } catch (BadLocationException x) {
      // ignore and return silently
      return;
    }
    int stableWidgetLine= getClosestWidgetLineForModelLine(stableLine);
    if (stableWidgetLine == -1)
      return;
    int linePixel= getTextWidget().getLinePixel(stableWidgetLine);
    int delta= fStablePixel - linePixel;
    int topPixel= getTextWidget().getTopPixel();
    getTextWidget().setTopPixel(topPixel - delta);
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * Updates the viewport, trying to keep the
 * {@linkplain StyledText#getLinePixel(int) line pixel} of the caret line stable. If the
 * selection has been updated while in redraw(false) mode, the new selection is revealed.
 */
private void updateViewport() {
  if (fSelectionSet) {
    revealRange(fSelection.getOffset(), fSelection.getLength());
  } else if (fStableLine != null) {
    int stableLine;
    try {
      stableLine= fUpdaterDocument.getLineOfOffset(fStableLine.getOffset());
    } catch (BadLocationException x) {
      // ignore and return silently
      return;
    }
    int stableWidgetLine= getClosestWidgetLineForModelLine(stableLine);
    if (stableWidgetLine == -1)
      return;
    int linePixel= getTextWidget().getLinePixel(stableWidgetLine);
    int delta= fStablePixel - linePixel;
    int topPixel= getTextWidget().getTopPixel();
    getTextWidget().setTopPixel(topPixel - delta);
  }
}
origin: org.eclipse.platform/org.eclipse.jface.text

    revealRange(s.getOffset(), s.getLength());
} else if (selection instanceof ITextSelection) {
  ITextSelection s= (ITextSelection) selection;
  setSelectedRange(s.getOffset(), s.getLength());
  if (reveal)
    revealRange(s.getOffset(), s.getLength());
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

    revealRange(s.getOffset(), s.getLength());
} else if (selection instanceof ITextSelection) {
  ITextSelection s= (ITextSelection) selection;
  setSelectedRange(s.getOffset(), s.getLength());
  if (reveal)
    revealRange(s.getOffset(), s.getLength());
org.eclipse.jface.textTextViewerrevealRange

Popular methods of TextViewer

  • getTextWidget
  • getControl
  • doOperation
  • setDocument
  • modelRange2WidgetRange
    Same as #modelRange2WidgetRange(IRegion) just for a org.eclipse.jface.text.Position.
  • getRewriteTarget
  • getSelection
  • modelLine2WidgetLine
    Implements the contract of ITextViewerExtension5#modelLine2WidgetLine(int).
  • getDocument
  • setSelectedRange
  • setSelection
  • <init>
    Create a new text viewer with the given SWT style bits. The viewer is ready to use but does not have
  • setSelection,
  • <init>,
  • canDoOperation,
  • getVisibleRegion,
  • handleDispose,
  • invalidateTextPresentation,
  • setTopIndex,
  • _getVisibleRegionOffset,
  • activatePlugins,
  • addPresentation

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • getSharedPreferences (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now