Examples of toControl()


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

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 (getTextViewer() instanceof ITextViewerExtension5) {
        ITextViewerExtension5 extension = (ITextViewerExtension5) getTextViewer();
        return extension.widgetOffset2ModelOffset(widgetOffset);
View Full Code Here

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);
      Point p= text.getLocationAtOffset(widgetOffset);
      if (p.x > relativePosition.x)
        widgetOffset--;
View Full Code Here

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

    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

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);
      Point p= text.getLocationAtOffset(widgetOffset);
      if (p.x > relativePosition.x)
        widgetOffset--;
View Full Code Here

Examples of org.eclipse.swt.widgets.Control.toControl()

        // In order to know where to draw the string we have to calculate where the
        // drop event has taken place with respect to the ViewportPane.
        // The Event returns the location but it is w.r.t the Display.
        // All SWT widgets have helper methods to determine this so:
        Control control=pane.getControl();
        final Point drawLocation = control.toControl(getEvent().x, getEvent().y);
       
        // By Adding a custom draw command we can draw on the viewport model...
        pane.addDrawCommand(new AbstractDrawCommand(){

            public Rectangle getValidArea() {
View Full Code Here

Examples of org.eclipse.swt.widgets.Control.toControl()

       
        if( message!=null ){
            if( messageBubble!=null && messageBubble.isValid() )
                messageBubble.setValid(false);
            Control control=(Control) mapDisplay;
            Point mouseLocation = control.toControl(display.getCursorLocation());
            messageBubble = new MessageBubble(mouseLocation.x, mouseLocation.y,
                                message, PreferenceUtil.instance().getMessageDisplayDelay());
            AnimationUpdater.runTimer(mapDisplay, messageBubble);
        }
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.Control.toControl()

        }
        if( message!=null ){
            if( messageBubble!=null && messageBubble.isValid() )
                messageBubble.setValid(false);
            Control control=(Control) mapDisplay;
            Point mouseLocation = control.toControl(display.getCursorLocation());
            messageBubble = new MessageBubble(mouseLocation.x, mouseLocation.y,
                                message, PreferenceUtil.instance().getMessageDisplayDelay());
            AnimationUpdater.runTimer(mapDisplay, messageBubble);
        }
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.Control.toControl()

      private float getHeightInItem(DropTargetEvent event) {
        if(event.item == null) return .5f;
        if (event.item instanceof TreeItem) {
          TreeItem treeItem = (TreeItem) event.item;
          Control control = treeItem.getParent();
          Point point = control.toControl(new Point(event.x, event.y));
          Rectangle bounds = treeItem.getBounds();
          return (float) (point.y - bounds.y) / (float) bounds.height;
        }
        else if (event.item instanceof TableItem) {
          TableItem tableItem = (TableItem) event.item;
View Full Code Here

Examples of org.eclipse.swt.widgets.Control.toControl()

          return (float) (point.y - bounds.y) / (float) bounds.height;
        }
        else if (event.item instanceof TableItem) {
          TableItem tableItem = (TableItem) event.item;
          Control control = tableItem.getParent();
          Point point = control.toControl(new Point(event.x, event.y));
          Rectangle bounds = tableItem.getBounds(0);
          return (float) (point.y - bounds.y) / (float) bounds.height;
        }
        else {
          return 0.0F;
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.