Java Doc for FormAccessor.java in  » Swing-Library » abeille-forms-designer » com » jeta » forms » gui » form » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » abeille forms designer » com.jeta.forms.gui.form 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.jeta.forms.gui.form.FormAccessor

All known Subclasses:   com.jeta.forms.gui.form.GridView,
FormAccessor
public interface FormAccessor extends SwingComponentSupport(Code)
A FormAccessor is used to programmatically access and modify components on a form.

You should always use FormAccessors instead of modifying the underlying Container directly. The main reason is because the forms component hierachy may change in the future.

FormAccessors only modify the form they are associated with. A form can have nested forms, but FormAccessors do not access nested forms (except when using nested iterators).

Be careful when using components that have implicit JScrollPanes. The designer allows you to set a scroll property for those components that are scrollable (for example JTree, JTable, JList), and the forms runtime automatically creates JScrollPanes for those components you specifiy as scrollable. When iterating over a container, implicit scroll pane instances will be returned rather than the underlying Java bean for those scrollable components.

FormAccessors provide direct access to the underlying FormLayout and its assciated container. It is not recommended that you programmatically create CellConstraints and change the layout using hard-coded column and row values. The reason is because it is very easy to modify the form using the Forms Designer. Any modificiations can break code that has hard-coded columns and rows. The best approach is to name all of your components (including the scrollpanes) and access them by name whenever possible. This applies to wizard-like GUIs as well. It is recommended that in these cases, you provide a dummy component on the form such as an empty JLabel. You can then replace the dummy component with another component at runtime (via replaceBean ).


author:
   Jeff Tassin





Method Summary
public  voidaddBean(Component comp, CellConstraints cc)
     Adds a bean to this container using the given constraints.
Parameters:
  comp - the bean to add to the form.
Parameters:
  cc - the constraints for the bean.
public  IteratorbeanIterator()
     Defaults to beanIterator(false).
public  IteratorbeanIterator(boolean nested)
     An iterator for a collection of Java Beans (java.awt.Component objects) contained by a FormPanel.
public  CellConstraintsgetConstraints(Component comp)
     Returns a CellConstraints instance associated with the given component.
public  ContainergetContainer()
     Return the actual container that has the given layout.
public  StringgetFormName()
     Returns the name assigned to the form component associated with this accessor.
public  ComponentremoveBean(Component comp)
     Removes a bean from the container associated with this accessor.
public  ComponentremoveBean(String compName)
     Removes a bean with the given name from the container associated with this accessor.
public  ComponentreplaceBean(Component oldComp, Component newComponent)
     Replaces an existing bean with a new bean.
public  ComponentreplaceBean(String compName, Component newComponent)
     Locates an existing bean with the given name and replaces it with a new bean.



Method Detail
addBean
public void addBean(Component comp, CellConstraints cc)(Code)
Adds a bean to this container using the given constraints.
Parameters:
  comp - the bean to add to the form.
Parameters:
  cc - the constraints for the bean. This must be a validCellConstraints instance.



beanIterator
public Iterator beanIterator()(Code)
Defaults to beanIterator(false). See FormAccessor.beanIterator(boolean) an iterator to all the Java Beans in this container. Beans innested containers are not included.



beanIterator
public Iterator beanIterator(boolean nested)(Code)
An iterator for a collection of Java Beans (java.awt.Component objects) contained by a FormPanel. Only components that occupy a cell in the grid on the form are returned - not children of those components. For example, if you have a Java Bean such as a calendar that has several child components, only the calendar instance will be returned. This iterator will not return the child components of that bean. However, if a component is a nested form and the nested parameter is true, then this iterator will return the components in the nested form (as well as the form itself). If an iterator encounters a nested form instance, that object will be returned (regardless of whether the nested flag is set). A component is a nested form if it is an instance of a FormAccessor:
 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 } }
 
The 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 true, then the iterator will fail if components are added to any FormAccessor in the form hierarchy. You may safely call remove on the iterator if you want to remove the component from the form. Note that you should not modify the underlying form container by calling the Container methods directly. This is not recommended and can also leave the form in an undefined state.
Parameters:
  nested - if true, all components in nested forms will be returned. an iterator to all the Java Beans in this container.



getConstraints
public CellConstraints getConstraints(Component comp)(Code)
Returns a CellConstraints instance associated with the given component. If the component is not contained by the form associated with this accessor, null is returned. the constraints associated with the given component.



getContainer
public Container getContainer()(Code)
Return the actual container that has the given layout. This method should rarely be called. It is only provided for very limited cased. If you need to access the underlying FormLayout, you can retrieve it from the Container returned by this call. the container associated with the FormLayout



getFormName
public String getFormName()(Code)
Returns the name assigned to the form component associated with this accessor. the name assigned to the form component associated with thisaccessor.



removeBean
public Component removeBean(Component comp)(Code)
Removes a bean from the container associated with this accessor. If the given component is contained by an implicit JScrollPane or is an implicit JSCrollPane, the JScrollPane is removed.
Parameters:
  comp - the component to remove. the component that was removed. If this method fails for anyreason then null is returned.



removeBean
public Component removeBean(String compName)(Code)
Removes a bean with the given name from the container associated with this accessor. The bean must be contained within the current form. This method will not remove beans in nested forms. If compName refers to a component contained by an implicit JScrollPane or compName directly refers to an implicit JSCrollPane, the JScrollPane is removed.
Parameters:
  compName - the name of the Java Bean to remove. the component that was removed. If this method fails for anyreason then null is returned.



replaceBean
public Component replaceBean(Component oldComp, Component newComponent)(Code)
Replaces an existing bean with a new bean. If the old component is contained by an implicit JScrollPane or is an implicit JSCrollPane, the JScrollPane is replaced.
Parameters:
  oldComp - the component to replace
Parameters:
  newComponent - the component to add. the component that was replaced. If this method fails for anyreason then null is returned.



replaceBean
public Component replaceBean(String compName, Component newComponent)(Code)
Locates an existing bean with the given name and replaces it with a new bean. The bean must be contained within the current form. This method will not remove beans in nested forms. If the old component is contained by an implicit JScrollPane or is an implicit JSCrollPane, the JScrollPane is replaced.
Parameters:
  compName - the name of the component to replace.
Parameters:
  newComponent - the component to add. the component that was replaced. If this method fails for anyreason then null is returned.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.