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

x33g5p2x  于2022-01-29 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(141)

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

ToolBar.getDisplay介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

public void handleEvent(org.osgi.service.event.Event event) {
    if (minimizedElement == null || trimStackTB == null)
      return;
    Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT);
    // if a child has been added or removed, re-scape the CTF
    if (changedObj == minimizedElement) {
      trimStackTB.getDisplay().asyncExec(new Runnable() {
        public void run() {
          updateTrimStackItems();
        }
      });
    }
  }
};

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

@Override
public void menuHidden(MenuEvent e) {
  perspSwitcherToolbar.getDisplay().asyncExec(() -> menu.dispose());
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

public void handleEvent(org.osgi.service.event.Event event) {
    Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT);
    if (changedObj != minimizedElement)
      return;
    if (minimizedElement.getWidget() != null) {
      trimStackTB.getDisplay().asyncExec(new Runnable() {
        public void run() {
          updateTrimStackItems();
        }
      });
    }
  }
};

代码示例来源:origin: com.diffplug.durian/durian-swt

/** Returns this corner's position on the given ToolItem in display coordinates. */
public Point getPosition(ToolItem item) {
  ToolBar toolbar = item.getParent();
  return toolbar.getDisplay().map(toolbar, null, getPosition(item.getBounds()));
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

public void handleEvent(org.osgi.service.event.Event event) {
    if (minimizedElement == null || trimStackTB == null)
      return;
    MUIElement changedElement = (MUIElement) event.getProperty(UIEvents.EventTags.ELEMENT);
    // if our stack is going away, so should we
    if (changedElement == minimizedElement && !minimizedElement.isToBeRendered()) {
      restoreStack();
      return;
    }
    // if one of the kids changes state, re-scrape the CTF
    MUIElement parentElement = changedElement.getParent();
    if (parentElement == minimizedElement) {
      trimStackTB.getDisplay().asyncExec(new Runnable() {
        public void run() {
          updateTrimStackItems();
        }
      });
    }
  }
};

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

private void track(MouseEvent e) {
  // Create and track the feedback overlay
  if (dragShell == null)
    createFeedback();
  // Move the drag shell
  Rectangle b = dragItem.getBounds();
  Point p = new Point(e.x, e.y);
  p = dragShell.getDisplay().map(dragItem.getParent(), null, p);
  dragShell.setLocation(p.x - (b.width / 2), p.y - (b.height / 2));
  // Set the cursor feedback
  ToolBar bar = (ToolBar) e.widget;
  ToolItem curItem = bar.getItem(new Point(e.x, e.y));
  if (curItem != null && curItem.getData() instanceof MPerspective) {
    perspSwitcherToolbar.setCursor(perspSwitcherToolbar.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
  } else {
    perspSwitcherToolbar.setCursor(perspSwitcherToolbar.getDisplay().getSystemCursor(SWT.CURSOR_NO));
  }
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

public void handleEvent(Event event) {
    // Clear any existing menus
    while (trimStackMenu.getItemCount() > 0)
      trimStackMenu.getItem(0).dispose();
    // Only open the menu if a tool item is selected
    Point point = trimStackTB.getDisplay().map(null, trimStackTB,
        new Point(event.x, event.y));
    ToolItem selectedToolItem = trimStackTB.getItem(point);
    if (selectedToolItem == null) {
      return;
    }
    // Are we hovering over a valid tool item (vs restore button)
    Object data = selectedToolItem.getData();
    if (data instanceof MPart) {
      // A part on a stack or editor area
      createPartMenu((MPart) data);
    } else if (data instanceof MPerspective) {
      // A perspective in a perspective stack (for now we just support restore)
      createEmtpyEditorAreaMenu();
    } else if (isEditorStack()) {
      // An empty editor area
      createEmtpyEditorAreaMenu();
    }
  }
});

代码示例来源:origin: com.diffplug.durian/durian-swt

point = toolbar.getDisplay().map(null, toolbar, point);

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

Point point = trimStackTB.getDisplay().map(null, trimStackTB, new Point(event.x, event.y));
ToolItem selectedToolItem = trimStackTB.getItem(point);
if (selectedToolItem == null) {

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

ToolBar tb = (ToolBar) e.widget;
Point p = new Point(e.x, e.y);
p = perspSwitcherToolbar.getDisplay().map(null, perspSwitcherToolbar, p);
ToolItem item = tb.getItem(p);
if (item == null)

相关文章

ToolBar类方法