本文整理了Java中javax.swing.JMenuBar.getSubElements()
方法的一些代码示例,展示了JMenuBar.getSubElements()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenuBar.getSubElements()
方法的具体详情如下:
包路径:javax.swing.JMenuBar
类名称: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(...)
内容来源于网络,如有侵权,请联系作者删除!