Java Code Examples for java.awt.Menu#getItem()
The following examples show how to use
java.awt.Menu#getItem() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CMenu.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
@Override public final void setEnabled(final boolean b) { super.setEnabled(b); final Menu target = (Menu) getTarget(); final int count = target.getItemCount(); for (int i = 0; i < count; ++i) { MenuItem item = target.getItem(i); MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item); if (p != null) { p.setEnabled(b && item.isEnabled()); } } }
Example 2
Source File: CMenu.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Override public final void setEnabled(final boolean b) { super.setEnabled(b); final Menu target = (Menu) getTarget(); final int count = target.getItemCount(); for (int i = 0; i < count; ++i) { MenuItem item = target.getItem(i); MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item); if (p != null) { p.setEnabled(b && item.isEnabled()); } } }
Example 3
Source File: CMenu.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@Override public final void setEnabled(final boolean b) { super.setEnabled(b); final Menu target = (Menu) getTarget(); final int count = target.getItemCount(); for (int i = 0; i < count; ++i) { MenuItem item = target.getItem(i); MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item); if (p != null) { p.setEnabled(b && item.isEnabled()); } } }
Example 4
Source File: CMenu.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Override public final void setEnabled(final boolean b) { super.setEnabled(b); final Menu target = (Menu) getTarget(); final int count = target.getItemCount(); for (int i = 0; i < count; ++i) { MenuItem item = target.getItem(i); MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item); if (p != null) { p.setEnabled(b && item.isEnabled()); } } }
Example 5
Source File: CMenu.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@Override public final void setEnabled(final boolean b) { super.setEnabled(b); final Menu target = (Menu) getTarget(); final int count = target.getItemCount(); for (int i = 0; i < count; ++i) { MenuItem item = target.getItem(i); MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item); if (p != null) { p.setEnabled(b && item.isEnabled()); } } }
Example 6
Source File: CMenu.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Override public final void setEnabled(final boolean b) { super.setEnabled(b); final Menu target = (Menu) getTarget(); final int count = target.getItemCount(); for (int i = 0; i < count; ++i) { MenuItem item = target.getItem(i); MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item); if (p != null) { p.setEnabled(b && item.isEnabled()); } } }
Example 7
Source File: CMenu.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
@Override public final void setEnabled(final boolean b) { super.setEnabled(b); final Menu target = (Menu) getTarget(); final int count = target.getItemCount(); for (int i = 0; i < count; ++i) { MenuItem item = target.getItem(i); MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item); if (p != null) { p.setEnabled(b && item.isEnabled()); } } }
Example 8
Source File: Utils.java From TrakEM2 with GNU General Public License v3.0 | 5 votes |
static private void restoreMenu(final Menu menu) { final int n_menuitems = menu.getItemCount(); for (int i=0; i<n_menuitems; i++) { final MenuItem menu_item = menu.getItem(i); if (menu_item instanceof Menu) { restoreMenu((Menu)menu_item); } menu_item.setEnabled(true); } }