本文整理汇总了Java中java.awt.MenuBar.getHelpMenu方法的典型用法代码示例。如果您正苦于以下问题:Java MenuBar.getHelpMenu方法的具体用法?Java MenuBar.getHelpMenu怎么用?Java MenuBar.getHelpMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.MenuBar
的用法示例。
在下文中一共展示了MenuBar.getHelpMenu方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createModel
import java.awt.MenuBar; //导入方法依赖的package包/类
@Override
long createModel() {
CMenuComponent parent = (CMenuComponent)
LWCToolkit.targetToPeer(getTarget().getParent());
if (parent instanceof CMenu) {
return parent.executeGet(this::nativeCreateSubMenu);
}
if (parent instanceof CMenuBar) {
MenuBar parentContainer = (MenuBar)getTarget().getParent();
boolean isHelpMenu = parentContainer.getHelpMenu() == getTarget();
int insertionLocation = ((CMenuBar)parent).getNextInsertionIndex();
return parent.executeGet(ptr -> nativeCreateMenu(ptr, isHelpMenu,
insertionLocation));
}
throw new InternalError("Parent must be CMenu or CMenuBar");
}
示例2: addMenus
import java.awt.MenuBar; //导入方法依赖的package包/类
/**
* Recurses the menubar adding menus (and menu items),
* called from the Frame peer.
*/
void addMenus()
{
MenuBar o = (MenuBar)owner;
int help = (o.getHelpMenu() != null) ? 1 : 0;
for (int i = 0; i < o.getMenuCount() - help; i++)
addMenu( o.getMenu(i) );
if(o.getHelpMenu() != null)
addHelpMenu( o.getHelpMenu() );
}
示例3: addMenus
import java.awt.MenuBar; //导入方法依赖的package包/类
/**
* Recurses the menubar adding menus (and menu items),
* called from the Frame peer.
*/
void addMenus()
{
MenuBar o = (MenuBar)owner;
int help = (o.getHelpMenu() != null) ? 1 : 0;
for (int i = 0; i < o.getMenuCount() - help; i++)
addMenu( o.getMenu(i) );
if(o.getHelpMenu() != null)
addHelpMenu( o.getHelpMenu() );
}
示例4: checkCurrentMenu
import java.awt.MenuBar; //导入方法依赖的package包/类
private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
if (bar.getHelpMenu() != menu) {
throw new RuntimeException("Wrong HelpMenu");
}
}