Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.StyledText.toControl()


      if (text == null || text.isDisposed())
        return -1;

      Display display= text.getDisplay();
      Point absolutePosition= display.getCursorLocation();
      Point relativePosition= text.toControl(absolutePosition);
     
      int widgetOffset= text.getOffsetAtLocation(relativePosition);
      if (viewer instanceof ITextViewerExtension5) {
        ITextViewerExtension5 extension= (ITextViewerExtension5) viewer;
        return extension.widgetOffset2ModelOffset(widgetOffset);
View Full Code Here


      if (text == null || text.isDisposed())
        return -1;

      Display display = text.getDisplay();
      Point absolutePosition = display.getCursorLocation();
      Point relativePosition = text.toControl(absolutePosition);

      int widgetOffset = text.getOffsetAtLocation(relativePosition);
      if (getTextViewer() instanceof ITextViewerExtension5) {
        ITextViewerExtension5 extension = (ITextViewerExtension5) getTextViewer();
        return extension.widgetOffset2ModelOffset(widgetOffset);
View Full Code Here

      if (text == null || text.isDisposed())
        return -1;

      Display display= text.getDisplay();
      Point absolutePosition= display.getCursorLocation();
      Point relativePosition= text.toControl(absolutePosition);

      int widgetOffset= text.getOffsetAtLocation(relativePosition);
      Point p= text.getLocationAtOffset(widgetOffset);
      if (p.x > relativePosition.x)
        widgetOffset--;
View Full Code Here

    IDocument document= fTextEditor.getDocumentProvider().getDocument(fTextEditor.getEditorInput());
    try {
      if (location.equals(fCachedPosition))
        return fCachedResult;
      fCachedPosition= location;
      int offset= getOffset(document, textWidget, textWidget.toControl(location.x,
          location.y));
      if (fCachedOffset == offset)
        return fCachedResult;
      fCachedOffset= offset;
      if (isValidTemplate(document, template, offset, 0))
View Full Code Here

      if (text == null || text.isDisposed())
        return -1;

      Display display= text.getDisplay();
      Point absolutePosition= display.getCursorLocation();
      Point relativePosition= text.toControl(absolutePosition);

      int widgetOffset= text.getOffsetAtLocation(relativePosition);
      Point p= text.getLocationAtOffset(widgetOffset);
      if (p.x > relativePosition.x)
        widgetOffset--;
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.