本文整理了Java中org.eclipse.swt.widgets.Menu.getEnabled()
方法的一些代码示例,展示了Menu.getEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Menu.getEnabled()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Menu
类名称:Menu
方法名:getEnabled
[英]Returns true
if the receiver is enabled, and false
otherwise. A disabled menu is typically not selectable from the user interface and draws with an inactive or "grayed" look.
[中]如果接收器已启用,则返回true
,否则返回false
。禁用的菜单通常无法从用户界面中选择,并以非活动或“灰色”外观绘制。
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding
@Override
public boolean doGetBooleanValue(Object source) {
return ((Menu) source).getEnabled();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
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 );
}
代码示例来源:origin: org.xworker/xworker_swt
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());
}
}
});
代码示例来源:origin: org.xworker/xworker_swt
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());
}
}
});
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
public static void preserveEnabled( final Menu menu ) {
IWidgetAdapter adapter = WidgetUtil.getAdapter( menu );
adapter.preserve( PROP_ENABLED, Boolean.valueOf( menu.getEnabled() ) );
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
/**
* 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 ();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* 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();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private static boolean isAccessible( Menu menu ) {
return menu.getEnabled() && isShellAccessible( menu.getShell() );
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* 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 ();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
public void preserveValues( Menu menu ) {
preserveProperty( menu, PROP_ENABLED, menu.getEnabled() );
preserveProperty( menu, PROP_ORIENTATION, menu.getOrientation() );
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* 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 ();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
/**
* 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 ();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* 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 ();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@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 );
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@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;
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
boolean enabled = menu.getEnabled () && item.getEnabled ();
nsItem.setEnabled(!enabled);
nsItem.setEnabled(enabled);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
menuBarWasEnabled = menuBar.getEnabled();
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
menuBarWasEnabled = menuBar.getEnabled();
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
if (!getEnabled ()) nsItem.setEnabled (false);
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
menuBarWasEnabled = menuBar.getEnabled();
内容来源于网络,如有侵权,请联系作者删除!