|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.jeta.open.gui.framework.JETAPanel
public class JETAPanel
A panel that supports locating components by name as well as supporting the
JETA controller/validation framework. Before adding components to this panel,
you should call Component.setName(java.lang.String)
. Components with unique
names can be accessed using the component getter methods in this class.
JETAPanel works with JETAController. Both classes follow the
Model-View-Controller architecture where JETAPanel is the view and
JETAController is the controller. Event handlers and listeners should be
declared in a JETAController derived class while view and layout code should
be confined to JETAPanel instances.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JETAPanel()
ctor |
|
JETAPanel(ComponentFinder finder)
ctor |
|
JETAPanel(LayoutManager layout)
ctor |
Method Summary | |
---|---|
protected ComponentFinder |
createComponentFinder()
Creates a component finder that is used to locate child components in this panel by name. |
void |
enableComponent(String commandId,
boolean bEnable)
Enables/Disables the component associated with the given name. |
Collection |
getAllNamedComponents()
Recursively searches an associated parent container for all components that are named. |
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. |
Component |
getComponentByName(String componentName)
Locates the first component found in this container hierarchy that has the given name. |
protected ComponentFinder |
getComponentFinder()
Returns the component finder associated with this panel |
Collection |
getComponentsByName(String compName)
Locates all components found in this container hierarchy that has the given name. |
JETAController |
getController()
Return the controller object that handles events for this panel. |
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. |
UIDirector |
getUIDirector()
Returns the UIDirector for this container. |
boolean |
isSelected(String compName)
Return the selected state of the AbstractButton that has the given name. |
void |
removeDescendent(String compName)
Locates the component with the given name and removes it from its parent. |
static void |
removeFromParent(Component comp)
Helper method that removes a component from its parent container. |
void |
reset()
Tells the implementation that any cached components should be flushed and reloaded because the parent container might have changed. |
protected void |
setComponentFinder(ComponentFinder finder)
Sets the component finder associated with this panel |
void |
setController(JETAController controller)
Sets the main controller that will handle events for this panel. |
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 |
setUIDirector(UIDirector director)
Sets the UIDirector for this panel. |
void |
setVisible(String compName,
boolean bVisible)
Shows/Hides the component with the given name. |
void |
updateComponents()
This is a helper method that simply forwards the call to the controller for this view (which forwards the call to the UIDirector if one exists) |
void |
updateComponents(EventObject evt)
This is a helper method that simply forwards the call to the controller for this view (which forwards the call to the UIDirector if one exists) |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JETAPanel()
public JETAPanel(LayoutManager layout)
public JETAPanel(ComponentFinder finder)
Method Detail |
---|
protected ComponentFinder createComponentFinder()
public void enableComponent(String commandId, boolean bEnable)
enableComponent
in interface JETAContainer
enableComponent
in interface SwingComponentSupport
commandId
- the name of the component to enable/disablebEnable
- true/false to enable/disablepublic boolean getBoolean(String compName)
getBoolean
in interface SwingComponentSupport
public AbstractButton getButton(String compName)
getButton
in interface SwingComponentSupport
public JCheckBox getCheckBox(String compName)
getCheckBox
in interface SwingComponentSupport
public JComboBox getComboBox(String compName)
getComboBox
in interface SwingComponentSupport
public Component getComponentByName(String componentName)
getComponentByName
in interface JETAContainer
getComponentByName
in interface ComponentFinder
componentName
- the name of the component to search for
protected ComponentFinder getComponentFinder()
public Collection getComponentsByName(String compName)
getComponentsByName
in interface JETAContainer
getComponentsByName
in interface ComponentFinder
compName
- the name of the components to search for
objects that have the given name.
public Collection getAllNamedComponents()
getAllNamedComponents
in interface ComponentFinder
public JETAController getController()
public int getInteger(String compName, int defaultValue)
getInteger
in interface SwingComponentSupport
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.
public JLabel getLabel(String compName)
getLabel
in interface SwingComponentSupport
public JList getList(String compName)
getList
in interface SwingComponentSupport
public JPanel getPanel(String compName)
getPanel
in interface SwingComponentSupport
public JProgressBar getProgressBar(String compName)
getProgressBar
in interface SwingComponentSupport
public JRadioButton getRadioButton(String compName)
getRadioButton
in interface SwingComponentSupport
public Object getSelectedItem(String compName)
getSelectedItem
in interface SwingComponentSupport
public JSpinner getSpinner(String compName)
getSpinner
in interface SwingComponentSupport
public JTable getTable(String compName)
getTable
in interface SwingComponentSupport
public JTabbedPane getTabbedPane(String compName)
getTabbedPane
in interface SwingComponentSupport
public JTextComponent getTextComponent(String compName)
getTextComponent
in interface SwingComponentSupport
public JTextField getTextField(String compName)
getTextField
in interface SwingComponentSupport
public String getText(String compName)
getText
in interface SwingComponentSupport
public JTree getTree(String compName)
getTree
in interface SwingComponentSupport
public UIDirector getUIDirector()
getUIDirector
in interface JETAContainer
public boolean isSelected(String compName)
isSelected
in interface SwingComponentSupport
getBoolean(java.lang.String)
public void removeDescendent(String compName)
compName
- the name of the component to locate.public static void removeFromParent(Component comp)
comp
- the component to removepublic void reset()
ComponentFinder
reset
in interface ComponentFinder
protected void setComponentFinder(ComponentFinder finder)
public void setUIDirector(UIDirector director)
public void setController(JETAController controller)
public void setVisible(String compName, boolean bVisible)
setVisible
in interface SwingComponentSupport
compName
- the name of the component to enable/disablebVisible
- show/hide the component/disablepublic void setSelected(String compName, boolean sel)
setSelected
in interface SwingComponentSupport
compName
- the name of the AbstractButton whose selected attribute to
set.sel
- the selected attribute to setpublic void setSelectedItem(String compName, Object value)
setSelectedItem
in interface SwingComponentSupport
public void setText(String compName, String txt)
setText
in interface SwingComponentSupport
compName
- the name of the JTextComponent whose text to settxt
- the text to setpublic void updateComponents()
public void updateComponents(EventObject evt)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |