本文整理了Java中org.eclipse.swt.widgets.MenuItem.dispose()
方法的一些代码示例,展示了MenuItem.dispose()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MenuItem.dispose()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.MenuItem
类名称:MenuItem
方法名:dispose
暂无
代码示例来源:origin: caoxinyu/RedisClient
private void removeFavoriteMenuItem() {
int num = menuFavorite.getItemCount();
if (num > 2) {
MenuItem[] items = menuFavorite.getItems();
for (int i = 2; i < num; i++) {
items[i].dispose();
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
} else {
for ( MenuItem item : helperMenu.getItems() ) {
item.dispose();
代码示例来源:origin: pentaho/pentaho-kettle
public void removeMenuItem( String itemid, boolean removeTrailingSeparators ) {
XulMenuitem item = (XulMenuitem) mainSpoonContainer.getDocumentRoot().getElementById( itemid );
if ( item != null ) {
XulComponent menu = item.getParent();
item.getParent().removeChild( item );
if ( removeTrailingSeparators ) {
List<XulComponent> children = menu.getChildNodes();
if ( children.size() > 0 ) {
XulComponent lastMenuItem = children.get( children.size() - 1 );
if ( lastMenuItem instanceof XulMenuseparator ) {
menu.removeChild( lastMenuItem );
// above call should work, but doesn't for some reason, removing separator by force
// the menu separators seem to not be modeled as individual objects in XUL
try {
Menu swtm = (Menu) menu.getManagedObject();
swtm.getItems()[swtm.getItemCount() - 1].dispose();
} catch ( Throwable t ) {
LogChannel.GENERAL.logError( "Error removing XUL menu item", t );
}
}
}
}
} else {
log.logError( "Could not find menu item with id " + itemid + " to remove from Spoon menu" );
}
}
代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt
public void dispose() {
for (MenuItem item : items) {
item.dispose();
}
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
@Override
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
for (int i=0; i < items.length; i++) {
items[i].dispose();
}
fillMenu(m);
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
@Override
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
for (int i=0; i < items.length; i++) {
items[i].dispose();
}
fillMenu();
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
@Override
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
for (int i=0; i < items.length; i++) {
items[i].dispose();
}
fillMenu(m);
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
@Override
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
for (int i=0; i < items.length; i++) {
items[i].dispose();
}
fillMenu(m);
}
});
代码示例来源:origin: com.eclipsesource.tabris/tabris
private void clearMenuItems() {
for( MenuItem item : proposalsMenu.getItems() ) {
item.dispose();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
@Override
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
for (int i=0; i < items.length; i++) {
items[i].dispose();
}
fillMenu(m);
}
});
代码示例来源:origin: org.eclipse.mylyn.builds/ui
@Override
public void menuShown(MenuEvent e) {
for (MenuItem item : menu.getItems()) {
item.dispose();
}
addActions(menu);
}
});
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
for (int i=0; i < items.length; i++) {
items[i].dispose();
}
fillMenu(m);
}
});
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public void menuShown(MenuEvent e) {
Menu m= (Menu) e.widget;
MenuItem[] items= m.getItems();
for (int i= 0; i < items.length; i++) {
items[i].dispose();
}
fillMenu(m);
}
});
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public void menuShown(MenuEvent e) {
if (fFillMenu) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
for (int i=0; i < items.length; i++) {
items[i].dispose();
}
fillMenu(m);
fFillMenu = false;
}
}
});
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
for (int i=0; i < items.length; i++) {
items[i].dispose();
}
fillMenu(m);
}
});
代码示例来源:origin: org.eclipse/org.eclipse.wst.server.ui
public void menuShown(MenuEvent e) {
//if (recreateMenu) {
Menu m = (Menu) e.widget;
MenuItem[] items = m.getItems();
for (int i = 0; i < items.length; i++) {
items[i].dispose();
}
fillMenu(m);
recreateMenu = false;
//}
}
});
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public void menuShown(MenuEvent e) {
Menu m= (Menu) e.widget;
MenuItem[] items= m.getItems();
for (int i= 0; i < items.length; i++) {
items[i].dispose();
}
fillMenu(m);
}
});
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
protected void disposeMenuItems() {
if (fMenu == null || fMenu.isDisposed()) {
return;
}
MenuItem[] items = fMenu.getItems();
for (int i=0; i < items.length; i++) {
MenuItem menuItem= items[i];
if (!menuItem.isDisposed()) {
menuItem.dispose();
}
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
protected void disposeMenuItems() {
if (fMenu == null || fMenu.isDisposed()) {
return;
}
MenuItem[] items = fMenu.getItems();
for (int i=0; i < items.length; i++) {
MenuItem menuItem= items[i];
if (!menuItem.isDisposed()) {
menuItem.dispose();
}
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void menuShown(MenuEvent e) {
for ( MenuItem mi: menu.getItems()){
mi.dispose();
}
com.biglybt.pif.ui.menus.MenuItem[] menu_items = MenuItemManager.getInstance().getAllAsArray( menu_key );
MenuBuildUtils.addPluginMenuItems(menu_items, menu, true, true,
new MenuBuildUtils.MenuItemPluginMenuControllerImpl(new Object[]{ ds }));
}
内容来源于网络,如有侵权,请联系作者删除!