org.eclipse.swt.widgets.Menu.getParentMenu()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.eclipse.swt.widgets.Menu.getParentMenu()方法的一些代码示例,展示了Menu.getParentMenu()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Menu.getParentMenu()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Menu
类名称:Menu
方法名:getParentMenu

[英]Returns the receiver's parent item, which must be a Menu or null when the receiver is a root.
[中]

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

Menu menu = shell.activeMenu;
while (menu != null && menu != this) {
  menu = menu.getParentMenu ();

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

while (topMenu.getParentMenu() != null) {
  topMenu = topMenu.getParentMenu();

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

while (topMenu.getParentMenu() != null) {
  topMenu = topMenu.getParentMenu();

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

if (menu.parent == this) {
  while (menu != null && menu != menuBar) {
    menu = menu.getParentMenu ();

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

while (topMenu.getParentMenu() != null) {
  topMenu = topMenu.getParentMenu();

代码示例来源: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.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

menu = menu.getParentMenu ();
  menu = menu.getParentMenu ();
  Menu ancestor = newMenu;
  while (ancestor != null && ancestor != menu) {
    ancestor = ancestor.getParentMenu ();

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * 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);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * 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);
}

代码示例来源: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.jface

/**
 * 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);
}

代码示例来源: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.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.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.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

Menu menu = this;
while (menu != null && menu != menuBar) {
  menu = menu.getParentMenu ();

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

menu = menu.getParentMenu ();

相关文章