|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.groovy.runtime.SwingGroovyMethods
public class SwingGroovyMethods
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.
| Constructor Summary | |
|---|---|
SwingGroovyMethods()
|
|
| Method Summary | |
|---|---|
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.tree.DefaultMutableTreeNode self)
Removes all children nodes from the DefaultMutableTreeNode. |
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 javax.swing.AbstractButton |
getAt(javax.swing.ButtonGroup self,
int index)
Support the subscript operator for ButtonGroup. |
static java.awt.Component |
getAt(java.awt.Container self,
int index)
Support the subscript operator for Container. |
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<javax.swing.AbstractButton> |
iterator(javax.swing.ButtonGroup self)
Returns an Iterator which traverses the ButtonGroup one AbstractButton at a time. |
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 |
iterator(javax.swing.DefaultListModel self)
Returns an Iterator which traverses the DefaultListModel one element 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 |
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<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 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 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.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.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.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.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.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.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,
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,
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,
javax.swing.JMenuItem item)
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.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,
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,
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,
javax.swing.JMenuItem item)
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.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.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.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.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.table.DefaultTableModel self,
int index,
java.lang.Object row)
Allow DefaultTableModel 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.tree.MutableTreeNode self,
int index,
javax.swing.tree.MutableTreeNode node)
Allow MutableTreeNode to work with subscript operators. |
static int |
size(javax.swing.ButtonGroup self)
Provide the standard Groovy size() method for ButtonGroup. |
static int |
size(java.awt.Container self)
Provide the standard Groovy size() method for Container. |
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 |
|---|
public SwingGroovyMethods()
| Method Detail |
|---|
public static int size(java.awt.Container self)
size() method for Container.
self - a Container
public static java.awt.Component getAt(java.awt.Container self,
int index)
self - a Containerindex - the index of the Component to get
public static java.awt.Container leftShift(java.awt.Container self,
java.awt.Component c)
self - a Containerc - a Component to be added to the container.
public static java.util.Iterator<java.awt.Component> iterator(java.awt.Container self)
Iterator which traverses the Container one Component at a time.
self - a Container
public static void clear(java.awt.Container self)
self - a Containerpublic static int size(javax.swing.ButtonGroup self)
size() method for ButtonGroup.
self - a ButtonGroup
public static javax.swing.AbstractButton getAt(javax.swing.ButtonGroup self,
int index)
self - a ButtonGroupindex - the index of the AbstractButton to get
public static javax.swing.ButtonGroup leftShift(javax.swing.ButtonGroup self,
javax.swing.AbstractButton b)
self - a ButtonGroupb - an AbstractButton to be added to the buttonGroup.
public static java.util.Iterator<javax.swing.AbstractButton> iterator(javax.swing.ButtonGroup self)
Iterator which traverses the ButtonGroup one AbstractButton at a time.
self - a ButtonGroup
public static int size(javax.swing.ListModel self)
size() method for ListModel.
self - a ListModel
public static java.lang.Object getAt(javax.swing.ListModel self,
int index)
self - a ListModelindex - the index of the element to get
public static java.util.Iterator iterator(javax.swing.ListModel self)
Iterator which traverses the ListModel one element at a time.
self - a ListModel
public static javax.swing.DefaultListModel leftShift(javax.swing.DefaultListModel self,
java.lang.Object e)
self - a DefaultListModele - an element to be added to the listModel.
public static void putAt(javax.swing.DefaultListModel self,
int index,
java.lang.Object e)
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 indexpublic static void clear(javax.swing.DefaultListModel self)
self - a DefaultListModelpublic static java.util.Iterator iterator(javax.swing.DefaultListModel self)
Iterator which traverses the DefaultListModel one element at a time.
self - a DefaultListModel
public static int size(javax.swing.JComboBox self)
size() method for JComboBox.
self - a JComboBox
public static java.lang.Object getAt(javax.swing.JComboBox self,
int index)
self - a JComboBoxindex - the index of the item to get
public static javax.swing.JComboBox leftShift(javax.swing.JComboBox self,
java.lang.Object i)
self - a JComboBoxi - an item to be added to the comboBox.
public static void clear(javax.swing.JComboBox self)
self - a JComboBoxpublic static java.util.Iterator iterator(javax.swing.JComboBox self)
Iterator which traverses the ComboBox one item at a time.
self - a ComboBox
public static javax.swing.MutableComboBoxModel leftShift(javax.swing.MutableComboBoxModel self,
java.lang.Object i)
self - a MutableComboBoxModeli - an item to be added to the model.
public static void putAt(javax.swing.MutableComboBoxModel self,
int index,
java.lang.Object i)
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 indexpublic static java.util.Iterator iterator(javax.swing.MutableComboBoxModel self)
Iterator which traverses the MutableComboBoxModel one item at a time.
self - a MutableComboBoxModel
public static void clear(javax.swing.DefaultComboBoxModel self)
self - a DefaultComboBoxModelpublic static int size(javax.swing.table.TableModel self)
size() method for TableModel.
self - a TableModel
public static java.lang.Object[] getAt(javax.swing.table.TableModel self,
int index)
self - a TableModelindex - the index of the row to get
public static java.util.Iterator iterator(javax.swing.table.TableModel self)
Iterator which traverses the TableModel one row at a time.
self - a TableModel
public static javax.swing.table.DefaultTableModel leftShift(javax.swing.table.DefaultTableModel self,
java.lang.Object row)
if row.size < model.size -> row will be padded with nulls
self - a DefaultTableModelrow - a row to be added to the model.
public static void putAt(javax.swing.table.DefaultTableModel self,
int index,
java.lang.Object row)
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
self - a DefaultTableModelindex - an indexrow - the row to insert at the given indexpublic static java.util.Iterator iterator(javax.swing.table.DefaultTableModel self)
Iterator which traverses the DefaultTableModel one item at a time.
self - a DefaultTableModel
public static int size(javax.swing.table.TableColumnModel self)
size() method for TableColumnModel.
self - a TableColumnModel
public static javax.swing.table.TableColumn getAt(javax.swing.table.TableColumnModel self,
int index)
self - a TableColumnModelindex - the index of the column to get
public static java.util.Iterator<javax.swing.table.TableColumn> iterator(javax.swing.table.TableColumnModel self)
Iterator which traverses the TableColumnModel one TableColumn at a time.
self - a TableColumnModel
public static javax.swing.table.TableColumnModel leftShift(javax.swing.table.TableColumnModel self,
javax.swing.table.TableColumn column)
self - a TableColumnModelcolumn - a TableColumn to be added to the model.
public static int size(javax.swing.tree.TreePath self)
size() method for TreePath.
self - a TreePath
public static java.lang.Object getAt(javax.swing.tree.TreePath self,
int index)
self - a TreePathindex - the index of the path to get
public static javax.swing.tree.TreePath leftShift(javax.swing.tree.TreePath self,
java.lang.Object p)
WARNING: this operation returns a new TreePath, not the original one.
self - a TreePathp - an object to be added to the treePath.
public static java.util.Iterator iterator(javax.swing.tree.TreePath self)
Iterator which traverses the TreePath one path at a time.
self - a TreePath
public static int size(javax.swing.tree.TreeNode self)
size() method for TreeNode.
self - a TreeNode
public static javax.swing.tree.TreeNode getAt(javax.swing.tree.TreeNode self,
int index)
self - a TreeNodeindex - the index of the child node to get
public static java.util.Iterator<javax.swing.tree.TreeNode> iterator(javax.swing.tree.TreeNode self)
Iterator which traverses the TreeNode one node at a time.
self - a TreeNode
public static javax.swing.tree.MutableTreeNode leftShift(javax.swing.tree.MutableTreeNode self,
javax.swing.tree.MutableTreeNode node)
self - a MutableTreeNodenode - a node to be added to the treeNode.
public static void putAt(javax.swing.tree.MutableTreeNode self,
int index,
javax.swing.tree.MutableTreeNode node)
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 index
public static javax.swing.tree.DefaultMutableTreeNode leftShift(javax.swing.tree.DefaultMutableTreeNode self,
javax.swing.tree.DefaultMutableTreeNode node)
self - a DefaultMutableTreeNodenode - a node to be added to the treeNode.
public static void clear(javax.swing.tree.DefaultMutableTreeNode self)
self - a DefaultMutableTreeNodepublic static int size(javax.swing.JMenu self)
size() method for JMenu.
self - a JMenu
public static java.awt.Component getAt(javax.swing.JMenu self,
int index)
self - a JMenuindex - the index of the menu component to get
public static javax.swing.JMenu leftShift(javax.swing.JMenu self,
javax.swing.Action action)
self - a JMenuaction - an action to be added to the menu.
public static javax.swing.JMenu leftShift(javax.swing.JMenu self,
java.awt.Component component)
self - a JMenucomponent - a component to be added to the menu.
public static javax.swing.JMenu leftShift(javax.swing.JMenu self,
javax.swing.JMenuItem item)
self - a JMenuitem - an item to be added to the menu.
public static javax.swing.JMenu leftShift(javax.swing.JMenu self,
java.lang.String str)
self - a JMenustr - a String to be added to the menu.
public static javax.swing.JMenu leftShift(javax.swing.JMenu self,
GString gstr)
self - a JMenugstr - a GString to be added to the menu.
public static java.util.Iterator iterator(javax.swing.JMenu self)
Iterator which traverses the JMenu one component at a time.
self - a JMenu
public static int size(javax.swing.JMenuBar self)
size() method for JMenuBar.
self - a JMenuBar
public static javax.swing.JMenu getAt(javax.swing.JMenuBar self,
int index)
self - a JMenuBarindex - the index of the menu to get
public static javax.swing.JMenuBar leftShift(javax.swing.JMenuBar self,
javax.swing.JMenu menu)
self - a JMenuBarmenu - a menu to be added to the menuBar.
public static java.util.Iterator iterator(javax.swing.JMenuBar self)
Iterator which traverses the JMenuBar one menu at a time.
self - a JMenuBar
public static javax.swing.JPopupMenu leftShift(javax.swing.JPopupMenu self,
javax.swing.Action action)
self - a JPopupMenuaction - an action to be added to the popupMenu.
public static javax.swing.JPopupMenu leftShift(javax.swing.JPopupMenu self,
java.awt.Component component)
self - a JPopupMenucomponent - a component to be added to the popupMenu.
public static javax.swing.JPopupMenu leftShift(javax.swing.JPopupMenu self,
javax.swing.JMenuItem item)
self - a JPopupMenuitem - an item to be added to the popupMenu.
public static javax.swing.JPopupMenu leftShift(javax.swing.JPopupMenu self,
java.lang.String str)
self - a JPopupMenustr - a String to be added to the popupMenu.
public static javax.swing.JPopupMenu leftShift(javax.swing.JPopupMenu self,
GString gstr)
self - a JPopupMenugstr - a GString to be added to the popupMenu.
public static java.util.Iterator<javax.swing.MenuElement> iterator(javax.swing.JPopupMenu self)
Iterator which traverses the JPopupMenu one MenuElement at a time.
self - a JPopupMenu
public static int size(javax.swing.JTabbedPane self)
size() method for JTabbedPane.
self - a JTabbedPane
public static void clear(javax.swing.JTabbedPane self)
self - a JTabbedPane
public static java.awt.Component getAt(javax.swing.JTabbedPane self,
int index)
self - a JTabbedPaneindex - the index of the tab component to get
public static java.util.Iterator<java.awt.Component> iterator(javax.swing.JTabbedPane self)
Iterator which traverses the JTabbedPane one Component tab at a time.
self - a JTabbedPane
public static javax.swing.JToolBar leftShift(javax.swing.JToolBar self,
javax.swing.Action action)
self - a JToolBaraction - an Action to be added to the toolBar.
public static java.awt.Component getAt(javax.swing.JToolBar self,
int index)
self - a JToolBarindex - the index of the tab component to get
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||