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

  • Running tasks concurrently on multiple threads
  • getContentResolver (Context)
  • onRequestPermissionsResult (Fragment)
  • getSupportFragmentManager (FragmentActivity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JPanel (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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