Class SwingGroovyMethods


  • public class SwingGroovyMethods
    extends java.lang.Object
    This class defines all the new Swing-related groovy methods which enhance the normal JDK Swing classes when inside the Groovy environment. Static methods are used with the first parameter the destination class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void clear​(java.awt.Container self)
      Removes all components from the Container.
      static void clear​(javax.swing.DefaultComboBoxModel self)
      Removes all items from the model.
      static void clear​(javax.swing.DefaultListModel self)
      Removes all elements from the DefaultListModel.
      static void clear​(javax.swing.JComboBox self)
      Removes all items from the JComboBox.
      static void clear​(javax.swing.JTabbedPane self)
      Removes all elements from the JTabbedPane.
      static void clear​(javax.swing.tree.DefaultMutableTreeNode self)
      Removes all children nodes from the DefaultMutableTreeNode.
      static java.awt.Component getAt​(java.awt.Container self, int index)
      Support the subscript operator for Container.
      static javax.swing.AbstractButton getAt​(javax.swing.ButtonGroup self, int index)
      Support the subscript operator for ButtonGroup.
      static java.lang.Object getAt​(javax.swing.JComboBox self, int index)
      Support the subscript operator for JComboBox.
      static javax.swing.JMenu getAt​(javax.swing.JMenuBar self, int index)
      Support the subscript operator for JMenuBar.
      static java.awt.Component getAt​(javax.swing.JMenu self, int index)
      Support the subscript operator for JMenu.
      static java.awt.Component getAt​(javax.swing.JTabbedPane self, int index)
      Support the subscript operator for JTabbedPane.
      static java.awt.Component getAt​(javax.swing.JToolBar self, int index)
      Support the subscript operator for JToolBar.
      static java.lang.Object getAt​(javax.swing.ListModel self, int index)
      Support the subscript operator for ListModel.
      static javax.swing.table.TableColumn getAt​(javax.swing.table.TableColumnModel self, int index)
      Support the subscript operator for TableColumnModel.
      static java.lang.Object[] getAt​(javax.swing.table.TableModel self, int index)
      Support the subscript operator for TableModel.
      static javax.swing.tree.TreeNode getAt​(javax.swing.tree.TreeNode self, int index)
      Support the subscript operator for TreeNode.
      static java.lang.Object getAt​(javax.swing.tree.TreePath self, int index)
      Support the subscript operator for TreePath.
      static java.util.Iterator<java.awt.Component> iterator​(java.awt.Container self)
      Returns an Iterator which traverses the Container one Component at a time.
      static java.util.Iterator<javax.swing.AbstractButton> iterator​(javax.swing.ButtonGroup self)
      Returns an Iterator which traverses the ButtonGroup one AbstractButton at a time.
      static java.util.Iterator iterator​(javax.swing.DefaultListModel self)
      Returns an Iterator which traverses the DefaultListModel one element at a time.
      static java.util.Iterator iterator​(javax.swing.JComboBox self)
      Returns an Iterator which traverses the ComboBox one item at a time.
      static java.util.Iterator iterator​(javax.swing.JMenu self)
      Returns an Iterator which traverses the JMenu one component at a time.
      static java.util.Iterator iterator​(javax.swing.JMenuBar self)
      Returns an Iterator which traverses the JMenuBar one menu at a time.
      static java.util.Iterator<javax.swing.MenuElement> iterator​(javax.swing.JPopupMenu self)
      Returns an Iterator which traverses the JPopupMenu one MenuElement at a time.
      static java.util.Iterator<java.awt.Component> iterator​(javax.swing.JTabbedPane self)
      Returns an Iterator which traverses the JTabbedPane one Component tab at a time.
      static java.util.Iterator iterator​(javax.swing.ListModel self)
      Returns an Iterator which traverses the ListModel one element at a time.
      static java.util.Iterator iterator​(javax.swing.MutableComboBoxModel self)
      Returns an Iterator which traverses the MutableComboBoxModel one item at a time.
      static java.util.Iterator iterator​(javax.swing.table.DefaultTableModel self)
      Returns an Iterator which traverses the DefaultTableModel one item at a time.
      static java.util.Iterator<javax.swing.table.TableColumn> iterator​(javax.swing.table.TableColumnModel self)
      Returns an Iterator which traverses the TableColumnModel one TableColumn at a time.
      static java.util.Iterator iterator​(javax.swing.table.TableModel self)
      Returns an Iterator which traverses the TableModel one row at a time.
      static java.util.Iterator<javax.swing.tree.TreeNode> iterator​(javax.swing.tree.TreeNode self)
      Returns an Iterator which traverses the TreeNode one node at a time.
      static java.util.Iterator iterator​(javax.swing.tree.TreePath self)
      Returns an Iterator which traverses the TreePath one path at a time.
      static java.awt.Container leftShift​(java.awt.Container self, java.awt.Component c)
      Overloads the left shift operator to provide an easy way to add components to a Container.
      static javax.swing.ButtonGroup leftShift​(javax.swing.ButtonGroup self, javax.swing.AbstractButton b)
      Overloads the left shift operator to provide an easy way to add buttons to a ButtonGroup.
      static javax.swing.DefaultListModel leftShift​(javax.swing.DefaultListModel self, java.lang.Object e)
      Overloads the left shift operator to provide an easy way to add elements to a DefaultListModel.
      static javax.swing.JComboBox leftShift​(javax.swing.JComboBox self, java.lang.Object i)
      Overloads the left shift operator to provide an easy way to add items to a JComboBox.
      static javax.swing.JMenuBar leftShift​(javax.swing.JMenuBar self, javax.swing.JMenu menu)
      Overloads the left shift operator to provide an easy way to add menus to a menuBar.
      static javax.swing.JMenu leftShift​(javax.swing.JMenu self, GString gstr)
      Overloads the left shift operator to provide an easy way to add components to a menu.
      static javax.swing.JMenu leftShift​(javax.swing.JMenu self, java.awt.Component component)
      Overloads the left shift operator to provide an easy way to add components to a menu.
      static javax.swing.JMenu leftShift​(javax.swing.JMenu self, java.lang.String str)
      Overloads the left shift operator to provide an easy way to add components to a menu.
      static javax.swing.JMenu leftShift​(javax.swing.JMenu self, javax.swing.Action action)
      Overloads the left shift operator to provide an easy way to add components to a menu.
      static javax.swing.JMenu leftShift​(javax.swing.JMenu self, javax.swing.JMenuItem item)
      Overloads the left shift operator to provide an easy way to add components to a menu.
      static javax.swing.JPopupMenu leftShift​(javax.swing.JPopupMenu self, GString gstr)
      Overloads the left shift operator to provide an easy way to add components to a popupMenu.
      static javax.swing.JPopupMenu leftShift​(javax.swing.JPopupMenu self, java.awt.Component component)
      Overloads the left shift operator to provide an easy way to add components to a popupMenu.
      static javax.swing.JPopupMenu leftShift​(javax.swing.JPopupMenu self, java.lang.String str)
      Overloads the left shift operator to provide an easy way to add components to a popupMenu.
      static javax.swing.JPopupMenu leftShift​(javax.swing.JPopupMenu self, javax.swing.Action action)
      Overloads the left shift operator to provide an easy way to add components to a popupMenu.
      static javax.swing.JPopupMenu leftShift​(javax.swing.JPopupMenu self, javax.swing.JMenuItem item)
      Overloads the left shift operator to provide an easy way to add components to a popupMenu.
      static javax.swing.JToolBar leftShift​(javax.swing.JToolBar self, javax.swing.Action action)
      Overloads the left shift operator to provide an easy way to add components to a toolBar.
      static javax.swing.MutableComboBoxModel leftShift​(javax.swing.MutableComboBoxModel self, java.lang.Object i)
      Overloads the left shift operator to provide an easy way to add items to a MutableComboBoxModel.
      static javax.swing.table.DefaultTableModel leftShift​(javax.swing.table.DefaultTableModel self, java.lang.Object row)
      Overloads the left shift operator to provide an easy way to add rows to a DefaultTableModel.
      static javax.swing.table.TableColumnModel leftShift​(javax.swing.table.TableColumnModel self, javax.swing.table.TableColumn column)
      Overloads the left shift operator to provide an easy way to add columns to a TableColumnModel.
      static javax.swing.tree.DefaultMutableTreeNode leftShift​(javax.swing.tree.DefaultMutableTreeNode self, javax.swing.tree.DefaultMutableTreeNode node)
      Overloads the left shift operator to provide an easy way to add nodes to a DefaultMutableTreeNode.
      static javax.swing.tree.MutableTreeNode leftShift​(javax.swing.tree.MutableTreeNode self, javax.swing.tree.MutableTreeNode node)
      Overloads the left shift operator to provide an easy way to add nodes to a MutableTreeNode.
      static javax.swing.tree.TreePath leftShift​(javax.swing.tree.TreePath self, java.lang.Object p)
      Overloads the left shift operator to provide an easy way to add paths to a treePath.
      static void putAt​(javax.swing.DefaultListModel self, int index, java.lang.Object e)
      Allow DefaultListModel to work with subscript operators.
      static void putAt​(javax.swing.MutableComboBoxModel self, int index, java.lang.Object i)
      Allow MutableComboBoxModel to work with subscript operators.
      static void putAt​(javax.swing.table.DefaultTableModel self, int index, java.lang.Object row)
      Allow DefaultTableModel to work with subscript operators.
      static void putAt​(javax.swing.tree.MutableTreeNode self, int index, javax.swing.tree.MutableTreeNode node)
      Allow MutableTreeNode to work with subscript operators.
      static void setMnemonic​(javax.swing.AbstractButton button, java.lang.String mnemonic)
      Allows the usage of a one-element string for a mnemonic
      static int size​(java.awt.Container self)
      Provide the standard Groovy size() method for Container.
      static int size​(javax.swing.ButtonGroup self)
      Provide the standard Groovy size() method for ButtonGroup.
      static int size​(javax.swing.JComboBox self)
      Provide the standard Groovy size() method for JComboBox.
      static int size​(javax.swing.JMenu self)
      Provide the standard Groovy size() method for JMenu.
      static int size​(javax.swing.JMenuBar self)
      Provide the standard Groovy size() method for JMenuBar.
      static int size​(javax.swing.JTabbedPane self)
      Provide the standard Groovy size() method for JTabbedPane.
      static int size​(javax.swing.ListModel self)
      Provide the standard Groovy size() method for ListModel.
      static int size​(javax.swing.table.TableColumnModel self)
      Provide the standard Groovy size() method for TableColumnModel.
      static int size​(javax.swing.table.TableModel self)
      Provide the standard Groovy size() method for TableModel.
      static int size​(javax.swing.tree.TreeNode self)
      Provide the standard Groovy size() method for TreeNode.
      static int size​(javax.swing.tree.TreePath self)
      Provide the standard Groovy size() method for TreePath.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SwingGroovyMethods

        public SwingGroovyMethods()
    • Method Detail

      • size

        public static int size​(java.awt.Container self)
        Provide the standard Groovy size() method for Container.
        Parameters:
        self - a Container
        Returns:
        the component count of the container
        Since:
        1.6.4
      • getAt

        public static java.awt.Component getAt​(java.awt.Container self,
                                               int index)
        Support the subscript operator for Container.
        Parameters:
        self - a Container
        index - the index of the Component to get
        Returns:
        the component at the given index
        Since:
        1.6.4
      • leftShift

        public static java.awt.Container leftShift​(java.awt.Container self,
                                                   java.awt.Component c)
        Overloads the left shift operator to provide an easy way to add components to a Container.
        Parameters:
        self - a Container
        c - a Component to be added to the container.
        Returns:
        same container, after the value was added to it.
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator<java.awt.Component> iterator​(java.awt.Container self)
        Returns an Iterator which traverses the Container one Component at a time.
        Parameters:
        self - a Container
        Returns:
        an Iterator for a Container
        Since:
        1.6.4
      • clear

        public static void clear​(java.awt.Container self)
        Removes all components from the Container.
        Parameters:
        self - a Container
        Since:
        1.6.4
      • size

        public static int size​(javax.swing.ButtonGroup self)
        Provide the standard Groovy size() method for ButtonGroup.
        Parameters:
        self - a ButtonGroup
        Returns:
        the button count of the buttonGroup
        Since:
        1.6.4
      • getAt

        public static javax.swing.AbstractButton getAt​(javax.swing.ButtonGroup self,
                                                       int index)
        Support the subscript operator for ButtonGroup.
        Parameters:
        self - a ButtonGroup
        index - the index of the AbstractButton to get
        Returns:
        the button at the given index
        Since:
        1.6.4
      • leftShift

        public static javax.swing.ButtonGroup leftShift​(javax.swing.ButtonGroup self,
                                                        javax.swing.AbstractButton b)
        Overloads the left shift operator to provide an easy way to add buttons to a ButtonGroup.
        Parameters:
        self - a ButtonGroup
        b - an AbstractButton to be added to the buttonGroup.
        Returns:
        same buttonGroup, after the value was added to it.
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator<javax.swing.AbstractButton> iterator​(javax.swing.ButtonGroup self)
        Returns an Iterator which traverses the ButtonGroup one AbstractButton at a time.
        Parameters:
        self - a ButtonGroup
        Returns:
        an Iterator for a ButtonGroup
        Since:
        1.6.4
      • size

        public static int size​(javax.swing.ListModel self)
        Provide the standard Groovy size() method for ListModel.
        Parameters:
        self - a ListModel
        Returns:
        the size of the ListModel
        Since:
        1.6.4
      • getAt

        public static java.lang.Object getAt​(javax.swing.ListModel self,
                                             int index)
        Support the subscript operator for ListModel.
        Parameters:
        self - a ListModel
        index - the index of the element to get
        Returns:
        the element at the given index
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator iterator​(javax.swing.ListModel self)
        Returns an Iterator which traverses the ListModel one element at a time.
        Parameters:
        self - a ListModel
        Returns:
        an Iterator for a ListModel
        Since:
        1.6.4
      • leftShift

        public static javax.swing.DefaultListModel leftShift​(javax.swing.DefaultListModel self,
                                                             java.lang.Object e)
        Overloads the left shift operator to provide an easy way to add elements to a DefaultListModel.
        Parameters:
        self - a DefaultListModel
        e - an element to be added to the listModel.
        Returns:
        same listModel, after the value was added to it.
        Since:
        1.6.4
      • putAt

        public static void putAt​(javax.swing.DefaultListModel self,
                                 int index,
                                 java.lang.Object e)
        Allow DefaultListModel to work with subscript operators.

        WARNING: this operation does not replace the element at the specified index, rather it inserts the element at that index, thus increasing the size of of the model by 1.

        Parameters:
        self - a DefaultListModel
        index - an index
        e - the element to insert at the given index
        Since:
        1.6.4
      • clear

        public static void clear​(javax.swing.DefaultListModel self)
        Removes all elements from the DefaultListModel.
        Parameters:
        self - a DefaultListModel
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator iterator​(javax.swing.DefaultListModel self)
        Returns an Iterator which traverses the DefaultListModel one element at a time.
        Parameters:
        self - a DefaultListModel
        Returns:
        an Iterator for a DefaultListModel
        Since:
        1.6.4
      • size

        public static int size​(javax.swing.JComboBox self)
        Provide the standard Groovy size() method for JComboBox.
        Parameters:
        self - a JComboBox
        Returns:
        the item count of the comboBox
        Since:
        1.6.4
      • getAt

        public static java.lang.Object getAt​(javax.swing.JComboBox self,
                                             int index)
        Support the subscript operator for JComboBox.
        Parameters:
        self - a JComboBox
        index - the index of the item to get
        Returns:
        the tem at the given index
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JComboBox leftShift​(javax.swing.JComboBox self,
                                                      java.lang.Object i)
        Overloads the left shift operator to provide an easy way to add items to a JComboBox.
        Parameters:
        self - a JComboBox
        i - an item to be added to the comboBox.
        Returns:
        same comboBox, after the value was added to it.
        Since:
        1.6.4
      • clear

        public static void clear​(javax.swing.JComboBox self)
        Removes all items from the JComboBox.
        Parameters:
        self - a JComboBox
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator iterator​(javax.swing.JComboBox self)
        Returns an Iterator which traverses the ComboBox one item at a time.
        Parameters:
        self - a ComboBox
        Returns:
        an Iterator for a ComboBox
        Since:
        1.6.4
      • leftShift

        public static javax.swing.MutableComboBoxModel leftShift​(javax.swing.MutableComboBoxModel self,
                                                                 java.lang.Object i)
        Overloads the left shift operator to provide an easy way to add items to a MutableComboBoxModel.
        Parameters:
        self - a MutableComboBoxModel
        i - an item to be added to the model.
        Returns:
        same model, after the value was added to it.
        Since:
        1.6.4
      • putAt

        public static void putAt​(javax.swing.MutableComboBoxModel self,
                                 int index,
                                 java.lang.Object i)
        Allow MutableComboBoxModel to work with subscript operators.

        WARNING: this operation does not replace the item at the specified index, rather it inserts the item at that index, thus increasing the size of the model by 1.

        Parameters:
        self - a MutableComboBoxModel
        index - an index
        i - the item to insert at the given index
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator iterator​(javax.swing.MutableComboBoxModel self)
        Returns an Iterator which traverses the MutableComboBoxModel one item at a time.
        Parameters:
        self - a MutableComboBoxModel
        Returns:
        an Iterator for a MutableComboBoxModel
        Since:
        1.6.4
      • clear

        public static void clear​(javax.swing.DefaultComboBoxModel self)
        Removes all items from the model.
        Parameters:
        self - a DefaultComboBoxModel
        Since:
        1.7.3
      • size

        public static int size​(javax.swing.table.TableModel self)
        Provide the standard Groovy size() method for TableModel.
        Parameters:
        self - a TableModel
        Returns:
        the row count of the TableModel
        Since:
        1.6.4
      • getAt

        public static java.lang.Object[] getAt​(javax.swing.table.TableModel self,
                                               int index)
        Support the subscript operator for TableModel.
        Parameters:
        self - a TableModel
        index - the index of the row to get
        Returns:
        the row at the given index
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator iterator​(javax.swing.table.TableModel self)
        Returns an Iterator which traverses the TableModel one row at a time.
        Parameters:
        self - a TableModel
        Returns:
        an Iterator for a TableModel
        Since:
        1.6.4
      • leftShift

        public static javax.swing.table.DefaultTableModel leftShift​(javax.swing.table.DefaultTableModel self,
                                                                    java.lang.Object row)
        Overloads the left shift operator to provide an easy way to add rows to a DefaultTableModel.

        if row.size < model.size -> row will be padded with nulls
        if row.size > model.size -> additional columns will be discarded

        Parameters:
        self - a DefaultTableModel
        row - a row to be added to the model.
        Returns:
        same model, after the value was added to it.
        Since:
        1.6.4
      • putAt

        public static void putAt​(javax.swing.table.DefaultTableModel self,
                                 int index,
                                 java.lang.Object row)
        Allow DefaultTableModel to work with subscript operators.

        WARNING: this operation does not replace the item at the specified index, rather it inserts the item at that index, thus increasing the size of the model by 1.

        if row.size < model.size -> row will be padded with nulls
        if row.size > model.size -> additional columns will be discarded

        Parameters:
        self - a DefaultTableModel
        index - an index
        row - the row to insert at the given index
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator iterator​(javax.swing.table.DefaultTableModel self)
        Returns an Iterator which traverses the DefaultTableModel one item at a time.
        Parameters:
        self - a DefaultTableModel
        Returns:
        an Iterator for a DefaultTableModel
        Since:
        1.6.4
      • size

        public static int size​(javax.swing.table.TableColumnModel self)
        Provide the standard Groovy size() method for TableColumnModel.
        Parameters:
        self - a TableColumnModel
        Returns:
        the column count of the TableColumnModel
        Since:
        1.6.4
      • getAt

        public static javax.swing.table.TableColumn getAt​(javax.swing.table.TableColumnModel self,
                                                          int index)
        Support the subscript operator for TableColumnModel.
        Parameters:
        self - a TableColumnModel
        index - the index of the column to get
        Returns:
        the column at the given index
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator<javax.swing.table.TableColumn> iterator​(javax.swing.table.TableColumnModel self)
        Returns an Iterator which traverses the TableColumnModel one TableColumn at a time.
        Parameters:
        self - a TableColumnModel
        Returns:
        an Iterator for a TableColumnModel
        Since:
        1.6.4
      • leftShift

        public static javax.swing.table.TableColumnModel leftShift​(javax.swing.table.TableColumnModel self,
                                                                   javax.swing.table.TableColumn column)
        Overloads the left shift operator to provide an easy way to add columns to a TableColumnModel.
        Parameters:
        self - a TableColumnModel
        column - a TableColumn to be added to the model.
        Returns:
        same model, after the value was added to it.
        Since:
        1.6.4
      • size

        public static int size​(javax.swing.tree.TreePath self)
        Provide the standard Groovy size() method for TreePath.
        Parameters:
        self - a TreePath
        Returns:
        the path count of the treePath
        Since:
        1.6.4
      • getAt

        public static java.lang.Object getAt​(javax.swing.tree.TreePath self,
                                             int index)
        Support the subscript operator for TreePath.
        Parameters:
        self - a TreePath
        index - the index of the path to get
        Returns:
        the path at the given index
        Since:
        1.6.4
      • leftShift

        public static javax.swing.tree.TreePath leftShift​(javax.swing.tree.TreePath self,
                                                          java.lang.Object p)
        Overloads the left shift operator to provide an easy way to add paths to a treePath.

        WARNING: this operation returns a new TreePath, not the original one.

        Parameters:
        self - a TreePath
        p - an object to be added to the treePath.
        Returns:
        same treePath, after the value was added to it.
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator iterator​(javax.swing.tree.TreePath self)
        Returns an Iterator which traverses the TreePath one path at a time.
        Parameters:
        self - a TreePath
        Returns:
        an Iterator for a TreePath
        Since:
        1.6.4
      • size

        public static int size​(javax.swing.tree.TreeNode self)
        Provide the standard Groovy size() method for TreeNode.
        Parameters:
        self - a TreeNode
        Returns:
        the child count of the treeNode
        Since:
        1.6.4
      • getAt

        public static javax.swing.tree.TreeNode getAt​(javax.swing.tree.TreeNode self,
                                                      int index)
        Support the subscript operator for TreeNode.
        Parameters:
        self - a TreeNode
        index - the index of the child node to get
        Returns:
        the child node at the given index
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator<javax.swing.tree.TreeNode> iterator​(javax.swing.tree.TreeNode self)
        Returns an Iterator which traverses the TreeNode one node at a time.
        Parameters:
        self - a TreeNode
        Returns:
        an Iterator for a TreeNode
        Since:
        1.6.4
      • leftShift

        public static javax.swing.tree.MutableTreeNode leftShift​(javax.swing.tree.MutableTreeNode self,
                                                                 javax.swing.tree.MutableTreeNode node)
        Overloads the left shift operator to provide an easy way to add nodes to a MutableTreeNode.

        Parameters:
        self - a MutableTreeNode
        node - a node to be added to the treeNode.
        Returns:
        same treeNode, after the value was added to it.
        Since:
        1.6.4
      • putAt

        public static void putAt​(javax.swing.tree.MutableTreeNode self,
                                 int index,
                                 javax.swing.tree.MutableTreeNode node)
        Allow MutableTreeNode to work with subscript operators.

        WARNING: this operation does not replace the node at the specified index, rather it inserts the node at that index, thus increasing the size of the treeNode by 1.

        Parameters:
        self - a MutableTreeNode
        index - an index
        node - the node to insert at the given index
        Since:
        1.6.4
      • leftShift

        public static javax.swing.tree.DefaultMutableTreeNode leftShift​(javax.swing.tree.DefaultMutableTreeNode self,
                                                                        javax.swing.tree.DefaultMutableTreeNode node)
        Overloads the left shift operator to provide an easy way to add nodes to a DefaultMutableTreeNode.

        Parameters:
        self - a DefaultMutableTreeNode
        node - a node to be added to the treeNode.
        Returns:
        same treeNode, after the value was added to it.
        Since:
        1.6.4
      • clear

        public static void clear​(javax.swing.tree.DefaultMutableTreeNode self)
        Removes all children nodes from the DefaultMutableTreeNode.
        Parameters:
        self - a DefaultMutableTreeNode
        Since:
        1.6.4
      • size

        public static int size​(javax.swing.JMenu self)
        Provide the standard Groovy size() method for JMenu.
        Parameters:
        self - a JMenu
        Returns:
        the menu component count of the menu
        Since:
        1.6.4
      • getAt

        public static java.awt.Component getAt​(javax.swing.JMenu self,
                                               int index)
        Support the subscript operator for JMenu.
        Parameters:
        self - a JMenu
        index - the index of the menu component to get
        Returns:
        the menu component at the given index
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JMenu leftShift​(javax.swing.JMenu self,
                                                  javax.swing.Action action)
        Overloads the left shift operator to provide an easy way to add components to a menu.

        Parameters:
        self - a JMenu
        action - an action to be added to the menu.
        Returns:
        same menu, after the value was added to it.
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JMenu leftShift​(javax.swing.JMenu self,
                                                  java.awt.Component component)
        Overloads the left shift operator to provide an easy way to add components to a menu.

        Parameters:
        self - a JMenu
        component - a component to be added to the menu.
        Returns:
        same menu, after the value was added to it.
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JMenu leftShift​(javax.swing.JMenu self,
                                                  javax.swing.JMenuItem item)
        Overloads the left shift operator to provide an easy way to add components to a menu.

        Parameters:
        self - a JMenu
        item - an item to be added to the menu.
        Returns:
        same menu, after the value was added to it.
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JMenu leftShift​(javax.swing.JMenu self,
                                                  java.lang.String str)
        Overloads the left shift operator to provide an easy way to add components to a menu.

        Parameters:
        self - a JMenu
        str - a String to be added to the menu.
        Returns:
        same menu, after the value was added to it.
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JMenu leftShift​(javax.swing.JMenu self,
                                                  GString gstr)
        Overloads the left shift operator to provide an easy way to add components to a menu.

        Parameters:
        self - a JMenu
        gstr - a GString to be added to the menu.
        Returns:
        same menu, after the value was added to it.
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator iterator​(javax.swing.JMenu self)
        Returns an Iterator which traverses the JMenu one component at a time.
        Parameters:
        self - a JMenu
        Returns:
        an Iterator for a JMenu
        Since:
        1.6.4
      • size

        public static int size​(javax.swing.JMenuBar self)
        Provide the standard Groovy size() method for JMenuBar.
        Parameters:
        self - a JMenuBar
        Returns:
        the menu count of the menuBar
        Since:
        1.6.4
      • getAt

        public static javax.swing.JMenu getAt​(javax.swing.JMenuBar self,
                                              int index)
        Support the subscript operator for JMenuBar.
        Parameters:
        self - a JMenuBar
        index - the index of the menu to get
        Returns:
        the menu at the given index
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JMenuBar leftShift​(javax.swing.JMenuBar self,
                                                     javax.swing.JMenu menu)
        Overloads the left shift operator to provide an easy way to add menus to a menuBar.

        Parameters:
        self - a JMenuBar
        menu - a menu to be added to the menuBar.
        Returns:
        same menuBar, after the value was added to it.
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator iterator​(javax.swing.JMenuBar self)
        Returns an Iterator which traverses the JMenuBar one menu at a time.
        Parameters:
        self - a JMenuBar
        Returns:
        an Iterator for a JMenuBar
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JPopupMenu leftShift​(javax.swing.JPopupMenu self,
                                                       javax.swing.Action action)
        Overloads the left shift operator to provide an easy way to add components to a popupMenu.

        Parameters:
        self - a JPopupMenu
        action - an action to be added to the popupMenu.
        Returns:
        same popupMenu, after the value was added to it.
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JPopupMenu leftShift​(javax.swing.JPopupMenu self,
                                                       java.awt.Component component)
        Overloads the left shift operator to provide an easy way to add components to a popupMenu.

        Parameters:
        self - a JPopupMenu
        component - a component to be added to the popupMenu.
        Returns:
        same popupMenu, after the value was added to it.
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JPopupMenu leftShift​(javax.swing.JPopupMenu self,
                                                       javax.swing.JMenuItem item)
        Overloads the left shift operator to provide an easy way to add components to a popupMenu.

        Parameters:
        self - a JPopupMenu
        item - an item to be added to the popupMenu.
        Returns:
        same popupMenu, after the value was added to it.
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JPopupMenu leftShift​(javax.swing.JPopupMenu self,
                                                       java.lang.String str)
        Overloads the left shift operator to provide an easy way to add components to a popupMenu.

        Parameters:
        self - a JPopupMenu
        str - a String to be added to the popupMenu.
        Returns:
        same popupMenu, after the value was added to it.
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JPopupMenu leftShift​(javax.swing.JPopupMenu self,
                                                       GString gstr)
        Overloads the left shift operator to provide an easy way to add components to a popupMenu.

        Parameters:
        self - a JPopupMenu
        gstr - a GString to be added to the popupMenu.
        Returns:
        same popupMenu, after the value was added to it.
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator<javax.swing.MenuElement> iterator​(javax.swing.JPopupMenu self)
        Returns an Iterator which traverses the JPopupMenu one MenuElement at a time.
        Parameters:
        self - a JPopupMenu
        Returns:
        an Iterator for a JPopupMenu
        Since:
        1.6.4
      • size

        public static int size​(javax.swing.JTabbedPane self)
        Provide the standard Groovy size() method for JTabbedPane.
        Parameters:
        self - a JTabbedPane
        Returns:
        the tab count of the tabbedPane
        Since:
        1.6.4
      • clear

        public static void clear​(javax.swing.JTabbedPane self)
        Removes all elements from the JTabbedPane.
        Parameters:
        self - a JTabbedPane
        Since:
        1.6.4
      • getAt

        public static java.awt.Component getAt​(javax.swing.JTabbedPane self,
                                               int index)
        Support the subscript operator for JTabbedPane.
        Parameters:
        self - a JTabbedPane
        index - the index of the tab component to get
        Returns:
        the component at the given index
        Since:
        1.6.4
      • iterator

        public static java.util.Iterator<java.awt.Component> iterator​(javax.swing.JTabbedPane self)
        Returns an Iterator which traverses the JTabbedPane one Component tab at a time.
        Parameters:
        self - a JTabbedPane
        Returns:
        an Iterator for a JTabbedPane
        Since:
        1.6.4
      • leftShift

        public static javax.swing.JToolBar leftShift​(javax.swing.JToolBar self,
                                                     javax.swing.Action action)
        Overloads the left shift operator to provide an easy way to add components to a toolBar.

        Parameters:
        self - a JToolBar
        action - an Action to be added to the toolBar.
        Returns:
        same toolBar, after the value was added to it.
        Since:
        1.6.4
      • getAt

        public static java.awt.Component getAt​(javax.swing.JToolBar self,
                                               int index)
        Support the subscript operator for JToolBar.
        Parameters:
        self - a JToolBar
        index - the index of the tab component to get
        Returns:
        the tab component at the given index
        Since:
        1.6.4
      • setMnemonic

        public static void setMnemonic​(javax.swing.AbstractButton button,
                                       java.lang.String mnemonic)
        Allows the usage of a one-element string for a mnemonic
        Parameters:
        button - a AbstractButton
        mnemonic - the String
        Since:
        2.3.7