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

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

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

[英]Adds the listener to the collection of listeners who will be notified when the help events are generated for the control, by sending it one of the messages defined in the HelpListener interface.
[中]将侦听器添加到侦听器集合中,当为控件生成帮助事件时,将通知这些侦听器,方法是向其发送HelpListener界面中定义的消息之一。

代码示例

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

  1. @Override
  2. public void setHelp(MenuItem item, String contextId) {
  3. if (WorkbenchPlugin.DEBUG)
  4. setHelpTrace(contextId);
  5. item.setData(HELP_KEY, contextId);
  6. // ensure that the listener is only registered once
  7. item.removeHelpListener(getHelpListener());
  8. item.addHelpListener(getHelpListener());
  9. }

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

  1. /**
  2. * Sets the given help contexts on the given menu item.
  3. * <p>
  4. * Use this method when the list of help contexts is known in advance. Help
  5. * contexts can either supplied as a static list, or calculated with a
  6. * context computer (but not both).
  7. * </p>
  8. *
  9. * @param item
  10. * the menu item on which to register the context
  11. * @param contexts
  12. * the contexts to use when F1 help is invoked; a mixed-type
  13. * array of context ids (type <code>String</code>) and/or help
  14. * contexts (type <code>IContext</code>)
  15. * @deprecated use setHelp with single context id parameter
  16. */
  17. @Deprecated
  18. public void setHelp(MenuItem item, Object[] contexts) {
  19. for (Object context : contexts) {
  20. Assert.isTrue(context instanceof String
  21. || context instanceof IContext);
  22. }
  23. item.setData(HELP_KEY, contexts);
  24. // ensure that the listener is only registered once
  25. item.removeHelpListener(getHelpListener());
  26. item.addHelpListener(getHelpListener());
  27. }

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

  1. mi.addListener(SWT.Selection, getMenuItemListener());
  2. if (action.getHelpListener() != null) {
  3. mi.addHelpListener(action.getHelpListener());

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

  1. mi.addListener(SWT.Selection, getMenuItemListener());
  2. if (action.getHelpListener() != null) {
  3. mi.addHelpListener(action.getHelpListener());

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

  1. mi.addListener(SWT.Selection, getMenuItemListener());
  2. if (action.getHelpListener() != null) {
  3. mi.addHelpListener(action.getHelpListener());

相关文章