Menu menu = shell.activeMenu; while (menu != null && menu != this) { menu = menu.getParentMenu ();
while (topMenu.getParentMenu() != null) { topMenu = topMenu.getParentMenu();
while (topMenu.getParentMenu() != null) { topMenu = topMenu.getParentMenu();
if (menu.parent == this) { while (menu != null && menu != menuBar) { menu = menu.getParentMenu ();
while (topMenu.getParentMenu() != null) { topMenu = topMenu.getParentMenu();
/** * Returns <code>true</code> if the receiver is enabled and all * of the receiver's ancestors are enabled, and <code>false</code> * otherwise. A disabled menu is typically not selectable from the * user interface and draws with an inactive or "grayed" look. * * @return the receiver's enabled state * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see #getEnabled */ public boolean isEnabled() { checkWidget(); Menu parentMenu = getParentMenu(); if( parentMenu == null ) { return getEnabled(); } return getEnabled() && parentMenu.isEnabled(); }
menu = menu.getParentMenu (); menu = menu.getParentMenu (); Menu ancestor = newMenu; while (ancestor != null && ancestor != menu) { ancestor = ancestor.getParentMenu ();
/** * The proxy menu is being shown, we better get the real menu. * * @param proxy * the proxy menu * @since 3.4 */ private void handleShowProxy(Menu proxy) { proxy.removeListener(SWT.Show, getMenuCreatorListener()); IMenuCreator mc = action.getMenuCreator(); menuCreatorCalled = true; if (mc == null) { return; } holdMenu = mc.getMenu(proxy.getParentMenu()); if (holdMenu == null) { return; } copyMenu(holdMenu, proxy); }
/** * The proxy menu is being shown, we better get the real menu. * * @param proxy * the proxy menu * @since 3.4 */ private void handleShowProxy(Menu proxy) { proxy.removeListener(SWT.Show, getMenuCreatorListener()); IMenuCreator mc = action.getMenuCreator(); menuCreatorCalled = true; if (mc == null) { return; } holdMenu = mc.getMenu(proxy.getParentMenu()); if (holdMenu == null) { return; } copyMenu(holdMenu, proxy); }
/** * Returns <code>true</code> if the receiver is enabled and all * of the receiver's ancestors are enabled, and <code>false</code> * otherwise. A disabled menu is typically not selectable from the * user interface and draws with an inactive or "grayed" look. * * @return the receiver's enabled state * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see #getEnabled */ public boolean isEnabled () { checkWidget(); Menu parentMenu = getParentMenu (); if (parentMenu == null) { return getEnabled () && parent.isEnabled (); } return getEnabled () && parentMenu.isEnabled (); }
/** * The proxy menu is being shown, we better get the real menu. * * @param proxy * the proxy menu * @since 1.1 */ private void handleShowProxy(Menu proxy) { proxy.removeListener(SWT.Show, getMenuCreatorListener()); IMenuCreator mc = action.getMenuCreator(); menuCreatorCalled = true; if (mc == null) { return; } holdMenu = mc.getMenu(proxy.getParentMenu()); if (holdMenu == null) { return; } copyMenu(holdMenu, proxy); }
/** * Returns <code>true</code> if the receiver is enabled and all * of the receiver's ancestors are enabled, and <code>false</code> * otherwise. A disabled menu is typically not selectable from the * user interface and draws with an inactive or "grayed" look. * * @return the receiver's enabled state * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see #getEnabled */ public boolean isEnabled () { checkWidget(); Menu parentMenu = getParentMenu (); if (parentMenu == null) { return getEnabled () && parent.isEnabled (); } return getEnabled () && parentMenu.isEnabled (); }
/** * Returns <code>true</code> if the receiver is enabled and all * of the receiver's ancestors are enabled, and <code>false</code> * otherwise. A disabled menu is typically not selectable from the * user interface and draws with an inactive or "grayed" look. * * @return the receiver's enabled state * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see #getEnabled */ public boolean isEnabled () { checkWidget(); Menu parentMenu = getParentMenu (); if (parentMenu == null) { return getEnabled () && parent.isEnabled (); } return getEnabled () && parentMenu.isEnabled (); }
/** * Returns <code>true</code> if the receiver is enabled and all * of the receiver's ancestors are enabled, and <code>false</code> * otherwise. A disabled menu is typically not selectable from the * user interface and draws with an inactive or "grayed" look. * * @return the receiver's enabled state * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see #getEnabled */ public boolean isEnabled () { checkWidget (); Menu parentMenu = getParentMenu (); if (parentMenu == null) { return getEnabled () && parent.isEnabled (); } return getEnabled () && parentMenu.isEnabled (); }
/** * Returns <code>true</code> if the receiver is enabled and all * of the receiver's ancestors are enabled, and <code>false</code> * otherwise. A disabled menu is typically not selectable from the * user interface and draws with an inactive or "grayed" look. * * @return the receiver's enabled state * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see #getEnabled */ public boolean isEnabled () { checkWidget (); if (this == display.appMenuBar) return getEnabled(); Menu parentMenu = getParentMenu (); if (parentMenu == null) { return getEnabled () && parent.isEnabled (); } return getEnabled () && parentMenu.isEnabled (); }
Menu menu = this; while (menu != null && menu != menuBar) { menu = menu.getParentMenu ();