Examples of toControl()


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

          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

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

      return;
    }

        // Get the tool item under the mouse.
        ToolBar toolBar = perspectiveBar.getControl();
        ToolItem toolItem = toolBar.getItem(toolBar.toControl(pt));
       
        // Get the action for the tool item.
        Object data = null;
        if (toolItem != null){
            data = toolItem.getData();
View Full Code Here

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

     * Returns the toolbar item at the given position, in display coordinates
     * @param position
     */
    private ToolItem getToolItem(Point position) {
        ToolBar toolbar = tbm.getControl();
        Point local = toolbar.toControl(position);
        return toolbar.getItem(local);
    }
   
  /* (non-Javadoc)
   * @see org.eclipse.ui.internal.dnd.IDragOverListener#drag(org.eclipse.swt.widgets.Control, java.lang.Object, org.eclipse.swt.graphics.Point, org.eclipse.swt.graphics.Rectangle)
View Full Code Here

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

     * Returns the toolbar item at the given position, in display coordinates
     * @param position
     */
    private ToolItem getToolItem(Point position) {
        ToolBar toolbar = getToolBar();
        Point local = toolbar.toControl(position);
        return toolbar.getItem(local);
    }

    /**
     * Shows the popup menu for an item in the fast view bar.
View Full Code Here

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

  protected void specialPopupMenuItems(Menu menu, Event event) {
    MenuItem item = new MenuItem(menu, SWT.PUSH);
    item.setText("getItem(Point) on mouse coordinates");
    final Tree t = (Tree) event.widget;
    menuMouseCoords = t.toControl(new Point(event.x, event.y));
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        eventConsole.append("getItem(Point(" + menuMouseCoords + ")) returned: " + t.getItem(menuMouseCoords));
        eventConsole.append("\n");
      };
View Full Code Here

Examples of org.gudy.azureus2.ui.swt.views.table.TableOrTreeSWT.toControl()

    TableOrTreeSWT table = row.getTable();
    if (table == null || table.isDisposed()) {
      return false;
    }
    Point pt = table.getDisplay().getCursorLocation();
    pt = table.toControl(pt);

    Rectangle bounds = getBounds();
    return bounds == null ? false : bounds.contains(pt);
  }
 
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.