javax.swing.JMenuBar.getSubElements()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(144)

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

JMenuBar.getSubElements介绍

暂无

代码示例

代码示例来源:origin: groovy/groovy-core

/**
 * Returns an {@link java.util.Iterator} which traverses the JMenuBar one menu at a time.
 *
 * @param self a JMenuBar
 * @return an Iterator for a JMenuBar
 * @since 1.6.4
 */
public static Iterator/*<JMenu>*/ iterator(JMenuBar self) {
  return DefaultGroovyMethods.iterator(self.getSubElements());
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public static void setCheckedForAction
 (JMenuBar _bar, String _action, boolean _state)
{
 if(_bar==null) return;
 MenuElement[] c=_bar.getSubElements();
 for(int i=0; i<c.length; i++)
  if(c[i] instanceof JMenu)
 setCheckedForAction((JMenu)c[i],_action,_state);
}

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

/**
 * Returns an {@link Iterator} which traverses the JMenuBar one menu at a time.
 *
 * @param self a JMenuBar
 * @return an Iterator for a JMenuBar
 * @since 1.6.4
 */
public static Iterator/*<JMenu>*/ iterator(JMenuBar self) {
  return DefaultGroovyMethods.iterator(self.getSubElements());
}

代码示例来源:origin: org.codehaus.groovy/groovy-swing

/**
 * Returns an {@link java.util.Iterator} which traverses the JMenuBar one menu at a time.
 *
 * @param self a JMenuBar
 * @return an Iterator for a JMenuBar
 * @since 1.6.4
 */
public static Iterator/*<JMenu>*/ iterator(JMenuBar self) {
  return DefaultGroovyMethods.iterator(self.getSubElements());
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

/**
 * Returns an {@link java.util.Iterator} which traverses the JMenuBar one menu at a time.
 *
 * @param self a JMenuBar
 * @return an Iterator for a JMenuBar
 * @since 1.6.4
 */
public static Iterator/*<JMenu>*/ iterator(JMenuBar self) {
  return DefaultGroovyMethods.iterator(self.getSubElements());
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public static void removeAction(JMenuBar _bar, String _action)
{
 if(_bar==null) return;
 MenuElement[] c=_bar.getSubElements();
 for(int i=0; i<c.length; i++)
  if(c[i] instanceof JMenu)
 removeAction((JMenu)c[i],_action);
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public static void setEnabledForAction
 (JMenuBar _bar, String _action, boolean _state)
{
 if(_bar==null) return;
 MenuElement[] c=_bar.getSubElements();
 for(int i=0; i<c.length; i++)
  if(c[i] instanceof JMenu)
 setEnabledForAction((JMenu)c[i],_action,_state);
}

代码示例来源:origin: org.orbisgis/orbisgis-view

public void setDockingManager(DockingManager dockingManager) {
  this.dockingManager = dockingManager;
  // Add Window close menu
  menuBar.add(dockingManager.getCloseableDockableMenu());
  // Add l&f menu
  MenuElement toolsMenu = actions.getActionMenu(MainFrameAction.MENU_TOOLS,menuBar.getSubElements());
  if(toolsMenu !=null && toolsMenu instanceof JMenu) {
    ((JMenu)toolsMenu).add(dockingManager.getLookAndFeelMenu());
  }
}

代码示例来源:origin: girtel/Net2Plan

if (menubar != null) children = menubar.getSubElements();
else if (parent != null) children = parent.getSubElements();
else throw new RuntimeException("Bad");

代码示例来源:origin: jtrfp/terminal-recall

protected void refreshOrdering(final JComponent component){
  final TreeSet<JMenuItem> items = new TreeSet<JMenuItem>(new JMenuItemComparator());
  if(component instanceof JMenu){
  for(java.awt.Component comp : ((JMenu)component).getMenuComponents())
    if(comp instanceof JMenuItem)
    items.add((JMenuItem)comp);
  }else if(component instanceof JMenuBar)
  for(MenuElement elm : ((JMenuBar)component).getSubElements())
    if(elm instanceof JMenuItem)
    items.add((JMenuItem)elm);
  for(JMenuItem jMenuItem : items)
  component.remove(jMenuItem);
  for(JMenuItem jMenuItem : items)
  component.add(jMenuItem);
  rw.invalidate();
  rw.validate();
}//end refreshOrderingLater(...)

相关文章