com.jeta.open.support
Interface SwingComponentSupport

All Superinterfaces:
ComponentFinder
All Known Subinterfaces:
FormAccessor
All Known Implementing Classes:
FormPanel, JETAPanel

public interface SwingComponentSupport
extends ComponentFinder

Interface that defines common methods for working with SwingComponents in a Container.


Method Summary
 void enableComponent(String commandId, boolean bEnable)
          Enables/Disables the component associated with the commandid
 boolean getBoolean(String compName)
          Returns the selected state of the AbstractButton that has the given name.
 AbstractButton getButton(String compName)
          Returns the button that is contained in this panel and has the given name.
 JCheckBox getCheckBox(String compName)
          Returns the JCheckBox that is contained in this panel and has the given name.
 JComboBox getComboBox(String compName)
          Returns the JComboBox that is contained in this panel and has the given name.
 int getInteger(String compName, int defaultValue)
          Locates the JTextField that has the given component name.
 JLabel getLabel(String compName)
          Returns the JLabel that is contained in this panel and has the given name.
 JList getList(String compName)
          Returns the JList that is contained in this panel and has the given name.
 JPanel getPanel(String compName)
          Returns the JPanel that is contained in this panel and has the given name.
 JProgressBar getProgressBar(String compName)
          Returns JProgressBar that is contained in this panel and has the given name.
 JRadioButton getRadioButton(String compName)
          Returns the JRadioButton that is contained in this panel and has the given name.
 Object getSelectedItem(String compName)
          Returns the selected item from the JList or JComboBox that has the given name.
 JSpinner getSpinner(String compName)
          Returns JSpinner that is contained in this panel and has the given name.
 JTabbedPane getTabbedPane(String compName)
          Returns the JTabbedPane that is contained in this panel and has the given name.
 JTable getTable(String compName)
          Returns the JTable that is contained in this panel and has the given name.
 String getText(String compName)
          Returns the text property from a Component.
 JTextComponent getTextComponent(String compName)
          Returns the JTextComponent that is contained in this panel and has the given name.
 JTextField getTextField(String compName)
          Returns the JTextField that is contained in this panel and has the given name.
 JTree getTree(String compName)
          Returns the JTree that is contained in this panel and has the given name.
 boolean isSelected(String compName)
          Return the selected state of the AbstractButton that has the given name.
 void setSelected(String compName, boolean sel)
          Sets the selected attribute for the AbstractButton with the given name.
 void setSelectedItem(String compName, Object value)
          Sets the selected item in a JComboBox that has the given name.
 void setText(String compName, String txt)
          Sets text property for the Component with the given name.
 void setVisible(String compName, boolean bVisible)
          Shows/Hides the component with the given name.
 
Methods inherited from interface com.jeta.open.support.ComponentFinder
getAllNamedComponents, getComponentByName, getComponentsByName, reset
 

Method Detail

enableComponent

void enableComponent(String commandId,
                     boolean bEnable)
Enables/Disables the component associated with the commandid

Parameters:
commandId - the id of the command whose button to enable/disable
bEnable - true/false to enable/disable

getBoolean

boolean getBoolean(String compName)
Returns the selected state of the AbstractButton that has the given name. If a component is found with the given name and that component is not an AbstractButton, then false is returned.

Returns:
the selected state of the named AbstractButton.

getButton

AbstractButton getButton(String compName)
Returns the button that is contained in this panel and has the given name. If the component is not found nor is an AbstractButton, null is returned.

Returns:
the named AbstractButton

getCheckBox

JCheckBox getCheckBox(String compName)
Returns the JCheckBox that is contained in this panel and has the given name. If the component is not found nor is a JCheckBox, null is returned.

Returns:
the named JCheckBox

getComboBox

JComboBox getComboBox(String compName)
Returns the JComboBox that is contained in this panel and has the given name. If the component is not found nor is a JComboBox, null is returned.

Returns:
the named JComboBox

getInteger

int getInteger(String compName,
               int defaultValue)
Locates the JTextField that has the given component name. The text in the field is converted to an integer and returned. If the text cannot be converted to an integer or the component is not a JTextField, the defaultValue is returned.

Parameters:
compName - the JTextField to find.
defaultValue - the value to return if the component is not a JTextField or the text in the field is not an integer.
Returns:
the text converted to an integer.

getLabel

JLabel getLabel(String compName)
Returns the JLabel that is contained in this panel and has the given name. If the component is not found nor is a JLabel, null is returned.

Returns:
the named JLabel.

getList

JList getList(String compName)
Returns the JList that is contained in this panel and has the given name. If the component is not found nor is a JList, null is returned.

Returns:
the named JList

getPanel

JPanel getPanel(String compName)
Returns the JPanel that is contained in this panel and has the given name. If the component is not found nor is a JPanel, null is returned.

Returns:
the named JPanel

getProgressBar

JProgressBar getProgressBar(String compName)
Returns JProgressBar that is contained in this panel and has the given name. If the component is not found nor is a JProgressBar, null is returned.

Returns:
the named JProgressBar.

getRadioButton

JRadioButton getRadioButton(String compName)
Returns the JRadioButton that is contained in this panel and has the given name. If the component is not found nor is a JRadioButton, null is returned.

Returns:
the named JRadioButton

getSelectedItem

Object getSelectedItem(String compName)
Returns the selected item from the JList or JComboBox that has the given name. If a list or combo is not found with the name, null is returned.

Returns:
the selected item from the named JList or JComboBox.

getSpinner

JSpinner getSpinner(String compName)
Returns JSpinner that is contained in this panel and has the given name. If the component is not found nor is a JSpinner, null is returned.

Returns:
the named JSpinner

getTable

JTable getTable(String compName)
Returns the JTable that is contained in this panel and has the given name. If the component is not found nor is a JTable, null is returned.

Returns:
the named JTable

getTabbedPane

JTabbedPane getTabbedPane(String compName)
Returns the JTabbedPane that is contained in this panel and has the given name. If the component is not found nor is a JTabbedPane, null is returned.

Returns:
the named JTabbedPane

getTextComponent

JTextComponent getTextComponent(String compName)
Returns the JTextComponent that is contained in this panel and has the given name. If the component is not found nor is a JTextComponent, null is returned.

Returns:
the named JTextComponent

getTextField

JTextField getTextField(String compName)
Returns the JTextField that is contained in this panel and has the given name. If the component is not found nor is a JTextField, null is returned.

Returns:
the named JTextField

getText

String getText(String compName)
Returns the text property from a Component. If a component is not found with the given name or a component does not have a text property, then null is returned.

Returns:
the text property.

getTree

JTree getTree(String compName)
Returns the JTree that is contained in this panel and has the given name. If the component is not found nor is a JTree, null is returned.

Returns:
the named JTree

isSelected

boolean isSelected(String compName)
Return the selected state of the AbstractButton that has the given name. If a component is found with the given name and that component is not an AbstractButton, then false is returned.

See Also:
SwingCompnentSupport#getBoolean

setVisible

void setVisible(String compName,
                boolean bVisible)
Shows/Hides the component with the given name.

Parameters:
compName - the name of the component to enable/disable
bVisible - show/hide the component/disable

setSelected

void setSelected(String compName,
                 boolean sel)
Sets the selected attribute for the AbstractButton with the given name. If a component is found with the given name and that component is not an AbstractButton, this call is ignored.

Parameters:
compName - the name of the AbstractButton whose selected attribute to set.
sel - the selected attribute to set

setSelectedItem

void setSelectedItem(String compName,
                     Object value)
Sets the selected item in a JComboBox that has the given name. If a combo is not found with the name, no action is performed.


setText

void setText(String compName,
             String txt)
Sets text property for the Component with the given name. If no component is found or the Component does not have a text property, then this method is a no op.

Parameters:
compName - the name of the JTextComponent whose text to set
txt - the text to set


Copyright © 2005-2007 Jeff Tassin & Todd Viegut. All Rights Reserved.