Java Code Examples for java.awt.MenuBar#getMenuCount()

The following examples show how to use java.awt.MenuBar#getMenuCount() . 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: Utils.java    From TrakEM2 with GNU General Public License v3.0 5 votes vote down vote up
/**Restore ImageJ's MenuBar*/
static public final void restoreMenuBar() {
	final MenuBar menu_bar = Menus.getMenuBar();
	final int n_menus = menu_bar.getMenuCount();
	for (int i=0; i<n_menus;i++) {
		final Menu menu = menu_bar.getMenu(i);
		restoreMenu(menu);
	}
	//make sure there isn't a null menu bar
	//WindowManager.getCurrentWindow().setMenuBar(menu_bar);
}
 
Example 2
Source File: RemoveHelpMenu.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void checkMenuCount(final MenuBar bar, final int expected) {
    final int actual = bar.getMenuCount();
    if (actual != expected) {
        throw new RuntimeException("Incorrect menus count");
    }
}
 
Example 3
Source File: RemoveHelpMenu.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static void checkMenuCount(final MenuBar bar, final int expected) {
    final int actual = bar.getMenuCount();
    if (actual != expected) {
        throw new RuntimeException("Incorrect menus count");
    }
}
 
Example 4
Source File: RemoveHelpMenu.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private static void checkMenuCount(final MenuBar bar, final int expected) {
    final int actual = bar.getMenuCount();
    if (actual != expected) {
        throw new RuntimeException("Incorrect menus count");
    }
}
 
Example 5
Source File: RemoveHelpMenu.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private static void checkMenuCount(final MenuBar bar, final int expected) {
    final int actual = bar.getMenuCount();
    if (actual != expected) {
        throw new RuntimeException("Incorrect menus count");
    }
}
 
Example 6
Source File: RemoveHelpMenu.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private static void checkMenuCount(final MenuBar bar, final int expected) {
    final int actual = bar.getMenuCount();
    if (actual != expected) {
        throw new RuntimeException("Incorrect menus count");
    }
}
 
Example 7
Source File: RemoveHelpMenu.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private static void checkMenuCount(final MenuBar bar, final int expected) {
    final int actual = bar.getMenuCount();
    if (actual != expected) {
        throw new RuntimeException("Incorrect menus count");
    }
}
 
Example 8
Source File: RemoveHelpMenu.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void checkMenuCount(final MenuBar bar, final int expected) {
    final int actual = bar.getMenuCount();
    if (actual != expected) {
        throw new RuntimeException("Incorrect menus count");
    }
}
 
Example 9
Source File: RemoveHelpMenu.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private static void checkMenuCount(final MenuBar bar, final int expected) {
    final int actual = bar.getMenuCount();
    if (actual != expected) {
        throw new RuntimeException("Incorrect menus count");
    }
}
 
Example 10
Source File: RemoveHelpMenu.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void checkMenuCount(final MenuBar bar, final int expected) {
    final int actual = bar.getMenuCount();
    if (actual != expected) {
        throw new RuntimeException("Incorrect menus count");
    }
}