public class SwingExtensions
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.
Type Params | Return Type | Name and description |
---|---|---|
|
public static void |
clear(Container self) Removes all components from the Container. |
|
public static void |
clear(DefaultListModel self) Removes all elements from the DefaultListModel. |
|
public static void |
clear(JComboBox self) Removes all items from the JComboBox. |
|
public static void |
clear(DefaultComboBoxModel self) Removes all items from the model. |
|
public static void |
clear(DefaultMutableTreeNode self) Removes all children nodes from the DefaultMutableTreeNode. |
|
public static void |
clear(JTabbedPane self) Removes all elements from the JTabbedPane. |
|
public static Component |
getAt(Container self, int index) Support the subscript operator for Container. |
|
public static AbstractButton |
getAt(ButtonGroup self, int index) Support the subscript operator for ButtonGroup. |
|
public static Object |
getAt(ListModel self, int index) Support the subscript operator for ListModel. |
|
public static Object |
getAt(JComboBox self, int index) Support the subscript operator for JComboBox. |
|
public static Object[] |
getAt(TableModel self, int index) Support the subscript operator for TableModel. |
|
public static TableColumn |
getAt(TableColumnModel self, int index) Support the subscript operator for TableColumnModel. |
|
public static Object |
getAt(TreePath self, int index) Support the subscript operator for TreePath. |
|
public static TreeNode |
getAt(TreeNode self, int index) Support the subscript operator for TreeNode. |
|
public static Component |
getAt(JMenu self, int index) Support the subscript operator for JMenu. |
|
public static JMenu |
getAt(JMenuBar self, int index) Support the subscript operator for JMenuBar. |
|
public static Component |
getAt(JTabbedPane self, int index) Support the subscript operator for JTabbedPane. |
|
public static Component |
getAt(JToolBar self, int index) Support the subscript operator for JToolBar. |
|
public boolean |
hasNext() |
|
public boolean |
hasNext() |
|
public boolean |
hasNext() |
|
public boolean |
hasNext() |
|
public boolean |
hasNext() |
|
public boolean |
hasNext() |
|
public boolean |
hasNext() |
|
public static Iterator<Component> |
iterator(Container self) Returns an Iterator which traverses the Container one Component at a time. |
|
public static Iterator<AbstractButton> |
iterator(ButtonGroup self) Returns an Iterator which traverses the ButtonGroup one AbstractButton at a time. |
|
public static Iterator |
iterator(ListModel self) Returns an Iterator which traverses the ListModel one element at a time. |
|
public static Iterator |
iterator(DefaultListModel self) Returns an Iterator which traverses the DefaultListModel one element at a time. |
|
public static Iterator |
iterator(JComboBox self) Returns an Iterator which traverses the ComboBox one item at a time. |
|
public static Iterator |
iterator(MutableComboBoxModel self) Returns an Iterator which traverses the MutableComboBoxModel one item at a time. |
|
public static Iterator |
iterator(TableModel self) Returns an Iterator which traverses the TableModel one row at a time. |
|
public static Iterator |
iterator(DefaultTableModel self) Returns an Iterator which traverses the DefaultTableModel one item at a time. |
|
public static Iterator<TableColumn> |
iterator(TableColumnModel self) Returns an Iterator which traverses the TableColumnModel one TableColumn at a time. |
|
public static Iterator |
iterator(TreePath self) Returns an Iterator which traverses the TreePath one path at a time. |
|
public static Iterator<TreeNode> |
iterator(TreeNode self) Returns an Iterator which traverses the TreeNode one node at a time. |
|
public static Iterator |
iterator(JMenu self) Returns an Iterator which traverses the JMenu one component at a time. |
|
public static Iterator |
iterator(JMenuBar self) Returns an Iterator which traverses the JMenuBar one menu at a time. |
|
public static Iterator<MenuElement> |
iterator(JPopupMenu self) Returns an Iterator which traverses the JPopupMenu one MenuElement at a time. |
|
public static Iterator<Component> |
iterator(JTabbedPane self) Returns an Iterator which traverses the JTabbedPane one Component tab at a time. |
|
public static Container |
leftShift(Container self, Component c) Overloads the left shift operator to provide an easy way to add components to a Container. |
|
public static ButtonGroup |
leftShift(ButtonGroup self, AbstractButton b) Overloads the left shift operator to provide an easy way to add buttons to a ButtonGroup. |
|
public static DefaultListModel |
leftShift(DefaultListModel self, Object e) Overloads the left shift operator to provide an easy way to add elements to a DefaultListModel. |
|
public static JComboBox |
leftShift(JComboBox self, Object i) Overloads the left shift operator to provide an easy way to add items to a JComboBox. |
|
public static MutableComboBoxModel |
leftShift(MutableComboBoxModel self, Object i) Overloads the left shift operator to provide an easy way to add items to a MutableComboBoxModel. |
|
public static DefaultTableModel |
leftShift(DefaultTableModel self, Object row) Overloads the left shift operator to provide an easy way to add rows to a DefaultTableModel. |
|
public static TableColumnModel |
leftShift(TableColumnModel self, TableColumn column) Overloads the left shift operator to provide an easy way to add columns to a TableColumnModel. |
|
public static TreePath |
leftShift(TreePath self, Object p) Overloads the left shift operator to provide an easy way to add paths to a treePath. |
|
public static MutableTreeNode |
leftShift(MutableTreeNode self, MutableTreeNode node) Overloads the left shift operator to provide an easy way to add nodes to a MutableTreeNode. |
|
public static DefaultMutableTreeNode |
leftShift(DefaultMutableTreeNode self, DefaultMutableTreeNode node) Overloads the left shift operator to provide an easy way to add nodes to a DefaultMutableTreeNode. |
|
public static JMenu |
leftShift(JMenu self, Action action) Overloads the left shift operator to provide an easy way to add components to a menu. |
|
public static JMenu |
leftShift(JMenu self, Component component) Overloads the left shift operator to provide an easy way to add components to a menu. |
|
public static JMenu |
leftShift(JMenu self, JMenuItem item) Overloads the left shift operator to provide an easy way to add components to a menu. |
|
public static JMenu |
leftShift(JMenu self, String str) Overloads the left shift operator to provide an easy way to add components to a menu. |
|
public static JMenu |
leftShift(JMenu self, GString gstr) Overloads the left shift operator to provide an easy way to add components to a menu. |
|
public static JMenuBar |
leftShift(JMenuBar self, JMenu menu) Overloads the left shift operator to provide an easy way to add menus to a menuBar. |
|
public static JPopupMenu |
leftShift(JPopupMenu self, Action action) Overloads the left shift operator to provide an easy way to add components to a popupMenu. |
|
public static JPopupMenu |
leftShift(JPopupMenu self, Component component) Overloads the left shift operator to provide an easy way to add components to a popupMenu. |
|
public static JPopupMenu |
leftShift(JPopupMenu self, JMenuItem item) Overloads the left shift operator to provide an easy way to add components to a popupMenu. |
|
public static JPopupMenu |
leftShift(JPopupMenu self, String str) Overloads the left shift operator to provide an easy way to add components to a popupMenu. |
|
public static JPopupMenu |
leftShift(JPopupMenu self, GString gstr) Overloads the left shift operator to provide an easy way to add components to a popupMenu. |
|
public static JToolBar |
leftShift(JToolBar self, Action action) Overloads the left shift operator to provide an easy way to add components to a toolBar. |
|
public Object |
next() |
|
public Object |
next() |
|
public Object |
next() |
|
public Object |
next() |
|
public Object |
next() |
|
public TableColumn |
next() |
|
public Component |
next() |
|
public static void |
putAt(DefaultListModel self, int index, Object e) Allow DefaultListModel to work with subscript operators. |
|
public static void |
putAt(MutableComboBoxModel self, int index, Object i) Allow MutableComboBoxModel to work with subscript operators. |
|
public static void |
putAt(DefaultTableModel self, int index, Object row) Allow DefaultTableModel to work with subscript operators. |
|
public static void |
putAt(MutableTreeNode self, int index, MutableTreeNode node) Allow MutableTreeNode to work with subscript operators. |
|
public void |
remove() |
|
public void |
remove() |
|
public void |
remove() |
|
public void |
remove() |
|
public void |
remove() |
|
public void |
remove() |
|
public void |
remove() |
|
public static void |
setMnemonic(AbstractButton button, String mnemonic) Allows the usage of a one-element string for a mnemonic |
|
public static int |
size(Container self) Provide the standard Groovy size() method for Container . |
|
public static int |
size(ButtonGroup self) Provide the standard Groovy size() method for ButtonGroup . |
|
public static int |
size(ListModel self) Provide the standard Groovy size() method for ListModel . |
|
public static int |
size(JComboBox self) Provide the standard Groovy size() method for JComboBox . |
|
public static int |
size(TableModel self) Provide the standard Groovy size() method for TableModel . |
|
public static int |
size(TableColumnModel self) Provide the standard Groovy size() method for TableColumnModel . |
|
public static int |
size(TreePath self) Provide the standard Groovy size() method for TreePath . |
|
public static int |
size(TreeNode self) Provide the standard Groovy size() method for TreeNode . |
|
public static int |
size(JMenu self) Provide the standard Groovy size() method for JMenu . |
|
public static int |
size(JMenuBar self) Provide the standard Groovy size() method for JMenuBar . |
|
public static int |
size(JTabbedPane self) Provide the standard Groovy size() method for JTabbedPane . |
Removes all components from the Container.
self
- a ContainerRemoves all elements from the DefaultListModel.
self
- a DefaultListModelRemoves all items from the JComboBox.
self
- a JComboBoxRemoves all items from the model.
self
- a DefaultComboBoxModelRemoves all children nodes from the DefaultMutableTreeNode.
self
- a DefaultMutableTreeNodeRemoves all elements from the JTabbedPane.
self
- a JTabbedPaneSupport the subscript operator for Container.
self
- a Containerindex
- the index of the Component to getSupport the subscript operator for ButtonGroup.
self
- a ButtonGroupindex
- the index of the AbstractButton to getSupport the subscript operator for ListModel.
self
- a ListModelindex
- the index of the element to getSupport the subscript operator for JComboBox.
self
- a JComboBoxindex
- the index of the item to getSupport the subscript operator for TableModel.
self
- a TableModelindex
- the index of the row to getSupport the subscript operator for TableColumnModel.
self
- a TableColumnModelindex
- the index of the column to getSupport the subscript operator for TreePath.
self
- a TreePathindex
- the index of the path to getSupport the subscript operator for TreeNode.
self
- a TreeNodeindex
- the index of the child node to getSupport the subscript operator for JMenu.
self
- a JMenuindex
- the index of the menu component to getSupport the subscript operator for JMenuBar.
self
- a JMenuBarindex
- the index of the menu to getSupport the subscript operator for JTabbedPane.
self
- a JTabbedPaneindex
- the index of the tab component to getSupport the subscript operator for JToolBar.
self
- a JToolBarindex
- the index of the tab component to getReturns an Iterator which traverses the Container one Component at a time.
self
- a ContainerReturns an Iterator which traverses the ButtonGroup one AbstractButton at a time.
self
- a ButtonGroupReturns an Iterator which traverses the ListModel one element at a time.
self
- a ListModelReturns an Iterator which traverses the DefaultListModel one element at a time.
self
- a DefaultListModelReturns an Iterator which traverses the ComboBox one item at a time.
self
- a ComboBoxReturns an Iterator which traverses the MutableComboBoxModel one item at a time.
self
- a MutableComboBoxModelReturns an Iterator which traverses the TableModel one row at a time.
self
- a TableModelReturns an Iterator which traverses the DefaultTableModel one item at a time.
self
- a DefaultTableModelReturns an Iterator which traverses the TableColumnModel one TableColumn at a time.
self
- a TableColumnModelReturns an Iterator which traverses the TreePath one path at a time.
self
- a TreePathReturns an Iterator which traverses the TreeNode one node at a time.
self
- a TreeNodeReturns an Iterator which traverses the JMenu one component at a time.
self
- a JMenuReturns an Iterator which traverses the JMenuBar one menu at a time.
self
- a JMenuBarReturns an Iterator which traverses the JPopupMenu one MenuElement at a time.
self
- a JPopupMenuReturns an Iterator which traverses the JTabbedPane one Component tab at a time.
self
- a JTabbedPaneOverloads the left shift operator to provide an easy way to add components to a Container.
self
- a Containerc
- a Component to be added to the container.Overloads the left shift operator to provide an easy way to add buttons to a ButtonGroup.
self
- a ButtonGroupb
- an AbstractButton to be added to the buttonGroup.Overloads the left shift operator to provide an easy way to add elements to a DefaultListModel.
self
- a DefaultListModele
- an element to be added to the listModel.Overloads the left shift operator to provide an easy way to add items to a JComboBox.
self
- a JComboBoxi
- an item to be added to the comboBox.Overloads the left shift operator to provide an easy way to add items to a MutableComboBoxModel.
self
- a MutableComboBoxModeli
- an item to be added to the model.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
self
- a DefaultTableModelrow
- a row to be added to the model.Overloads the left shift operator to provide an easy way to add columns to a TableColumnModel.
self
- a TableColumnModelcolumn
- a TableColumn to be added to the model.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.
self
- a TreePathp
- an object to be added to the treePath.Overloads the left shift operator to provide an easy way to add nodes to a MutableTreeNode.
self
- a MutableTreeNodenode
- a node to be added to the treeNode.Overloads the left shift operator to provide an easy way to add nodes to a DefaultMutableTreeNode.
self
- a DefaultMutableTreeNodenode
- a node to be added to the treeNode.Overloads the left shift operator to provide an easy way to add components to a menu.
self
- a JMenuaction
- an action to be added to the menu.Overloads the left shift operator to provide an easy way to add components to a menu.
self
- a JMenucomponent
- a component to be added to the menu.Overloads the left shift operator to provide an easy way to add components to a menu.
self
- a JMenuitem
- an item to be added to the menu.Overloads the left shift operator to provide an easy way to add components to a menu.
self
- a JMenustr
- a String to be added to the menu.Overloads the left shift operator to provide an easy way to add components to a menu.
self
- a JMenugstr
- a GString to be added to the menu.Overloads the left shift operator to provide an easy way to add menus to a menuBar.
self
- a JMenuBarmenu
- a menu to be added to the menuBar.Overloads the left shift operator to provide an easy way to add components to a popupMenu.
self
- a JPopupMenuaction
- an action to be added to the popupMenu.Overloads the left shift operator to provide an easy way to add components to a popupMenu.
self
- a JPopupMenucomponent
- a component to be added to the popupMenu.Overloads the left shift operator to provide an easy way to add components to a popupMenu.
self
- a JPopupMenuitem
- an item to be added to the popupMenu.Overloads the left shift operator to provide an easy way to add components to a popupMenu.
self
- a JPopupMenustr
- a String to be added to the popupMenu.Overloads the left shift operator to provide an easy way to add components to a popupMenu.
self
- a JPopupMenugstr
- a GString to be added to the popupMenu.Overloads the left shift operator to provide an easy way to add components to a toolBar.
self
- a JToolBaraction
- an Action to be added to the toolBar.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.
self
- a DefaultListModelindex
- an indexe
- the element to insert at the given indexAllow 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.
self
- a MutableComboBoxModelindex
- an indexi
- the item to insert at the given indexAllow 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
self
- a DefaultTableModelindex
- an indexrow
- the row to insert at the given indexAllow 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.
self
- a MutableTreeNodeindex
- an indexnode
- the node to insert at the given indexAllows the usage of a one-element string for a mnemonic
button
- a AbstractButtonmnemonic
- the String Provide the standard Groovy size()
method for Container
.
self
- a Container Provide the standard Groovy size()
method for ButtonGroup
.
self
- a ButtonGroup Provide the standard Groovy size()
method for ListModel
.
self
- a ListModel Provide the standard Groovy size()
method for JComboBox
.
self
- a JComboBox Provide the standard Groovy size()
method for TableModel
.
self
- a TableModel Provide the standard Groovy size()
method for TableColumnModel
.
self
- a TableColumnModel Provide the standard Groovy size()
method for TreePath
.
self
- a TreePath Provide the standard Groovy size()
method for TreeNode
.
self
- a TreeNode Provide the standard Groovy size()
method for JMenu
.
self
- a JMenu Provide the standard Groovy size()
method for JMenuBar
.
self
- a JMenuBar Provide the standard Groovy size()
method for JTabbedPane
.
self
- a JTabbedPane