本文整理了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
@Override
public void setHelp(MenuItem item, String contextId) {
if (WorkbenchPlugin.DEBUG)
setHelpTrace(contextId);
item.setData(HELP_KEY, contextId);
// ensure that the listener is only registered once
item.removeHelpListener(getHelpListener());
item.addHelpListener(getHelpListener());
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Sets the given help contexts on the given menu item.
* <p>
* Use this method when the list of help contexts is known in advance. Help
* contexts can either supplied as a static list, or calculated with a
* context computer (but not both).
* </p>
*
* @param item
* the menu item on which to register the context
* @param contexts
* the contexts to use when F1 help is invoked; a mixed-type
* array of context ids (type <code>String</code>) and/or help
* contexts (type <code>IContext</code>)
* @deprecated use setHelp with single context id parameter
*/
@Deprecated
public void setHelp(MenuItem item, Object[] contexts) {
for (Object context : contexts) {
Assert.isTrue(context instanceof String
|| context instanceof IContext);
}
item.setData(HELP_KEY, contexts);
// ensure that the listener is only registered once
item.removeHelpListener(getHelpListener());
item.addHelpListener(getHelpListener());
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
mi.addListener(SWT.Selection, getMenuItemListener());
if (action.getHelpListener() != null) {
mi.addHelpListener(action.getHelpListener());
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
mi.addListener(SWT.Selection, getMenuItemListener());
if (action.getHelpListener() != null) {
mi.addHelpListener(action.getHelpListener());
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
mi.addListener(SWT.Selection, getMenuItemListener());
if (action.getHelpListener() != null) {
mi.addHelpListener(action.getHelpListener());
内容来源于网络,如有侵权,请联系作者删除!