|
||||||||||
| 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 JETAContainerenableComponent in interface SwingComponentSupportcommandId - the name of the component to enable/disablebEnable - true/false to enable/disablepublic boolean getBoolean(String compName)
getBoolean in interface SwingComponentSupportpublic AbstractButton getButton(String compName)
getButton in interface SwingComponentSupportpublic JCheckBox getCheckBox(String compName)
getCheckBox in interface SwingComponentSupportpublic JComboBox getComboBox(String compName)
getComboBox in interface SwingComponentSupportpublic Component getComponentByName(String componentName)
getComponentByName in interface JETAContainergetComponentByName in interface ComponentFindercomponentName - the name of the component to search for
protected ComponentFinder getComponentFinder()
public Collection getComponentsByName(String compName)
getComponentsByName in interface JETAContainergetComponentsByName in interface ComponentFindercompName - the name of the components to search for
objects that have the given name.public Collection getAllNamedComponents()
getAllNamedComponents in interface ComponentFinderpublic JETAController getController()
public int getInteger(String compName,
int defaultValue)
getInteger in interface SwingComponentSupportcompName - 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 SwingComponentSupportpublic JList getList(String compName)
getList in interface SwingComponentSupportpublic JPanel getPanel(String compName)
getPanel in interface SwingComponentSupportpublic JProgressBar getProgressBar(String compName)
getProgressBar in interface SwingComponentSupportpublic JRadioButton getRadioButton(String compName)
getRadioButton in interface SwingComponentSupportpublic Object getSelectedItem(String compName)
getSelectedItem in interface SwingComponentSupportpublic JSpinner getSpinner(String compName)
getSpinner in interface SwingComponentSupportpublic JTable getTable(String compName)
getTable in interface SwingComponentSupportpublic JTabbedPane getTabbedPane(String compName)
getTabbedPane in interface SwingComponentSupportpublic JTextComponent getTextComponent(String compName)
getTextComponent in interface SwingComponentSupportpublic JTextField getTextField(String compName)
getTextField in interface SwingComponentSupportpublic String getText(String compName)
getText in interface SwingComponentSupportpublic JTree getTree(String compName)
getTree in interface SwingComponentSupportpublic UIDirector getUIDirector()
getUIDirector in interface JETAContainerpublic boolean isSelected(String compName)
isSelected in interface SwingComponentSupportgetBoolean(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 ComponentFinderprotected void setComponentFinder(ComponentFinder finder)
public void setUIDirector(UIDirector director)
public void setController(JETAController controller)
public void setVisible(String compName,
boolean bVisible)
setVisible in interface SwingComponentSupportcompName - the name of the component to enable/disablebVisible - show/hide the component/disable
public void setSelected(String compName,
boolean sel)
setSelected in interface SwingComponentSupportcompName - the name of the AbstractButton whose selected attribute to
set.sel - the selected attribute to set
public void setSelectedItem(String compName,
Object value)
setSelectedItem in interface SwingComponentSupport
public void setText(String compName,
String txt)
setText in interface SwingComponentSupportcompName - 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 | |||||||||