示例#1
0
 /**
  * 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>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  *     </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 item 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>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  *     </ul>
  *
  * @see #getEnabled
  */
 public boolean isEnabled() {
   return getEnabled() && parent.isEnabled();
 }