Examples of widgetLine2ModelLine()


Examples of org.eclipse.jface.text.ITextViewerExtension5.widgetLine2ModelLine()

   * @return <code>true</code> if the line is folded
   */
  private boolean isFoldedLine(int widgetLine) {
    if (fTextViewer instanceof ITextViewerExtension5) {
      ITextViewerExtension5 extension= (ITextViewerExtension5)fTextViewer;
      int modelLine= extension.widgetLine2ModelLine(widgetLine);
      int widgetLine2= extension.modelLine2WidgetLine(modelLine + 1);
      return widgetLine2 == -1;
    }
    return false;
  }
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension5.widgetLine2ModelLine()

      if (fSourceViewer instanceof ITextViewerExtension5) {
        ITextViewerExtension5 extension= (ITextViewerExtension5) fSourceViewer;
        StyledText textWidget= fSourceViewer.getTextWidget();
        int topIndex= textWidget.getTopIndex();
        int newTopIndex= Math.max(0, topIndex + fScrollIncrement);
        fSourceViewer.setTopIndex(extension.widgetLine2ModelLine(newTopIndex));
      } else {
        int topIndex= fSourceViewer.getTopIndex();
        int newTopIndex= Math.max(0, topIndex + fScrollIncrement);
        fSourceViewer.setTopIndex(newTopIndex);
      }
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension5.widgetLine2ModelLine()

    lines[0]= (pixel0 * maxLines) / rulerLength;
    lines[1]= (pixel1 * maxLines) / rulerLength;

    if (fTextViewer instanceof ITextViewerExtension5) {
      ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;
      lines[0]= extension.widgetLine2ModelLine(lines[0]);
      lines[1]= extension.widgetLine2ModelLine(lines[1]);
    } else {
      try {
        IRegion visible= fTextViewer.getVisibleRegion();
        int lineNumber= fTextViewer.getDocument().getLineOfOffset(visible.getOffset());
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension5.widgetLine2ModelLine()

    lines[1]= (pixel1 * maxLines) / rulerLength;

    if (fTextViewer instanceof ITextViewerExtension5) {
      ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;
      lines[0]= extension.widgetLine2ModelLine(lines[0]);
      lines[1]= extension.widgetLine2ModelLine(lines[1]);
    } else {
      try {
        IRegion visible= fTextViewer.getVisibleRegion();
        int lineNumber= fTextViewer.getDocument().getLineOfOffset(visible.getOffset());
        lines[0] += lineNumber;
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension5.widgetLine2ModelLine()

      ITextViewerExtension5 extension= (ITextViewerExtension5) fCachedTextViewer;
     
      // ITextViewer.getTopIndex returns the fully visible line, but we want the partially
      // visible one
      int widgetTopLine= JFaceTextUtil.getPartialTopIndex(fCachedTextWidget);
      topLine= extension.widgetLine2ModelLine(widgetTopLine);
     
      coverage= extension.getModelCoverage();
     
    } else {
      topLine= JFaceTextUtil.getPartialTopIndex(fCachedTextViewer);
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension5.widgetLine2ModelLine()

   */
  protected final static int widgetLine2ModelLine(ITextViewer viewer, int widgetLine) {

    if (viewer instanceof ITextViewerExtension5) {
      ITextViewerExtension5 extension= (ITextViewerExtension5) viewer;
      return extension.widgetLine2ModelLine(widgetLine);
    }

    try {
      IRegion r= viewer.getVisibleRegion();
      IDocument d= viewer.getDocument();
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension5.widgetLine2ModelLine()

   */
  protected final static int widgetLine2ModelLine(ITextViewer viewer, int widgetLine) {

    if (viewer instanceof ITextViewerExtension5) {
      ITextViewerExtension5 extension= (ITextViewerExtension5) viewer;
      return extension.widgetLine2ModelLine(widgetLine);
    }

    try {
      IRegion r= viewer.getVisibleRegion();
      IDocument d= viewer.getDocument();
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension5.widgetLine2ModelLine()

    if (fViewer instanceof ITextViewerExtension5) {
      ITextViewerExtension5 ext= (ITextViewerExtension5) fViewer;
      try {
        return ext.widgetOffset2ModelOffset(textWidget.getOffsetAtLocation(point));
      } catch (IllegalArgumentException e) {
        int docLineIndex= ext.widgetLine2ModelLine(textWidget.getLineIndex(point.y));
        String lineDelimiter= document.getLineDelimiter(docLineIndex);
        int delimLength= lineDelimiter == null ? 0 : lineDelimiter.length();
        return document.getLineOffset(docLineIndex) + document.getLineLength(docLineIndex)
            - delimLength;
      }
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension5.widgetLine2ModelLine()

      if (fSourceViewer instanceof ITextViewerExtension5) {
        ITextViewerExtension5 extension= (ITextViewerExtension5) fSourceViewer;
        StyledText textWidget= fSourceViewer.getTextWidget();
        int topIndex= textWidget.getTopIndex();
        int newTopIndex= Math.max(0, topIndex + fScrollIncrement);
        fSourceViewer.setTopIndex(extension.widgetLine2ModelLine(newTopIndex));
      } else {
        int topIndex= fSourceViewer.getTopIndex();
        int newTopIndex= Math.max(0, topIndex + fScrollIncrement);
        fSourceViewer.setTopIndex(newTopIndex);
      }
View Full Code Here

Examples of org.eclipse.jface.text.ITextViewerExtension5.widgetLine2ModelLine()

    if (lines[1] > infos.maxLines)
      lines[1]= infos.maxLines;
   
    if (fTextViewer instanceof ITextViewerExtension5) {
      ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;
      lines[0]= extension.widgetLine2ModelLine(lines[0]);
      lines[1]= extension.widgetLine2ModelLine(lines[1]);
    } else {
      try {
        IRegion visible= fTextViewer.getVisibleRegion();
        int lineNumber= fTextViewer.getDocument().getLineOfOffset(visible.getOffset());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.