org.eclipse.jface.action.ToolBarManager.setContextMenuManager()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(66)

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

ToolBarManager.setContextMenuManager介绍

[英]Sets the context menu manager for this tool bar manager to the given menu manager. If the tool bar control exists, it also adds the menu control to the tool bar.
[中]将此工具栏管理器的上下文菜单管理器设置为给定的菜单管理器。如果工具栏控件存在,它还会将菜单控件添加到工具栏。

代码示例

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * Disposes of this tool bar manager and frees all allocated SWT resources.
 * Notifies all contribution items of the dispose. Note that this method
 * does not clean up references between this tool bar manager and its
 * associated contribution items. Use <code>removeAll</code> for that
 * purpose.
 */
public void dispose() {
  if (toolBarExist()) {
    toolBar.dispose();
  }
  toolBar = null;
  IContributionItem[] items = getItems();
  for (int i = 0; i < items.length; i++) {
    items[i].dispose();
  }
  if (getContextMenuManager() != null) {
    getContextMenuManager().dispose();
    setContextMenuManager(null);
  }
}

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

/**
 * Disposes of this tool bar manager and frees all allocated SWT resources.
 * Notifies all contribution items of the dispose. Note that this method
 * does not clean up references between this tool bar manager and its
 * associated contribution items. Use <code>removeAll</code> for that
 * purpose.
 */
public void dispose() {
  if (toolBarExist()) {
    toolBar.dispose();
  }
  toolBar = null;
  IContributionItem[] items = getItems();
  for (IContributionItem item : items) {
    item.dispose();
  }
  if (getContextMenuManager() != null) {
    getContextMenuManager().dispose();
    setContextMenuManager(null);
  }
}

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

/**
 * Disposes of this tool bar manager and frees all allocated SWT resources.
 * Notifies all contribution items of the dispose. Note that this method
 * does not clean up references between this tool bar manager and its
 * associated contribution items. Use <code>removeAll</code> for that
 * purpose.
 */
public void dispose() {
  if (toolBarExist()) {
    toolBar.dispose();
  }
  toolBar = null;
  IContributionItem[] items = getItems();
  for (IContributionItem item : items) {
    item.dispose();
  }
  if (getContextMenuManager() != null) {
    getContextMenuManager().dispose();
    setContextMenuManager(null);
  }
  super.setOverrides(null);
}

相关文章