| com.jeta.open.gui.framework.JETAPanel com.jeta.forms.components.panel.FormPanel
All known Subclasses: com.jeta.swingbuilder.gui.components.list.ItemsView, com.jeta.swingbuilder.gui.components.text.TextPropertyView, com.jeta.swingbuilder.gui.main.PasteSpecialView, com.jeta.swingbuilder.gui.components.panel.SwingBuilderPanel, com.jeta.swingbuilder.codegen.gui.config.OptionsView,
FormPanel | public class FormPanel extends JETAPanel (Code) | | This is the main panel class used to load and view a form during runtime.
Usage:
FormPanel panel = new FormPanel("com/mycorp/app/gui/login/loginView.jfrm");
It assumed that all form files are located in your classpath.
You should only use the published APIs to programmatically add, remove, or
access Swing Components from a form. If you need to programmatically change a
form, you use a FormAccessor, see
FormPanel.getFormAccessor(String) . If you
pass a valid form name, this method will return a FormAccessor instance. Use
FormAccessors to access the FormLayout or to add, remove, change, or
enumerate components in the underlying container.
FormPanel myform = new FormPanel( "test.jfrm" ); // where the main form in
test.jfrm is named "settings" FormAccessor form_accessor =
(FormAccessor)myform.getFormAccessor( "settings" ); // adds a component at
column 2 and row 5 form_accessor.addBean( new JButton("Test"), new
CellConstraints( 2, 5 ) );
// or replace the component named 'wizard.view' with a different
component. FormPanel wiz_view = new FormPanel( "pane2.jfrm" );
form_accessor.replaceBean( "wizard.view", wiz_view );
// use FormAccessor to iterate over components in a form as well
Iterator iter = formaccessor.beanIterator(); while( iter.hasNext() ) {
Component comp = (Component)iter.next(); if ( comp instanceof FormAccessor ) {
// found a nested form. // if this iterator is nested, the next
call to next() will // return components in the nested form. }
else { // found a standard Java Bean } }
author: Jeff Tassin |
FormPanel | public FormPanel(String formPath)(Code) | | FormPanel constructor. Loads the form from the given path. This
constructor does not throw an exception if the form resource cannot be
found. Instead, it will display an error message in the panel.
Parameters: formPath - the path to the form file. This path can be absolute orrelative to the classpath. |
FormPanel | public FormPanel(InputStream istream) throws FormException(Code) | | FormPanel constructor. Creates a FormPanel using the given InputStream.
The InputStream must reference a valid underlying .jfrm.
throws: FormException - if any type of I/O error occurs or the input stream is not avalid form file. |
FormPanel | public FormPanel(FormComponent fc)(Code) | | FormPanel constructor. Creates a FormPanel using the given FormComponent
as the content.
|
beanIterator | public Iterator beanIterator(boolean nested)(Code) | | Returns an iterator for a collection of Java Beans (java.awt.Component
objects) contained by this form and its nested forms. Only components
that occupy a cell in the grid on the form are returned - not children of
those components. So, if you have a Java Bean that has several child
components, only the Java Bean will be returned and not its children.
This iterator is fail-fast. If any components are added or removed by
invoking the underlying FormAccessors at any time after the Iterator is
created, the iterator will throw a ConcurrentModificationException. If
nested is set to true, then the iterator will fail if components are
added to any FormAccessor in the form hierarchy. If nested if
false, the iterator will fail only if modifications are made to the Form
associated with the current FormAccessor. You may safely call remove on
the iterator if you want to remove the component from the form.
an iterator to a collection of components (java.awt.Componentobjects) contained by this form. |
getFormAccessor | public FormAccessor getFormAccessor()(Code) | | Return an instance of a FormAccessor that is associated with the top-most
form in this panel (recall that a form can have nested forms). Use
FormAccessors if you want to programmatically change the underlying
FormLayout and/or container.
the FormAccessor associated with the topmost form in this panel. |
getFormAccessor | public FormAccessor getFormAccessor(String compName)(Code) | | Return an instance of a FormAccessor that has the given name. This is the
same name you gave to the form (either the main form or nested forms) in
the designer. Use FormAccessors if you want to programmatically change
the underlying FormLayout and/or container.
Parameters: compName - the name of the form to retrieve. the FormAccessor associated with the named form. Null is returnedif component cannot be found with the given name or if thecomponent is not a FormAccessor object. |
getFormContainer | public Container getFormContainer()(Code) | | Returns the parent container that contains the top-level form in this
panel. You should rarely have to call this method. Note that a better
and safer solution is to name the form in the builder and call
FormPanel.getFormAccessor(String) |
put | public void put(String objName, Object obj)(Code) | | Puts the given object into the user objects map. If an object already
exists for the given name, it is overwritten. Objects can be retrieved
from the map by calling
FormPanel.get(String) Parameters: objName - the name of the object Parameters: obj - the object |
revalidate | public void revalidate()(Code) | | Revalidates this panel.
|
setFocusTraversalPolicy | public void setFocusTraversalPolicy(FocusTraversalPolicy policy)(Code) | | Sets the focus traversal policy for this panel. Only call this if you
wish to override the default handling provided by the form.
|
updateFocusPolicy | public void updateFocusPolicy()(Code) | | If this form panel contains a form with a custom focus policy, you should
call updateFocusPolicy whenever you programatically add or remove
components from the form or any nested forms. If a custom focus policy
was not assigned in the Form Designer, then this method is not needed.
|
updateUI | public void updateUI()(Code) | | Override so we can update the underlying FormComponent
|
|
|