001: /* Copyright (C) 2003 Finalist IT Group
002: *
003: * This file is part of JAG - the Java J2EE Application Generator
004: *
005: * JAG is free software; you can redistribute it and/or modify
006: * it under the terms of the GNU General Public License as published by
007: * the Free Software Foundation; either version 2 of the License, or
008: * (at your option) any later version.
009: * JAG is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU General Public License for more details.
013: * You should have received a copy of the GNU General Public License
014: * along with JAG; if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
016: */
017: package com.finalist.jaggenerator;
018:
019: /**
020: *
021: * @author hillie
022: */
023: public class ConnectView extends javax.swing.JDialog {
024: private JagGenerator jg;
025:
026: /** Creates new form DTOGenView */
027: public ConnectView(JagGenerator jg) {
028: this .jg = jg;
029: initComponents();
030: UrlTextField
031: .setText("jdbc:oracle:thin:@192.168.0.60:1521:sample");
032: UsernameTextField.setText("FACTURENONLINE");
033: PasswordTextField.setText("FACTURENONLINE");
034: }
035:
036: public void setUndecorated(boolean val) {
037: }
038:
039: /** This method is called from within the constructor to
040: * initialize the form.
041: * WARNING: Do NOT modify this code. The content of this method is
042: * always regenerated by the Form Editor.
043: */
044: private void initComponents() {//GEN-BEGIN:initComponents
045: UrlLabel = new javax.swing.JLabel();
046: UsernameLabel = new javax.swing.JLabel();
047: PasswordLabel = new javax.swing.JLabel();
048: UrlTextField = new javax.swing.JTextField();
049: UsernameTextField = new javax.swing.JTextField();
050: PasswordTextField = new javax.swing.JTextField();
051: ConnectButton = new javax.swing.JButton();
052:
053: getContentPane().setLayout(
054: new org.netbeans.lib.awtextra.AbsoluteLayout());
055:
056: setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
057: setUndecorated(true);
058: addWindowListener(new java.awt.event.WindowAdapter() {
059: public void windowClosing(java.awt.event.WindowEvent evt) {
060: exitForm(evt);
061: }
062: });
063:
064: UrlLabel.setText("Database URL");
065: getContentPane().add(
066: UrlLabel,
067: new org.netbeans.lib.awtextra.AbsoluteConstraints(20,
068: 20, 120, -1));
069:
070: UsernameLabel.setText("Username");
071: getContentPane().add(
072: UsernameLabel,
073: new org.netbeans.lib.awtextra.AbsoluteConstraints(20,
074: 40, 100, -1));
075:
076: PasswordLabel.setText("Password");
077: getContentPane().add(
078: PasswordLabel,
079: new org.netbeans.lib.awtextra.AbsoluteConstraints(20,
080: 60, -1, -1));
081:
082: getContentPane().add(
083: UrlTextField,
084: new org.netbeans.lib.awtextra.AbsoluteConstraints(110,
085: 20, 370, -1));
086:
087: getContentPane().add(
088: UsernameTextField,
089: new org.netbeans.lib.awtextra.AbsoluteConstraints(110,
090: 40, 170, -1));
091:
092: getContentPane().add(
093: PasswordTextField,
094: new org.netbeans.lib.awtextra.AbsoluteConstraints(110,
095: 60, 170, -1));
096:
097: ConnectButton.setText("Connect");
098: ConnectButton
099: .addActionListener(new java.awt.event.ActionListener() {
100: public void actionPerformed(
101: java.awt.event.ActionEvent evt) {
102: ConnectButtonActionPerformed(evt);
103: }
104: });
105:
106: getContentPane().add(
107: ConnectButton,
108: new org.netbeans.lib.awtextra.AbsoluteConstraints(150,
109: 100, -1, -1));
110:
111: pack();
112: }//GEN-END:initComponents
113:
114: private void ConnectButtonActionPerformed(
115: java.awt.event.ActionEvent evt)//GEN-FIRST:event_ConnectButtonActionPerformed
116: {//GEN-HEADEREND:event_ConnectButtonActionPerformed
117: String url = UrlTextField.getText();
118: String username = UsernameTextField.getText();
119: String password = PasswordTextField.getText();
120: String[] showTableTypes = { "TABLE" };
121: jg.setConManager(new GenericJdbcManager(url, username,
122: password, jg.root.datasource.getDatabase()
123: .getDriverClass(), showTableTypes));
124: this .dispose();
125: }//GEN-LAST:event_ConnectButtonActionPerformed
126:
127: /** Exit the Application */
128: private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
129: System.exit(-1);
130: }//GEN-LAST:event_exitForm
131:
132: // Variables declaration - do not modify//GEN-BEGIN:variables
133: private javax.swing.JTextField UrlTextField;
134: private javax.swing.JLabel PasswordLabel;
135: private javax.swing.JTextField UsernameTextField;
136: private javax.swing.JLabel UrlLabel;
137: private javax.swing.JLabel UsernameLabel;
138: private javax.swing.JButton ConnectButton;
139: private javax.swing.JTextField PasswordTextField;
140: // End of variables declaration//GEN-END:variables
141:
142: }
|