org.eclipse.swt.widgets.Button.getLocation()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中org.eclipse.swt.widgets.Button.getLocation()方法的一些代码示例,展示了Button.getLocation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.getLocation()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Button
类名称:Button
方法名:getLocation

Button.getLocation介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

/**
 * Append the Set/Get API controls to the "Other" group.
 */
void createSetGetGroup() {
  /*
   * Create the button to access set/get API functionality.
   */
  final String [] methodNames = getMethodNames ();
  if (methodNames != null) {
    final Button setGetButton = new Button (otherGroup, SWT.PUSH);
    setGetButton.setText (ControlExample.getResourceString ("Set_Get"));
    setGetButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    setGetButton.addSelectionListener (widgetSelectedAdapter(e -> {
      if (getExampleWidgets().length >  0) {
        if (setGetDialog == null) {
          setGetDialog = createSetGetDialog(methodNames);
        }
        Point pt = setGetButton.getLocation();
        pt = display.map(setGetButton.getParent(), null, pt);
        setGetDialog.setLocation(pt.x, pt.y);
        setGetDialog.open();
      }
    }));
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

@Override
  public void widgetDefaultSelected(SelectionEvent e) {
    if (editEvent.getEnabled()) {
      Point pt = editEvent.getLocation();
      pt = e.display.map(editEvent, null, pt);
      int index = table.getSelectionIndex();
      if (getExampleWidgets().length > 0 && index != -1 && index < EVENT_INFO.length) {
        createEditEventDialog(dialog, pt.x, pt.y, index);
      }
    }
  }
});

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

private void showMenu(Button button, IContributionItem menuContribution) {
    Menu menu = new Menu(button);
    Point p = button.getLocation();
    p.y = p.y + button.getSize().y;
    p = button.getParent().toDisplay(p);

    menu.setLocation(p);
    menuContribution.fill(menu, 0);
    menu.setVisible(true);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

editEvent.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING));
editEvent.addSelectionListener (widgetSelectedAdapter(e -> {
  Point pt = editEvent.getLocation();
  pt = e.display.map(editEvent, null, pt);
  int index = table.getSelectionIndex();

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

Point buttonLocation = buttonAddKey.getLocation();
buttonLocation = groupKeySequence.toDisplay(buttonLocation.x, buttonLocation.y);
Point buttonSize = buttonAddKey.getSize();

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

Point buttonLocation = addKeyButton.getLocation();
buttonLocation = dataArea.toDisplay(buttonLocation.x, buttonLocation.y);
Point buttonSize = addKeyButton.getSize();

代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui

Point ptBrowse = button.getLocation();
Rectangle rcBrowse = button.getBounds();
ptBrowse.y += rcBrowse.height;

相关文章

Button类方法