@Override public boolean doGetBooleanValue(Object source) { return ((Menu) source).getEnabled(); }
public static void writeEnabled( final Menu menu ) throws IOException { Boolean newValue = Boolean.valueOf( menu.getEnabled() ); Boolean defValue = Boolean.TRUE; JSWriter writer = JSWriter.getWriterFor( menu ); writer.set( PROP_ENABLED, JSConst.QX_FIELD_ENABLED, newValue, defValue ); }
public void run() { if ("true".equals(m)) { item.setVisible(true); } else if ("false".equals(m)) { item.setVisible(false); } else if ("reverse".equals(m)) { item.setVisible(!item.getEnabled()); } } });
public void run() { if("enable".equals(m)){ item.setEnabled(true); }else if("disable".equals(m)){ item.setEnabled(false); }else if("reverse".equals(m)){ item.setEnabled(!item.getEnabled()); } } });
public static void preserveEnabled( final Menu menu ) { IWidgetAdapter adapter = WidgetUtil.getAdapter( menu ); adapter.preserve( PROP_ENABLED, Boolean.valueOf( menu.getEnabled() ) ); }
/** * 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 (); }
/** * 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(); }
private static boolean isAccessible( Menu menu ) { return menu.getEnabled() && isShellAccessible( menu.getShell() ); }
/** * 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 (); }
@Override public void preserveValues( Menu menu ) { preserveProperty( menu, PROP_ENABLED, menu.getEnabled() ); preserveProperty( menu, PROP_ORIENTATION, menu.getOrientation() ); }
/** * 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 (); }
@Override public void renderChanges( Menu menu ) throws IOException { renderProperty( menu, PROP_ENABLED, menu.getEnabled(), true ); renderOrientation( menu ); if( !isMenuBar( menu ) ) { renderListener( menu, SWT.Hide, PROP_HIDE_LISTENER ); } WidgetLCAUtil.renderCustomVariant( menu ); renderListenHelp( menu ); renderBounds( menu ); renderShow( menu ); renderUnhideItems( menu ); }
@Override LRESULT WM_NCHITTEST (int /*long*/ wParam, int /*long*/ lParam) { if (!OS.IsWindowEnabled (handle)) return null; if (!isEnabled () || !isActive ()) { if (!Display.TrimEnabled) return new LRESULT (OS.HTNOWHERE); int /*long*/ hittest = callWindowProc (handle, OS.WM_NCHITTEST, wParam, lParam); if (hittest == OS.HTCLIENT || hittest == OS.HTMENU) hittest = OS.HTBORDER; return new LRESULT (hittest); } if (menuBar != null && !menuBar.getEnabled ()) { int /*long*/ hittest = callWindowProc (handle, OS.WM_NCHITTEST, wParam, lParam); if (hittest == OS.HTMENU) hittest = OS.HTBORDER; return new LRESULT (hittest); } return null; }
boolean enabled = menu.getEnabled () && item.getEnabled (); nsItem.setEnabled(!enabled); nsItem.setEnabled(enabled);
menuBarWasEnabled = menuBar.getEnabled();
menuBarWasEnabled = menuBar.getEnabled();
if (!getEnabled ()) nsItem.setEnabled (false);
menuBarWasEnabled = menuBar.getEnabled();