/** * Creates a view menu for the given part in the contained tab folder. * * @param part * the part that should have its view menu created * @param ctf * the containing tab folder */ public void setupMenuButton(MPart part, CTabFolder ctf) { MMenu viewMenu = getViewMenu(part); // View menu (if any) if (viewMenu != null && hasVisibleMenuItems(viewMenu, part)) { showMenuButton(part, ctf, viewMenu); } else { // hide the menu's TB ToolBar menuTB = getViewMenuTB(ctf); if (menuTB != null) { menuTB.dispose(); } } }
boolean needsMenu = viewMenu != null && hasVisibleMenuItems(viewMenu, part);