本文整理了Java中java.awt.MenuItem.deleteShortcut()
方法的一些代码示例,展示了MenuItem.deleteShortcut()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MenuItem.deleteShortcut()
方法的具体详情如下:
包路径:java.awt.MenuItem
类名称:MenuItem
方法名:deleteShortcut
暂无
代码示例来源:origin: com.dorkbox/SystemTray
@Override
public
void run() {
_native.deleteShortcut();
_native.setEnabled(false);
if (callback != null) {
_native.removeActionListener(callback);
callback = null;
}
parent._native.remove(_native);
_native.removeNotify();
}
});
代码示例来源:origin: net.imagej/imagej-legacy
private void nullShortcut(final IJ1Helper ij1Helper, final String menuLabel,
final String subMenuLabel, final String itemLabel)
{
final MenuBar menuBar = ij1Helper.getMenuBar();
for (int m = 0; m < menuBar.getMenuCount(); m++) {
final Menu menu = menuBar.getMenu(m);
if (!menuLabel.equals(menu.getLabel())) continue;
for (int s = 0; s < menu.getItemCount(); s++) {
final MenuItem ms = menu.getItem(s);
if (!(ms instanceof Menu)) continue;
final Menu subMenu = (Menu) ms;
if (!subMenuLabel.equals(subMenu.getLabel())) continue;
for (int i = 0; i < subMenu.getItemCount(); i++) {
final MenuItem mi = subMenu.getItem(i);
if (!itemLabel.equals(mi.getLabel())) continue;
subMenu.remove(i);
mi.deleteShortcut();
subMenu.insert(mi, i);
}
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!