Source Code Cross Referenced for XmlEditorConnectionPane.java in  » Report » jmagallanes-1.0 » com » calipso » xmleditor » 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 » jmagallanes 1.0 » com.calipso.xmleditor 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.calipso.xmleditor;
002:
003:        import com.calipso.reportgenerator.common.LanguageTraslator;
004:
005:        import javax.swing.*;
006:        import javax.swing.text.JTextComponent;
007:        import javax.swing.text.Document;
008:        import java.awt.event.*;
009:        import java.awt.*;
010:        import java.util.Map;
011:
012:        /**
013:         *
014:         * User: jbassino
015:         * Date: 17/06/2004
016:         * Time: 15:56:50
017:         *
018:         */
019:        public class XmlEditorConnectionPane extends JDialog implements 
020:                ActionListener, WindowListener {
021:            JButton btnAccept;
022:            JButton btnCancel;
023:            JTextField txtDriverName;
024:            JTextField txtUrl;
025:            JTextField txtUser;
026:            JPasswordField pswPassword;
027:            JTextArea txtQuery;
028:            JTextField txtReportName;
029:            private boolean cancelled = false;
030:
031:            /**
032:             * Obtiene la variable que indica si el panel ha sido cancelado.
033:             * @return
034:             */
035:            public boolean isCancelled() {
036:                return cancelled;
037:            }
038:
039:            /**
040:             * Genera el panel de carga de parametros.
041:             * @param component
042:             */
043:            public XmlEditorConnectionPane(Frame component, boolean modal,
044:                    Map defaultParams) {
045:                super (component, modal);
046:                addWindowListener(this );
047:                setTitle(LanguageTraslator.traslate("549"));
048:                getContentPane().setLayout(new GridBagLayout());
049:                GridBagConstraints constrain = new GridBagConstraints();
050:
051:                txtReportName = new JTextField(LanguageTraslator
052:                        .traslate("550"), 50);
053:                addComponent(constrain, new JLabel(LanguageTraslator
054:                        .traslate("550")), 0, 0, 1, 1);
055:                addComponent(constrain, txtReportName, 0, 1, 1, 5);
056:
057:                txtQuery = new JTextArea("Query");
058:                txtQuery.setAutoscrolls(false);
059:                txtQuery.setRows(15);
060:                txtQuery.setLineWrap(true);
061:                JScrollPane jScrollPane = new JScrollPane(txtQuery);
062:                addComponent(constrain, new JLabel("Query "), 2, 0, 1, 1);
063:                addComponent(constrain, jScrollPane, 2, 1, 5, 10);
064:
065:                txtDriverName = new JTextField("Class Name ");
066:                if (defaultParams.containsKey(new String(
067:                        "DefaultConnectionClassName"))) {
068:                    txtDriverName.setText(defaultParams.get(
069:                            new String("DefaultConnectionClassName"))
070:                            .toString());
071:                }
072:                addComponent(constrain, new JLabel("Class Name "), 7, 0, 1, 1);
073:                addComponent(constrain, txtDriverName, 7, 1, 1, 5);
074:
075:                txtUrl = new JTextField("Local Url", 50);
076:                if (defaultParams.containsKey(new String(
077:                        "DefaultConnectionLocalUrl"))) {
078:                    txtUrl
079:                            .setText(defaultParams.get(
080:                                    new String("DefaultConnectionLocalUrl"))
081:                                    .toString());
082:                }
083:                addComponent(constrain, new JLabel("Local Url "), 8, 0, 1, 1);
084:                addComponent(constrain, txtUrl, 8, 1, 1, 5);
085:
086:                txtUser = new JTextField("User");
087:                if (defaultParams.containsKey(new String(
088:                        "DefaultConnectionUser"))) {
089:                    txtUser.setText(defaultParams.get(
090:                            new String("DefaultConnectionUser")).toString());
091:                }
092:                addComponent(constrain, new JLabel("User "), 9, 0, 1, 1);
093:                addComponent(constrain, txtUser, 9, 1, 1, 5);
094:
095:                pswPassword = new JPasswordField("Password", 25);
096:                if (defaultParams.containsKey(new String(
097:                        "DefaultConnectionPassword"))) {
098:                    pswPassword
099:                            .setText(defaultParams.get(
100:                                    new String("DefaultConnectionPassword"))
101:                                    .toString());
102:                }
103:                addComponent(constrain, new JLabel("Password "), 10, 0, 1, 1);
104:                addComponent(constrain, pswPassword, 10, 1, 1, 5);
105:
106:                JPanel pnlButton = new JPanel(new FlowLayout(FlowLayout.RIGHT));
107:                btnAccept = new JButton(LanguageTraslator.traslate("112"));
108:                btnAccept.addActionListener(this );
109:                pnlButton.add(btnAccept);
110:                btnCancel = new JButton(LanguageTraslator.traslate("113"));
111:                btnCancel.addActionListener(this );
112:                pnlButton.add(btnCancel);
113:                addComponent(constrain, pnlButton, 11, 4, 1, 2);
114:                setResizable(false);
115:                pack();
116:            }
117:
118:            /**
119:             * Agrega el item al panel con los parametros pasados para la GridBagConstraints.
120:             * @param constrain
121:             * @param component: el componente a agregar
122:             * @param row: el numero de fila en el que se agregara
123:             * @param col: el numero de columna en el que se agregara
124:             * @param height: las filas que ocupara
125:             * @param width: el numero de columnas que ocupara
126:             */
127:            private void addComponent(GridBagConstraints constrain,
128:                    Component component, int row, int col, int height, int width) {
129:                if (!(component instanceof  JButton)) {
130:                    constrain.fill = GridBagConstraints.HORIZONTAL;
131:                } else {
132:                    constrain.anchor = GridBagConstraints.WEST;
133:                }
134:                constrain.gridy = row;
135:                constrain.gridx = col;
136:                constrain.gridheight = height;
137:                constrain.gridwidth = width;
138:                ((GridBagLayout) getContentPane().getLayout()).setConstraints(
139:                        component, constrain);
140:                getContentPane().add(component);
141:            }
142:
143:            public void actionPerformed(ActionEvent e) {
144:
145:                this .dispose();
146:                if (e.getSource() == btnAccept) {
147:                    setCancelled(false);
148:                } else {
149:                    setCancelled(true);
150:                }
151:                /*}else if(e.getSource() == btnAccept){
152:                  listener.createReportDefinitionsFromSql(txtReportName.getText(),
153:                                                  txtDriverName.getText(),
154:                                                  txtUrl.getText(),
155:                                                  txtUser.getText(),
156:                                                  String.valueOf(pswPassword.getPassword()),
157:                                                  txtQuery.getText(),
158:                                                  Integer.valueOf(txtMetricStart.getText()).intValue());
159:                }*/
160:            }
161:
162:            private void setCancelled(boolean b) {
163:                this .cancelled = b;
164:            }
165:
166:            public String getReportName() {
167:                return txtReportName.getText();
168:            }
169:
170:            public String getClassName() {
171:                return txtDriverName.getText();
172:            }
173:
174:            public String getLocalUrl() {
175:                return txtUrl.getText();
176:            }
177:
178:            public String getUser() {
179:                return txtUser.getText();
180:            }
181:
182:            public char[] getPassword() {
183:                return pswPassword.getPassword();
184:            }
185:
186:            public String getSqlText() {
187:                return txtQuery.getText();
188:            }
189:
190:            public void windowActivated(WindowEvent e) {
191:            }
192:
193:            public void windowClosed(WindowEvent e) {
194:            }
195:
196:            public void windowClosing(WindowEvent e) {
197:                setCancelled(true);
198:            }
199:
200:            public void windowDeactivated(WindowEvent e) {
201:            }
202:
203:            public void windowDeiconified(WindowEvent e) {
204:            }
205:
206:            public void windowIconified(WindowEvent e) {
207:            }
208:
209:            public void windowOpened(WindowEvent e) {
210:            }
211:
212:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.