Tabnine Logo
TextViewer.getClosestWidgetLineForModelLine
Code IndexAdd Tabnine to your IDE (free)

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

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

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

@Override
public void setTopIndex(int index) {
  if (fTextWidget != null) {
    int widgetLine= modelLine2WidgetLine(index);
    if (widgetLine == -1)
      widgetLine= getClosestWidgetLineForModelLine(index);
    if (widgetLine > -1) {
      fTextWidget.setTopIndex(widgetLine);
        updateViewportListeners(INTERNAL);
    }
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
public void setTopIndex(int index) {
  if (fTextWidget != null) {
    int widgetLine= modelLine2WidgetLine(index);
    if (widgetLine == -1)
      widgetLine= getClosestWidgetLineForModelLine(index);
    if (widgetLine > -1) {
      fTextWidget.setTopIndex(widgetLine);
        updateViewportListeners(INTERNAL);
    }
  }
}
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);
  }
}
org.eclipse.jface.textTextViewergetClosestWidgetLineForModelLine

Javadoc

Returns the line of the widget whose corresponding line in the viewer's document is closest to the given line in the viewer's document or -1.

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

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top plugins for WebStorm
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