Java Code Examples for org.codehaus.groovy.runtime.DefaultGroovyMethods#iterator()

The following examples show how to use org.codehaus.groovy.runtime.DefaultGroovyMethods#iterator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SwingExtensions.java    From groovy with Apache License 2.0 5 votes vote down vote up
private static Object[] buildRowData(DefaultTableModel delegate, Object row) {
    int cols = delegate.getColumnCount();
    Object[] rowData = new Object[cols];
    int i = 0;
    for (Iterator<?> it = DefaultGroovyMethods.iterator(row); it.hasNext() && i < cols;) {
        rowData[i++] = it.next();
    }
    return rowData;
}
 
Example 2
Source File: SwingExtensions.java    From groovy with Apache License 2.0 2 votes vote down vote up
/**
 * Returns an {@link java.util.Iterator} which traverses the Container one Component at a time.
 *
 * @param self a Container
 * @return an Iterator for a Container
 * @since 1.6.4
 */
public static Iterator<Component> iterator(Container self) {
    return DefaultGroovyMethods.iterator(self.getComponents());
}
 
Example 3
Source File: SwingExtensions.java    From groovy with Apache License 2.0 2 votes vote down vote up
/**
 * Returns an {@link java.util.Iterator} which traverses the ButtonGroup one AbstractButton at a time.
 *
 * @param self a ButtonGroup
 * @return an Iterator for a ButtonGroup
 * @since 1.6.4
 */
public static Iterator<AbstractButton> iterator(ButtonGroup self) {
    return DefaultGroovyMethods.iterator(self.getElements());
}
 
Example 4
Source File: SwingExtensions.java    From groovy with Apache License 2.0 2 votes vote down vote up
/**
 * Returns an {@link java.util.Iterator} which traverses the TreePath one path at a time.
 *
 * @param self a TreePath
 * @return an Iterator for a TreePath
 * @since 1.6.4
 */
public static Iterator<?> iterator(TreePath self) {
    return DefaultGroovyMethods.iterator(self.getPath());
}
 
Example 5
Source File: SwingExtensions.java    From groovy with Apache License 2.0 2 votes vote down vote up
/**
 * Returns an {@link java.util.Iterator} which traverses the TreeNode one node at a time.
 *
 * @param self a TreeNode
 * @return an Iterator for a TreeNode
 * @since 1.6.4
 */
@SuppressWarnings("unchecked")
public static Iterator<TreeNode> iterator(TreeNode self) {
    return (Iterator<TreeNode>) DefaultGroovyMethods.iterator(self.children());
}
 
Example 6
Source File: SwingExtensions.java    From groovy with Apache License 2.0 2 votes vote down vote up
/**
 * Returns an {@link java.util.Iterator} which traverses the JMenu one component at a time.
 *
 * @param self a JMenu
 * @return an Iterator for a JMenu
 * @since 1.6.4
 */
public static Iterator<Component> iterator(JMenu self) {
    return DefaultGroovyMethods.iterator(self.getMenuComponents());
}
 
Example 7
Source File: SwingExtensions.java    From groovy with Apache License 2.0 2 votes vote down vote up
/**
 * 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<MenuElement> iterator(JMenuBar self) {
    return DefaultGroovyMethods.iterator(self.getSubElements());
}
 
Example 8
Source File: SwingExtensions.java    From groovy with Apache License 2.0 2 votes vote down vote up
/**
 * Returns an {@link java.util.Iterator} which traverses the JPopupMenu one MenuElement at a time.
 *
 * @param self a JPopupMenu
 * @return an Iterator for a JPopupMenu
 * @since 1.6.4
 */
public static Iterator<MenuElement> iterator(JPopupMenu self) {
    return DefaultGroovyMethods.iterator(self.getSubElements());
}