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

The following examples show how to use java.awt.MenuBar#getHelpMenu() . 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 6 votes vote down vote up
@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");
}
 
Example 2
Source File: CMenu.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@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");
}
 
Example 3
Source File: CMenu.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@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");
}
 
Example 4
Source File: CMenu.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@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");
}
 
Example 5
Source File: CMenu.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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");
}
 
Example 6
Source File: CMenu.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@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");
}
 
Example 7
Source File: CMenu.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
@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");
}
 
Example 8
Source File: RemoveHelpMenu.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
    if (bar.getHelpMenu() != menu) {
        throw new RuntimeException("Wrong HelpMenu");
    }
}
 
Example 9
Source File: RemoveHelpMenu.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
    if (bar.getHelpMenu() != menu) {
        throw new RuntimeException("Wrong HelpMenu");
    }
}
 
Example 10
Source File: RemoveHelpMenu.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
    if (bar.getHelpMenu() != menu) {
        throw new RuntimeException("Wrong HelpMenu");
    }
}
 
Example 11
Source File: RemoveHelpMenu.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
    if (bar.getHelpMenu() != menu) {
        throw new RuntimeException("Wrong HelpMenu");
    }
}
 
Example 12
Source File: RemoveHelpMenu.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
    if (bar.getHelpMenu() != menu) {
        throw new RuntimeException("Wrong HelpMenu");
    }
}
 
Example 13
Source File: RemoveHelpMenu.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
    if (bar.getHelpMenu() != menu) {
        throw new RuntimeException("Wrong HelpMenu");
    }
}
 
Example 14
Source File: RemoveHelpMenu.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
    if (bar.getHelpMenu() != menu) {
        throw new RuntimeException("Wrong HelpMenu");
    }
}
 
Example 15
Source File: RemoveHelpMenu.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
    if (bar.getHelpMenu() != menu) {
        throw new RuntimeException("Wrong HelpMenu");
    }
}
 
Example 16
Source File: RemoveHelpMenu.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void checkCurrentMenu(final MenuBar bar, final Menu menu) {
    if (bar.getHelpMenu() != menu) {
        throw new RuntimeException("Wrong HelpMenu");
    }
}