Source Code Cross Referenced for JavaBeanDataSourceConnectionEditor.java in  » Report » iReport-2.0.5 » it » businesslogic » ireport » connection » gui » 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 » Report » iReport 2.0.5 » it.businesslogic.ireport.connection.gui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * EJBQLConnectionEditor.java
003:         *
004:         * Created on March 27, 2007, 1:18 PM
005:         */
006:
007:        package it.businesslogic.ireport.connection.gui;
008:
009:        import it.businesslogic.ireport.IReportConnection;
010:        import it.businesslogic.ireport.IReportConnectionEditor;
011:        import it.businesslogic.ireport.connection.JavaBeanDataSourceConnection;
012:        import it.businesslogic.ireport.util.I18n;
013:
014:        /**
015:         *
016:         * @author  gtoffoli
017:         */
018:        public class JavaBeanDataSourceConnectionEditor extends
019:                javax.swing.JPanel implements  IReportConnectionEditor {
020:
021:            private IReportConnection iReportConnection = null;
022:            private boolean init = false;
023:
024:            /** Creates new form EJBQLConnectionEditor */
025:            public JavaBeanDataSourceConnectionEditor() {
026:                initComponents();
027:                applyI18n();
028:            }
029:
030:            /** This method is called from within the constructor to
031:             * initialize the form.
032:             * WARNING: Do NOT modify this code. The content of this method is
033:             * always regenerated by the Form Editor.
034:             */
035:            // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
036:            private void initComponents() {
037:                java.awt.GridBagConstraints gridBagConstraints;
038:
039:                buttonGroup1 = new javax.swing.ButtonGroup();
040:                jPanelBeansSet = new javax.swing.JPanel();
041:                jLabel12 = new javax.swing.JLabel();
042:                jTextFieldJBSetFactoryClass = new javax.swing.JTextField();
043:                jRadioButtonJBSetCollection = new javax.swing.JRadioButton();
044:                jRadioButtonJBSetArray = new javax.swing.JRadioButton();
045:                jLabel13 = new javax.swing.JLabel();
046:                jTextFieldJBSetMethodToCall = new javax.swing.JTextField();
047:                jCheckBoxisUseFieldDescription = new javax.swing.JCheckBox();
048:
049:                setLayout(new java.awt.BorderLayout());
050:
051:                jPanelBeansSet.setLayout(new java.awt.GridBagLayout());
052:
053:                jLabel12
054:                        .setText("Factory class (the class that will produce the set)");
055:                gridBagConstraints = new java.awt.GridBagConstraints();
056:                gridBagConstraints.gridx = 0;
057:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
058:                gridBagConstraints.weightx = 1.0;
059:                gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
060:                jPanelBeansSet.add(jLabel12, gridBagConstraints);
061:
062:                jTextFieldJBSetFactoryClass
063:                        .setText("it.businesslogic.ireport.connection.SampleJRDataSourceFactory");
064:                gridBagConstraints = new java.awt.GridBagConstraints();
065:                gridBagConstraints.gridx = 0;
066:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
067:                gridBagConstraints.weightx = 1.0;
068:                gridBagConstraints.insets = new java.awt.Insets(2, 4, 4, 4);
069:                jPanelBeansSet.add(jTextFieldJBSetFactoryClass,
070:                        gridBagConstraints);
071:
072:                buttonGroup1.add(jRadioButtonJBSetCollection);
073:                jRadioButtonJBSetCollection.setSelected(true);
074:                jRadioButtonJBSetCollection.setText(" Collection of javaBeans");
075:                gridBagConstraints = new java.awt.GridBagConstraints();
076:                gridBagConstraints.gridx = 0;
077:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
078:                gridBagConstraints.weightx = 1.0;
079:                gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
080:                jPanelBeansSet.add(jRadioButtonJBSetCollection,
081:                        gridBagConstraints);
082:
083:                buttonGroup1.add(jRadioButtonJBSetArray);
084:                jRadioButtonJBSetArray.setText("Array of javaBeans");
085:                jRadioButtonJBSetArray
086:                        .addActionListener(new java.awt.event.ActionListener() {
087:                            public void actionPerformed(
088:                                    java.awt.event.ActionEvent evt) {
089:                                jRadioButtonJBSetArrayActionPerformed(evt);
090:                            }
091:                        });
092:
093:                gridBagConstraints = new java.awt.GridBagConstraints();
094:                gridBagConstraints.gridx = 0;
095:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
096:                gridBagConstraints.weightx = 1.0;
097:                gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
098:                jPanelBeansSet.add(jRadioButtonJBSetArray, gridBagConstraints);
099:
100:                jLabel13
101:                        .setText("The static method to call to retrive the array or the the collection of javaBeans");
102:                gridBagConstraints = new java.awt.GridBagConstraints();
103:                gridBagConstraints.gridx = 0;
104:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
105:                gridBagConstraints.weightx = 1.0;
106:                gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
107:                jPanelBeansSet.add(jLabel13, gridBagConstraints);
108:
109:                jTextFieldJBSetMethodToCall.setText("createBeanCollection");
110:                gridBagConstraints = new java.awt.GridBagConstraints();
111:                gridBagConstraints.gridx = 0;
112:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
113:                gridBagConstraints.weightx = 1.0;
114:                gridBagConstraints.insets = new java.awt.Insets(2, 4, 4, 4);
115:                jPanelBeansSet.add(jTextFieldJBSetMethodToCall,
116:                        gridBagConstraints);
117:
118:                jCheckBoxisUseFieldDescription.setText("Use field description");
119:                jCheckBoxisUseFieldDescription
120:                        .setBorder(javax.swing.BorderFactory.createEmptyBorder(
121:                                0, 0, 0, 0));
122:                jCheckBoxisUseFieldDescription.setMargin(new java.awt.Insets(0,
123:                        0, 0, 0));
124:                gridBagConstraints = new java.awt.GridBagConstraints();
125:                gridBagConstraints.gridx = 0;
126:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
127:                gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
128:                gridBagConstraints.weightx = 1.0;
129:                gridBagConstraints.weighty = 1.0;
130:                gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
131:                jPanelBeansSet.add(jCheckBoxisUseFieldDescription,
132:                        gridBagConstraints);
133:
134:                add(jPanelBeansSet, java.awt.BorderLayout.CENTER);
135:
136:            }// </editor-fold>//GEN-END:initComponents
137:
138:            // Variables declaration - do not modify//GEN-BEGIN:variables
139:            private javax.swing.ButtonGroup buttonGroup1;
140:            private javax.swing.JCheckBox jCheckBoxisUseFieldDescription;
141:            private javax.swing.JLabel jLabel12;
142:            private javax.swing.JLabel jLabel13;
143:            private javax.swing.JPanel jPanelBeansSet;
144:            private javax.swing.JRadioButton jRadioButtonJBSetArray;
145:            private javax.swing.JRadioButton jRadioButtonJBSetCollection;
146:            private javax.swing.JTextField jTextFieldJBSetFactoryClass;
147:            private javax.swing.JTextField jTextFieldJBSetMethodToCall;
148:
149:            // End of variables declaration//GEN-END:variables
150:
151:            public void setIReportConnection(IReportConnection c) {
152:
153:                this .iReportConnection = c;
154:                if (iReportConnection instanceof  JavaBeanDataSourceConnection) {
155:                    JavaBeanDataSourceConnection con = (JavaBeanDataSourceConnection) iReportConnection;
156:                    this .jTextFieldJBSetFactoryClass.setText(con
157:                            .getFactoryClass());
158:                    this .jTextFieldJBSetMethodToCall.setText(con
159:                            .getMethodToCall());
160:                    this .jCheckBoxisUseFieldDescription.setSelected(con
161:                            .isUseFieldDescription());
162:                    if (con.getType().equals(con.BEAN_ARRAY)) {
163:                        jRadioButtonJBSetArray.setSelected(true);
164:                        jRadioButtonJBSetCollection.setSelected(false);
165:                    } else {
166:                        jRadioButtonJBSetArray.setSelected(false);
167:                        jRadioButtonJBSetCollection.setSelected(true);
168:                    }
169:                }
170:            }
171:
172:            public IReportConnection getIReportConnection() {
173:
174:                IReportConnection irConn = irConn = new JavaBeanDataSourceConnection();
175:
176:                ((JavaBeanDataSourceConnection) irConn)
177:                        .setFactoryClass(this .jTextFieldJBSetFactoryClass
178:                                .getText().trim());
179:                ((JavaBeanDataSourceConnection) irConn)
180:                        .setMethodToCall(this .jTextFieldJBSetMethodToCall
181:                                .getText().trim());
182:                ((JavaBeanDataSourceConnection) irConn)
183:                        .setUseFieldDescription(this .jCheckBoxisUseFieldDescription
184:                                .isSelected());
185:                if (jRadioButtonJBSetArray.isSelected()) {
186:                    ((JavaBeanDataSourceConnection) irConn)
187:                            .setType(JavaBeanDataSourceConnection.BEAN_ARRAY);
188:                } else {
189:                    ((JavaBeanDataSourceConnection) irConn)
190:                            .setType(JavaBeanDataSourceConnection.BEAN_COLLECTION);
191:                }
192:
193:                iReportConnection = irConn;
194:                return iReportConnection;
195:            }
196:
197:            private void jRadioButtonJBSetArrayActionPerformed(
198:                    java.awt.event.ActionEvent evt) {
199:
200:            }
201:
202:            public void applyI18n() {
203:                jCheckBoxisUseFieldDescription.setText(I18n.getString(
204:                        "connectionDialog.checkBoxisUseFieldDescription",
205:                        "Use field description"));
206:                jRadioButtonJBSetArray.setText(I18n.getString(
207:                        "connectionDialog.radioButtonJBSetArray",
208:                        "Array of javaBeans"));
209:                jRadioButtonJBSetCollection.setText(I18n.getString(
210:                        "connectionDialog.radioButtonJBSetCollection",
211:                        " Collection of javaBeans"));
212:
213:                jLabel12.setText(I18n.getString("connectionDialog.label12",
214:                        "Factory class (the class that will produce the set)"));
215:                jLabel13
216:                        .setText("<html>"
217:                                + I18n
218:                                        .getString(
219:                                                "connectionDialog.label13",
220:                                                "The static method to call to retrive the array or the the collection of javaBeans"));
221:            }
222:
223:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.