0001: /*
0002: * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved.
0003: * http://www.jaspersoft.com.
0004: *
0005: * Unless you have purchased a commercial license agreement from JasperSoft,
0006: * the following license terms apply:
0007: *
0008: * This program is free software; you can redistribute it and/or modify
0009: * it under the terms of the GNU General Public License version 2 as published by
0010: * the Free Software Foundation.
0011: *
0012: * This program is distributed WITHOUT ANY WARRANTY; and without the
0013: * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0014: * See the GNU General Public License for more details.
0015: *
0016: * You should have received a copy of the GNU General Public License
0017: * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
0018: * or write to:
0019: *
0020: * Free Software Foundation, Inc.,
0021: * 59 Temple Place - Suite 330,
0022: * Boston, MA USA 02111-1307
0023: *
0024: *
0025: *
0026: *
0027: * ConnectionDialog.java
0028: *
0029: * Created on 9 maggio 2003, 17.25
0030: *
0031: */
0032:
0033: package it.businesslogic.ireport.gui;
0034:
0035: import it.businesslogic.ireport.connection.JRCsvDataSourceInspector;
0036: import it.businesslogic.ireport.connection.JRHibernateConnection;
0037: import it.businesslogic.ireport.data.olap.CustomHTTPAuthenticator;
0038: import it.businesslogic.ireport.gui.locale.LocaleSelectorDialog;
0039: import it.businesslogic.ireport.gui.locale.TimeZoneDialog;
0040: import it.businesslogic.ireport.gui.sheet.Tag;
0041: import it.businesslogic.ireport.util.*;
0042: import it.businesslogic.ireport.*;
0043: import it.businesslogic.ireport.connection.*;
0044:
0045: import java.awt.Component;
0046: import java.io.File;
0047: import java.net.Authenticator;
0048: import java.sql.*;
0049: import java.text.SimpleDateFormat;
0050: import java.util.HashMap;
0051: import java.util.Iterator;
0052: import java.util.List;
0053: import java.util.Locale;
0054: import java.util.TimeZone;
0055: import java.util.Vector;
0056: import javax.swing.*;
0057: import javax.swing.table.DefaultTableModel;
0058: import org.hibernate.SessionFactory;
0059: import org.hibernate.cfg.Configuration;
0060:
0061: import rex.metadata.*;
0062: import rex.graphics.datasourcetree.elements.*;
0063:
0064: /**
0065: *
0066: * @author Administrator
0067: */
0068: public class ConnectionDialog extends javax.swing.JDialog {
0069: /** Creates new form JRParameterDialog */
0070:
0071: private boolean init = false;
0072: private Locale tmpXMLLocale = null;
0073: private TimeZone tmpXMLTimeZone = null;
0074:
0075: public ConnectionDialog(java.awt.Dialog parent, boolean modal) {
0076: super (parent, modal);
0077: initAll();
0078: }
0079:
0080: public ConnectionDialog(java.awt.Frame parent, boolean modal) {
0081:
0082: super (parent, modal);
0083: initAll();
0084: }
0085:
0086: public void initAll() {
0087: initComponents();
0088: // this.setSize(400, 300);
0089: applyI18n();
0090: this .pack();
0091: Misc.centerFrame(this );
0092: init = true;
0093:
0094: jComboBoxConnectionType.addItem(new Tag("0", I18n.getString(
0095: "connectionType.jdbc", "Database JDBC connection"))); // Type 0
0096: jComboBoxConnectionType.addItem(new Tag("1", I18n.getString(
0097: "connectionType.xml", "XML file datasource"))); // Type 1
0098: jComboBoxConnectionType
0099: .addItem(new Tag("2", I18n.getString(
0100: "connectionType.javabeans",
0101: "JavaBeans set datasource"))); // Type 2
0102: jComboBoxConnectionType.addItem(new Tag("3", I18n.getString(
0103: "connectionType.customDataSource",
0104: "Custom JRDataSource"))); // Type 3
0105: jComboBoxConnectionType.addItem(new Tag("4", I18n.getString(
0106: "connectionType.csv", "File CSV datasource"))); // Type 4
0107: jComboBoxConnectionType.addItem(new Tag("5", I18n.getString(
0108: "connectionType.datasourceProvider",
0109: "JRDataSourceProvider"))); // Type 5
0110: jComboBoxConnectionType.addItem(new Tag("6", I18n.getString(
0111: "connectionType.hibernate", "Hibernate connection"))); // Type 6
0112: jComboBoxConnectionType.addItem(new Tag("9", I18n.getString(
0113: "connectionType.hibernateSpring",
0114: "Spring loaded Hibernate connection"))); // Type 6
0115: jComboBoxConnectionType.addItem(new Tag("7", I18n.getString(
0116: "connectionType.ejbql", "EJBQL connection"))); // Type 7
0117: jComboBoxConnectionType.addItem(new Tag("8", I18n.getString(
0118: "connectionType.olap", "Mondrian OLAP connection"))); // Type 8
0119: jComboBoxConnectionType
0120: .addItem(new Tag("10", I18n.getString(
0121: "connectionType.queryExecuter",
0122: "Query Executer mode"))); // Type 10
0123: jComboBoxConnectionType
0124: .addItem(new Tag("11", I18n.getString(
0125: "connectionType.emptyDataSource",
0126: "Empty data source"))); // Type 11
0127: jComboBoxConnectionType.addItem(new Tag("12", I18n.getString(
0128: "connectionType.customIReportConnection",
0129: "Custom iReport connection"))); // Type 12
0130: /**
0131: * Copyright (C) 2005, 2006 CINCOM SYSTEMS, INC.
0132: * All Rights Reserved
0133: * www.cincom.com
0134: *
0135: */
0136: /* Adding XMLA Server Connection Type */
0137: jComboBoxConnectionType.addItem(new Tag("13", I18n.getString(
0138: "connectionType.xmlaServer", "XMLA Server"))); // Type 13
0139:
0140: jComboBoxJDBCDriver.addItem("com.mysql.jdbc.Driver");
0141: jComboBoxJDBCDriver.addItem("org.gjt.mm.mysql.Driver");
0142: jComboBoxJDBCDriver.addItem("com.internetcds.jdbc.tds.Driver");
0143: jComboBoxJDBCDriver.addItem("net.sourceforge.jtds.jdbc.Driver");
0144: jComboBoxJDBCDriver
0145: .addItem("com.microsoft.jdbc.sqlserver.SQLServerDriver");
0146: jComboBoxJDBCDriver.addItem("sun.jdbc.odbc.JdbcOdbcDriver");
0147: jComboBoxJDBCDriver.addItem("com.ms.jdbc.odbc.JdbcOdbcDriver");
0148: jComboBoxJDBCDriver.addItem("oracle.jdbc.driver.OracleDriver");
0149: jComboBoxJDBCDriver.addItem("COM.ibm.db2.jdbc.app.DB2Driver");
0150: jComboBoxJDBCDriver.addItem("com.informix.jdbc.IfxDriver");
0151: jComboBoxJDBCDriver.addItem("com.sybase.jdbc2.jdbc.SybDriver");
0152: jComboBoxJDBCDriver
0153: .addItem("com.merant.datadirect.jdbc.sqlserver.SQLServerDriver");
0154: jComboBoxJDBCDriver.addItem("com.inet.tds.TdsDriver");
0155: jComboBoxJDBCDriver.addItem("org.postgresql.Driver");
0156: jComboBoxJDBCDriver.addItem("org.hsqldb.jdbcDriver");
0157: jComboBoxJDBCDriver.addItem("COM.cloudscape.JDBCDriver");
0158:
0159: Vector conns = MainFrame.getMainInstance().getConnections();
0160: for (int i = 0; i < conns.size(); ++i) {
0161: IReportConnection con = (IReportConnection) conns
0162: .elementAt(i);
0163: if (con instanceof JDBCConnection) {
0164: jComboBoxMondrianJdbc.addItem(con.getName());
0165: }
0166: }
0167:
0168: if (jComboBoxMondrianJdbc.getItemCount() > 0) {
0169: jComboBoxMondrianJdbc.setSelectedIndex(0);
0170: }
0171:
0172: // All languages, countries and time zones....
0173:
0174: init = false;
0175:
0176: jComboBoxConnectionType.setSelectedIndex(0);
0177: //System.out.println(jListCVSColumns);
0178: jListCVSColumns.setModel(new DefaultListModel());
0179: jTextFieldCVSDateFormat.setText(new SimpleDateFormat()
0180: .toPattern());
0181:
0182: javax.swing.KeyStroke escape = javax.swing.KeyStroke
0183: .getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0,
0184: false);
0185: javax.swing.Action escapeAction = new javax.swing.AbstractAction() {
0186: public void actionPerformed(java.awt.event.ActionEvent e) {
0187: jButtonCancelActionPerformed(e);
0188: }
0189: };
0190:
0191: getRootPane().getInputMap(
0192: javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW).put(
0193: escape, "ESCAPE");
0194: getRootPane().getActionMap().put("ESCAPE", escapeAction);
0195:
0196: //to make the default button ...
0197: this .getRootPane().setDefaultButton(this .jButtonOK);
0198: }
0199:
0200: /** This method is called from within the constructor to
0201: * initialize the form.
0202: * WARNING: Do NOT modify this code. The content of this method is
0203: * always regenerated by the Form Editor.
0204: */
0205: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
0206: private void initComponents() {
0207: java.awt.GridBagConstraints gridBagConstraints;
0208:
0209: buttonGroupBeansSetType = new javax.swing.ButtonGroup();
0210: buttonGroupCVSFieldSeparator = new javax.swing.ButtonGroup();
0211: buttonGroupCVSFieldSeparator1 = new javax.swing.ButtonGroup();
0212: buttonGroup1 = new javax.swing.ButtonGroup();
0213: jPanel1 = new javax.swing.JPanel();
0214: jPanelConnectionType = new javax.swing.JPanel();
0215: jLabel4 = new javax.swing.JLabel();
0216: jComboBoxConnectionType = new javax.swing.JComboBox();
0217: jLabel1 = new javax.swing.JLabel();
0218: jTextFieldName = new javax.swing.JTextField();
0219: jSeparator2 = new javax.swing.JSeparator();
0220: jPanelConnectionRoot = new javax.swing.JPanel();
0221: jPanelXML = new javax.swing.JPanel();
0222: jLabel9 = new javax.swing.JLabel();
0223: jTextFieldXMLFile = new javax.swing.JTextField();
0224: jButton2 = new javax.swing.JButton();
0225: jRadioButtonXML_connection = new javax.swing.JRadioButton();
0226: jRadioButtonXML_datasource = new javax.swing.JRadioButton();
0227: jPanel13 = new javax.swing.JPanel();
0228: jLabelXMLRecordPath = new javax.swing.JLabel();
0229: jTextFieldRecordPath = new javax.swing.JTextField();
0230: jSeparator9 = new javax.swing.JSeparator();
0231: jLabelXMLDatePattern = new javax.swing.JLabel();
0232: jTextFieldXMLDatePattern = new javax.swing.JTextField();
0233: jButtonXMLDatePattern = new javax.swing.JButton();
0234: jLabelXMLNumberPattern = new javax.swing.JLabel();
0235: jTextFieldXMLNumberPattern = new javax.swing.JTextField();
0236: jButtonXMLNumberPattern = new javax.swing.JButton();
0237: jPanel3 = new javax.swing.JPanel();
0238: jLabelXMLLocale = new javax.swing.JLabel();
0239: jTextFieldXMLLocaleValue = new javax.swing.JTextField();
0240: jLabelXMLTimeZone = new javax.swing.JLabel();
0241: jButtonXMLLocale = new javax.swing.JButton();
0242: jTextFieldXMLTimeZoneValue = new javax.swing.JTextField();
0243: jButtonXMLTimeZone = new javax.swing.JButton();
0244: jSeparator7 = new javax.swing.JSeparator();
0245: jPanelBeansSet = new javax.swing.JPanel();
0246: jLabel12 = new javax.swing.JLabel();
0247: jTextFieldJBSetFactoryClass = new javax.swing.JTextField();
0248: jRadioButtonJBSetCollection = new javax.swing.JRadioButton();
0249: jRadioButtonJBSetArray = new javax.swing.JRadioButton();
0250: jLabel13 = new javax.swing.JLabel();
0251: jTextFieldJBSetMethodToCall = new javax.swing.JTextField();
0252: jCheckBoxisUseFieldDescription = new javax.swing.JCheckBox();
0253: jSeparator6 = new javax.swing.JSeparator();
0254: jPanelJDBC = new javax.swing.JPanel();
0255: jLabel2 = new javax.swing.JLabel();
0256: jLabel3 = new javax.swing.JLabel();
0257: jComboBoxJDBCDriver = new javax.swing.JComboBox();
0258: jTextFieldJDBCUrl = new javax.swing.JTextField();
0259: jPanel2 = new javax.swing.JPanel();
0260: jLabel14 = new javax.swing.JLabel();
0261: jLabel5 = new javax.swing.JLabel();
0262: jTextFieldDBName = new javax.swing.JTextField();
0263: jTextFieldServerAddress = new javax.swing.JTextField();
0264: jButtonWizard = new javax.swing.JButton();
0265: jLabel6 = new javax.swing.JLabel();
0266: jLabel7 = new javax.swing.JLabel();
0267: jTextFieldPassword = new javax.swing.JPasswordField();
0268: jTextFieldUsername = new javax.swing.JTextField();
0269: jCheckBoxSavePassword = new javax.swing.JCheckBox();
0270: jTextArea1 = new javax.swing.JLabel();
0271: jSeparator5 = new javax.swing.JSeparator();
0272: jPanelCustomDataSourceFactory = new javax.swing.JPanel();
0273: jLabel10 = new javax.swing.JLabel();
0274: jTextFieldJRCustomDataSourceFactoryClass = new javax.swing.JTextField();
0275: jLabel11 = new javax.swing.JLabel();
0276: jTextFieldJRCustomDataSourceMethod = new javax.swing.JTextField();
0277: jSeparator1 = new javax.swing.JSeparator();
0278: jPanelCSV = new javax.swing.JPanel();
0279: jLabel15 = new javax.swing.JLabel();
0280: jTextFieldCSVFilename = new javax.swing.JTextField();
0281: jButtonCSVFilename = new javax.swing.JButton();
0282: jTabbedPane1 = new javax.swing.JTabbedPane();
0283: jPanel11 = new javax.swing.JPanel();
0284: jPanel8 = new javax.swing.JPanel();
0285: jScrollPane1 = new javax.swing.JScrollPane();
0286: jListCVSColumns = new javax.swing.JList();
0287: jPanel9 = new javax.swing.JPanel();
0288: jButtonNewParameter = new javax.swing.JButton();
0289: jButtonModifyParameter = new javax.swing.JButton();
0290: jButtonDeleteParameter = new javax.swing.JButton();
0291: jPanel10 = new javax.swing.JPanel();
0292: jButtonNewParameter1 = new javax.swing.JButton();
0293: jPanel6 = new javax.swing.JPanel();
0294: jCheckBoxCVSDateFormat = new javax.swing.JCheckBox();
0295: jTextFieldCVSDateFormat = new javax.swing.JTextField();
0296: jButtonCVSDateFormat = new javax.swing.JButton();
0297: jCheckBoxCVSFirstRowAsHeader = new javax.swing.JCheckBox();
0298: jPanel7 = new javax.swing.JPanel();
0299: jPanel4 = new javax.swing.JPanel();
0300: jRadioButtonCVSSeparatorComma = new javax.swing.JRadioButton();
0301: jRadioButtonCVSSeparatorSpace = new javax.swing.JRadioButton();
0302: jRadioButtonCVSSeparatorTab = new javax.swing.JRadioButton();
0303: jRadioButtonCVSSeparatorSemicolon = new javax.swing.JRadioButton();
0304: jRadioButtonCVSSeparatorOther = new javax.swing.JRadioButton();
0305: jTextFieldCVSSeparatorText = new javax.swing.JTextField();
0306: jRadioButtonCVSSeparatorNewLine = new javax.swing.JRadioButton();
0307: jPanel5 = new javax.swing.JPanel();
0308: jRadioButtonCVSSeparatorComma1 = new javax.swing.JRadioButton();
0309: jRadioButtonCVSSeparatorSpace1 = new javax.swing.JRadioButton();
0310: jRadioButtonCVSSeparatorTab1 = new javax.swing.JRadioButton();
0311: jRadioButtonCVSSeparatorSemicolon1 = new javax.swing.JRadioButton();
0312: jRadioButtonCVSSeparatorNewLine1 = new javax.swing.JRadioButton();
0313: jRadioButtonCVSSeparatorOther1 = new javax.swing.JRadioButton();
0314: jTextFieldCVSSeparatorText1 = new javax.swing.JTextField();
0315: jPanel12 = new javax.swing.JPanel();
0316: jSeparator4 = new javax.swing.JSeparator();
0317: jPanelDatasourceProvider = new javax.swing.JPanel();
0318: jLabel17 = new javax.swing.JLabel();
0319: jTextFieldJRDataSourceProvider = new javax.swing.JTextField();
0320: jSeparator3 = new javax.swing.JSeparator();
0321: jPanelHibernate = new javax.swing.JPanel();
0322: jTextPane1 = new javax.swing.JTextPane();
0323: jLabel8 = new javax.swing.JLabel();
0324: jPanelEJBQL = new javax.swing.JPanel();
0325: jLabel18 = new javax.swing.JLabel();
0326: jTextFieldPersistanceUnit = new javax.swing.JTextField();
0327: jScrollPane2 = new javax.swing.JScrollPane();
0328: jTextPane2 = new javax.swing.JTextPane();
0329: jPanelMondrian = new javax.swing.JPanel();
0330: jLabel20 = new javax.swing.JLabel();
0331: jComboBoxMondrianJdbc = new javax.swing.JComboBox();
0332: jLabel19 = new javax.swing.JLabel();
0333: jTextFieldCatalogURI = new javax.swing.JTextField();
0334: jButtonBrowseCatalog = new javax.swing.JButton();
0335: jPanel14 = new javax.swing.JPanel();
0336: jPanelSpringLoadedHibernate = new javax.swing.JPanel();
0337: jLabel21 = new javax.swing.JLabel();
0338: jTextFieldSLHSpringConfig = new javax.swing.JTextField();
0339: jLabel22 = new javax.swing.JLabel();
0340: jTextFieldSLHSessionFactory = new javax.swing.JTextField();
0341: jLabel16 = new javax.swing.JLabel();
0342: jPanelQueryExecutorMode = new javax.swing.JPanel();
0343: jLabel23 = new javax.swing.JLabel();
0344: jPanelEmptyDataSource = new javax.swing.JPanel();
0345: jLabel24 = new javax.swing.JLabel();
0346: jSpinnerNumRecords = new javax.swing.JSpinner();
0347: jPanelCustomConnection = new javax.swing.JPanel();
0348: jLabel25 = new javax.swing.JLabel();
0349: jTextFieldIReportConnectionClassName = new javax.swing.JTextField();
0350: jPanel15 = new javax.swing.JPanel();
0351: jLabelPropertiesTable = new javax.swing.JLabel();
0352: jScrollPane3 = new javax.swing.JScrollPane();
0353: jTableCustomProperties = new javax.swing.JTable();
0354: jButtonAddProp = new javax.swing.JButton();
0355: jButtonRemoveProp = new javax.swing.JButton();
0356: jPanelXMLA = new javax.swing.JPanel();
0357: jLabelXMLAUrl = new javax.swing.JLabel();
0358: jTextFieldXMLAUrl = new javax.swing.JTextField();
0359: jButtonGetXMLAMetadata = new javax.swing.JButton();
0360: jLabelXMLADatasource = new javax.swing.JLabel();
0361: jComboBoxXMLADatasource = new javax.swing.JComboBox();
0362: jLabelXMLACatalog = new javax.swing.JLabel();
0363: jComboBoxXMLACatalog = new javax.swing.JComboBox();
0364: jSeparator8 = new javax.swing.JSeparator();
0365: jLabelXMLACube = new javax.swing.JLabel();
0366: jComboBoxXMLACube = new javax.swing.JComboBox();
0367: jSeparator10 = new javax.swing.JSeparator();
0368: jPanel16 = new javax.swing.JPanel();
0369: jLabel26 = new javax.swing.JLabel();
0370: jLabel27 = new javax.swing.JLabel();
0371: jTextFieldUsername1 = new javax.swing.JTextField();
0372: jTextFieldPassword1 = new javax.swing.JPasswordField();
0373: jCheckBoxSavePassword1 = new javax.swing.JCheckBox();
0374: jLabelAttention = new javax.swing.JLabel();
0375: jPanelButtons = new javax.swing.JPanel();
0376: jButtonOK = new javax.swing.JButton();
0377: jButtonCancel = new javax.swing.JButton();
0378: jButtonOK1 = new javax.swing.JButton();
0379:
0380: setTitle("Connections properties");
0381: setModal(true);
0382: addWindowListener(new java.awt.event.WindowAdapter() {
0383: public void windowClosing(java.awt.event.WindowEvent evt) {
0384: closeDialog(evt);
0385: }
0386: });
0387:
0388: jPanel1.setLayout(new java.awt.BorderLayout());
0389:
0390: jPanelConnectionType.setLayout(new java.awt.GridBagLayout());
0391:
0392: jPanelConnectionType.setMinimumSize(new java.awt.Dimension(164,
0393: 90));
0394: jPanelConnectionType.setPreferredSize(new java.awt.Dimension(
0395: 10, 90));
0396: jLabel4.setText("Type of connection / datasource");
0397: jLabel4.setMaximumSize(new java.awt.Dimension(157, 21));
0398: jLabel4.setPreferredSize(new java.awt.Dimension(157, 14));
0399: gridBagConstraints = new java.awt.GridBagConstraints();
0400: gridBagConstraints.gridx = 0;
0401: gridBagConstraints.gridy = 2;
0402: gridBagConstraints.gridwidth = 2;
0403: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0404: gridBagConstraints.insets = new java.awt.Insets(3, 5, 0, 3);
0405: jPanelConnectionType.add(jLabel4, gridBagConstraints);
0406:
0407: jComboBoxConnectionType.setMinimumSize(new java.awt.Dimension(
0408: 25, 21));
0409: jComboBoxConnectionType
0410: .setPreferredSize(new java.awt.Dimension(25, 21));
0411: jComboBoxConnectionType
0412: .addActionListener(new java.awt.event.ActionListener() {
0413: public void actionPerformed(
0414: java.awt.event.ActionEvent evt) {
0415: jComboBoxConnectionTypeActionPerformed(evt);
0416: }
0417: });
0418:
0419: gridBagConstraints = new java.awt.GridBagConstraints();
0420: gridBagConstraints.gridx = 0;
0421: gridBagConstraints.gridy = 3;
0422: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
0423: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0424: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0425: gridBagConstraints.insets = new java.awt.Insets(0, 5, 2, 5);
0426: jPanelConnectionType.add(jComboBoxConnectionType,
0427: gridBagConstraints);
0428:
0429: jLabel1.setText("Name");
0430: gridBagConstraints = new java.awt.GridBagConstraints();
0431: gridBagConstraints.gridx = 0;
0432: gridBagConstraints.gridy = 0;
0433: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0434: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0435: gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 3);
0436: jPanelConnectionType.add(jLabel1, gridBagConstraints);
0437:
0438: jTextFieldName.setMinimumSize(new java.awt.Dimension(6, 21));
0439: jTextFieldName.setPreferredSize(new java.awt.Dimension(11, 21));
0440: gridBagConstraints = new java.awt.GridBagConstraints();
0441: gridBagConstraints.gridx = 0;
0442: gridBagConstraints.gridy = 1;
0443: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
0444: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0445: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0446: gridBagConstraints.insets = new java.awt.Insets(0, 3, 4, 5);
0447: jPanelConnectionType.add(jTextFieldName, gridBagConstraints);
0448:
0449: gridBagConstraints = new java.awt.GridBagConstraints();
0450: gridBagConstraints.gridx = 0;
0451: gridBagConstraints.gridy = 4;
0452: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0453: gridBagConstraints.weightx = 1.0;
0454: gridBagConstraints.weighty = 1.0;
0455: jPanelConnectionType.add(jSeparator2, gridBagConstraints);
0456:
0457: jPanel1.add(jPanelConnectionType, java.awt.BorderLayout.NORTH);
0458:
0459: jPanelConnectionRoot.setLayout(new java.awt.BorderLayout());
0460:
0461: jPanelConnectionRoot.setPreferredSize(new java.awt.Dimension(
0462: 400, 350));
0463: jPanelXML.setLayout(new java.awt.GridBagLayout());
0464:
0465: jPanelXML.setPreferredSize(new java.awt.Dimension(1, 30));
0466: jLabel9.setText("XML file");
0467: gridBagConstraints = new java.awt.GridBagConstraints();
0468: gridBagConstraints.gridx = 0;
0469: gridBagConstraints.gridy = 0;
0470: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0471: gridBagConstraints.ipadx = 24;
0472: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0473: jPanelXML.add(jLabel9, gridBagConstraints);
0474:
0475: gridBagConstraints = new java.awt.GridBagConstraints();
0476: gridBagConstraints.gridx = 1;
0477: gridBagConstraints.gridy = 0;
0478: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0479: gridBagConstraints.ipadx = 232;
0480: gridBagConstraints.ipady = 1;
0481: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
0482: gridBagConstraints.weightx = 1.0;
0483: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0484: jPanelXML.add(jTextFieldXMLFile, gridBagConstraints);
0485:
0486: jButton2.setText("Browse");
0487: jButton2.setMargin(new java.awt.Insets(2, 4, 2, 4));
0488: jButton2.setMaximumSize(new java.awt.Dimension(100, 25));
0489: jButton2.setMinimumSize(new java.awt.Dimension(70, 25));
0490: jButton2.setPreferredSize(new java.awt.Dimension(70, 25));
0491: jButton2.addActionListener(new java.awt.event.ActionListener() {
0492: public void actionPerformed(java.awt.event.ActionEvent evt) {
0493: jButton2ActionPerformed(evt);
0494: }
0495: });
0496:
0497: gridBagConstraints = new java.awt.GridBagConstraints();
0498: gridBagConstraints.gridx = 2;
0499: gridBagConstraints.gridy = 0;
0500: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0501: gridBagConstraints.ipadx = 21;
0502: gridBagConstraints.ipady = -3;
0503: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 7);
0504: jPanelXML.add(jButton2, gridBagConstraints);
0505:
0506: buttonGroup1.add(jRadioButtonXML_connection);
0507: jRadioButtonXML_connection
0508: .setText("Use the report XPath expression when filling the report");
0509: jRadioButtonXML_connection.setBorder(javax.swing.BorderFactory
0510: .createEmptyBorder(0, 0, 0, 0));
0511: jRadioButtonXML_connection.setMargin(new java.awt.Insets(0, 0,
0512: 0, 0));
0513: jRadioButtonXML_connection
0514: .addActionListener(new java.awt.event.ActionListener() {
0515: public void actionPerformed(
0516: java.awt.event.ActionEvent evt) {
0517: jRadioButtonXML_connectionActionPerformed(evt);
0518: }
0519: });
0520:
0521: gridBagConstraints = new java.awt.GridBagConstraints();
0522: gridBagConstraints.gridx = 0;
0523: gridBagConstraints.gridwidth = 3;
0524: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0525: gridBagConstraints.weightx = 1.0;
0526: gridBagConstraints.insets = new java.awt.Insets(8, 4, 0, 4);
0527: jPanelXML.add(jRadioButtonXML_connection, gridBagConstraints);
0528:
0529: buttonGroup1.add(jRadioButtonXML_datasource);
0530: jRadioButtonXML_datasource.setSelected(true);
0531: jRadioButtonXML_datasource
0532: .setText("Create a datasource using this expression");
0533: jRadioButtonXML_datasource
0534: .setActionCommand("Create a datasource using the following expression");
0535: jRadioButtonXML_datasource.setBorder(javax.swing.BorderFactory
0536: .createEmptyBorder(0, 0, 0, 0));
0537: jRadioButtonXML_datasource.setMargin(new java.awt.Insets(0, 0,
0538: 0, 0));
0539: jRadioButtonXML_datasource
0540: .addActionListener(new java.awt.event.ActionListener() {
0541: public void actionPerformed(
0542: java.awt.event.ActionEvent evt) {
0543: jRadioButtonXML_datasourceActionPerformed(evt);
0544: }
0545: });
0546:
0547: gridBagConstraints = new java.awt.GridBagConstraints();
0548: gridBagConstraints.gridx = 0;
0549: gridBagConstraints.gridwidth = 3;
0550: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0551: gridBagConstraints.weightx = 1.0;
0552: gridBagConstraints.insets = new java.awt.Insets(8, 4, 0, 4);
0553: jPanelXML.add(jRadioButtonXML_datasource, gridBagConstraints);
0554:
0555: jPanel13.setLayout(new java.awt.GridBagLayout());
0556:
0557: jLabelXMLRecordPath.setText("Select Expression");
0558: jLabelXMLRecordPath.setMaximumSize(new java.awt.Dimension(2000,
0559: 14));
0560: jLabelXMLRecordPath
0561: .setMinimumSize(new java.awt.Dimension(2, 14));
0562: jLabelXMLRecordPath.setPreferredSize(new java.awt.Dimension(60,
0563: 14));
0564: gridBagConstraints = new java.awt.GridBagConstraints();
0565: gridBagConstraints.gridx = 0;
0566: gridBagConstraints.gridy = 4;
0567: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0568: gridBagConstraints.ipadx = 24;
0569: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0570: jPanel13.add(jLabelXMLRecordPath, gridBagConstraints);
0571:
0572: gridBagConstraints = new java.awt.GridBagConstraints();
0573: gridBagConstraints.gridx = 1;
0574: gridBagConstraints.gridy = 4;
0575: gridBagConstraints.gridwidth = 2;
0576: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0577: gridBagConstraints.ipadx = 232;
0578: gridBagConstraints.ipady = 1;
0579: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
0580: gridBagConstraints.weightx = 1.0;
0581: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 7);
0582: jPanel13.add(jTextFieldRecordPath, gridBagConstraints);
0583:
0584: gridBagConstraints = new java.awt.GridBagConstraints();
0585: gridBagConstraints.gridx = 0;
0586: gridBagConstraints.gridwidth = 3;
0587: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0588: gridBagConstraints.weightx = 1.0;
0589: gridBagConstraints.insets = new java.awt.Insets(0, 40, 0, 0);
0590: jPanelXML.add(jPanel13, gridBagConstraints);
0591:
0592: jSeparator9.setPreferredSize(new java.awt.Dimension(2, 2));
0593: gridBagConstraints = new java.awt.GridBagConstraints();
0594: gridBagConstraints.gridx = 0;
0595: gridBagConstraints.gridwidth = 4;
0596: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0597: gridBagConstraints.insets = new java.awt.Insets(8, 4, 8, 4);
0598: jPanelXML.add(jSeparator9, gridBagConstraints);
0599:
0600: jLabelXMLDatePattern.setText("Date pattern");
0601: gridBagConstraints = new java.awt.GridBagConstraints();
0602: gridBagConstraints.gridx = 0;
0603: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0604: gridBagConstraints.ipadx = 24;
0605: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0606: jPanelXML.add(jLabelXMLDatePattern, gridBagConstraints);
0607:
0608: gridBagConstraints = new java.awt.GridBagConstraints();
0609: gridBagConstraints.gridx = 1;
0610: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0611: gridBagConstraints.ipadx = 232;
0612: gridBagConstraints.ipady = 1;
0613: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
0614: gridBagConstraints.weightx = 1.0;
0615: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0616: jPanelXML.add(jTextFieldXMLDatePattern, gridBagConstraints);
0617:
0618: jButtonXMLDatePattern.setText("Create");
0619: jButtonXMLDatePattern
0620: .setMargin(new java.awt.Insets(2, 4, 2, 4));
0621: jButtonXMLDatePattern.setMaximumSize(new java.awt.Dimension(
0622: 100, 25));
0623: jButtonXMLDatePattern.setMinimumSize(new java.awt.Dimension(70,
0624: 25));
0625: jButtonXMLDatePattern.setPreferredSize(new java.awt.Dimension(
0626: 70, 25));
0627: jButtonXMLDatePattern
0628: .addActionListener(new java.awt.event.ActionListener() {
0629: public void actionPerformed(
0630: java.awt.event.ActionEvent evt) {
0631: jButton2ActionPerformed1(evt);
0632: }
0633: });
0634:
0635: gridBagConstraints = new java.awt.GridBagConstraints();
0636: gridBagConstraints.gridx = 2;
0637: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0638: gridBagConstraints.ipadx = 21;
0639: gridBagConstraints.ipady = -3;
0640: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 7);
0641: jPanelXML.add(jButtonXMLDatePattern, gridBagConstraints);
0642:
0643: jLabelXMLNumberPattern.setText("Number pattern");
0644: gridBagConstraints = new java.awt.GridBagConstraints();
0645: gridBagConstraints.gridx = 0;
0646: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0647: gridBagConstraints.ipadx = 24;
0648: gridBagConstraints.insets = new java.awt.Insets(1, 3, 3, 3);
0649: jPanelXML.add(jLabelXMLNumberPattern, gridBagConstraints);
0650:
0651: gridBagConstraints = new java.awt.GridBagConstraints();
0652: gridBagConstraints.gridx = 1;
0653: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0654: gridBagConstraints.ipadx = 232;
0655: gridBagConstraints.ipady = 1;
0656: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
0657: gridBagConstraints.weightx = 1.0;
0658: gridBagConstraints.insets = new java.awt.Insets(1, 3, 3, 3);
0659: jPanelXML.add(jTextFieldXMLNumberPattern, gridBagConstraints);
0660:
0661: jButtonXMLNumberPattern.setText("Create");
0662: jButtonXMLNumberPattern.setMargin(new java.awt.Insets(2, 4, 2,
0663: 4));
0664: jButtonXMLNumberPattern.setMaximumSize(new java.awt.Dimension(
0665: 100, 25));
0666: jButtonXMLNumberPattern.setMinimumSize(new java.awt.Dimension(
0667: 70, 25));
0668: jButtonXMLNumberPattern
0669: .setPreferredSize(new java.awt.Dimension(70, 25));
0670: jButtonXMLNumberPattern
0671: .addActionListener(new java.awt.event.ActionListener() {
0672: public void actionPerformed(
0673: java.awt.event.ActionEvent evt) {
0674: jButtonXMLDatePatternjButton2ActionPerformed1(evt);
0675: }
0676: });
0677:
0678: gridBagConstraints = new java.awt.GridBagConstraints();
0679: gridBagConstraints.gridx = 2;
0680: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0681: gridBagConstraints.ipadx = 21;
0682: gridBagConstraints.ipady = -3;
0683: gridBagConstraints.insets = new java.awt.Insets(1, 3, 3, 7);
0684: jPanelXML.add(jButtonXMLNumberPattern, gridBagConstraints);
0685:
0686: jPanel3.setLayout(new java.awt.GridBagLayout());
0687:
0688: jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(
0689: javax.swing.BorderFactory.createEtchedBorder(),
0690: "Locale / Time zone"));
0691: jLabelXMLLocale.setText("Locale");
0692: gridBagConstraints = new java.awt.GridBagConstraints();
0693: gridBagConstraints.gridx = 0;
0694: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0695: gridBagConstraints.ipadx = 24;
0696: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
0697: jPanel3.add(jLabelXMLLocale, gridBagConstraints);
0698:
0699: jTextFieldXMLLocaleValue.setEditable(false);
0700: jTextFieldXMLLocaleValue.setText("Default");
0701: gridBagConstraints = new java.awt.GridBagConstraints();
0702: gridBagConstraints.gridx = 1;
0703: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0704: gridBagConstraints.ipadx = 232;
0705: gridBagConstraints.ipady = 1;
0706: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
0707: gridBagConstraints.weightx = 1.0;
0708: gridBagConstraints.insets = new java.awt.Insets(4, 0, 4, 4);
0709: jPanel3.add(jTextFieldXMLLocaleValue, gridBagConstraints);
0710:
0711: jLabelXMLTimeZone.setText("Time zone");
0712: gridBagConstraints = new java.awt.GridBagConstraints();
0713: gridBagConstraints.gridx = 0;
0714: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0715: gridBagConstraints.ipadx = 24;
0716: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
0717: jPanel3.add(jLabelXMLTimeZone, gridBagConstraints);
0718:
0719: jButtonXMLLocale.setText("Select...");
0720: jButtonXMLLocale.setMargin(new java.awt.Insets(2, 4, 2, 4));
0721: jButtonXMLLocale
0722: .setMaximumSize(new java.awt.Dimension(100, 25));
0723: jButtonXMLLocale.setMinimumSize(new java.awt.Dimension(70, 25));
0724: jButtonXMLLocale
0725: .setPreferredSize(new java.awt.Dimension(70, 25));
0726: jButtonXMLLocale
0727: .addActionListener(new java.awt.event.ActionListener() {
0728: public void actionPerformed(
0729: java.awt.event.ActionEvent evt) {
0730: jButtonXMLDatePatternjButton2ActionPerformed11(evt);
0731: }
0732: });
0733:
0734: gridBagConstraints = new java.awt.GridBagConstraints();
0735: gridBagConstraints.gridx = 2;
0736: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0737: gridBagConstraints.ipadx = 21;
0738: gridBagConstraints.ipady = -3;
0739: gridBagConstraints.insets = new java.awt.Insets(4, 0, 4, 8);
0740: jPanel3.add(jButtonXMLLocale, gridBagConstraints);
0741:
0742: jTextFieldXMLTimeZoneValue.setEditable(false);
0743: jTextFieldXMLTimeZoneValue.setText("Default");
0744: gridBagConstraints = new java.awt.GridBagConstraints();
0745: gridBagConstraints.gridx = 1;
0746: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0747: gridBagConstraints.ipadx = 232;
0748: gridBagConstraints.ipady = 1;
0749: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
0750: gridBagConstraints.weightx = 1.0;
0751: gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 4);
0752: jPanel3.add(jTextFieldXMLTimeZoneValue, gridBagConstraints);
0753:
0754: jButtonXMLTimeZone.setText("Select...");
0755: jButtonXMLTimeZone.setMargin(new java.awt.Insets(2, 4, 2, 4));
0756: jButtonXMLTimeZone.setMaximumSize(new java.awt.Dimension(100,
0757: 25));
0758: jButtonXMLTimeZone
0759: .setMinimumSize(new java.awt.Dimension(70, 25));
0760: jButtonXMLTimeZone.setPreferredSize(new java.awt.Dimension(70,
0761: 25));
0762: jButtonXMLTimeZone
0763: .addActionListener(new java.awt.event.ActionListener() {
0764: public void actionPerformed(
0765: java.awt.event.ActionEvent evt) {
0766: jButtonXMLDatePattern1jButtonXMLDatePatternjButton2ActionPerformed11(evt);
0767: }
0768: });
0769:
0770: gridBagConstraints = new java.awt.GridBagConstraints();
0771: gridBagConstraints.gridx = 2;
0772: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0773: gridBagConstraints.ipadx = 21;
0774: gridBagConstraints.ipady = -3;
0775: gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 8);
0776: jPanel3.add(jButtonXMLTimeZone, gridBagConstraints);
0777:
0778: gridBagConstraints = new java.awt.GridBagConstraints();
0779: gridBagConstraints.gridx = 0;
0780: gridBagConstraints.gridwidth = 3;
0781: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0782: gridBagConstraints.weightx = 1.0;
0783: gridBagConstraints.insets = new java.awt.Insets(4, 3, 0, 4);
0784: jPanelXML.add(jPanel3, gridBagConstraints);
0785:
0786: gridBagConstraints = new java.awt.GridBagConstraints();
0787: gridBagConstraints.gridx = 0;
0788: gridBagConstraints.gridy = 99;
0789: gridBagConstraints.gridwidth = 3;
0790: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0791: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
0792: gridBagConstraints.weightx = 1.0;
0793: gridBagConstraints.weighty = 1.0;
0794: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0795: jPanelXML.add(jSeparator7, gridBagConstraints);
0796:
0797: jPanelConnectionRoot.add(jPanelXML,
0798: java.awt.BorderLayout.CENTER);
0799:
0800: jPanelBeansSet.setLayout(new java.awt.GridBagLayout());
0801:
0802: jLabel12
0803: .setText("Factory class (the class that will produce the set)");
0804: gridBagConstraints = new java.awt.GridBagConstraints();
0805: gridBagConstraints.gridx = 0;
0806: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0807: gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
0808: jPanelBeansSet.add(jLabel12, gridBagConstraints);
0809:
0810: jTextFieldJBSetFactoryClass
0811: .setText("it.businesslogic.ireport.connection.SampleJRDataSourceFactory");
0812: gridBagConstraints = new java.awt.GridBagConstraints();
0813: gridBagConstraints.gridx = 0;
0814: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0815: gridBagConstraints.insets = new java.awt.Insets(2, 4, 4, 4);
0816: jPanelBeansSet.add(jTextFieldJBSetFactoryClass,
0817: gridBagConstraints);
0818:
0819: buttonGroupBeansSetType.add(jRadioButtonJBSetCollection);
0820: jRadioButtonJBSetCollection.setSelected(true);
0821: jRadioButtonJBSetCollection.setText(" Collection of javaBeans");
0822: gridBagConstraints = new java.awt.GridBagConstraints();
0823: gridBagConstraints.gridx = 0;
0824: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0825: gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
0826: jPanelBeansSet.add(jRadioButtonJBSetCollection,
0827: gridBagConstraints);
0828:
0829: buttonGroupBeansSetType.add(jRadioButtonJBSetArray);
0830: jRadioButtonJBSetArray.setText("Array of javaBeans");
0831: jRadioButtonJBSetArray
0832: .addActionListener(new java.awt.event.ActionListener() {
0833: public void actionPerformed(
0834: java.awt.event.ActionEvent evt) {
0835: jRadioButtonJBSetArrayActionPerformed(evt);
0836: }
0837: });
0838:
0839: gridBagConstraints = new java.awt.GridBagConstraints();
0840: gridBagConstraints.gridx = 0;
0841: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0842: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
0843: jPanelBeansSet.add(jRadioButtonJBSetArray, gridBagConstraints);
0844:
0845: jLabel13
0846: .setText("The static method to call to retrive the array or the the collection of javaBeans");
0847: gridBagConstraints = new java.awt.GridBagConstraints();
0848: gridBagConstraints.gridx = 0;
0849: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0850: gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
0851: jPanelBeansSet.add(jLabel13, gridBagConstraints);
0852:
0853: jTextFieldJBSetMethodToCall.setText("createBeanCollection");
0854: gridBagConstraints = new java.awt.GridBagConstraints();
0855: gridBagConstraints.gridx = 0;
0856: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0857: gridBagConstraints.insets = new java.awt.Insets(2, 4, 4, 4);
0858: jPanelBeansSet.add(jTextFieldJBSetMethodToCall,
0859: gridBagConstraints);
0860:
0861: jCheckBoxisUseFieldDescription.setText("Use field description");
0862: jCheckBoxisUseFieldDescription
0863: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
0864: 0, 0, 0, 0));
0865: jCheckBoxisUseFieldDescription.setMargin(new java.awt.Insets(0,
0866: 0, 0, 0));
0867: gridBagConstraints = new java.awt.GridBagConstraints();
0868: gridBagConstraints.gridx = 0;
0869: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0870: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
0871: jPanelBeansSet.add(jCheckBoxisUseFieldDescription,
0872: gridBagConstraints);
0873:
0874: gridBagConstraints = new java.awt.GridBagConstraints();
0875: gridBagConstraints.gridx = 0;
0876: gridBagConstraints.gridy = 99;
0877: gridBagConstraints.gridwidth = 3;
0878: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0879: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
0880: gridBagConstraints.weightx = 1.0;
0881: gridBagConstraints.weighty = 1.0;
0882: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0883: jPanelBeansSet.add(jSeparator6, gridBagConstraints);
0884:
0885: jPanelConnectionRoot.add(jPanelBeansSet,
0886: java.awt.BorderLayout.CENTER);
0887:
0888: jPanelJDBC.setLayout(new java.awt.GridBagLayout());
0889:
0890: jLabel2.setText("JDBC Driver");
0891: gridBagConstraints = new java.awt.GridBagConstraints();
0892: gridBagConstraints.gridx = 0;
0893: gridBagConstraints.gridy = 0;
0894: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0895: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
0896: jPanelJDBC.add(jLabel2, gridBagConstraints);
0897:
0898: jLabel3.setText("JDBC URL");
0899: gridBagConstraints = new java.awt.GridBagConstraints();
0900: gridBagConstraints.gridx = 0;
0901: gridBagConstraints.gridy = 1;
0902: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0903: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
0904: jPanelJDBC.add(jLabel3, gridBagConstraints);
0905:
0906: jComboBoxJDBCDriver.setEditable(true);
0907: jComboBoxJDBCDriver
0908: .addActionListener(new java.awt.event.ActionListener() {
0909: public void actionPerformed(
0910: java.awt.event.ActionEvent evt) {
0911: jComboBoxJDBCDriverActionPerformed(evt);
0912: }
0913: });
0914:
0915: gridBagConstraints = new java.awt.GridBagConstraints();
0916: gridBagConstraints.gridx = 1;
0917: gridBagConstraints.gridy = 0;
0918: gridBagConstraints.gridwidth = 2;
0919: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0920: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 6);
0921: jPanelJDBC.add(jComboBoxJDBCDriver, gridBagConstraints);
0922:
0923: gridBagConstraints = new java.awt.GridBagConstraints();
0924: gridBagConstraints.gridx = 1;
0925: gridBagConstraints.gridy = 1;
0926: gridBagConstraints.gridwidth = 2;
0927: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0928: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 6);
0929: jPanelJDBC.add(jTextFieldJDBCUrl, gridBagConstraints);
0930:
0931: jPanel2.setLayout(new java.awt.GridBagLayout());
0932:
0933: jPanel2.setBorder(javax.swing.BorderFactory
0934: .createTitledBorder("JDBC URL Wizard"));
0935: jPanel2.setMinimumSize(new java.awt.Dimension(300, 100));
0936: jLabel14.setText("Server Address");
0937: gridBagConstraints = new java.awt.GridBagConstraints();
0938: gridBagConstraints.gridx = 0;
0939: gridBagConstraints.gridy = 0;
0940: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0941: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
0942: jPanel2.add(jLabel14, gridBagConstraints);
0943:
0944: jLabel5.setText("Database");
0945: gridBagConstraints = new java.awt.GridBagConstraints();
0946: gridBagConstraints.gridx = 0;
0947: gridBagConstraints.gridy = 1;
0948: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0949: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
0950: jPanel2.add(jLabel5, gridBagConstraints);
0951:
0952: gridBagConstraints = new java.awt.GridBagConstraints();
0953: gridBagConstraints.gridx = 1;
0954: gridBagConstraints.gridy = 1;
0955: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0956: gridBagConstraints.weightx = 1.0;
0957: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
0958: jPanel2.add(jTextFieldDBName, gridBagConstraints);
0959:
0960: gridBagConstraints = new java.awt.GridBagConstraints();
0961: gridBagConstraints.gridx = 1;
0962: gridBagConstraints.gridy = 0;
0963: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0964: gridBagConstraints.weightx = 1.0;
0965: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
0966: jPanel2.add(jTextFieldServerAddress, gridBagConstraints);
0967:
0968: jButtonWizard.setText("Wizard");
0969: jButtonWizard.setMargin(new java.awt.Insets(2, 2, 2, 2));
0970: jButtonWizard.setMaximumSize(new java.awt.Dimension(60, 23));
0971: jButtonWizard.setMinimumSize(new java.awt.Dimension(60, 23));
0972: jButtonWizard.setPreferredSize(new java.awt.Dimension(60, 23));
0973: jButtonWizard
0974: .addActionListener(new java.awt.event.ActionListener() {
0975: public void actionPerformed(
0976: java.awt.event.ActionEvent evt) {
0977: jButtonWizardActionPerformed(evt);
0978: }
0979: });
0980:
0981: gridBagConstraints = new java.awt.GridBagConstraints();
0982: gridBagConstraints.gridx = 2;
0983: gridBagConstraints.gridy = 1;
0984: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0985: gridBagConstraints.insets = new java.awt.Insets(2, 6, 2, 0);
0986: jPanel2.add(jButtonWizard, gridBagConstraints);
0987:
0988: gridBagConstraints = new java.awt.GridBagConstraints();
0989: gridBagConstraints.gridx = 0;
0990: gridBagConstraints.gridy = 4;
0991: gridBagConstraints.gridwidth = 3;
0992: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0993: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0994: gridBagConstraints.weightx = 1.0;
0995: jPanelJDBC.add(jPanel2, gridBagConstraints);
0996:
0997: jLabel6.setText("Username");
0998: gridBagConstraints = new java.awt.GridBagConstraints();
0999: gridBagConstraints.gridx = 0;
1000: gridBagConstraints.gridy = 5;
1001: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1002: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
1003: jPanelJDBC.add(jLabel6, gridBagConstraints);
1004:
1005: jLabel7.setText("Password");
1006: gridBagConstraints = new java.awt.GridBagConstraints();
1007: gridBagConstraints.gridx = 0;
1008: gridBagConstraints.gridy = 6;
1009: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1010: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
1011: jPanelJDBC.add(jLabel7, gridBagConstraints);
1012:
1013: jTextFieldPassword.setFont(new java.awt.Font("Tahoma", 0, 11));
1014: gridBagConstraints = new java.awt.GridBagConstraints();
1015: gridBagConstraints.gridx = 1;
1016: gridBagConstraints.gridy = 6;
1017: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1018: gridBagConstraints.weightx = 1.0;
1019: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
1020: jPanelJDBC.add(jTextFieldPassword, gridBagConstraints);
1021:
1022: gridBagConstraints = new java.awt.GridBagConstraints();
1023: gridBagConstraints.gridx = 1;
1024: gridBagConstraints.gridy = 5;
1025: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1026: gridBagConstraints.weightx = 1.0;
1027: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
1028: jPanelJDBC.add(jTextFieldUsername, gridBagConstraints);
1029:
1030: jCheckBoxSavePassword.setText("Save password");
1031: gridBagConstraints = new java.awt.GridBagConstraints();
1032: gridBagConstraints.gridx = 2;
1033: gridBagConstraints.gridy = 6;
1034: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1035: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 6);
1036: jPanelJDBC.add(jCheckBoxSavePassword, gridBagConstraints);
1037:
1038: jTextArea1
1039: .setText("<html>ATTENTION! Passwords are stored in clear text. If you dont specify a password now, iReport will ask you for one only when required and will not save it.");
1040: jTextArea1.setBorder(javax.swing.BorderFactory
1041: .createEtchedBorder());
1042: jTextArea1.setPreferredSize(new java.awt.Dimension(739, 50));
1043: gridBagConstraints = new java.awt.GridBagConstraints();
1044: gridBagConstraints.gridx = 0;
1045: gridBagConstraints.gridwidth = 3;
1046: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1047: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
1048: gridBagConstraints.weightx = 1.0;
1049: gridBagConstraints.weighty = 1.0;
1050: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1051: jPanelJDBC.add(jTextArea1, gridBagConstraints);
1052:
1053: gridBagConstraints = new java.awt.GridBagConstraints();
1054: gridBagConstraints.gridx = 0;
1055: gridBagConstraints.gridy = 99;
1056: gridBagConstraints.gridwidth = 3;
1057: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1058: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
1059: gridBagConstraints.weightx = 1.0;
1060: gridBagConstraints.weighty = 1.0;
1061: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
1062: jPanelJDBC.add(jSeparator5, gridBagConstraints);
1063:
1064: jPanelConnectionRoot.add(jPanelJDBC,
1065: java.awt.BorderLayout.CENTER);
1066:
1067: jPanelCustomDataSourceFactory
1068: .setLayout(new java.awt.GridBagLayout());
1069:
1070: jLabel10.setText("Factory class");
1071: gridBagConstraints = new java.awt.GridBagConstraints();
1072: gridBagConstraints.gridx = 0;
1073: gridBagConstraints.gridy = 0;
1074: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1075: gridBagConstraints.insets = new java.awt.Insets(3, 5, 3, 3);
1076: jPanelCustomDataSourceFactory.add(jLabel10, gridBagConstraints);
1077:
1078: jTextFieldJRCustomDataSourceFactoryClass
1079: .setText("it.businesslogic.ireport.connection.SampleJRDataSourceFactory");
1080: gridBagConstraints = new java.awt.GridBagConstraints();
1081: gridBagConstraints.gridx = 0;
1082: gridBagConstraints.gridy = 1;
1083: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1084: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1085: gridBagConstraints.insets = new java.awt.Insets(3, 5, 3, 3);
1086: jPanelCustomDataSourceFactory.add(
1087: jTextFieldJRCustomDataSourceFactoryClass,
1088: gridBagConstraints);
1089:
1090: jLabel11
1091: .setText("The static method to call to retrive the JRDataSource");
1092: gridBagConstraints = new java.awt.GridBagConstraints();
1093: gridBagConstraints.gridx = 0;
1094: gridBagConstraints.gridy = 2;
1095: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1096: gridBagConstraints.insets = new java.awt.Insets(3, 5, 3, 3);
1097: jPanelCustomDataSourceFactory.add(jLabel11, gridBagConstraints);
1098:
1099: jTextFieldJRCustomDataSourceMethod.setText("createDatasource");
1100: jTextFieldJRCustomDataSourceMethod
1101: .setPreferredSize(new java.awt.Dimension(314, 21));
1102: gridBagConstraints = new java.awt.GridBagConstraints();
1103: gridBagConstraints.gridx = 0;
1104: gridBagConstraints.gridy = 3;
1105: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1106: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1107: gridBagConstraints.weightx = 1.0;
1108: gridBagConstraints.insets = new java.awt.Insets(3, 5, 3, 3);
1109: jPanelCustomDataSourceFactory.add(
1110: jTextFieldJRCustomDataSourceMethod, gridBagConstraints);
1111:
1112: gridBagConstraints = new java.awt.GridBagConstraints();
1113: gridBagConstraints.gridx = 0;
1114: gridBagConstraints.gridy = 4;
1115: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1116: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
1117: gridBagConstraints.weightx = 1.0;
1118: gridBagConstraints.weighty = 1.0;
1119: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
1120: jPanelCustomDataSourceFactory.add(jSeparator1,
1121: gridBagConstraints);
1122:
1123: jPanelConnectionRoot.add(jPanelCustomDataSourceFactory,
1124: java.awt.BorderLayout.CENTER);
1125:
1126: jPanelCSV.setLayout(new java.awt.GridBagLayout());
1127:
1128: jPanelCSV.setPreferredSize(new java.awt.Dimension(1, 30));
1129: jLabel15.setText("CSV file");
1130: gridBagConstraints = new java.awt.GridBagConstraints();
1131: gridBagConstraints.gridx = 0;
1132: gridBagConstraints.gridy = 0;
1133: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1134: gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
1135: jPanelCSV.add(jLabel15, gridBagConstraints);
1136:
1137: gridBagConstraints = new java.awt.GridBagConstraints();
1138: gridBagConstraints.gridx = 1;
1139: gridBagConstraints.gridy = 0;
1140: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1141: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1142: gridBagConstraints.weightx = 1.0;
1143: gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
1144: jPanelCSV.add(jTextFieldCSVFilename, gridBagConstraints);
1145:
1146: jButtonCSVFilename.setText("Browse");
1147: jButtonCSVFilename.setMargin(new java.awt.Insets(2, 4, 2, 4));
1148: jButtonCSVFilename
1149: .addActionListener(new java.awt.event.ActionListener() {
1150: public void actionPerformed(
1151: java.awt.event.ActionEvent evt) {
1152: jButtonCSVFilenameActionPerformed(evt);
1153: }
1154: });
1155:
1156: gridBagConstraints = new java.awt.GridBagConstraints();
1157: gridBagConstraints.gridx = 2;
1158: gridBagConstraints.gridy = 0;
1159: gridBagConstraints.ipadx = 27;
1160: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1161: gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 4);
1162: jPanelCSV.add(jButtonCSVFilename, gridBagConstraints);
1163:
1164: jPanel11.setLayout(new java.awt.GridBagLayout());
1165:
1166: jPanel8.setLayout(new java.awt.GridBagLayout());
1167:
1168: jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(
1169: javax.swing.BorderFactory.createEtchedBorder(),
1170: "Column names"));
1171: jListCVSColumns
1172: .addListSelectionListener(new javax.swing.event.ListSelectionListener() {
1173: public void valueChanged(
1174: javax.swing.event.ListSelectionEvent evt) {
1175: jListCVSColumnsValueChanged(evt);
1176: }
1177: });
1178: jListCVSColumns
1179: .addMouseListener(new java.awt.event.MouseAdapter() {
1180: public void mouseClicked(
1181: java.awt.event.MouseEvent evt) {
1182: jListCVSColumnsMouseClicked(evt);
1183: }
1184: });
1185:
1186: jScrollPane1.setViewportView(jListCVSColumns);
1187:
1188: gridBagConstraints = new java.awt.GridBagConstraints();
1189: gridBagConstraints.gridx = 0;
1190: gridBagConstraints.gridy = 1;
1191: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1192: gridBagConstraints.weightx = 1.0;
1193: gridBagConstraints.weighty = 1.0;
1194: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1195: jPanel8.add(jScrollPane1, gridBagConstraints);
1196:
1197: jPanel9.setLayout(new java.awt.GridBagLayout());
1198:
1199: jPanel9.setPreferredSize(new java.awt.Dimension(71, 200));
1200: jButtonNewParameter.setText("New");
1201: jButtonNewParameter
1202: .addActionListener(new java.awt.event.ActionListener() {
1203: public void actionPerformed(
1204: java.awt.event.ActionEvent evt) {
1205: jButtonNewParameterActionPerformed1(evt);
1206: }
1207: });
1208:
1209: gridBagConstraints = new java.awt.GridBagConstraints();
1210: gridBagConstraints.gridx = 0;
1211: gridBagConstraints.gridy = 0;
1212: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1213: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1214: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
1215: jPanel9.add(jButtonNewParameter, gridBagConstraints);
1216:
1217: jButtonModifyParameter.setText("Modify");
1218: jButtonModifyParameter.setEnabled(false);
1219: jButtonModifyParameter
1220: .addActionListener(new java.awt.event.ActionListener() {
1221: public void actionPerformed(
1222: java.awt.event.ActionEvent evt) {
1223: jButtonModifyParameterActionPerformed1(evt);
1224: }
1225: });
1226:
1227: gridBagConstraints = new java.awt.GridBagConstraints();
1228: gridBagConstraints.gridx = 0;
1229: gridBagConstraints.gridy = 1;
1230: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1231: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1232: gridBagConstraints.insets = new java.awt.Insets(0, 3, 5, 3);
1233: jPanel9.add(jButtonModifyParameter, gridBagConstraints);
1234:
1235: jButtonDeleteParameter.setText("Delete");
1236: jButtonDeleteParameter.setEnabled(false);
1237: jButtonDeleteParameter
1238: .addActionListener(new java.awt.event.ActionListener() {
1239: public void actionPerformed(
1240: java.awt.event.ActionEvent evt) {
1241: jButtonDeleteParameterActionPerformed1(evt);
1242: }
1243: });
1244:
1245: gridBagConstraints = new java.awt.GridBagConstraints();
1246: gridBagConstraints.gridx = 0;
1247: gridBagConstraints.gridy = 2;
1248: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1249: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1250: gridBagConstraints.weightx = 1.0;
1251: gridBagConstraints.insets = new java.awt.Insets(0, 3, 5, 3);
1252: jPanel9.add(jButtonDeleteParameter, gridBagConstraints);
1253:
1254: jPanel10.setLayout(null);
1255:
1256: gridBagConstraints = new java.awt.GridBagConstraints();
1257: gridBagConstraints.gridx = 0;
1258: gridBagConstraints.weighty = 1.0;
1259: jPanel9.add(jPanel10, gridBagConstraints);
1260:
1261: gridBagConstraints = new java.awt.GridBagConstraints();
1262: gridBagConstraints.gridx = 1;
1263: gridBagConstraints.gridy = 1;
1264: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1265: gridBagConstraints.weighty = 1.0;
1266: gridBagConstraints.insets = new java.awt.Insets(4, 0, 4, 4);
1267: jPanel8.add(jPanel9, gridBagConstraints);
1268:
1269: jButtonNewParameter1
1270: .setText("Get columns name from the first row of the file");
1271: jButtonNewParameter1
1272: .addActionListener(new java.awt.event.ActionListener() {
1273: public void actionPerformed(
1274: java.awt.event.ActionEvent evt) {
1275: jButtonNewParameterActionPerformed11(evt);
1276: }
1277: });
1278:
1279: gridBagConstraints = new java.awt.GridBagConstraints();
1280: gridBagConstraints.gridx = 0;
1281: gridBagConstraints.gridy = 0;
1282: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1283: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1284: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
1285: jPanel8.add(jButtonNewParameter1, gridBagConstraints);
1286:
1287: gridBagConstraints = new java.awt.GridBagConstraints();
1288: gridBagConstraints.gridy = 5;
1289: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1290: gridBagConstraints.weightx = 1.0;
1291: gridBagConstraints.weighty = 1.0;
1292: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1293: jPanel11.add(jPanel8, gridBagConstraints);
1294:
1295: jPanel6.setLayout(new java.awt.GridBagLayout());
1296:
1297: jPanel6.setBorder(javax.swing.BorderFactory
1298: .createTitledBorder(javax.swing.BorderFactory
1299: .createEtchedBorder(), "Other"));
1300: jCheckBoxCVSDateFormat.setText("Use custom date format");
1301: jCheckBoxCVSDateFormat.setBorder(javax.swing.BorderFactory
1302: .createEmptyBorder(0, 0, 0, 0));
1303: jCheckBoxCVSDateFormat
1304: .setMargin(new java.awt.Insets(0, 0, 0, 0));
1305: jCheckBoxCVSDateFormat
1306: .addActionListener(new java.awt.event.ActionListener() {
1307: public void actionPerformed(
1308: java.awt.event.ActionEvent evt) {
1309: jCheckBoxCVSDateFormatActionPerformed(evt);
1310: }
1311: });
1312:
1313: gridBagConstraints = new java.awt.GridBagConstraints();
1314: gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 0);
1315: jPanel6.add(jCheckBoxCVSDateFormat, gridBagConstraints);
1316:
1317: jTextFieldCVSDateFormat.setEnabled(false);
1318: jTextFieldCVSDateFormat
1319: .setPreferredSize(new java.awt.Dimension(100, 19));
1320: gridBagConstraints = new java.awt.GridBagConstraints();
1321: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1322: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1323: gridBagConstraints.weightx = 1.0;
1324: gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
1325: jPanel6.add(jTextFieldCVSDateFormat, gridBagConstraints);
1326:
1327: jButtonCVSDateFormat.setText("Date format");
1328: jButtonCVSDateFormat.setEnabled(false);
1329: jButtonCVSDateFormat
1330: .addActionListener(new java.awt.event.ActionListener() {
1331: public void actionPerformed(
1332: java.awt.event.ActionEvent evt) {
1333: jButtonCVSDateFormatActionPerformed(evt);
1334: }
1335: });
1336:
1337: gridBagConstraints = new java.awt.GridBagConstraints();
1338: gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 0);
1339: jPanel6.add(jButtonCVSDateFormat, gridBagConstraints);
1340:
1341: jCheckBoxCVSFirstRowAsHeader
1342: .setText("Skip the first line (the column names will be read from the first line)");
1343: jCheckBoxCVSFirstRowAsHeader
1344: .setActionCommand("Skip the first line (column names will be read from the first line)");
1345: jCheckBoxCVSFirstRowAsHeader
1346: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1347: 0, 0, 0, 0));
1348: jCheckBoxCVSFirstRowAsHeader.setMargin(new java.awt.Insets(0,
1349: 0, 0, 0));
1350: jCheckBoxCVSFirstRowAsHeader
1351: .addActionListener(new java.awt.event.ActionListener() {
1352: public void actionPerformed(
1353: java.awt.event.ActionEvent evt) {
1354: jCheckBoxCVSDateFormatActionPerformed1(evt);
1355: }
1356: });
1357:
1358: gridBagConstraints = new java.awt.GridBagConstraints();
1359: gridBagConstraints.gridx = 0;
1360: gridBagConstraints.gridwidth = 3;
1361: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1362: gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 0);
1363: jPanel6.add(jCheckBoxCVSFirstRowAsHeader, gridBagConstraints);
1364:
1365: gridBagConstraints = new java.awt.GridBagConstraints();
1366: gridBagConstraints.gridx = 0;
1367: gridBagConstraints.gridy = 20;
1368: gridBagConstraints.gridwidth = 3;
1369: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1370: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1371: jPanel11.add(jPanel6, gridBagConstraints);
1372:
1373: jTabbedPane1.addTab("Columns", jPanel11);
1374:
1375: jPanel7.setLayout(new java.awt.GridBagLayout());
1376:
1377: jPanel4.setLayout(new java.awt.GridBagLayout());
1378:
1379: jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(
1380: javax.swing.BorderFactory.createEtchedBorder(),
1381: "Field separator (char)"));
1382: buttonGroupCVSFieldSeparator.add(jRadioButtonCVSSeparatorComma);
1383: jRadioButtonCVSSeparatorComma.setSelected(true);
1384: jRadioButtonCVSSeparatorComma.setText("Comma");
1385: jRadioButtonCVSSeparatorComma
1386: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1387: 0, 0, 0, 0));
1388: jRadioButtonCVSSeparatorComma.setMargin(new java.awt.Insets(0,
1389: 0, 0, 0));
1390: gridBagConstraints = new java.awt.GridBagConstraints();
1391: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1392: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1393: gridBagConstraints.weightx = 1.0;
1394: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1395: jPanel4.add(jRadioButtonCVSSeparatorComma, gridBagConstraints);
1396:
1397: buttonGroupCVSFieldSeparator.add(jRadioButtonCVSSeparatorSpace);
1398: jRadioButtonCVSSeparatorSpace.setText("Space");
1399: jRadioButtonCVSSeparatorSpace
1400: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1401: 0, 0, 0, 0));
1402: jRadioButtonCVSSeparatorSpace.setMargin(new java.awt.Insets(0,
1403: 0, 0, 0));
1404: gridBagConstraints = new java.awt.GridBagConstraints();
1405: gridBagConstraints.gridx = 0;
1406: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1407: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1408: gridBagConstraints.weightx = 1.0;
1409: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1410: jPanel4.add(jRadioButtonCVSSeparatorSpace, gridBagConstraints);
1411:
1412: buttonGroupCVSFieldSeparator.add(jRadioButtonCVSSeparatorTab);
1413: jRadioButtonCVSSeparatorTab.setText("Tab");
1414: jRadioButtonCVSSeparatorTab.setBorder(javax.swing.BorderFactory
1415: .createEmptyBorder(0, 0, 0, 0));
1416: jRadioButtonCVSSeparatorTab.setMargin(new java.awt.Insets(0, 0,
1417: 0, 0));
1418: gridBagConstraints = new java.awt.GridBagConstraints();
1419: gridBagConstraints.gridx = 1;
1420: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1421: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1422: gridBagConstraints.weightx = 1.0;
1423: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1424: jPanel4.add(jRadioButtonCVSSeparatorTab, gridBagConstraints);
1425:
1426: buttonGroupCVSFieldSeparator
1427: .add(jRadioButtonCVSSeparatorSemicolon);
1428: jRadioButtonCVSSeparatorSemicolon.setText("Semicolon");
1429: jRadioButtonCVSSeparatorSemicolon
1430: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1431: 0, 0, 0, 0));
1432: jRadioButtonCVSSeparatorSemicolon
1433: .setMargin(new java.awt.Insets(0, 0, 0, 0));
1434: gridBagConstraints = new java.awt.GridBagConstraints();
1435: gridBagConstraints.gridx = 1;
1436: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1437: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1438: gridBagConstraints.weightx = 1.0;
1439: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1440: jPanel4.add(jRadioButtonCVSSeparatorSemicolon,
1441: gridBagConstraints);
1442:
1443: buttonGroupCVSFieldSeparator.add(jRadioButtonCVSSeparatorOther);
1444: jRadioButtonCVSSeparatorOther.setText("Other");
1445: jRadioButtonCVSSeparatorOther
1446: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1447: 0, 0, 0, 0));
1448: jRadioButtonCVSSeparatorOther.setMargin(new java.awt.Insets(0,
1449: 0, 0, 0));
1450: gridBagConstraints = new java.awt.GridBagConstraints();
1451: gridBagConstraints.gridx = 2;
1452: gridBagConstraints.gridy = 1;
1453: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1454: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1455: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1456: jPanel4.add(jRadioButtonCVSSeparatorOther, gridBagConstraints);
1457:
1458: jTextFieldCVSSeparatorText
1459: .setPreferredSize(new java.awt.Dimension(30, 19));
1460: jTextFieldCVSSeparatorText
1461: .addActionListener(new java.awt.event.ActionListener() {
1462: public void actionPerformed(
1463: java.awt.event.ActionEvent evt) {
1464: jTextFieldCVSSeparatorTextActionPerformed(evt);
1465: }
1466: });
1467:
1468: gridBagConstraints = new java.awt.GridBagConstraints();
1469: gridBagConstraints.gridy = 1;
1470: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1471: gridBagConstraints.weightx = 1.0;
1472: gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 0);
1473: jPanel4.add(jTextFieldCVSSeparatorText, gridBagConstraints);
1474:
1475: buttonGroupCVSFieldSeparator
1476: .add(jRadioButtonCVSSeparatorNewLine);
1477: jRadioButtonCVSSeparatorNewLine.setText("New line");
1478: jRadioButtonCVSSeparatorNewLine
1479: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1480: 0, 0, 0, 0));
1481: jRadioButtonCVSSeparatorNewLine.setMargin(new java.awt.Insets(
1482: 0, 0, 0, 0));
1483: gridBagConstraints = new java.awt.GridBagConstraints();
1484: gridBagConstraints.gridwidth = 2;
1485: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1486: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1487: gridBagConstraints.weightx = 1.0;
1488: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1489: jPanel4
1490: .add(jRadioButtonCVSSeparatorNewLine,
1491: gridBagConstraints);
1492:
1493: gridBagConstraints = new java.awt.GridBagConstraints();
1494: gridBagConstraints.gridx = 0;
1495: gridBagConstraints.gridwidth = 3;
1496: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1497: gridBagConstraints.weightx = 1.0;
1498: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1499: jPanel7.add(jPanel4, gridBagConstraints);
1500:
1501: jPanel5.setLayout(new java.awt.GridBagLayout());
1502:
1503: jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(
1504: javax.swing.BorderFactory.createEtchedBorder(),
1505: "Row separator"));
1506: buttonGroupCVSFieldSeparator1
1507: .add(jRadioButtonCVSSeparatorComma1);
1508: jRadioButtonCVSSeparatorComma1.setText("Comma");
1509: jRadioButtonCVSSeparatorComma1
1510: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1511: 0, 0, 0, 0));
1512: jRadioButtonCVSSeparatorComma1.setMargin(new java.awt.Insets(0,
1513: 0, 0, 0));
1514: gridBagConstraints = new java.awt.GridBagConstraints();
1515: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1516: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1517: gridBagConstraints.weightx = 1.0;
1518: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1519: jPanel5.add(jRadioButtonCVSSeparatorComma1, gridBagConstraints);
1520:
1521: buttonGroupCVSFieldSeparator1
1522: .add(jRadioButtonCVSSeparatorSpace1);
1523: jRadioButtonCVSSeparatorSpace1.setText("Space");
1524: jRadioButtonCVSSeparatorSpace1
1525: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1526: 0, 0, 0, 0));
1527: jRadioButtonCVSSeparatorSpace1.setMargin(new java.awt.Insets(0,
1528: 0, 0, 0));
1529: gridBagConstraints = new java.awt.GridBagConstraints();
1530: gridBagConstraints.gridx = 0;
1531: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1532: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1533: gridBagConstraints.weightx = 1.0;
1534: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1535: jPanel5.add(jRadioButtonCVSSeparatorSpace1, gridBagConstraints);
1536:
1537: buttonGroupCVSFieldSeparator1.add(jRadioButtonCVSSeparatorTab1);
1538: jRadioButtonCVSSeparatorTab1.setText("Tab");
1539: jRadioButtonCVSSeparatorTab1
1540: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1541: 0, 0, 0, 0));
1542: jRadioButtonCVSSeparatorTab1.setMargin(new java.awt.Insets(0,
1543: 0, 0, 0));
1544: gridBagConstraints = new java.awt.GridBagConstraints();
1545: gridBagConstraints.gridx = 1;
1546: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1547: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1548: gridBagConstraints.weightx = 1.0;
1549: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1550: jPanel5.add(jRadioButtonCVSSeparatorTab1, gridBagConstraints);
1551:
1552: buttonGroupCVSFieldSeparator1
1553: .add(jRadioButtonCVSSeparatorSemicolon1);
1554: jRadioButtonCVSSeparatorSemicolon1.setText("Semicolon");
1555: jRadioButtonCVSSeparatorSemicolon1
1556: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1557: 0, 0, 0, 0));
1558: jRadioButtonCVSSeparatorSemicolon1
1559: .setMargin(new java.awt.Insets(0, 0, 0, 0));
1560: gridBagConstraints = new java.awt.GridBagConstraints();
1561: gridBagConstraints.gridx = 1;
1562: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1563: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1564: gridBagConstraints.weightx = 1.0;
1565: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1566: jPanel5.add(jRadioButtonCVSSeparatorSemicolon1,
1567: gridBagConstraints);
1568:
1569: buttonGroupCVSFieldSeparator1
1570: .add(jRadioButtonCVSSeparatorNewLine1);
1571: jRadioButtonCVSSeparatorNewLine1.setSelected(true);
1572: jRadioButtonCVSSeparatorNewLine1.setText("New line");
1573: jRadioButtonCVSSeparatorNewLine1
1574: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1575: 0, 0, 0, 0));
1576: jRadioButtonCVSSeparatorNewLine1.setMargin(new java.awt.Insets(
1577: 0, 0, 0, 0));
1578: gridBagConstraints = new java.awt.GridBagConstraints();
1579: gridBagConstraints.gridwidth = 2;
1580: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1581: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1582: gridBagConstraints.weightx = 1.0;
1583: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1584: jPanel5.add(jRadioButtonCVSSeparatorNewLine1,
1585: gridBagConstraints);
1586:
1587: buttonGroupCVSFieldSeparator1
1588: .add(jRadioButtonCVSSeparatorOther1);
1589: jRadioButtonCVSSeparatorOther1.setText("Other");
1590: jRadioButtonCVSSeparatorOther1
1591: .setBorder(javax.swing.BorderFactory.createEmptyBorder(
1592: 0, 0, 0, 0));
1593: jRadioButtonCVSSeparatorOther1.setMargin(new java.awt.Insets(0,
1594: 0, 0, 0));
1595: gridBagConstraints = new java.awt.GridBagConstraints();
1596: gridBagConstraints.gridx = 2;
1597: gridBagConstraints.gridy = 1;
1598: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1599: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;
1600: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1601: jPanel5.add(jRadioButtonCVSSeparatorOther1, gridBagConstraints);
1602:
1603: jTextFieldCVSSeparatorText1
1604: .setPreferredSize(new java.awt.Dimension(30, 19));
1605: jTextFieldCVSSeparatorText1
1606: .addActionListener(new java.awt.event.ActionListener() {
1607: public void actionPerformed(
1608: java.awt.event.ActionEvent evt) {
1609: jTextFieldCVSSeparatorText1ActionPerformed(evt);
1610: }
1611: });
1612:
1613: gridBagConstraints = new java.awt.GridBagConstraints();
1614: gridBagConstraints.gridy = 1;
1615: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1616: gridBagConstraints.weightx = 1.0;
1617: gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 0);
1618: jPanel5.add(jTextFieldCVSSeparatorText1, gridBagConstraints);
1619:
1620: gridBagConstraints = new java.awt.GridBagConstraints();
1621: gridBagConstraints.gridx = 0;
1622: gridBagConstraints.gridwidth = 3;
1623: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1624: gridBagConstraints.weightx = 1.0;
1625: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1626: jPanel7.add(jPanel5, gridBagConstraints);
1627:
1628: gridBagConstraints = new java.awt.GridBagConstraints();
1629: gridBagConstraints.gridx = 0;
1630: gridBagConstraints.weighty = 1.0;
1631: jPanel7.add(jPanel12, gridBagConstraints);
1632:
1633: jTabbedPane1.addTab("Separators", jPanel7);
1634:
1635: gridBagConstraints = new java.awt.GridBagConstraints();
1636: gridBagConstraints.gridx = 0;
1637: gridBagConstraints.gridwidth = 3;
1638: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1639: gridBagConstraints.weightx = 1.0;
1640: gridBagConstraints.weighty = 1.0;
1641: jPanelCSV.add(jTabbedPane1, gridBagConstraints);
1642:
1643: gridBagConstraints = new java.awt.GridBagConstraints();
1644: gridBagConstraints.gridx = 0;
1645: gridBagConstraints.gridy = 99;
1646: gridBagConstraints.gridwidth = 3;
1647: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1648: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
1649: gridBagConstraints.weightx = 1.0;
1650: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
1651: jPanelCSV.add(jSeparator4, gridBagConstraints);
1652:
1653: jPanelConnectionRoot.add(jPanelCSV,
1654: java.awt.BorderLayout.CENTER);
1655:
1656: jPanelDatasourceProvider
1657: .setLayout(new java.awt.GridBagLayout());
1658:
1659: jLabel17.setText("JasperReports DataSource Provider class");
1660: gridBagConstraints = new java.awt.GridBagConstraints();
1661: gridBagConstraints.gridx = 0;
1662: gridBagConstraints.gridy = 0;
1663: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1664: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1665: gridBagConstraints.weightx = 1.0;
1666: gridBagConstraints.insets = new java.awt.Insets(3, 5, 1, 3);
1667: jPanelDatasourceProvider.add(jLabel17, gridBagConstraints);
1668:
1669: jTextFieldJRDataSourceProvider
1670: .setText("it.businesslogic.ireport.examples.PersonBeansDataSource");
1671: gridBagConstraints = new java.awt.GridBagConstraints();
1672: gridBagConstraints.gridx = 0;
1673: gridBagConstraints.gridy = 1;
1674: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1675: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1676: gridBagConstraints.insets = new java.awt.Insets(3, 5, 3, 3);
1677: jPanelDatasourceProvider.add(jTextFieldJRDataSourceProvider,
1678: gridBagConstraints);
1679:
1680: gridBagConstraints = new java.awt.GridBagConstraints();
1681: gridBagConstraints.gridx = 0;
1682: gridBagConstraints.gridy = 4;
1683: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1684: gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
1685: gridBagConstraints.weightx = 1.0;
1686: gridBagConstraints.weighty = 1.0;
1687: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
1688: jPanelDatasourceProvider.add(jSeparator3, gridBagConstraints);
1689:
1690: jPanelConnectionRoot.add(jPanelDatasourceProvider,
1691: java.awt.BorderLayout.CENTER);
1692:
1693: jPanelHibernate.setLayout(new java.awt.GridBagLayout());
1694:
1695: jTextPane1
1696: .setText("Press the test button.\\n\\niReport will look in the classpath for a valid hibernate configuration.");
1697: jTextPane1.setOpaque(false);
1698: gridBagConstraints = new java.awt.GridBagConstraints();
1699: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1700: gridBagConstraints.weightx = 1.0;
1701: gridBagConstraints.weighty = 1.0;
1702: jPanelHibernate.add(jTextPane1, gridBagConstraints);
1703:
1704: jLabel8
1705: .setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
1706: jLabel8
1707: .setIcon(new javax.swing.ImageIcon(
1708: getClass()
1709: .getResource(
1710: "/it/businesslogic/ireport/icons/hibernate.png")));
1711: jLabel8.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
1712: jLabel8
1713: .setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
1714: gridBagConstraints = new java.awt.GridBagConstraints();
1715: gridBagConstraints.gridy = 1;
1716: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1717: jPanelHibernate.add(jLabel8, gridBagConstraints);
1718:
1719: jPanelConnectionRoot.add(jPanelHibernate,
1720: java.awt.BorderLayout.CENTER);
1721:
1722: jPanelEJBQL.setLayout(new java.awt.GridBagLayout());
1723:
1724: jLabel18.setText("Persistance Unit Name");
1725: gridBagConstraints = new java.awt.GridBagConstraints();
1726: gridBagConstraints.gridx = 0;
1727: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1728: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1729: gridBagConstraints.weightx = 1.0;
1730: gridBagConstraints.insets = new java.awt.Insets(4, 4, 2, 4);
1731: jPanelEJBQL.add(jLabel18, gridBagConstraints);
1732:
1733: jTextFieldPersistanceUnit.setMargin(new java.awt.Insets(0, 5,
1734: 2, 4));
1735: gridBagConstraints = new java.awt.GridBagConstraints();
1736: gridBagConstraints.gridx = 0;
1737: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1738: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1739: gridBagConstraints.weightx = 1.0;
1740: gridBagConstraints.insets = new java.awt.Insets(0, 4, 3, 4);
1741: jPanelEJBQL.add(jTextFieldPersistanceUnit, gridBagConstraints);
1742:
1743: jScrollPane2.setBorder(null);
1744: jScrollPane2.setFocusable(false);
1745: jScrollPane2.setRequestFocusEnabled(false);
1746: jScrollPane2.setVerifyInputWhenFocusTarget(false);
1747: jTextPane2.setBorder(null);
1748: jTextPane2.setEditable(false);
1749: jTextPane2
1750: .setText("iReport will search for persistence.xml files within the META-INF directory of any CLASSPATH element");
1751: jTextPane2.setOpaque(false);
1752: jScrollPane2.setViewportView(jTextPane2);
1753:
1754: gridBagConstraints = new java.awt.GridBagConstraints();
1755: gridBagConstraints.gridx = 0;
1756: gridBagConstraints.gridy = 2;
1757: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1758: gridBagConstraints.weightx = 1.0;
1759: gridBagConstraints.weighty = 1.0;
1760: gridBagConstraints.insets = new java.awt.Insets(12, 4, 4, 4);
1761: jPanelEJBQL.add(jScrollPane2, gridBagConstraints);
1762:
1763: jPanelConnectionRoot.add(jPanelEJBQL,
1764: java.awt.BorderLayout.CENTER);
1765:
1766: jPanelMondrian.setLayout(new java.awt.GridBagLayout());
1767:
1768: jLabel20.setText("Jdbc Connection");
1769: gridBagConstraints = new java.awt.GridBagConstraints();
1770: gridBagConstraints.gridx = 0;
1771: gridBagConstraints.gridwidth = 2;
1772: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1773: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1774: gridBagConstraints.weightx = 1.0;
1775: gridBagConstraints.insets = new java.awt.Insets(4, 4, 2, 4);
1776: jPanelMondrian.add(jLabel20, gridBagConstraints);
1777:
1778: gridBagConstraints = new java.awt.GridBagConstraints();
1779: gridBagConstraints.gridx = 0;
1780: gridBagConstraints.gridwidth = 2;
1781: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1782: gridBagConstraints.weightx = 1.0;
1783: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
1784: jPanelMondrian.add(jComboBoxMondrianJdbc, gridBagConstraints);
1785:
1786: jLabel19.setText("Catalog URI (i.e. file:/path/schema.xml)");
1787: gridBagConstraints = new java.awt.GridBagConstraints();
1788: gridBagConstraints.gridx = 0;
1789: gridBagConstraints.gridwidth = 2;
1790: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1791: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1792: gridBagConstraints.weightx = 1.0;
1793: gridBagConstraints.insets = new java.awt.Insets(4, 4, 2, 4);
1794: jPanelMondrian.add(jLabel19, gridBagConstraints);
1795:
1796: jTextFieldCatalogURI.setMargin(new java.awt.Insets(0, 5, 2, 4));
1797: gridBagConstraints = new java.awt.GridBagConstraints();
1798: gridBagConstraints.gridx = 0;
1799: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1800: gridBagConstraints.weightx = 1.0;
1801: gridBagConstraints.insets = new java.awt.Insets(0, 4, 3, 4);
1802: jPanelMondrian.add(jTextFieldCatalogURI, gridBagConstraints);
1803:
1804: jButtonBrowseCatalog.setText("Browse...");
1805: jButtonBrowseCatalog
1806: .addActionListener(new java.awt.event.ActionListener() {
1807: public void actionPerformed(
1808: java.awt.event.ActionEvent evt) {
1809: jButtonBrowseCatalogActionPerformed(evt);
1810: }
1811: });
1812:
1813: gridBagConstraints = new java.awt.GridBagConstraints();
1814: gridBagConstraints.gridx = 1;
1815: jPanelMondrian.add(jButtonBrowseCatalog, gridBagConstraints);
1816:
1817: gridBagConstraints = new java.awt.GridBagConstraints();
1818: gridBagConstraints.gridx = 0;
1819: gridBagConstraints.weighty = 1.0;
1820: jPanelMondrian.add(jPanel14, gridBagConstraints);
1821:
1822: jPanelConnectionRoot.add(jPanelMondrian,
1823: java.awt.BorderLayout.CENTER);
1824:
1825: jPanelSpringLoadedHibernate
1826: .setLayout(new java.awt.GridBagLayout());
1827:
1828: jLabel21.setText("Spring configuration");
1829: gridBagConstraints = new java.awt.GridBagConstraints();
1830: gridBagConstraints.gridx = 0;
1831: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1832: gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
1833: jPanelSpringLoadedHibernate.add(jLabel21, gridBagConstraints);
1834:
1835: gridBagConstraints = new java.awt.GridBagConstraints();
1836: gridBagConstraints.gridx = 0;
1837: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1838: gridBagConstraints.insets = new java.awt.Insets(2, 4, 4, 4);
1839: jPanelSpringLoadedHibernate.add(jTextFieldSLHSpringConfig,
1840: gridBagConstraints);
1841:
1842: jLabel22.setText("Session Factory Bean ID");
1843: gridBagConstraints = new java.awt.GridBagConstraints();
1844: gridBagConstraints.gridx = 0;
1845: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1846: gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
1847: jPanelSpringLoadedHibernate.add(jLabel22, gridBagConstraints);
1848:
1849: gridBagConstraints = new java.awt.GridBagConstraints();
1850: gridBagConstraints.gridx = 0;
1851: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1852: gridBagConstraints.insets = new java.awt.Insets(2, 4, 4, 4);
1853: jPanelSpringLoadedHibernate.add(jTextFieldSLHSessionFactory,
1854: gridBagConstraints);
1855:
1856: jLabel16
1857: .setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
1858: jLabel16
1859: .setIcon(new javax.swing.ImageIcon(
1860: getClass()
1861: .getResource(
1862: "/it/businesslogic/ireport/icons/hibernate.png")));
1863: jLabel16
1864: .setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
1865: jLabel16
1866: .setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
1867: gridBagConstraints = new java.awt.GridBagConstraints();
1868: gridBagConstraints.gridx = 0;
1869: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1870: gridBagConstraints.weightx = 1.0;
1871: gridBagConstraints.weighty = 1.0;
1872: jPanelSpringLoadedHibernate.add(jLabel16, gridBagConstraints);
1873:
1874: jPanelConnectionRoot.add(jPanelSpringLoadedHibernate,
1875: java.awt.BorderLayout.CENTER);
1876:
1877: jPanelQueryExecutorMode.setLayout(new java.awt.GridBagLayout());
1878:
1879: jPanelQueryExecutorMode.setMinimumSize(new java.awt.Dimension(
1880: 125, 204));
1881: jPanelQueryExecutorMode
1882: .setPreferredSize(new java.awt.Dimension(20, 20));
1883: jLabel23.setText(" ");
1884: jPanelQueryExecutorMode.add(jLabel23,
1885: new java.awt.GridBagConstraints());
1886:
1887: jPanelConnectionRoot.add(jPanelQueryExecutorMode,
1888: java.awt.BorderLayout.CENTER);
1889:
1890: jPanelEmptyDataSource.setLayout(new java.awt.GridBagLayout());
1891:
1892: jLabel24
1893: .setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
1894: jLabel24.setText("Number of empty records");
1895: gridBagConstraints = new java.awt.GridBagConstraints();
1896: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1897: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
1898: gridBagConstraints.weighty = 1.0;
1899: gridBagConstraints.insets = new java.awt.Insets(16, 20, 0, 4);
1900: jPanelEmptyDataSource.add(jLabel24, gridBagConstraints);
1901:
1902: jSpinnerNumRecords.setPreferredSize(new java.awt.Dimension(70,
1903: 18));
1904: gridBagConstraints = new java.awt.GridBagConstraints();
1905: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1906: gridBagConstraints.weightx = 1.0;
1907: gridBagConstraints.weighty = 1.0;
1908: gridBagConstraints.insets = new java.awt.Insets(14, 0, 0, 20);
1909: jPanelEmptyDataSource.add(jSpinnerNumRecords,
1910: gridBagConstraints);
1911:
1912: jPanelConnectionRoot.add(jPanelEmptyDataSource,
1913: java.awt.BorderLayout.CENTER);
1914:
1915: jPanelCustomConnection.setLayout(new java.awt.GridBagLayout());
1916:
1917: jLabel25
1918: .setText("Class name of the IReportConnection implementation");
1919: gridBagConstraints = new java.awt.GridBagConstraints();
1920: gridBagConstraints.gridx = 0;
1921: gridBagConstraints.gridy = 0;
1922: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1923: gridBagConstraints.insets = new java.awt.Insets(3, 5, 0, 3);
1924: jPanelCustomConnection.add(jLabel25, gridBagConstraints);
1925:
1926: jTextFieldIReportConnectionClassName
1927: .setText("it.businesslogic.ireport.connection.JREmptyDatasourceConnection");
1928: gridBagConstraints = new java.awt.GridBagConstraints();
1929: gridBagConstraints.gridx = 0;
1930: gridBagConstraints.gridy = 1;
1931: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1932: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1933: gridBagConstraints.insets = new java.awt.Insets(3, 5, 3, 3);
1934: jPanelCustomConnection.add(
1935: jTextFieldIReportConnectionClassName,
1936: gridBagConstraints);
1937:
1938: jPanel15.setLayout(new java.awt.GridBagLayout());
1939:
1940: jLabelPropertiesTable.setText("IReportConnection properties");
1941: gridBagConstraints = new java.awt.GridBagConstraints();
1942: gridBagConstraints.gridx = 0;
1943: gridBagConstraints.gridy = 0;
1944: gridBagConstraints.gridwidth = 2;
1945: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1946: gridBagConstraints.insets = new java.awt.Insets(6, 5, 0, 3);
1947: jPanel15.add(jLabelPropertiesTable, gridBagConstraints);
1948:
1949: jTableCustomProperties
1950: .setModel(new javax.swing.table.DefaultTableModel(
1951: new Object[][] {
1952:
1953: }, new String[] { "Name", "Value" }) {
1954: Class[] types = new Class[] {
1955: java.lang.String.class,
1956: java.lang.String.class };
1957:
1958: public Class getColumnClass(int columnIndex) {
1959: return types[columnIndex];
1960: }
1961: });
1962: jTableCustomProperties
1963: .addMouseListener(new java.awt.event.MouseAdapter() {
1964: public void mouseClicked(
1965: java.awt.event.MouseEvent evt) {
1966: jTableCustomPropertiesMouseClicked(evt);
1967: }
1968: });
1969:
1970: jScrollPane3.setViewportView(jTableCustomProperties);
1971:
1972: gridBagConstraints = new java.awt.GridBagConstraints();
1973: gridBagConstraints.gridx = 0;
1974: gridBagConstraints.gridwidth = 2;
1975: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1976: gridBagConstraints.weightx = 1.0;
1977: gridBagConstraints.weighty = 1.0;
1978: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1979: jPanel15.add(jScrollPane3, gridBagConstraints);
1980:
1981: jButtonAddProp.setText("Add");
1982: jButtonAddProp
1983: .addActionListener(new java.awt.event.ActionListener() {
1984: public void actionPerformed(
1985: java.awt.event.ActionEvent evt) {
1986: jButtonAddPropActionPerformed(evt);
1987: }
1988: });
1989:
1990: gridBagConstraints = new java.awt.GridBagConstraints();
1991: gridBagConstraints.gridx = 0;
1992: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
1993: jPanel15.add(jButtonAddProp, gridBagConstraints);
1994:
1995: jButtonRemoveProp.setText("Remove");
1996: jButtonRemoveProp.setEnabled(false);
1997: jButtonRemoveProp
1998: .addActionListener(new java.awt.event.ActionListener() {
1999: public void actionPerformed(
2000: java.awt.event.ActionEvent evt) {
2001: jButtonRemovePropActionPerformed(evt);
2002: }
2003: });
2004:
2005: gridBagConstraints = new java.awt.GridBagConstraints();
2006: gridBagConstraints.gridx = 1;
2007: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
2008: gridBagConstraints.weightx = 1.0;
2009: gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 4);
2010: jPanel15.add(jButtonRemoveProp, gridBagConstraints);
2011:
2012: gridBagConstraints = new java.awt.GridBagConstraints();
2013: gridBagConstraints.gridx = 0;
2014: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
2015: gridBagConstraints.weightx = 1.0;
2016: gridBagConstraints.weighty = 1.0;
2017: jPanelCustomConnection.add(jPanel15, gridBagConstraints);
2018:
2019: jPanelConnectionRoot.add(jPanelCustomConnection,
2020: java.awt.BorderLayout.NORTH);
2021:
2022: jPanelXMLA.setLayout(new java.awt.GridBagLayout());
2023:
2024: jLabelXMLAUrl.setText("Url of XML/A server");
2025: gridBagConstraints = new java.awt.GridBagConstraints();
2026: gridBagConstraints.gridx = 0;
2027: gridBagConstraints.gridwidth = 2;
2028: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
2029: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
2030: gridBagConstraints.weightx = 1.0;
2031: gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
2032: jPanelXMLA.add(jLabelXMLAUrl, gridBagConstraints);
2033:
2034: jTextFieldXMLAUrl
2035: .setText("http://localhost:8080/mondrian/xmla");
2036: gridBagConstraints = new java.awt.GridBagConstraints();
2037: gridBagConstraints.gridx = 0;
2038: gridBagConstraints.gridwidth = 2;
2039: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
2040: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
2041: gridBagConstraints.weightx = 1.0;
2042: gridBagConstraints.insets = new java.awt.Insets(2, 4, 4, 4);
2043: jPanelXMLA.add(jTextFieldXMLAUrl, gridBagConstraints);
2044:
2045: jButtonGetXMLAMetadata.setText("Get metadata");
2046: jButtonGetXMLAMetadata
2047: .addActionListener(new java.awt.event.ActionListener() {
2048: public void actionPerformed(
2049: java.awt.event.ActionEvent evt) {
2050: jButtonGetXMLAMetadataActionPerformed(evt);
2051: }
2052: });
2053:
2054: gridBagConstraints = new java.awt.GridBagConstraints();
2055: gridBagConstraints.gridx = 0;
2056: gridBagConstraints.gridwidth = 2;
2057: gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
2058: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
2059: jPanelXMLA.add(jButtonGetXMLAMetadata, gridBagConstraints);
2060:
2061: jLabelXMLADatasource.setText("Datasource");
2062: gridBagConstraints = new java.awt.GridBagConstraints();
2063: gridBagConstraints.gridx = 0;
2064: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
2065: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
2066: gridBagConstraints.insets = new java.awt.Insets(4, 4, 2, 4);
2067: jPanelXMLA.add(jLabelXMLADatasource, gridBagConstraints);
2068:
2069: jComboBoxXMLADatasource.setMinimumSize(new java.awt.Dimension(
2070: 23, 22));
2071: gridBagConstraints = new java.awt.GridBagConstraints();
2072: gridBagConstraints.gridx = 1;
2073: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
2074: gridBagConstraints.weightx = 1.0;
2075: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
2076: jPanelXMLA.add(jComboBoxXMLADatasource, gridBagConstraints);
2077:
2078: jLabelXMLACatalog.setText("Catalog");
2079: gridBagConstraints = new java.awt.GridBagConstraints();
2080: gridBagConstraints.gridx = 0;
2081: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
2082: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
2083: gridBagConstraints.insets = new java.awt.Insets(4, 4, 2, 4);
2084: jPanelXMLA.add(jLabelXMLACatalog, gridBagConstraints);
2085:
2086: jComboBoxXMLACatalog.setMinimumSize(new java.awt.Dimension(23,
2087: 22));
2088: gridBagConstraints = new java.awt.GridBagConstraints();
2089: gridBagConstraints.gridx = 1;
2090: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
2091: gridBagConstraints.weightx = 1.0;
2092: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
2093: jPanelXMLA.add(jComboBoxXMLACatalog, gridBagConstraints);
2094:
2095: gridBagConstraints = new java.awt.GridBagConstraints();
2096: gridBagConstraints.gridx = 0;
2097: gridBagConstraints.gridwidth = 2;
2098: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
2099: gridBagConstraints.weightx = 1.0;
2100: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
2101: jPanelXMLA.add(jSeparator8, gridBagConstraints);
2102:
2103: jLabelXMLACube.setText("Cube");
2104: gridBagConstraints = new java.awt.GridBagConstraints();
2105: gridBagConstraints.gridx = 0;
2106: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
2107: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
2108: gridBagConstraints.insets = new java.awt.Insets(4, 4, 2, 4);
2109: jPanelXMLA.add(jLabelXMLACube, gridBagConstraints);
2110:
2111: jComboBoxXMLACube
2112: .setMinimumSize(new java.awt.Dimension(23, 22));
2113: gridBagConstraints = new java.awt.GridBagConstraints();
2114: gridBagConstraints.gridx = 1;
2115: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
2116: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
2117: gridBagConstraints.weightx = 1.0;
2118: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
2119: jPanelXMLA.add(jComboBoxXMLACube, gridBagConstraints);
2120:
2121: gridBagConstraints = new java.awt.GridBagConstraints();
2122: gridBagConstraints.gridx = 0;
2123: gridBagConstraints.gridwidth = 2;
2124: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
2125: gridBagConstraints.weightx = 1.0;
2126: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
2127: jPanelXMLA.add(jSeparator10, gridBagConstraints);
2128:
2129: jPanel16.setLayout(new java.awt.GridBagLayout());
2130:
2131: jLabel26.setText("Username");
2132: gridBagConstraints = new java.awt.GridBagConstraints();
2133: gridBagConstraints.gridx = 0;
2134: gridBagConstraints.gridy = 5;
2135: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
2136: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
2137: jPanel16.add(jLabel26, gridBagConstraints);
2138:
2139: jLabel27.setText("Password");
2140: gridBagConstraints = new java.awt.GridBagConstraints();
2141: gridBagConstraints.gridx = 0;
2142: gridBagConstraints.gridy = 6;
2143: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
2144: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
2145: jPanel16.add(jLabel27, gridBagConstraints);
2146:
2147: gridBagConstraints = new java.awt.GridBagConstraints();
2148: gridBagConstraints.gridx = 1;
2149: gridBagConstraints.gridy = 5;
2150: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
2151: gridBagConstraints.weightx = 1.0;
2152: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
2153: jPanel16.add(jTextFieldUsername1, gridBagConstraints);
2154:
2155: jTextFieldPassword1.setFont(new java.awt.Font("Tahoma", 0, 11));
2156: gridBagConstraints = new java.awt.GridBagConstraints();
2157: gridBagConstraints.gridx = 1;
2158: gridBagConstraints.gridy = 6;
2159: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
2160: gridBagConstraints.weightx = 1.0;
2161: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
2162: jPanel16.add(jTextFieldPassword1, gridBagConstraints);
2163:
2164: jCheckBoxSavePassword1.setText("Save password");
2165: gridBagConstraints = new java.awt.GridBagConstraints();
2166: gridBagConstraints.gridx = 2;
2167: gridBagConstraints.gridy = 6;
2168: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
2169: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 6);
2170: jPanel16.add(jCheckBoxSavePassword1, gridBagConstraints);
2171:
2172: jLabelAttention
2173: .setText("<html>ATTENTION! Passwords are stored in clear text. If you dont specify a password now, iReport will ask you for one only when required and will not save it.");
2174: jLabelAttention.setBorder(javax.swing.BorderFactory
2175: .createEtchedBorder());
2176: gridBagConstraints = new java.awt.GridBagConstraints();
2177: gridBagConstraints.gridx = 0;
2178: gridBagConstraints.gridwidth = 3;
2179: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
2180: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
2181: gridBagConstraints.weightx = 1.0;
2182: gridBagConstraints.weighty = 1.0;
2183: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
2184: jPanel16.add(jLabelAttention, gridBagConstraints);
2185:
2186: gridBagConstraints = new java.awt.GridBagConstraints();
2187: gridBagConstraints.gridx = 0;
2188: gridBagConstraints.gridwidth = 2;
2189: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
2190: gridBagConstraints.weightx = 1.0;
2191: gridBagConstraints.weighty = 1.0;
2192: jPanelXMLA.add(jPanel16, gridBagConstraints);
2193:
2194: jPanelConnectionRoot.add(jPanelXMLA,
2195: java.awt.BorderLayout.SOUTH);
2196:
2197: jPanel1.add(jPanelConnectionRoot, java.awt.BorderLayout.CENTER);
2198:
2199: jPanelButtons.setLayout(new java.awt.FlowLayout(
2200: java.awt.FlowLayout.RIGHT));
2201:
2202: jButtonOK.setMnemonic('s');
2203: jButtonOK.setText("Save");
2204: jButtonOK
2205: .addActionListener(new java.awt.event.ActionListener() {
2206: public void actionPerformed(
2207: java.awt.event.ActionEvent evt) {
2208: jButtonOKActionPerformed(evt);
2209: }
2210: });
2211:
2212: jPanelButtons.add(jButtonOK);
2213:
2214: jButtonCancel.setMnemonic('c');
2215: jButtonCancel.setText("Cancel");
2216: jButtonCancel
2217: .addActionListener(new java.awt.event.ActionListener() {
2218: public void actionPerformed(
2219: java.awt.event.ActionEvent evt) {
2220: jButtonCancelActionPerformed(evt);
2221: }
2222: });
2223:
2224: jPanelButtons.add(jButtonCancel);
2225:
2226: jButtonOK1.setMnemonic('t');
2227: jButtonOK1.setText("Test");
2228: jButtonOK1
2229: .addActionListener(new java.awt.event.ActionListener() {
2230: public void actionPerformed(
2231: java.awt.event.ActionEvent evt) {
2232: jButtonOK1ActionPerformed(evt);
2233: }
2234: });
2235:
2236: jPanelButtons.add(jButtonOK1);
2237:
2238: jPanel1.add(jPanelButtons, java.awt.BorderLayout.SOUTH);
2239:
2240: getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
2241:
2242: java.awt.Dimension screenSize = java.awt.Toolkit
2243: .getDefaultToolkit().getScreenSize();
2244: setBounds((screenSize.width - 500) / 2,
2245: (screenSize.height - 531) / 2, 500, 531);
2246: }// </editor-fold>//GEN-END:initComponents
2247:
2248: private void jRadioButtonXML_datasourceActionPerformed(
2249: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonXML_datasourceActionPerformed
2250: XMLDataSourceCheckBoxesChanged();
2251: }//GEN-LAST:event_jRadioButtonXML_datasourceActionPerformed
2252:
2253: private void jButtonXMLDatePattern1jButtonXMLDatePatternjButton2ActionPerformed11(
2254: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonXMLDatePattern1jButtonXMLDatePatternjButton2ActionPerformed11
2255:
2256: TimeZoneDialog lsd = new TimeZoneDialog(this , true);
2257: if (this .tmpXMLTimeZone != null) {
2258: lsd.setReportTimeZoneId(tmpXMLTimeZone.getID());
2259: }
2260:
2261: lsd.setVisible(true);
2262:
2263: if (lsd.getDialogResult() == JOptionPane.OK_OPTION) {
2264: if (lsd.getReportTimeZoneId() == null) {
2265: tmpXMLTimeZone = null;
2266: jTextFieldXMLTimeZoneValue.setText(I18n.getString(
2267: "timezone.default", "Default"));
2268: } else {
2269: tmpXMLTimeZone = TimeZone.getTimeZone(lsd
2270: .getReportTimeZoneId());
2271: jTextFieldXMLTimeZoneValue.setText(tmpXMLTimeZone
2272: .getDisplayName(I18n.getCurrentLocale()));
2273: }
2274: }
2275: }//GEN-LAST:event_jButtonXMLDatePattern1jButtonXMLDatePatternjButton2ActionPerformed11
2276:
2277: private void jButtonXMLDatePatternjButton2ActionPerformed11(
2278: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonXMLDatePatternjButton2ActionPerformed11
2279:
2280: LocaleSelectorDialog lsd = new LocaleSelectorDialog(this , true);
2281: if (this .tmpXMLLocale != null) {
2282: lsd.setSelectedLocale(this .tmpXMLLocale);
2283: }
2284:
2285: lsd.setVisible(true);
2286:
2287: if (lsd.getDialogResult() == JOptionPane.OK_OPTION) {
2288: tmpXMLLocale = lsd.getSelectedLocale();
2289: jTextFieldXMLLocaleValue
2290: .setText((tmpXMLLocale == null) ? I18n.getString(
2291: "timezone.default", "Default")
2292: : tmpXMLLocale.getDisplayName(I18n
2293: .getCurrentLocale()));
2294: }
2295:
2296: }//GEN-LAST:event_jButtonXMLDatePatternjButton2ActionPerformed11
2297:
2298: private void jButtonXMLDatePatternjButton2ActionPerformed1(
2299: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonXMLDatePatternjButton2ActionPerformed1
2300:
2301: FieldPatternDialog fpd = new FieldPatternDialog(this , true);
2302: fpd.setOnlyNumbers(true);
2303: if (jTextFieldXMLNumberPattern.getText().length() > 0) {
2304: fpd.setPattern(jTextFieldXMLNumberPattern.getText());
2305: }
2306:
2307: fpd.setVisible(true);
2308:
2309: if (fpd.getDialogResult() == JOptionPane.OK_OPTION) {
2310: jTextFieldXMLNumberPattern.setText(fpd.getPattern());
2311: }
2312:
2313: }//GEN-LAST:event_jButtonXMLDatePatternjButton2ActionPerformed1
2314:
2315: private void jButton2ActionPerformed1(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed1
2316:
2317: FieldPatternDialog fpd = new FieldPatternDialog(this , true);
2318: fpd.setOnlyDate(true);
2319: if (jTextFieldXMLDatePattern.getText().length() > 0) {
2320: fpd.setPattern(jTextFieldXMLDatePattern.getText());
2321: }
2322:
2323: fpd.setVisible(true);
2324:
2325: if (fpd.getDialogResult() == JOptionPane.OK_OPTION) {
2326: jTextFieldXMLDatePattern.setText(fpd.getPattern());
2327: }
2328: }//GEN-LAST:event_jButton2ActionPerformed1
2329:
2330: private void jButtonGetXMLAMetadataActionPerformed(
2331: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGetXMLAMetadataActionPerformed
2332: jComboBoxXMLADatasource.removeActionListener(dsListener);
2333: jComboBoxXMLACatalog.removeActionListener(catListener);
2334:
2335: String urlstr = this .jTextFieldXMLAUrl.getText().trim();
2336:
2337: Authenticator.setDefault(new CustomHTTPAuthenticator(
2338: jTextFieldUsername1.getText(), new String(
2339: jTextFieldPassword1.getPassword())));
2340:
2341: rex.metadata.ServerMetadata smd = new rex.metadata.ServerMetadata(
2342: urlstr, (Component) getParent());
2343:
2344: if (smd.isValidUrl() == false) {
2345: JOptionPane
2346: .showMessageDialog(
2347: (Component) getParent(),
2348: I18n
2349: .getString(
2350: "messages.connectionDialog.xmla.invalidUrl",
2351: "Unable to connect to XMLA server."),
2352: "", JOptionPane.INFORMATION_MESSAGE);
2353: return;
2354: }
2355: this .jComboBoxXMLADatasource.removeAllItems();
2356: this .jComboBoxXMLACatalog.removeAllItems();
2357: this .jComboBoxXMLACube.removeAllItems();
2358: rex.graphics.datasourcetree.elements.DataSourceTreeElement dste[] = smd
2359: .discoverDataSources();
2360: if (dste == null) {
2361: JOptionPane.showMessageDialog((Component) getParent(),
2362: "No Datasources found.", "",
2363: JOptionPane.INFORMATION_MESSAGE);
2364: return;
2365: }
2366: for (int i = 0; i < dste.length; i++) {
2367: this .jComboBoxXMLADatasource.addItem(dste[i]
2368: .getDataSourceInfo());
2369: }
2370: rex.graphics.datasourcetree.elements.DataSourceTreeElement catalogs[] = dste[0]
2371: .getChildren();
2372: if (catalogs == null || catalogs.length == 0) {
2373: return;
2374: }
2375: this .jComboBoxXMLACatalog.removeAllItems();
2376: for (int i = 0; i < catalogs.length; i++) {
2377: this .jComboBoxXMLACatalog
2378: .addItem(((rex.graphics.datasourcetree.elements.CatalogElement) catalogs[i])
2379: .toString());
2380: }
2381: //get Cube information for the selected catalog...
2382: rex.graphics.datasourcetree.elements.DataSourceTreeElement cubes[] = catalogs[0]
2383: .getChildren();
2384: if (cubes == null || cubes.length == 0) {
2385: return;
2386: }
2387: this .jComboBoxXMLACube.removeAllItems();
2388: for (int i = 0; i < cubes.length; i++) {
2389: this .jComboBoxXMLACube
2390: .addItem(((rex.graphics.datasourcetree.elements.CubeElement) cubes[i])
2391: .toString());
2392: }
2393: jComboBoxXMLADatasource.addActionListener(dsListener);
2394: jComboBoxXMLACatalog.addActionListener(catListener);
2395: }//GEN-LAST:event_jButtonGetXMLAMetadataActionPerformed
2396:
2397: private void jTableCustomPropertiesMouseClicked(
2398: java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableCustomPropertiesMouseClicked
2399:
2400: jButtonRemoveProp.setEnabled(jTableCustomProperties
2401: .getSelectedRow() >= 0);
2402:
2403: }//GEN-LAST:event_jTableCustomPropertiesMouseClicked
2404:
2405: private void jButtonRemovePropActionPerformed(
2406: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemovePropActionPerformed
2407:
2408: if (jTableCustomProperties.getSelectedRow() >= 0) {
2409: ((DefaultTableModel) jTableCustomProperties.getModel())
2410: .removeRow(jTableCustomProperties.getSelectedRow());
2411: jButtonRemoveProp.setEnabled(jTableCustomProperties
2412: .getSelectedRow() >= 0);
2413: }
2414: }//GEN-LAST:event_jButtonRemovePropActionPerformed
2415:
2416: private void jButtonAddPropActionPerformed(
2417: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddPropActionPerformed
2418:
2419: ((DefaultTableModel) jTableCustomProperties.getModel())
2420: .addRow(new Object[] { "name", "value" });
2421:
2422: }//GEN-LAST:event_jButtonAddPropActionPerformed
2423:
2424: private void jRadioButtonXML_connectionActionPerformed(
2425: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonXML_connectionActionPerformed
2426:
2427: XMLDataSourceCheckBoxesChanged();
2428:
2429: }//GEN-LAST:event_jRadioButtonXML_connectionActionPerformed
2430:
2431: public void XMLDataSourceCheckBoxesChanged() {
2432: jTextFieldRecordPath.setEnabled(jRadioButtonXML_datasource
2433: .isSelected());
2434: jLabelXMLRecordPath.setEnabled(jRadioButtonXML_datasource
2435: .isSelected());
2436: }
2437:
2438: private void jButtonBrowseCatalogActionPerformed(
2439: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBrowseCatalogActionPerformed
2440:
2441: String fileName = "";
2442: javax.swing.JFileChooser jfc = new javax.swing.JFileChooser(
2443: MainFrame.getMainInstance().getCurrentDirectory());
2444:
2445: jfc.setDialogTitle("Select file....");
2446:
2447: jfc
2448: .addChoosableFileFilter(new javax.swing.filechooser.FileFilter() {
2449: public boolean accept(java.io.File file) {
2450: String filename = file.getName();
2451: return (filename.toLowerCase().endsWith(".xml") || file
2452: .isDirectory());
2453: }
2454:
2455: public String getDescription() {
2456: return "XML *.xml";
2457: }
2458: });
2459:
2460: jfc.setMultiSelectionEnabled(false);
2461: jfc.setDialogType(javax.swing.JFileChooser.OPEN_DIALOG);
2462: if (jfc.showOpenDialog(this ) == javax.swing.JOptionPane.OK_OPTION) {
2463: java.io.File file = jfc.getSelectedFile();
2464: try {
2465: jTextFieldCatalogURI.setText(file.toURI() + "");
2466: } catch (Exception ex) {
2467: }
2468: }
2469:
2470: }//GEN-LAST:event_jButtonBrowseCatalogActionPerformed
2471:
2472: private void jListCVSColumnsValueChanged(
2473: javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jListCVSColumnsValueChanged
2474:
2475: if (jListCVSColumns.getSelectedIndex() >= 0) {
2476: jButtonModifyParameter.setEnabled(true);
2477: jButtonDeleteParameter.setEnabled(true);
2478: } else {
2479: jButtonModifyParameter.setEnabled(false);
2480: jButtonDeleteParameter.setEnabled(false);
2481: }
2482:
2483: }//GEN-LAST:event_jListCVSColumnsValueChanged
2484:
2485: private void jListCVSColumnsMouseClicked(
2486: java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jListCVSColumnsMouseClicked
2487:
2488: if (evt.getClickCount() == 2 && evt.getButton() == evt.BUTTON1) {
2489: jButtonModifyParameterActionPerformed1(null);
2490: }
2491:
2492: }//GEN-LAST:event_jListCVSColumnsMouseClicked
2493:
2494: private void jCheckBoxCVSDateFormatActionPerformed1(
2495: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxCVSDateFormatActionPerformed1
2496: // TODO add your handling code here:
2497: }//GEN-LAST:event_jCheckBoxCVSDateFormatActionPerformed1
2498:
2499: private void jButtonNewParameterActionPerformed11(
2500: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNewParameterActionPerformed11
2501:
2502: try {
2503: JRCsvDataSourceInspector ds = new JRCsvDataSourceInspector(
2504: new File(jTextFieldCSVFilename.getText()));
2505:
2506: if (jRadioButtonCVSSeparatorComma.isSelected())
2507: ds.setFieldDelimiter(',');
2508: if (jRadioButtonCVSSeparatorTab.isSelected())
2509: ds.setFieldDelimiter('\t');
2510: if (jRadioButtonCVSSeparatorSpace.isSelected())
2511: ds.setFieldDelimiter(' ');
2512: if (jRadioButtonCVSSeparatorSemicolon.isSelected())
2513: ds.setFieldDelimiter(';');
2514: if (jRadioButtonCVSSeparatorNewLine.isSelected())
2515: ds.setFieldDelimiter('\n');
2516: if (jRadioButtonCVSSeparatorOther.isSelected())
2517: ds.setFieldDelimiter((jTextFieldCVSSeparatorText
2518: .getText() + " ").charAt(0));
2519:
2520: if (jRadioButtonCVSSeparatorComma1.isSelected())
2521: ds.setRecordDelimiter(",");
2522: if (jRadioButtonCVSSeparatorTab1.isSelected())
2523: ds.setRecordDelimiter("\t");
2524: if (jRadioButtonCVSSeparatorSpace1.isSelected())
2525: ds.setRecordDelimiter(" ");
2526: if (jRadioButtonCVSSeparatorSemicolon1.isSelected())
2527: ds.setRecordDelimiter(";");
2528: if (jRadioButtonCVSSeparatorNewLine1.isSelected())
2529: ds.setRecordDelimiter("\n");
2530: if (jRadioButtonCVSSeparatorOther1.isSelected())
2531: ds.setRecordDelimiter(jTextFieldCVSSeparatorText1
2532: .getText());
2533:
2534: DefaultListModel dlm = (DefaultListModel) jListCVSColumns
2535: .getModel();
2536: dlm.removeAllElements();
2537:
2538: Vector names = ds.getColumnNames();
2539: for (int i = 0; i < names.size(); ++i) {
2540: String fname = (names.elementAt(i) + "").trim();
2541: if (fname.length() > 0)
2542: dlm.addElement(fname);
2543: }
2544:
2545: if (names.size() > 0) {
2546: jListCVSColumns.setSelectedIndex(0);
2547: }
2548:
2549: } catch (Exception ex) {
2550: JOptionPane.showMessageDialog(this , ex.getMessage(), I18n
2551: .getString("message.title.exception", "Exception"),
2552: JOptionPane.ERROR_MESSAGE);
2553: }
2554:
2555: }//GEN-LAST:event_jButtonNewParameterActionPerformed11
2556:
2557: private void jButtonDeleteParameterActionPerformed1(
2558: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDeleteParameterActionPerformed1
2559:
2560: // Get the selected connection...
2561: DefaultListModel dlm = (DefaultListModel) jListCVSColumns
2562: .getModel();
2563: Object[] values = jListCVSColumns.getSelectedValues();
2564:
2565: for (int i = 0; i < values.length; ++i) {
2566: dlm.removeElement(values[i]);
2567: }
2568: }//GEN-LAST:event_jButtonDeleteParameterActionPerformed1
2569:
2570: private void jButtonModifyParameterActionPerformed1(
2571: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModifyParameterActionPerformed1
2572:
2573: int index = jListCVSColumns.getSelectedIndex();
2574:
2575: if (index < 0)
2576: return;
2577:
2578: DefaultListModel dlm = (DefaultListModel) jListCVSColumns
2579: .getModel();
2580: String oldName = (String) dlm.getElementAt(index);
2581:
2582: String name = JOptionPane.showInputDialog(this , I18n.getString(
2583: "connectionDialog.input.columnName", "Column name"),
2584: oldName);
2585:
2586: if (name != null) {
2587: dlm.setElementAt(name, index);
2588: }
2589: }//GEN-LAST:event_jButtonModifyParameterActionPerformed1
2590:
2591: private void jButtonNewParameterActionPerformed1(
2592: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNewParameterActionPerformed1
2593:
2594: DefaultListModel dlm = (DefaultListModel) jListCVSColumns
2595: .getModel();
2596: String name = JOptionPane.showInputDialog(this , I18n.getString(
2597: "connectionDialog.input.columnName", "Column name"),
2598: "COLUMN_" + dlm.getSize());
2599:
2600: if (name != null) {
2601: dlm.addElement(name);
2602: }
2603:
2604: if (dlm.size() == 1) {
2605: jListCVSColumns.setSelectedIndex(0);
2606: }
2607: }//GEN-LAST:event_jButtonNewParameterActionPerformed1
2608:
2609: private void jTextFieldCVSSeparatorText1ActionPerformed(
2610: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldCVSSeparatorText1ActionPerformed
2611:
2612: if (this .jTextFieldCVSSeparatorText1.getText().length() > 0)
2613: this .jRadioButtonCVSSeparatorOther1.setSelected(true);
2614: }//GEN-LAST:event_jTextFieldCVSSeparatorText1ActionPerformed
2615:
2616: private void jTextFieldCVSSeparatorTextActionPerformed(
2617: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldCVSSeparatorTextActionPerformed
2618:
2619: if (this .jTextFieldCVSSeparatorText.getText().length() > 0)
2620: this .jRadioButtonCVSSeparatorOther.setSelected(true);
2621:
2622: }//GEN-LAST:event_jTextFieldCVSSeparatorTextActionPerformed
2623:
2624: private void jButtonCVSDateFormatActionPerformed(
2625: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCVSDateFormatActionPerformed
2626:
2627: FieldPatternDialog fpd = new FieldPatternDialog(this , true);
2628: fpd.setOnlyDate(true);
2629:
2630: fpd.setVisible(true);
2631: if (fpd.getDialogResult() == JOptionPane.OK_OPTION) {
2632: jTextFieldCVSDateFormat.setText(fpd.getPattern());
2633: }
2634:
2635: }//GEN-LAST:event_jButtonCVSDateFormatActionPerformed
2636:
2637: private void jCheckBoxCVSDateFormatActionPerformed(
2638: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxCVSDateFormatActionPerformed
2639:
2640: jTextFieldCVSDateFormat.setEnabled(this .jCheckBoxCVSDateFormat
2641: .isSelected());
2642: jButtonCVSDateFormat.setEnabled(this .jCheckBoxCVSDateFormat
2643: .isSelected());
2644:
2645: if (!this .jCheckBoxCVSDateFormat.isSelected()) {
2646: jTextFieldCVSDateFormat.setText(new SimpleDateFormat()
2647: .toPattern());
2648: }
2649:
2650: }//GEN-LAST:event_jCheckBoxCVSDateFormatActionPerformed
2651:
2652: private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
2653: String fileName = "";
2654: javax.swing.JFileChooser jfc = new javax.swing.JFileChooser(
2655: MainFrame.getMainInstance().getCurrentDirectory());
2656:
2657: jfc.setDialogTitle("Select XML file....");
2658:
2659: jfc
2660: .addChoosableFileFilter(new javax.swing.filechooser.FileFilter() {
2661: public boolean accept(java.io.File file) {
2662: String filename = file.getName();
2663: return (filename.toLowerCase().endsWith(".xml") || file
2664: .isDirectory());
2665: }
2666:
2667: public String getDescription() {
2668: return "XML *.xml";
2669: }
2670: });
2671:
2672: jfc.setMultiSelectionEnabled(false);
2673: jfc.setDialogType(javax.swing.JFileChooser.OPEN_DIALOG);
2674: if (jfc.showOpenDialog(this ) == javax.swing.JOptionPane.OK_OPTION) {
2675: java.io.File file = jfc.getSelectedFile();
2676: try {
2677: jTextFieldXMLFile.setText(file.getAbsolutePath());
2678: } catch (Exception ex) {
2679: }
2680: }
2681:
2682: }//GEN-LAST:event_jButton2ActionPerformed
2683:
2684: private void jButtonCSVFilenameActionPerformed(
2685: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCSVFilenameActionPerformed
2686: String fileName = "";
2687: javax.swing.JFileChooser jfc = new javax.swing.JFileChooser(
2688: MainFrame.getMainInstance().getCurrentDirectory());
2689:
2690: jfc.setDialogTitle("Select CSV file....");
2691:
2692: jfc
2693: .addChoosableFileFilter(new javax.swing.filechooser.FileFilter() {
2694: public boolean accept(java.io.File file) {
2695: String filename = file.getName();
2696: return (filename.toLowerCase().endsWith(".csv") || file
2697: .isDirectory());
2698: }
2699:
2700: public String getDescription() {
2701: return "CSV *.csv";
2702: }
2703: });
2704:
2705: jfc.setMultiSelectionEnabled(false);
2706: jfc.setDialogType(javax.swing.JFileChooser.OPEN_DIALOG);
2707: if (jfc.showOpenDialog(this ) == javax.swing.JOptionPane.OK_OPTION) {
2708: java.io.File file = jfc.getSelectedFile();
2709: try {
2710: jTextFieldCSVFilename.setText(file.getAbsolutePath());
2711: } catch (Exception ex) {
2712: }
2713: }
2714:
2715: }//GEN-LAST:event_jButtonCSVFilenameActionPerformed
2716:
2717: private void jComboBoxJDBCDriverActionPerformed(
2718: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxJDBCDriverActionPerformed
2719: // Run the wizard to populate Connection URL
2720: jButtonWizardActionPerformed(null);
2721: }//GEN-LAST:event_jComboBoxJDBCDriverActionPerformed
2722:
2723: private void jRadioButtonJBSetArrayActionPerformed(
2724: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonJBSetArrayActionPerformed
2725: // Add your handling code here:
2726: }//GEN-LAST:event_jRadioButtonJBSetArrayActionPerformed
2727:
2728: private void jButtonOK1ActionPerformed(
2729: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOK1ActionPerformed
2730: //java.awt.Frame parent = Misc.frameFromComponent(this);
2731: //
2732: MainFrame.getMainInstance().getReportClassLoader()
2733: .rescanLibDirectory();
2734:
2735: int selectedConnectionType = Integer.parseInt(""
2736: + ((Tag) jComboBoxConnectionType.getSelectedItem())
2737: .getValue());
2738:
2739: if (selectedConnectionType == 0) {
2740:
2741: // Try the java connection...
2742: Connection conn = null;
2743: Statement stmt = null;
2744: try {
2745: try {
2746: DriverPool.registerDriver(
2747: (String) jComboBoxJDBCDriver
2748: .getSelectedItem(), MainFrame
2749: .getMainInstance()
2750: .getReportClassLoader());
2751: } catch (Exception ex) {
2752: DriverPool.registerDriver(
2753: (String) jComboBoxJDBCDriver
2754: .getSelectedItem(), this .getClass()
2755: .getClassLoader());
2756: }
2757:
2758: java.sql.Driver driver = DriverPool
2759: .getDriver(this .jTextFieldJDBCUrl.getText());
2760:
2761: java.util.Properties connectProps = new java.util.Properties();
2762: connectProps.setProperty("user",
2763: this .jTextFieldUsername.getText());
2764: connectProps.setProperty("password",
2765: this .jTextFieldPassword.getText());
2766:
2767: conn = driver.connect(this .jTextFieldJDBCUrl.getText(),
2768: connectProps);
2769: stmt = conn.createStatement();
2770:
2771: } catch (NoClassDefFoundError ex) {
2772: JOptionPane
2773: .showMessageDialog(
2774: (Component) getParent(),
2775: I18n
2776: .getFormattedString(
2777: "messages.connection.noClassDefFoundError",
2778: "{0}\nNoClassDefFoundError!!\nCheck your classpath!\n{1}",
2779: new Object[] {
2780: "",
2781: ""
2782: + ex
2783: .getMessage() }),
2784: I18n.getString(
2785: "message.title.exception",
2786: "Exception"),
2787: JOptionPane.ERROR_MESSAGE);
2788: return;
2789: } catch (ClassNotFoundException ex) {
2790: JOptionPane
2791: .showMessageDialog(
2792: (Component) getParent(),
2793: I18n
2794: .getFormattedString(
2795: "messages.connection.classNotFoundError",
2796: "{0}\nClassNotFoundError!\nMsg: {1}\nPossible not found class: {2}\nCheck your classpath!",
2797: new Object[] {
2798: "",
2799: ""
2800: + ex
2801: .getMessage(),
2802: ""
2803: + jComboBoxJDBCDriver
2804: .getSelectedItem() }),
2805: I18n.getString(
2806: "message.title.exception",
2807: "Exception"),
2808: JOptionPane.ERROR_MESSAGE);
2809: return;
2810: } catch (java.sql.SQLException ex) {
2811: JOptionPane
2812: .showMessageDialog(
2813: (Component) getParent(),
2814: I18n
2815: .getFormattedString(
2816: "messages.connection.sqlError",
2817: "{0}\nSQL problems: {1}\n{2}",
2818: new Object[] {
2819: "",
2820: ""
2821: + ex
2822: .getMessage(),
2823: ""
2824: + this .jTextFieldJDBCUrl
2825: .getText() }),
2826: I18n.getString(
2827: "message.title.exception",
2828: "Exception"),
2829: JOptionPane.ERROR_MESSAGE);
2830: return;
2831: } catch (Exception ex) {
2832: JOptionPane
2833: .showMessageDialog(
2834: MainFrame.getMainInstance(),
2835: I18n
2836: .getFormattedString(
2837: "messages.connection.generalError",
2838: "{0}\nGeneral problem: {1}\nPlease check your username and password. The DBMS is running?!",
2839: new Object[] {
2840: "",
2841: ""
2842: + ex
2843: .getMessage() }),
2844: I18n.getString(
2845: "message.title.exception",
2846: "Exception"),
2847: JOptionPane.ERROR_MESSAGE);
2848: return;
2849: } finally {
2850: // Clean up
2851: if (stmt != null)
2852: try {
2853: stmt.close();
2854: } catch (Exception e) { /* anyone really care? */
2855: }
2856: if (conn != null)
2857: try {
2858: conn.close();
2859: } catch (Exception e) { /* anyone really care? */
2860: }
2861: }
2862: JOptionPane
2863: .showMessageDialog(
2864: (Component) getParent(),
2865: I18n
2866: .getString(
2867: "messages.connectionDialog.connectionTestSuccessful",
2868: "Connection test successful!"),
2869: "", JOptionPane.INFORMATION_MESSAGE);
2870: return;
2871: } else if (selectedConnectionType == 1) {
2872: String xml_file = jTextFieldXMLFile.getText().trim();
2873:
2874: try {
2875:
2876: java.io.File f = new java.io.File(xml_file);
2877: if (!f.exists()) {
2878: JOptionPane
2879: .showMessageDialog(
2880: (Component) getParent(),
2881: I18n
2882: .getFormattedString(
2883: "messages.connectionDialog.fileNotFound",
2884: "File {0} not found",
2885: new Object[] { xml_file }),
2886: I18n.getString(
2887: "message.title.error",
2888: "Error"),
2889: JOptionPane.ERROR_MESSAGE);
2890: return;
2891: }
2892:
2893: JOptionPane
2894: .showMessageDialog(
2895: (Component) getParent(),
2896: I18n
2897: .getString(
2898: "messages.connectionDialog.connectionTestSuccessful",
2899: "Connection test successful!"),
2900: "", JOptionPane.INFORMATION_MESSAGE);
2901: return;
2902: } catch (Exception ex) {
2903: JOptionPane.showMessageDialog((Component) getParent(),
2904: ex.getMessage(), I18n.getString(
2905: "message.title.error", "Error"),
2906: JOptionPane.ERROR_MESSAGE);
2907: ex.printStackTrace();
2908: return;
2909: }
2910:
2911: } else if (selectedConnectionType == 3) {
2912:
2913: try {
2914: Object obj = Class
2915: .forName(
2916: (String) jTextFieldJRCustomDataSourceFactoryClass
2917: .getText().trim(),
2918: true,
2919: MainFrame.getMainInstance()
2920: .getReportClassLoader())
2921: .newInstance();
2922: obj.getClass().getMethod(
2923: (String) jTextFieldJRCustomDataSourceMethod
2924: .getText().trim(), new Class[0])
2925: .invoke(obj, new Object[0]);
2926: } catch (NoClassDefFoundError ex) {
2927: JOptionPane
2928: .showMessageDialog(
2929: (Component) getParent(),
2930: I18n
2931: .getFormattedString(
2932: "messages.connection.noClassDefFoundError",
2933: "{0}\nNoClassDefFoundError!!\nCheck your classpath!\n{1}",
2934: new Object[] {
2935: "",
2936: ""
2937: + ex
2938: .getMessage() }),
2939: I18n.getString(
2940: "message.title.exception",
2941: "Exception"),
2942: JOptionPane.ERROR_MESSAGE);
2943: return;
2944: } catch (ClassNotFoundException ex) {
2945: JOptionPane
2946: .showMessageDialog(
2947: (Component) getParent(),
2948: I18n
2949: .getFormattedString(
2950: "messages.connection.classNotFoundError",
2951: "{0}\nClassNotFoundError!\nMsg: {1}\nPossible not found class: {2}\nCheck your classpath!",
2952: new Object[] {
2953: "",
2954: ""
2955: + ex
2956: .getMessage(),
2957: ""
2958: + jTextFieldJRCustomDataSourceFactoryClass
2959: .getText()
2960: .trim() }),
2961: I18n.getString(
2962: "message.title.exception",
2963: "Exception"),
2964: JOptionPane.ERROR_MESSAGE);
2965: return;
2966: } catch (Exception ex) {
2967:
2968: JOptionPane
2969: .showMessageDialog(
2970: MainFrame.getMainInstance(),
2971: I18n
2972: .getFormattedString(
2973: "messages.connection.generalError",
2974: "{0}\nGeneral problem: {1}\nPlease check your username and password. The DBMS is running?!",
2975: new Object[] {
2976: "",
2977: ""
2978: + ex
2979: .getMessage() }),
2980: I18n.getString(
2981: "message.title.exception",
2982: "Exception"),
2983: JOptionPane.ERROR_MESSAGE);
2984: return;
2985: }
2986: JOptionPane
2987: .showMessageDialog(
2988: (Component) getParent(),
2989: I18n
2990: .getString(
2991: "messages.connectionDialog.connectionTestSuccessful",
2992: "Connection test successful!"),
2993: "", JOptionPane.INFORMATION_MESSAGE);
2994: return;
2995: } else if (selectedConnectionType == 2) {
2996: try {
2997: Object obj = Class.forName(
2998: (String) jTextFieldJBSetFactoryClass.getText()
2999: .trim(),
3000: true,
3001: MainFrame.getMainInstance()
3002: .getReportClassLoader()).newInstance();
3003: Object ret_obj = obj.getClass().getMethod(
3004: (String) jTextFieldJBSetMethodToCall.getText()
3005: .trim(), new Class[0]).invoke(null,
3006: new Object[0]);
3007:
3008: if (ret_obj != null
3009: && !jRadioButtonJBSetArray.isSelected()
3010: && (ret_obj instanceof java.util.Collection)) {
3011: JOptionPane
3012: .showMessageDialog(
3013: (Component) getParent(),
3014: I18n
3015: .getString(
3016: "messages.connectionDialog.connectionTestSuccessful",
3017: "Connection test successful!"),
3018: "", JOptionPane.INFORMATION_MESSAGE);
3019: } else if (ret_obj != null
3020: && jRadioButtonJBSetArray.isSelected()
3021: && (ret_obj instanceof Object[])) {
3022: JOptionPane
3023: .showMessageDialog(
3024: (Component) getParent(),
3025: I18n
3026: .getString(
3027: "messages.connectionDialog.connectionTestSuccessful",
3028: "Connection test successful!"),
3029: "", JOptionPane.INFORMATION_MESSAGE);
3030: } else {
3031: JOptionPane
3032: .showMessageDialog(
3033: (Component) getParent(),
3034: I18n
3035: .getString(
3036: "messages.connectionDialog.notValidValueReturned",
3037: "The method don't return a valid Array or java.util.Collection!\n"),
3038: I18n.getString(
3039: "message.title.error",
3040: "Error"),
3041: JOptionPane.ERROR_MESSAGE);
3042: }
3043:
3044: } catch (NoClassDefFoundError ex) {
3045: JOptionPane
3046: .showMessageDialog(
3047: (Component) getParent(),
3048: I18n
3049: .getFormattedString(
3050: "messages.connection.noClassDefFoundError",
3051: "{0}\nNoClassDefFoundError!!\nCheck your classpath!\n{1}",
3052: new Object[] {
3053: "",
3054: ""
3055: + ex
3056: .getMessage() }),
3057: I18n.getString(
3058: "message.title.exception",
3059: "Exception"),
3060: JOptionPane.ERROR_MESSAGE);
3061: return;
3062: } catch (ClassNotFoundException ex) {
3063: JOptionPane
3064: .showMessageDialog(
3065: (Component) getParent(),
3066: I18n
3067: .getFormattedString(
3068: "messages.connection.classNotFoundError",
3069: "{0}\nClassNotFoundError!\nMsg: {1}\nPossible not found class: {2}\nCheck your classpath!",
3070: new Object[] {
3071: "",
3072: ""
3073: + ex
3074: .getMessage(),
3075: ""
3076: + jTextFieldJBSetFactoryClass
3077: .getText()
3078: .trim() }),
3079: I18n.getString(
3080: "message.title.exception",
3081: "Exception"),
3082: JOptionPane.ERROR_MESSAGE);
3083: return;
3084: } catch (Exception ex) {
3085: ex.printStackTrace();
3086:
3087: JOptionPane
3088: .showMessageDialog(
3089: MainFrame.getMainInstance(),
3090: I18n
3091: .getFormattedString(
3092: "messages.connection.generalError",
3093: "{0}\nGeneral problem: {1}\nPlease check your username and password. The DBMS is running?!",
3094: new Object[] {
3095: "",
3096: ""
3097: + ex
3098: .getMessage() }),
3099: I18n.getString(
3100: "message.title.exception",
3101: "Exception"),
3102: JOptionPane.ERROR_MESSAGE);
3103: return;
3104: }
3105:
3106: return;
3107: } else if (selectedConnectionType == 4) {
3108: String csv_file = jTextFieldCSVFilename.getText().trim();
3109:
3110: try {
3111:
3112: JRCSVDataSourceConnection con = new JRCSVDataSourceConnection();
3113: java.io.File f = new java.io.File(csv_file);
3114: if (!f.exists()) {
3115: JOptionPane
3116: .showMessageDialog(
3117: (Component) getParent(),
3118: I18n
3119: .getFormattedString(
3120: "messages.connectionDialog.fileNotFound",
3121: "File {0} not found",
3122: new Object[] { csv_file }),
3123: I18n.getString(
3124: "message.title.error",
3125: "Error"),
3126: JOptionPane.ERROR_MESSAGE);
3127: return;
3128: }
3129:
3130: con.setFilename(csv_file);
3131: if (con.getJRDataSource() != null) {
3132: JOptionPane
3133: .showMessageDialog(
3134: (Component) getParent(),
3135: I18n
3136: .getString(
3137: "messages.connectionDialog.connectionTestSuccessful",
3138: "Connection test successful!"),
3139: "", JOptionPane.INFORMATION_MESSAGE);
3140: return;
3141: }
3142:
3143: } catch (Exception ex) {
3144: JOptionPane.showMessageDialog((Component) getParent(),
3145: ex.getMessage(), I18n.getString(
3146: "message.title.error", "Error"),
3147: JOptionPane.ERROR_MESSAGE);
3148: ex.printStackTrace();
3149: return;
3150: }
3151:
3152: return;
3153: } else if (selectedConnectionType == 5) {
3154: try {
3155:
3156: Object obj = Class.forName(
3157: (String) jTextFieldJRDataSourceProvider
3158: .getText().trim(),
3159: true,
3160: MainFrame.getMainInstance()
3161: .getReportClassLoader()).newInstance();
3162: if (!(obj instanceof net.sf.jasperreports.engine.JRDataSourceProvider)) {
3163: JOptionPane
3164: .showMessageDialog(
3165: (Component) getParent(),
3166: I18n
3167: .getFormattedString(
3168: "messages.connectionDialog.invalidJRDataSourceProvider",
3169: "\"{0}\" is not a subclass of\nnet.sf.jasperreports.engine.JRDataSourceProvider.",
3170: new Object[] { jTextFieldJRDataSourceProvider
3171: .getText() }),
3172: I18n.getString(
3173: "message.title.error",
3174: "Error"),
3175: JOptionPane.ERROR_MESSAGE);
3176: return;
3177: } else {
3178: JOptionPane
3179: .showMessageDialog(
3180: (Component) getParent(),
3181: I18n
3182: .getString(
3183: "messages.connectionDialog.connectionTestSuccessful",
3184: "Connection test successful!"),
3185: "", JOptionPane.INFORMATION_MESSAGE);
3186: return;
3187: }
3188:
3189: } catch (NoClassDefFoundError ex) {
3190: JOptionPane
3191: .showMessageDialog(
3192: (Component) getParent(),
3193: I18n
3194: .getFormattedString(
3195: "messages.connection.noClassDefFoundError",
3196: "{0}\nNoClassDefFoundError!!\nCheck your classpath!\n{1}",
3197: new Object[] {
3198: "",
3199: ""
3200: + ex
3201: .getMessage() }),
3202: I18n.getString(
3203: "message.title.exception",
3204: "Exception"),
3205: JOptionPane.ERROR_MESSAGE);
3206: return;
3207: } catch (ClassNotFoundException ex) {
3208: JOptionPane
3209: .showMessageDialog(
3210: (Component) getParent(),
3211: I18n
3212: .getFormattedString(
3213: "messages.connection.classNotFoundError",
3214: "{0}\nClassNotFoundError!\nMsg: {1}\nPossible not found class: {2}\nCheck your classpath!",
3215: new Object[] {
3216: "",
3217: ""
3218: + ex
3219: .getMessage(),
3220: ""
3221: + jTextFieldJBSetFactoryClass
3222: .getText()
3223: .trim() }),
3224: I18n.getString(
3225: "message.title.exception",
3226: "Exception"),
3227: JOptionPane.ERROR_MESSAGE);
3228: return;
3229: } catch (Exception ex) {
3230: JOptionPane
3231: .showMessageDialog(
3232: MainFrame.getMainInstance(),
3233: I18n
3234: .getFormattedString(
3235: "messages.connection.generalError",
3236: "{0}\nGeneral problem: {1}\nPlease check your username and password. The DBMS is running?!",
3237: new Object[] {
3238: "",
3239: ""
3240: + ex
3241: .getMessage() }),
3242: I18n.getString(
3243: "message.title.exception",
3244: "Exception"),
3245: JOptionPane.ERROR_MESSAGE);
3246: return;
3247: }
3248: } else if (selectedConnectionType == 6) {
3249: try {
3250: SwingUtilities.invokeLater(new Runnable() {
3251: public void run() {
3252: Thread.currentThread().setContextClassLoader(
3253: MainFrame.getMainInstance()
3254: .getReportClassLoader());
3255: SessionFactory hb_sessionFactory = null;
3256: try {
3257:
3258: hb_sessionFactory = new Configuration()
3259: .configure().buildSessionFactory();
3260:
3261: JOptionPane
3262: .showMessageDialog(
3263: (Component) getParent(),
3264: I18n
3265: .getString(
3266: "messages.connectionDialog.connectionTestSuccessful",
3267: "Connection test successful!"),
3268: "",
3269: JOptionPane.INFORMATION_MESSAGE);
3270:
3271: } catch (Exception ex) {
3272: ex.printStackTrace();
3273: JOptionPane.showMessageDialog(
3274: (Component) getParent(), ex
3275: .getMessage(),
3276: I18n.getString(
3277: "message.title.error",
3278: "Error"),
3279: JOptionPane.ERROR_MESSAGE);
3280: return;
3281: } finally {
3282:
3283: }
3284: }
3285: });
3286: } catch (Exception ex) {
3287: }
3288: } else if (selectedConnectionType == 7) {
3289: try {
3290: SwingUtilities.invokeLater(new Runnable() {
3291: public void run() {
3292:
3293: Thread.currentThread().setContextClassLoader(
3294: MainFrame.getMainInstance()
3295: .getReportClassLoader());
3296: SessionFactory hb_sessionFactory = null;
3297: try {
3298:
3299: EJBQLConnection iReportConn = new EJBQLConnection();
3300: if (jTextFieldPersistanceUnit.getText()
3301: .trim().length() != 0) {
3302: iReportConn.getProperties().put(
3303: "PersistenceUnit",
3304: jTextFieldPersistanceUnit
3305: .getText().trim());
3306: }
3307:
3308: iReportConn.getEntityManager();
3309: iReportConn.closeEntityManager();
3310: JOptionPane
3311: .showMessageDialog(
3312: (Component) getParent(),
3313: I18n
3314: .getString(
3315: "messages.connectionDialog.connectionTestSuccessful",
3316: "Connection test successful!"),
3317: "",
3318: JOptionPane.INFORMATION_MESSAGE);
3319:
3320: } catch (Exception ex) {
3321: ex.printStackTrace();
3322: JOptionPane.showMessageDialog(
3323: (Component) getParent(), ex
3324: .getMessage(),
3325: I18n.getString(
3326: "message.title.error",
3327: "Error"),
3328: JOptionPane.ERROR_MESSAGE);
3329: return;
3330: } finally {
3331:
3332: }
3333:
3334: }
3335: });
3336: } catch (Exception ex) {
3337: }
3338: } else if (selectedConnectionType == 8) {
3339: try {
3340: SwingUtilities.invokeLater(new Runnable() {
3341: public void run() {
3342:
3343: Thread.currentThread().setContextClassLoader(
3344: MainFrame.getMainInstance()
3345: .getReportClassLoader());
3346: try {
3347:
3348: MondrianConnection iReportConn = new MondrianConnection();
3349: iReportConn.getProperties().put(
3350: MondrianConnection.CATALOG_URI,
3351: jTextFieldCatalogURI.getText()
3352: .trim());
3353: iReportConn.getProperties().put(
3354: MondrianConnection.CONNECTION_NAME,
3355: jComboBoxMondrianJdbc
3356: .getSelectedItem()
3357: + "");
3358:
3359: iReportConn.getMondrianConnection();
3360: iReportConn.closeMondrianConnection();
3361: JOptionPane
3362: .showMessageDialog(
3363: (Component) getParent(),
3364: I18n
3365: .getString(
3366: "messages.connectionDialog.connectionTestSuccessful",
3367: "Connection test successful!"),
3368: "",
3369: JOptionPane.INFORMATION_MESSAGE);
3370:
3371: } catch (Exception ex) {
3372: ex.printStackTrace();
3373: JOptionPane.showMessageDialog(
3374: (Component) getParent(), ex
3375: .getMessage(),
3376: I18n.getString(
3377: "message.title.error",
3378: "Error"),
3379: JOptionPane.ERROR_MESSAGE);
3380: return;
3381: } finally {
3382:
3383: }
3384: }
3385: });
3386: } catch (Exception ex) {
3387: }
3388: } else if (selectedConnectionType == 9) {
3389: try {
3390: Thread.currentThread().setContextClassLoader(
3391: MainFrame.getMainInstance()
3392: .getReportClassLoader());
3393: JRSpringLoadedHibernateConnection iReportConn = new JRSpringLoadedHibernateConnection();
3394: iReportConn
3395: .setSessionFactoryBeanId(jTextFieldSLHSessionFactory
3396: .getText().trim());
3397: iReportConn.setSpringConfig(jTextFieldSLHSpringConfig
3398: .getText().trim());
3399:
3400: SessionFactory sf = iReportConn.getSessionFactory();
3401: if (sf == null) {
3402: JOptionPane
3403: .showMessageDialog(
3404: (Component) getParent(),
3405: I18n
3406: .getString(
3407: "messages.connectionDialog.noSessionFactoryReturned",
3408: "No session factory returned. Check your session factory bean id against the spring configuration."),
3409: I18n.getString(
3410: "message.title.error",
3411: "Error"),
3412: JOptionPane.ERROR_MESSAGE);
3413:
3414: }
3415: JOptionPane
3416: .showMessageDialog(
3417: (Component) getParent(),
3418: I18n
3419: .getString(
3420: "messages.connectionDialog.hibernateConnectionTestSuccessful",
3421: "iReport successfully created a Hibernate session factory from your Spring configuration."),
3422: "", JOptionPane.INFORMATION_MESSAGE);
3423: } catch (Exception e) {
3424: e.printStackTrace();
3425: JOptionPane.showMessageDialog((Component) getParent(),
3426: e.getMessage(), I18n.getString(
3427: "message.title.error", "Error"),
3428: JOptionPane.ERROR_MESSAGE);
3429:
3430: }
3431: } else if (selectedConnectionType == 10) {
3432: JOptionPane
3433: .showMessageDialog(
3434: (Component) getParent(),
3435: I18n
3436: .getString(
3437: "messages.connectionDialog.connectionTestSuccessful",
3438: "Connection test successful!"),
3439: "", JOptionPane.INFORMATION_MESSAGE);
3440: return;
3441: } else if (selectedConnectionType == 11) {
3442: JOptionPane
3443: .showMessageDialog(
3444: (Component) getParent(),
3445: I18n
3446: .getString(
3447: "messages.connectionDialog.connectionTestSuccessful",
3448: "Connection test successful!"),
3449: "", JOptionPane.INFORMATION_MESSAGE);
3450: return;
3451: } else if (selectedConnectionType == 13) {
3452: /**
3453: * Copyright (C) 2005, 2006 CINCOM SYSTEMS, INC.
3454: * All Rights Reserved
3455: * www.cincom.com
3456: *
3457: */
3458: String urlstr = this .jTextFieldXMLAUrl.getText().trim();
3459: Authenticator.setDefault(new CustomHTTPAuthenticator(
3460: jTextFieldUsername1.getText(), new String(
3461: jTextFieldPassword1.getPassword())));
3462:
3463: String dataSource = (String) this .jComboBoxXMLADatasource
3464: .getSelectedItem();
3465: String catalog = (String) this .jComboBoxXMLACatalog
3466: .getSelectedItem();
3467: rex.metadata.ServerMetadata smd = new rex.metadata.ServerMetadata(
3468: urlstr, (Component) getParent());
3469: if (smd.isValidUrl() == false) {
3470: JOptionPane
3471: .showMessageDialog(
3472: (Component) getParent(),
3473: I18n
3474: .getString(
3475: "messages.connectionDialog.connectionXMLATestFailed.InvalidUrl",
3476: "Connection test failed! Unable to connect to url."),
3477: "", JOptionPane.INFORMATION_MESSAGE);
3478: return;
3479: }
3480: rex.graphics.datasourcetree.elements.DataSourceTreeElement dste[] = smd
3481: .discoverDataSources();
3482: if (dste == null || dste.length == 0) {
3483: JOptionPane
3484: .showMessageDialog(
3485: (Component) getParent(),
3486: I18n
3487: .getString(
3488: "messages.connectionDialog.connectionXMLATestFailed.NoDatasources",
3489: "Connection test failed! No datasources found."),
3490: "", JOptionPane.INFORMATION_MESSAGE);
3491: return;
3492: }
3493: boolean found = false;
3494: int intI = 0;
3495: if (dataSource != null && dataSource.length() > 0) {
3496: while (!found && intI < dste.length) {
3497: if (dataSource.compareTo(dste[intI]
3498: .getDataSourceInfo()) == 0) {
3499: found = true;
3500: } else {
3501: intI++;
3502: }
3503: }
3504: if (!found) {
3505: JOptionPane
3506: .showMessageDialog(
3507: (Component) getParent(),
3508: I18n
3509: .getFormattedString(
3510: "messages.connectionDialog.connectionXMLATestFailed.NoDatasourceFound",
3511: "Connection test failed! Datasource {0} not found.",
3512: new Object[] { dataSource
3513: + "" }),
3514: "", JOptionPane.INFORMATION_MESSAGE);
3515: return;
3516: }
3517: if (catalog != null && catalog.length() > 0) {
3518: found = false;
3519: rex.graphics.datasourcetree.elements.DataSourceTreeElement cats[] = dste[intI]
3520: .getChildren();
3521: if (cats == null || cats.length == 0) {
3522: JOptionPane
3523: .showMessageDialog(
3524: (Component) getParent(),
3525: I18n
3526: .getString(
3527: "messages.connectionDialog.connectionXMLATestFailed.NoCatalogs",
3528: "Connection test failed! No catalogs found in datasource."),
3529: "",
3530: JOptionPane.INFORMATION_MESSAGE);
3531: return;
3532: }
3533: intI = 0;
3534: while (!found && intI < cats.length) {
3535: if (catalog
3536: .compareTo(((rex.graphics.datasourcetree.elements.CatalogElement) cats[intI])
3537: .toString()) == 0) {
3538: found = true;
3539: } else {
3540: intI++;
3541: }
3542: }
3543: if (!found) {
3544: JOptionPane
3545: .showMessageDialog(
3546: (Component) getParent(),
3547: I18n
3548: .getFormattedString(
3549: "messages.connectionDialog.connectionXMLATestFailed.NoCatalogFound",
3550: "Connection test failed! Catalog {0} not found in datasource.",
3551: new Object[] { catalog
3552: + "" }),
3553: "",
3554: JOptionPane.INFORMATION_MESSAGE);
3555: return;
3556: }
3557: } else {
3558: JOptionPane
3559: .showMessageDialog(
3560: (Component) getParent(),
3561: I18n
3562: .getString(
3563: "messages.connectionDialog.connectionXMLATestSuccessful.NoCatalog",
3564: "Connection test successful! Connected to server and found datasource, but no catalog specified."),
3565: "", JOptionPane.INFORMATION_MESSAGE);
3566: return;
3567: }
3568: } else {
3569: JOptionPane
3570: .showMessageDialog(
3571: (Component) getParent(),
3572: I18n
3573: .getString(
3574: "messages.connectionDialog.connectionXMLATestSuccessful.NoDatasource",
3575: "Connection test successful! Connected to server, but no datasource specified."),
3576: "", JOptionPane.INFORMATION_MESSAGE);
3577: return;
3578: }
3579: JOptionPane
3580: .showMessageDialog(
3581: (Component) getParent(),
3582: I18n
3583: .getString(
3584: "messages.connectionDialog.connectionXMLATestSuccessful",
3585: "Connection test successful! Catalog found in datasource on xmla server."),
3586: "", JOptionPane.INFORMATION_MESSAGE);
3587: /* end of modification */
3588:
3589: // } catch (Exception ex)
3590: // {}
3591: } else {
3592: // try to perform a test...
3593: try {
3594: IReportConnection connection = createConnection(selectedConnectionType);
3595: if (connection == null)
3596: throw new Exception(
3597: I18n
3598: .getString(
3599: "messages.connectionDialog.connectionTestError",
3600: "unable to instance the connecion class to test!"));
3601:
3602: connection.test();
3603: JOptionPane
3604: .showMessageDialog(
3605: (Component) getParent(),
3606: I18n
3607: .getString(
3608: "messages.connectionDialog.connectionTestSuccessful",
3609: "Connection test successful!"),
3610: "", JOptionPane.INFORMATION_MESSAGE);
3611: } catch (Throwable e) {
3612: e.printStackTrace();
3613: JOptionPane.showMessageDialog((Component) getParent(),
3614: e.getMessage(), I18n.getString(
3615: "message.title.error", "Error"),
3616: JOptionPane.ERROR_MESSAGE);
3617: }
3618: }
3619:
3620: }//GEN-LAST:event_jButtonOK1ActionPerformed
3621:
3622: private void jButtonWizardActionPerformed(
3623: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonWizardActionPerformed
3624:
3625: if (jComboBoxJDBCDriver.getSelectedIndex() < 0)
3626: return;
3627: String driver = "" + jComboBoxJDBCDriver.getSelectedItem();
3628: driver = driver.trim();
3629: if (driver.equals(""))
3630: return;
3631:
3632: String server = jTextFieldServerAddress.getText().trim();
3633: if (server.length() == 0) {
3634: server = "localhost";
3635: }
3636:
3637: String databaseName = jTextFieldDBName.getText().trim();
3638:
3639: if (driver.equalsIgnoreCase("org.gjt.mm.mysql.Driver")) {
3640: String url = "jdbc:mysql://" + server + "/";
3641: if (databaseName.length() > 0)
3642: url += databaseName;
3643: else
3644: url += "MYDATABASE";
3645: jTextFieldJDBCUrl.setText(url);
3646: } else if (driver.equalsIgnoreCase("com.mysql.jdbc.Driver")) {
3647: String url = "jdbc:mysql://" + server + "/";
3648: if (databaseName.length() > 0)
3649: url += databaseName;
3650: else
3651: url += "MYDATABASE";
3652: jTextFieldJDBCUrl.setText(url);
3653: } else if (driver
3654: .equalsIgnoreCase("com.internetcds.jdbc.tds.Driver")) {
3655: String url = "jdbc:freetds:sqlserver://localhost/";
3656: if (databaseName.length() > 0)
3657: url += databaseName;
3658: else
3659: url += "MYDATABASE";
3660: jTextFieldJDBCUrl.setText(url);
3661: } else if (driver
3662: .equalsIgnoreCase("com.microsoft.jdbc.sqlserver.SQLServerDriver")) {
3663: String url = "jdbc:microsoft:sqlserver://" + server
3664: + ":1433;DatabaseName=";
3665: if (databaseName.length() > 0)
3666: url += databaseName;
3667: else
3668: url += "MYDATABASE";
3669: jTextFieldJDBCUrl.setText(url);
3670: } else if (driver
3671: .equalsIgnoreCase("sun.jdbc.odbc.JdbcOdbcDriver")) {
3672: String url = "jdbc:odbc:";
3673: if (databaseName.length() > 0)
3674: url += jTextFieldDBName.getText();
3675: else
3676: url += "DSNAME";
3677: jTextFieldJDBCUrl.setText(url);
3678: } else if (driver
3679: .equalsIgnoreCase("com.ms.jdbc.odbc.JdbcOdbcDriver")) {
3680: String url = "jdbc:odbc:";
3681: if (databaseName.length() > 0)
3682: url += databaseName;
3683: else
3684: url += "DSNAME";
3685: jTextFieldJDBCUrl.setText(url);
3686: } else if (driver
3687: .equalsIgnoreCase("oracle.jdbc.driver.OracleDriver")) {
3688: String url = "jdbc:oracle:thin:@" + server + ":1521:";
3689: if (databaseName.length() > 0)
3690: url += databaseName;
3691: else
3692: url += "MYDATABASE";
3693: jTextFieldJDBCUrl.setText(url);
3694: } else if (driver
3695: .equalsIgnoreCase("COM.ibm.db2.jdbc.app.DB2Driver")) {
3696: String url = "jdbc:db2:";
3697: if (databaseName.length() > 0)
3698: url += databaseName;
3699: else
3700: url += "MYDATABASE";
3701: jTextFieldJDBCUrl.setText(url);
3702: } else if (driver
3703: .equalsIgnoreCase("com.informix.jdbc.IfxDriver")) {
3704: String url = "jdbc:informix-sqli://" + server + ":port/";
3705: if (databaseName.length() > 0)
3706: url += databaseName;
3707: else
3708: url += "MYDATABASE";
3709:
3710: url += ":informixserver=SERVERNAME";
3711: jTextFieldJDBCUrl.setText(url);
3712: } else if (driver
3713: .equalsIgnoreCase("com.sybase.jdbc2.jdbc.SybDriver")) {
3714: String url = "jdbc:sybase:Tds:" + server + ":2638/";
3715: if (databaseName.length() > 0)
3716: url += databaseName;
3717: else
3718: url += "MYDATABASE";
3719: jTextFieldJDBCUrl.setText(url);
3720: } else if (driver.equalsIgnoreCase("com.mysql.jdbc.Driver")) {
3721: String url = "jdbc:mysql://" + server + "/";
3722: if (databaseName.length() > 0)
3723: url += databaseName;
3724: else
3725: url += "MYDATABASE";
3726: jTextFieldJDBCUrl.setText(url);
3727: } else if (driver
3728: .equalsIgnoreCase("com.merant.datadirect.jdbc.sqlserver.SQLServerDriver")) {
3729: String url = "jdbc:sqlserver://" + server + ":1433/";
3730: if (databaseName.length() > 0)
3731: url += databaseName;
3732: else
3733: url += "MYDATABASE";
3734: jTextFieldJDBCUrl.setText(url);
3735: } else if (driver.equalsIgnoreCase("com.inet.tds.TdsDriver")) {
3736: String url = "jdbc:inetdae7:" + server + ":1433/";
3737: if (databaseName.length() > 0)
3738: url += jTextFieldDBName.getText();
3739: else
3740: url += "MYDATABASE";
3741: jTextFieldJDBCUrl.setText(url);
3742: } else if (driver.equalsIgnoreCase("org.postgresql.Driver")) {
3743: String url = "jdbc:postgresql://" + server + ":5432/";
3744: if (databaseName.length() > 0)
3745: url += databaseName;
3746: else
3747: url += "MYDATABASE";
3748: jTextFieldJDBCUrl.setText(url);
3749: } else if (driver.equalsIgnoreCase("org.hsqldb.jdbcDriver")) {
3750: String url = "jdbc:hsqldb:[PATH_TO_DB_FILES]/";
3751: if (databaseName.length() > 0)
3752: url += databaseName;
3753: else
3754: url += "MYDATABASE";
3755: jTextFieldJDBCUrl.setText(url);
3756: } else if (driver
3757: .equalsIgnoreCase("COM.cloudscape.JDBCDriver ")) {
3758: String url = "jdbc:cloudscape:/cloudscape/";
3759: if (databaseName.length() > 0)
3760: url += databaseName;
3761: else
3762: url += "MYDATABASE";
3763: jTextFieldJDBCUrl.setText(url);
3764: } else if (driver
3765: .equalsIgnoreCase("net.sourceforge.jtds.jdbc.Driver")) {
3766: String url = "jdbc:jtds:sqlserver://" + server + "/";
3767: if (databaseName.length() > 0)
3768: url += databaseName;
3769: else
3770: url += "MYDATABASE";
3771: url += ";instance=";
3772: jTextFieldJDBCUrl.setText(url);
3773: }
3774:
3775: }//GEN-LAST:event_jButtonWizardActionPerformed
3776:
3777: private void jComboBoxConnectionTypeActionPerformed(
3778: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxConnectionTypeActionPerformed
3779: if (init)
3780: return;
3781: jPanelConnectionRoot.removeAll();
3782: int selectedConnectionType = Integer.parseInt(""
3783: + ((Tag) jComboBoxConnectionType.getSelectedItem())
3784: .getValue());
3785:
3786: if (selectedConnectionType == 0) {
3787: jPanelConnectionRoot.add("Center", jPanelJDBC);
3788: } else if (selectedConnectionType == 1) {
3789: jPanelConnectionRoot.add("Center", jPanelXML);
3790: } else if (selectedConnectionType == 2) {
3791: jPanelConnectionRoot.add("Center", jPanelBeansSet);
3792: } else if (selectedConnectionType == 3) {
3793: jPanelConnectionRoot.add("Center",
3794: jPanelCustomDataSourceFactory);
3795: } else if (selectedConnectionType == 4) {
3796: jPanelConnectionRoot.add("Center", jPanelCSV);
3797: } else if (selectedConnectionType == 5) {
3798: jPanelConnectionRoot
3799: .add("Center", jPanelDatasourceProvider);
3800: } else if (selectedConnectionType == 6) {
3801: jPanelConnectionRoot.add("Center", jPanelHibernate);
3802: } else if (selectedConnectionType == 7) {
3803: jPanelConnectionRoot.add("Center", jPanelEJBQL);
3804: } else if (selectedConnectionType == 8) {
3805: jPanelConnectionRoot.add("Center", jPanelMondrian);
3806: } else if (selectedConnectionType == 9) {
3807: jPanelConnectionRoot.add("Center",
3808: jPanelSpringLoadedHibernate);
3809: } else if (selectedConnectionType == 10) {
3810: jPanelConnectionRoot.add("Center", jPanelQueryExecutorMode);
3811: } else if (selectedConnectionType == 11) {
3812: jPanelConnectionRoot.add("Center", jPanelEmptyDataSource);
3813: } else if (selectedConnectionType == 12) {
3814: jPanelConnectionRoot.add("Center", jPanelCustomConnection);
3815: } else if (selectedConnectionType == 13) {
3816: jPanelConnectionRoot.add("Center", jPanelXMLA);
3817: }
3818:
3819: jPanelConnectionRoot.updateUI();
3820: }//GEN-LAST:event_jComboBoxConnectionTypeActionPerformed
3821:
3822: private void jButtonCancelActionPerformed(
3823: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelActionPerformed
3824: setVisible(false);
3825: this .setDialogResult(javax.swing.JOptionPane.CANCEL_OPTION);
3826: dispose();
3827: }//GEN-LAST:event_jButtonCancelActionPerformed
3828:
3829: private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOKActionPerformed
3830: if (this .jTextFieldName.getText().trim().length() <= 0) {
3831: javax.swing.JOptionPane
3832: .showMessageDialog(
3833: this ,
3834: I18n
3835: .getString(
3836: "messages.connectionDialog.invalidName",
3837: "Please insert a valid connection name!"),
3838: I18n
3839: .getString(
3840: "messages.connectionDialog.invalidNameCaption",
3841: "Invalid connection name!"),
3842: javax.swing.JOptionPane.WARNING_MESSAGE);
3843: return;
3844: }
3845: int selectedConnectionType = Integer.parseInt(""
3846: + ((Tag) jComboBoxConnectionType.getSelectedItem())
3847: .getValue());
3848:
3849: iReportConnection = createConnection(selectedConnectionType);
3850: if (iReportConnection == null)
3851: return;
3852:
3853: setVisible(false);
3854: this .setDialogResult(javax.swing.JOptionPane.OK_OPTION);
3855: dispose();
3856: }//GEN-LAST:event_jButtonOKActionPerformed
3857:
3858: /** Closes the dialog */
3859: private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
3860: setVisible(false);
3861: this .setDialogResult(javax.swing.JOptionPane.CLOSED_OPTION);
3862: dispose();
3863: }//GEN-LAST:event_closeDialog
3864:
3865: /** Getter for property dialogResult.
3866: * @return Value of property dialogResult.
3867: *
3868: */
3869: public int getDialogResult() {
3870: return dialogResult;
3871: }
3872:
3873: /** Setter for property dialogResult.
3874: * @param dialogResult New value of property dialogResult.
3875: *
3876: */
3877: public void setDialogResult(int dialogResult) {
3878: this .dialogResult = dialogResult;
3879: }
3880:
3881: /** Getter for property iReportConnection.
3882: * @return Value of property iReportConnection.
3883: *
3884: */
3885: public it.businesslogic.ireport.IReportConnection getIReportConnection() {
3886: return iReportConnection;
3887: }
3888:
3889: /** Setter for property iReportConnection.
3890: * @param iReportConnection New value of property iReportConnection.
3891: *
3892: */
3893: public void setIReportConnection(
3894: it.businesslogic.ireport.IReportConnection iReportConnection) {
3895: this .iReportConnection = iReportConnection;
3896:
3897: this .jTextFieldName.setText(iReportConnection.getName());
3898: if (iReportConnection instanceof JDBCConnection) {
3899: JDBCConnection con = (JDBCConnection) iReportConnection;
3900: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
3901: "0");
3902: this .jComboBoxJDBCDriver.setSelectedItem(con
3903: .getJDBCDriver());
3904: this .jTextFieldJDBCUrl.setText(con.getUrl());
3905: this .jTextFieldServerAddress
3906: .setText(con.getServerAddress());
3907: this .jTextFieldDBName.setText(con.getDatabase());
3908: this .jTextFieldUsername.setText(con.getUsername());
3909: if (con.isSavePassword())
3910: this .jTextFieldPassword.setText(con.getPassword());
3911: else
3912: this .jTextFieldPassword.setText("");
3913: this .jCheckBoxSavePassword
3914: .setSelected(con.isSavePassword());
3915: } else if (iReportConnection instanceof JRCustomDataSourceConnection) {
3916: JRCustomDataSourceConnection con = (JRCustomDataSourceConnection) iReportConnection;
3917: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
3918: "3");
3919: this .jTextFieldJRCustomDataSourceFactoryClass.setText(con
3920: .getFactoryClass());
3921: this .jTextFieldJRCustomDataSourceMethod.setText(con
3922: .getMethodToCall());
3923: } else if (iReportConnection instanceof JavaBeanDataSourceConnection) {
3924: JavaBeanDataSourceConnection con = (JavaBeanDataSourceConnection) iReportConnection;
3925: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
3926: "2");
3927: this .jTextFieldJBSetFactoryClass.setText(con
3928: .getFactoryClass());
3929: this .jTextFieldJBSetMethodToCall.setText(con
3930: .getMethodToCall());
3931: this .jCheckBoxisUseFieldDescription.setSelected(con
3932: .isUseFieldDescription());
3933: if (con.getType().equals(con.BEAN_ARRAY)) {
3934: jRadioButtonJBSetArray.setSelected(true);
3935: jRadioButtonJBSetCollection.setSelected(false);
3936: } else {
3937: jRadioButtonJBSetArray.setSelected(false);
3938: jRadioButtonJBSetCollection.setSelected(true);
3939: }
3940: } else if (iReportConnection instanceof JRCSVDataSourceConnection) {
3941: JRCSVDataSourceConnection con = (JRCSVDataSourceConnection) iReportConnection;
3942: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
3943: "4");
3944: this .jTextFieldCSVFilename.setText(con.getFilename());
3945:
3946: if (con.getCustomDateFormat().length() > 0) {
3947: this .jCheckBoxCVSDateFormat.setSelected(true);
3948: this .jTextFieldCVSDateFormat.setText(con
3949: .getCustomDateFormat());
3950: this .jTextFieldCVSDateFormat.setEnabled(true);
3951: this .jButtonCVSDateFormat.setEnabled(true);
3952: }
3953:
3954: this .jCheckBoxCVSFirstRowAsHeader.setSelected(con
3955: .isUseFirstRowAsHeader());
3956:
3957: String fieldSeparator = con.getFieldDelimiter();
3958: if (fieldSeparator.equals(","))
3959: this .jRadioButtonCVSSeparatorComma.setSelected(true);
3960: else if (fieldSeparator.equals("\t"))
3961: this .jRadioButtonCVSSeparatorTab.setSelected(true);
3962: else if (fieldSeparator.equals(" "))
3963: this .jRadioButtonCVSSeparatorSpace.setSelected(true);
3964: else if (fieldSeparator.equals(";"))
3965: this .jRadioButtonCVSSeparatorSemicolon
3966: .setSelected(true);
3967: else if (fieldSeparator.equals("\n"))
3968: this .jRadioButtonCVSSeparatorNewLine.setSelected(true);
3969: else {
3970: this .jRadioButtonCVSSeparatorOther.setSelected(true);
3971: this .jTextFieldCVSSeparatorText.setText(fieldSeparator);
3972: }
3973:
3974: String rowSeparator = con.getRecordDelimiter();
3975: if (rowSeparator.equals(","))
3976: this .jRadioButtonCVSSeparatorComma1.setSelected(true);
3977: else if (rowSeparator.equals("\t"))
3978: this .jRadioButtonCVSSeparatorTab1.setSelected(true);
3979: else if (rowSeparator.equals(" "))
3980: this .jRadioButtonCVSSeparatorSpace1.setSelected(true);
3981: else if (rowSeparator.equals(";"))
3982: this .jRadioButtonCVSSeparatorSemicolon1
3983: .setSelected(true);
3984: else if (rowSeparator.equals("\n"))
3985: this .jRadioButtonCVSSeparatorNewLine1.setSelected(true);
3986: else {
3987: this .jRadioButtonCVSSeparatorOther1.setSelected(true);
3988: this .jTextFieldCVSSeparatorText1.setText(rowSeparator);
3989: }
3990:
3991: DefaultListModel dlm = (DefaultListModel) this .jListCVSColumns
3992: .getModel();
3993:
3994: for (int i = 0; i < con.getColumnNames().size(); ++i) {
3995: dlm.addElement(con.getColumnNames().elementAt(i) + "");
3996: }
3997:
3998: if (dlm.size() > 0) {
3999: jListCVSColumns.setSelectedIndex(0);
4000: }
4001:
4002: } else if (iReportConnection instanceof JRXMLDataSourceConnection) {
4003: JRXMLDataSourceConnection con = (JRXMLDataSourceConnection) iReportConnection;
4004: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
4005: "1");
4006: this .jTextFieldXMLFile.setText(con.getFilename());
4007: this .jTextFieldRecordPath
4008: .setText(con.getSelectExpression());
4009: this .jRadioButtonXML_connection.setSelected(con
4010: .isUseConnection());
4011: this .jRadioButtonXML_datasource.setSelected(!con
4012: .isUseConnection());
4013:
4014: this .jTextFieldXMLDatePattern.setText(Misc.nvl(con
4015: .getDatePattern(), ""));
4016: this .jTextFieldXMLNumberPattern.setText(Misc.nvl(con
4017: .getNumberPattern(), ""));
4018:
4019: this .tmpXMLLocale = con.getLocale();
4020: if (this .tmpXMLLocale != null) {
4021: jTextFieldXMLLocaleValue.setText(this .tmpXMLLocale
4022: .getDisplayName(I18n.getCurrentLocale()));
4023: } else {
4024: jTextFieldXMLLocaleValue.setText(I18n.getString(
4025: "timezone.default", "Default"));
4026: }
4027:
4028: this .tmpXMLTimeZone = con.getTimeZone();
4029: if (this .tmpXMLLocale != null) {
4030: jTextFieldXMLTimeZoneValue.setText(tmpXMLTimeZone
4031: .getDisplayName(I18n.getCurrentLocale()));
4032: } else {
4033: jTextFieldXMLTimeZoneValue.setText(I18n.getString(
4034: "timezone.default", "Default"));
4035: }
4036:
4037: XMLDataSourceCheckBoxesChanged();
4038: } else if (iReportConnection instanceof JRDataSourceProviderConnection) {
4039: JRDataSourceProviderConnection con = (JRDataSourceProviderConnection) iReportConnection;
4040: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
4041: "5");
4042: this .jTextFieldJRDataSourceProvider
4043: .setText(it.businesslogic.ireport.util.Misc.nvl(con
4044: .getProperties()
4045: .get("JRDataSourceProvider"), ""));
4046: } else if (iReportConnection instanceof JRSpringLoadedHibernateConnection) {
4047:
4048: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
4049: "9");
4050: this .jTextFieldSLHSpringConfig
4051: .setText(((JRSpringLoadedHibernateConnection) iReportConnection)
4052: .getSpringConfig());
4053: this .jTextFieldSLHSessionFactory
4054: .setText(((JRSpringLoadedHibernateConnection) iReportConnection)
4055: .getSessionFactoryBeanId());
4056: } else if (iReportConnection instanceof JRHibernateConnection) {
4057: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
4058: "6");
4059: } else if (iReportConnection instanceof EJBQLConnection) {
4060: EJBQLConnection con = (EJBQLConnection) iReportConnection;
4061: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
4062: "7");
4063: this .jTextFieldPersistanceUnit
4064: .setText(it.businesslogic.ireport.util.Misc
4065: .nvl(con.getProperties().get(
4066: "PersistenceUnit"), ""));
4067: } else if (iReportConnection instanceof MondrianConnection) {
4068: MondrianConnection con = (MondrianConnection) iReportConnection;
4069: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
4070: "8");
4071: this .jTextFieldCatalogURI
4072: .setText(it.businesslogic.ireport.util.Misc
4073: .nvl(con.getProperties().get(
4074: MondrianConnection.CATALOG_URI), ""));
4075: jComboBoxMondrianJdbc.setSelectedItem(con
4076: .getConnectionName());
4077: } else if (iReportConnection instanceof QueryExecuterConnection) {
4078: QueryExecuterConnection con = (QueryExecuterConnection) iReportConnection;
4079: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
4080: "10");
4081: } else if (iReportConnection instanceof JREmptyDatasourceConnection) {
4082: JREmptyDatasourceConnection con = (JREmptyDatasourceConnection) iReportConnection;
4083: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
4084: "11");
4085: jSpinnerNumRecords.getModel().setValue(
4086: new Integer(con.getRecords()));
4087: } else if (iReportConnection instanceof JRCustomConnection) {
4088: JRCustomConnection con = (JRCustomConnection) iReportConnection;
4089: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
4090: "12");
4091: jTextFieldIReportConnectionClassName.setText(con
4092: .getIReportConnectionClassName());
4093: HashMap map = con.getProperties();
4094: DefaultTableModel dtm = (DefaultTableModel) jTableCustomProperties
4095: .getModel();
4096: dtm.setRowCount(0);
4097: Iterator iterator = map.keySet().iterator();
4098: while (iterator.hasNext()) {
4099: String key = "" + iterator.next();
4100: Object value = map.get(key);
4101: if (key.startsWith(JRCustomConnection.PROPERTY_PREFIX)) {
4102: dtm
4103: .addRow(new Object[] {
4104: key
4105: .substring(JRCustomConnection.PROPERTY_PREFIX
4106: .length()),
4107: value + "" });
4108: }
4109: }
4110: } else if (iReportConnection instanceof JRXMLADataSourceConnection) {
4111: /**
4112: * Copyright (C) 2005, 2006 CINCOM SYSTEMS, INC.
4113: * All Rights Reserved
4114: * www.cincom.com
4115: *
4116: */
4117: JRXMLADataSourceConnection con = (JRXMLADataSourceConnection) iReportConnection;
4118: //this.jComboBoxConnectionType.setSelectedIndex(9); // referencing XMLA Server
4119: Misc.setComboboxSelectedTagValue(jComboBoxConnectionType,
4120: "13");
4121: this .jTextFieldXMLAUrl.setText(con.getUrl());
4122: this .jComboBoxXMLADatasource.removeAllItems();
4123: this .jComboBoxXMLADatasource.addItem(con.getDatasource());
4124: this .jComboBoxXMLACatalog.removeAllItems();
4125: this .jComboBoxXMLACatalog.addItem(con.getCatalog());
4126: this .jComboBoxXMLACube.removeAllItems();
4127: this .jComboBoxXMLACube.addItem(con.getCube());
4128:
4129: this .jTextFieldUsername1.setText(con.getUsername());
4130: if (con.isSavePassword())
4131: this .jTextFieldPassword1.setText(con.getPassword());
4132: else
4133: this .jTextFieldPassword1.setText("");
4134: this .jCheckBoxSavePassword1.setSelected(con
4135: .isSavePassword());
4136: }
4137: }
4138:
4139: // Variables declaration - do not modify//GEN-BEGIN:variables
4140: private javax.swing.ButtonGroup buttonGroup1;
4141: private javax.swing.ButtonGroup buttonGroupBeansSetType;
4142: private javax.swing.ButtonGroup buttonGroupCVSFieldSeparator;
4143: private javax.swing.ButtonGroup buttonGroupCVSFieldSeparator1;
4144: private javax.swing.JButton jButton2;
4145: private javax.swing.JButton jButtonAddProp;
4146: private javax.swing.JButton jButtonBrowseCatalog;
4147: private javax.swing.JButton jButtonCSVFilename;
4148: private javax.swing.JButton jButtonCVSDateFormat;
4149: private javax.swing.JButton jButtonCancel;
4150: private javax.swing.JButton jButtonDeleteParameter;
4151: private javax.swing.JButton jButtonGetXMLAMetadata;
4152: private javax.swing.JButton jButtonModifyParameter;
4153: private javax.swing.JButton jButtonNewParameter;
4154: private javax.swing.JButton jButtonNewParameter1;
4155: private javax.swing.JButton jButtonOK;
4156: private javax.swing.JButton jButtonOK1;
4157: private javax.swing.JButton jButtonRemoveProp;
4158: private javax.swing.JButton jButtonWizard;
4159: private javax.swing.JButton jButtonXMLDatePattern;
4160: private javax.swing.JButton jButtonXMLLocale;
4161: private javax.swing.JButton jButtonXMLNumberPattern;
4162: private javax.swing.JButton jButtonXMLTimeZone;
4163: private javax.swing.JCheckBox jCheckBoxCVSDateFormat;
4164: private javax.swing.JCheckBox jCheckBoxCVSFirstRowAsHeader;
4165: private javax.swing.JCheckBox jCheckBoxSavePassword;
4166: private javax.swing.JCheckBox jCheckBoxSavePassword1;
4167: private javax.swing.JCheckBox jCheckBoxisUseFieldDescription;
4168: private javax.swing.JComboBox jComboBoxConnectionType;
4169: private javax.swing.JComboBox jComboBoxJDBCDriver;
4170: private javax.swing.JComboBox jComboBoxMondrianJdbc;
4171: private javax.swing.JComboBox jComboBoxXMLACatalog;
4172: private javax.swing.JComboBox jComboBoxXMLACube;
4173: private javax.swing.JComboBox jComboBoxXMLADatasource;
4174: private javax.swing.JLabel jLabel1;
4175: private javax.swing.JLabel jLabel10;
4176: private javax.swing.JLabel jLabel11;
4177: private javax.swing.JLabel jLabel12;
4178: private javax.swing.JLabel jLabel13;
4179: private javax.swing.JLabel jLabel14;
4180: private javax.swing.JLabel jLabel15;
4181: private javax.swing.JLabel jLabel16;
4182: private javax.swing.JLabel jLabel17;
4183: private javax.swing.JLabel jLabel18;
4184: private javax.swing.JLabel jLabel19;
4185: private javax.swing.JLabel jLabel2;
4186: private javax.swing.JLabel jLabel20;
4187: private javax.swing.JLabel jLabel21;
4188: private javax.swing.JLabel jLabel22;
4189: private javax.swing.JLabel jLabel23;
4190: private javax.swing.JLabel jLabel24;
4191: private javax.swing.JLabel jLabel25;
4192: private javax.swing.JLabel jLabel26;
4193: private javax.swing.JLabel jLabel27;
4194: private javax.swing.JLabel jLabel3;
4195: private javax.swing.JLabel jLabel4;
4196: private javax.swing.JLabel jLabel5;
4197: private javax.swing.JLabel jLabel6;
4198: private javax.swing.JLabel jLabel7;
4199: private javax.swing.JLabel jLabel8;
4200: private javax.swing.JLabel jLabel9;
4201: private javax.swing.JLabel jLabelAttention;
4202: private javax.swing.JLabel jLabelPropertiesTable;
4203: private javax.swing.JLabel jLabelXMLACatalog;
4204: private javax.swing.JLabel jLabelXMLACube;
4205: private javax.swing.JLabel jLabelXMLADatasource;
4206: private javax.swing.JLabel jLabelXMLAUrl;
4207: private javax.swing.JLabel jLabelXMLDatePattern;
4208: private javax.swing.JLabel jLabelXMLLocale;
4209: private javax.swing.JLabel jLabelXMLNumberPattern;
4210: private javax.swing.JLabel jLabelXMLRecordPath;
4211: private javax.swing.JLabel jLabelXMLTimeZone;
4212: private javax.swing.JList jListCVSColumns;
4213: private javax.swing.JPanel jPanel1;
4214: private javax.swing.JPanel jPanel10;
4215: private javax.swing.JPanel jPanel11;
4216: private javax.swing.JPanel jPanel12;
4217: private javax.swing.JPanel jPanel13;
4218: private javax.swing.JPanel jPanel14;
4219: private javax.swing.JPanel jPanel15;
4220: private javax.swing.JPanel jPanel16;
4221: private javax.swing.JPanel jPanel2;
4222: private javax.swing.JPanel jPanel3;
4223: private javax.swing.JPanel jPanel4;
4224: private javax.swing.JPanel jPanel5;
4225: private javax.swing.JPanel jPanel6;
4226: private javax.swing.JPanel jPanel7;
4227: private javax.swing.JPanel jPanel8;
4228: private javax.swing.JPanel jPanel9;
4229: private javax.swing.JPanel jPanelBeansSet;
4230: private javax.swing.JPanel jPanelButtons;
4231: private javax.swing.JPanel jPanelCSV;
4232: private javax.swing.JPanel jPanelConnectionRoot;
4233: private javax.swing.JPanel jPanelConnectionType;
4234: private javax.swing.JPanel jPanelCustomConnection;
4235: private javax.swing.JPanel jPanelCustomDataSourceFactory;
4236: private javax.swing.JPanel jPanelDatasourceProvider;
4237: private javax.swing.JPanel jPanelEJBQL;
4238: private javax.swing.JPanel jPanelEmptyDataSource;
4239: private javax.swing.JPanel jPanelHibernate;
4240: private javax.swing.JPanel jPanelJDBC;
4241: private javax.swing.JPanel jPanelMondrian;
4242: private javax.swing.JPanel jPanelQueryExecutorMode;
4243: private javax.swing.JPanel jPanelSpringLoadedHibernate;
4244: private javax.swing.JPanel jPanelXML;
4245: private javax.swing.JPanel jPanelXMLA;
4246: private javax.swing.JRadioButton jRadioButtonCVSSeparatorComma;
4247: private javax.swing.JRadioButton jRadioButtonCVSSeparatorComma1;
4248: private javax.swing.JRadioButton jRadioButtonCVSSeparatorNewLine;
4249: private javax.swing.JRadioButton jRadioButtonCVSSeparatorNewLine1;
4250: private javax.swing.JRadioButton jRadioButtonCVSSeparatorOther;
4251: private javax.swing.JRadioButton jRadioButtonCVSSeparatorOther1;
4252: private javax.swing.JRadioButton jRadioButtonCVSSeparatorSemicolon;
4253: private javax.swing.JRadioButton jRadioButtonCVSSeparatorSemicolon1;
4254: private javax.swing.JRadioButton jRadioButtonCVSSeparatorSpace;
4255: private javax.swing.JRadioButton jRadioButtonCVSSeparatorSpace1;
4256: private javax.swing.JRadioButton jRadioButtonCVSSeparatorTab;
4257: private javax.swing.JRadioButton jRadioButtonCVSSeparatorTab1;
4258: private javax.swing.JRadioButton jRadioButtonJBSetArray;
4259: private javax.swing.JRadioButton jRadioButtonJBSetCollection;
4260: private javax.swing.JRadioButton jRadioButtonXML_connection;
4261: private javax.swing.JRadioButton jRadioButtonXML_datasource;
4262: private javax.swing.JScrollPane jScrollPane1;
4263: private javax.swing.JScrollPane jScrollPane2;
4264: private javax.swing.JScrollPane jScrollPane3;
4265: private javax.swing.JSeparator jSeparator1;
4266: private javax.swing.JSeparator jSeparator10;
4267: private javax.swing.JSeparator jSeparator2;
4268: private javax.swing.JSeparator jSeparator3;
4269: private javax.swing.JSeparator jSeparator4;
4270: private javax.swing.JSeparator jSeparator5;
4271: private javax.swing.JSeparator jSeparator6;
4272: private javax.swing.JSeparator jSeparator7;
4273: private javax.swing.JSeparator jSeparator8;
4274: private javax.swing.JSeparator jSeparator9;
4275: private javax.swing.JSpinner jSpinnerNumRecords;
4276: private javax.swing.JTabbedPane jTabbedPane1;
4277: private javax.swing.JTable jTableCustomProperties;
4278: private javax.swing.JLabel jTextArea1;
4279: private javax.swing.JTextField jTextFieldCSVFilename;
4280: private javax.swing.JTextField jTextFieldCVSDateFormat;
4281: private javax.swing.JTextField jTextFieldCVSSeparatorText;
4282: private javax.swing.JTextField jTextFieldCVSSeparatorText1;
4283: private javax.swing.JTextField jTextFieldCatalogURI;
4284: private javax.swing.JTextField jTextFieldDBName;
4285: private javax.swing.JTextField jTextFieldIReportConnectionClassName;
4286: private javax.swing.JTextField jTextFieldJBSetFactoryClass;
4287: private javax.swing.JTextField jTextFieldJBSetMethodToCall;
4288: private javax.swing.JTextField jTextFieldJDBCUrl;
4289: private javax.swing.JTextField jTextFieldJRCustomDataSourceFactoryClass;
4290: private javax.swing.JTextField jTextFieldJRCustomDataSourceMethod;
4291: private javax.swing.JTextField jTextFieldJRDataSourceProvider;
4292: private javax.swing.JTextField jTextFieldName;
4293: private javax.swing.JPasswordField jTextFieldPassword;
4294: private javax.swing.JPasswordField jTextFieldPassword1;
4295: private javax.swing.JTextField jTextFieldPersistanceUnit;
4296: private javax.swing.JTextField jTextFieldRecordPath;
4297: private javax.swing.JTextField jTextFieldSLHSessionFactory;
4298: private javax.swing.JTextField jTextFieldSLHSpringConfig;
4299: private javax.swing.JTextField jTextFieldServerAddress;
4300: private javax.swing.JTextField jTextFieldUsername;
4301: private javax.swing.JTextField jTextFieldUsername1;
4302: private javax.swing.JTextField jTextFieldXMLAUrl;
4303: private javax.swing.JTextField jTextFieldXMLDatePattern;
4304: private javax.swing.JTextField jTextFieldXMLFile;
4305: private javax.swing.JTextField jTextFieldXMLLocaleValue;
4306: private javax.swing.JTextField jTextFieldXMLNumberPattern;
4307: private javax.swing.JTextField jTextFieldXMLTimeZoneValue;
4308: private javax.swing.JTextPane jTextPane1;
4309: private javax.swing.JTextPane jTextPane2;
4310: // End of variables declaration//GEN-END:variables
4311:
4312: private int dialogResult;
4313:
4314: private IReportConnection iReportConnection;
4315:
4316: public void applyI18n() {
4317: // Start autogenerated code ----------------------
4318: jCheckBoxCVSDateFormat.setText(I18n.getString(
4319: "connectionDialog.checkBoxCVSDateFormat",
4320: "Use custom date format"));
4321: jCheckBoxCVSFirstRowAsHeader
4322: .setText(I18n
4323: .getString(
4324: "connectionDialog.checkBoxCVSFirstRowAsHeader",
4325: "Skip the first line (the column names will be read from the first line)"));
4326: jCheckBoxSavePassword.setText(I18n.getString(
4327: "connectionDialog.checkBoxSavePassword",
4328: "Save password"));
4329: jCheckBoxisUseFieldDescription.setText(I18n.getString(
4330: "connectionDialog.checkBoxisUseFieldDescription",
4331: "Use field description"));
4332: jRadioButtonCVSSeparatorComma.setText(I18n.getString(
4333: "connectionDialog.radioButtonCVSSeparatorComma",
4334: "Comma"));
4335: jRadioButtonCVSSeparatorComma1.setText(I18n.getString(
4336: "connectionDialog.radioButtonCVSSeparatorComma1",
4337: "Comma"));
4338: jRadioButtonCVSSeparatorNewLine.setText(I18n.getString(
4339: "connectionDialog.radioButtonCVSSeparatorNewLine",
4340: "New line"));
4341: jRadioButtonCVSSeparatorNewLine1.setText(I18n.getString(
4342: "connectionDialog.radioButtonCVSSeparatorNewLine1",
4343: "New line"));
4344: jRadioButtonCVSSeparatorOther.setText(I18n.getString(
4345: "connectionDialog.radioButtonCVSSeparatorOther",
4346: "Other"));
4347: jRadioButtonCVSSeparatorOther1.setText(I18n.getString(
4348: "connectionDialog.radioButtonCVSSeparatorOther1",
4349: "Other"));
4350: jRadioButtonCVSSeparatorSemicolon.setText(I18n.getString(
4351: "connectionDialog.radioButtonCVSSeparatorSemicolon",
4352: "Semicolon"));
4353: jRadioButtonCVSSeparatorSemicolon1.setText(I18n.getString(
4354: "connectionDialog.radioButtonCVSSeparatorSemicolon1",
4355: "Semicolon"));
4356: jRadioButtonCVSSeparatorSpace.setText(I18n.getString(
4357: "connectionDialog.radioButtonCVSSeparatorSpace",
4358: "Space"));
4359: jRadioButtonCVSSeparatorSpace1.setText(I18n.getString(
4360: "connectionDialog.radioButtonCVSSeparatorSpace1",
4361: "Space"));
4362: jRadioButtonCVSSeparatorTab.setText(I18n.getString(
4363: "connectionDialog.radioButtonCVSSeparatorTab", "Tab"));
4364: jRadioButtonCVSSeparatorTab1.setText(I18n.getString(
4365: "connectionDialog.radioButtonCVSSeparatorTab1", "Tab"));
4366: jRadioButtonJBSetArray.setText(I18n.getString(
4367: "connectionDialog.radioButtonJBSetArray",
4368: "Array of javaBeans"));
4369: jRadioButtonJBSetCollection.setText(I18n.getString(
4370: "connectionDialog.radioButtonJBSetCollection",
4371: " Collection of javaBeans"));
4372: jRadioButtonXML_connection
4373: .setText(I18n
4374: .getString(
4375: "connectionDialog.radioButtonXML_connection",
4376: "Use the report XPath expression when filling the report"));
4377: jRadioButtonXML_datasource.setText(I18n.getString(
4378: "connectionDialog.radioButtonXML_datasource",
4379: "Create a datasource using this expression"));
4380: // End autogenerated code ----------------------
4381: // Start autogenerated code ----------------------
4382: jButton2.setText(I18n.getString("connectionDialog.button2",
4383: "Browse"));
4384: jButtonBrowseCatalog.setText(I18n.getString(
4385: "connectionDialog.buttonBrowseCatalog", "Browse..."));
4386: jButtonCSVFilename.setText(I18n.getString(
4387: "connectionDialog.buttonCSVFilename", "Browse"));
4388: jButtonCVSDateFormat.setText(I18n.getString(
4389: "connectionDialog.buttonCVSDateFormat", "Date format"));
4390: jButtonCancel.setText(I18n.getString(
4391: "connectionDialog.buttonCancel", "Cancel"));
4392: jButtonDeleteParameter.setText(I18n.getString(
4393: "connectionDialog.buttonDeleteParameter", "Delete"));
4394: jButtonModifyParameter.setText(I18n.getString(
4395: "connectionDialog.buttonModifyParameter", "Modify"));
4396: jButtonNewParameter.setText(I18n.getString(
4397: "connectionDialog.buttonNewParameter", "New"));
4398: jButtonNewParameter1.setText(I18n.getString(
4399: "connectionDialog.buttonNewParameter1",
4400: "Get columns name from the first row of the file"));
4401: jButtonOK.setText(I18n.getString("connectionDialog.buttonOK",
4402: "Save"));
4403: jButtonOK1.setText(I18n.getString("connectionDialog.buttonOK1",
4404: "Test"));
4405: jButtonWizard.setText(I18n.getString(
4406: "connectionDialog.buttonWizard", "Wizard"));
4407: jLabel1.setText(I18n.getString("connectionDialog.label1",
4408: "Name"));
4409: jLabel10.setText(I18n.getString("connectionDialog.label10",
4410: "Factory class"));
4411: jLabel11
4412: .setText(I18n
4413: .getString("connectionDialog.label11",
4414: "The static method to call to retrive the JRDataSource"));
4415: jLabel12.setText(I18n.getString("connectionDialog.label12",
4416: "Factory class (the class that will produce the set)"));
4417: jLabel13
4418: .setText(I18n
4419: .getString(
4420: "connectionDialog.label13",
4421: "The static method to call to retrive the array or the the collection of javaBeans"));
4422: jLabel14.setText(I18n.getString("connectionDialog.label14",
4423: "Server Address"));
4424: jLabel15.setText(I18n.getString("connectionDialog.label15",
4425: "CSV file"));
4426: jLabel17.setText(I18n.getString("connectionDialog.label17",
4427: "JasperReports DataSource Provider class"));
4428: jLabel18.setText(I18n.getString("connectionDialog.label18",
4429: "Persistance Unit Name"));
4430: jLabel19.setText(I18n.getString("connectionDialog.label19",
4431: "Catalog URI (i.e. file:/path/schema.xml)"));
4432: jLabel2.setText(I18n.getString("connectionDialog.label2",
4433: "JDBC Driver"));
4434: jLabel20.setText(I18n.getString("connectionDialog.label20",
4435: "Jdbc Connection"));
4436: jLabel21.setText(I18n.getString("connectionDialog.label21",
4437: "Spring configuration"));
4438: jLabel22.setText(I18n.getString("connectionDialog.label22",
4439: "Session Factory Bean ID"));
4440: jLabel24.setText(I18n.getString("connectionDialog.label24",
4441: "Number of empty records"));
4442: jLabel3.setText(I18n.getString("connectionDialog.label3",
4443: "JDBC URL"));
4444: jLabel4.setText(I18n.getString("connectionDialog.label4",
4445: "Type of connection / datasource"));
4446: jLabel5.setText(I18n.getString("connectionDialog.label5",
4447: "Database"));
4448: jLabel6.setText(I18n.getString("connectionDialog.label6",
4449: "Username"));
4450: jLabel7.setText(I18n.getString("connectionDialog.label7",
4451: "Password"));
4452: jLabel9.setText(I18n.getString("connectionDialog.label9",
4453: "XML file"));
4454: jLabelXMLRecordPath.setText(I18n.getString(
4455: "connectionDialog.labelXMLRecordPath",
4456: "Select Expression"));
4457: // End autogenerated code ----------------------
4458:
4459: jLabelXMLAUrl
4460: .setText(I18n.getString(
4461: "connectionDialog.labelXMLAUrl",
4462: "Url of XML/A server"));
4463: jButtonGetXMLAMetadata.setText(I18n.getString(
4464: "connectionDialog.buttonGetXMLAMetadata",
4465: "Get metadata"));
4466: jLabelXMLADatasource.setText(I18n.getString(
4467: "connectionDialog.labelXMLADatasource", "Datasource"));
4468: jLabelXMLACatalog.setText(I18n.getString(
4469: "connectionDialog.labelXMLACatalog", "Catalog"));
4470: jLabelXMLACube.setText(I18n.getString(
4471: "connectionDialog.labelXMLACube", "Cube"));
4472:
4473: jTabbedPane1.setTitleAt(0, I18n.getString(
4474: "connectionDialog.tab.Columns", "Columns"));
4475: jTabbedPane1.setTitleAt(0, I18n.getString(
4476: "connectionDialog.tab.Separators", "Separators"));
4477:
4478: ((javax.swing.border.TitledBorder) jPanel2.getBorder())
4479: .setTitle(it.businesslogic.ireport.util.I18n.getString(
4480: "connectionDialog.panelBorder.jdbcUrlWizard",
4481: "JDBC URL Wizard"));
4482: ((javax.swing.border.TitledBorder) jPanel8.getBorder())
4483: .setTitle(it.businesslogic.ireport.util.I18n.getString(
4484: "connectionDialog.panelBorder.ColumnNames",
4485: "Column names"));
4486: ((javax.swing.border.TitledBorder) jPanel6.getBorder())
4487: .setTitle(it.businesslogic.ireport.util.I18n.getString(
4488: "connectionDialog.panelBorder.Other", "Other"));
4489: ((javax.swing.border.TitledBorder) jPanel4.getBorder())
4490: .setTitle(it.businesslogic.ireport.util.I18n
4491: .getString(
4492: "connectionDialog.panelBorder.FieldSeparatorChat",
4493: "Field separator (char)"));
4494: ((javax.swing.border.TitledBorder) jPanel5.getBorder())
4495: .setTitle(it.businesslogic.ireport.util.I18n.getString(
4496: "connectionDialog.panelBorder.RowSeparator",
4497: "Row separator"));
4498:
4499: jTableCustomProperties.getColumn("Name").setHeaderValue(
4500: I18n.getString("connectionDialog.tablecolumn.Name",
4501: "Name"));
4502: jTableCustomProperties.getColumn("Value").setHeaderValue(
4503: I18n.getString("connectionDialog.tablecolumn.Value",
4504: "Value"));
4505:
4506: jButtonAddProp.setText(I18n.getString(
4507: "connectionDialog.buttonAddProp", "Add"));
4508: jButtonRemoveProp.setText(I18n.getString(
4509: "connectionDialog.buttonRemoveProp", "Remove"));
4510:
4511: setTitle(I18n.getString("connectionDialog.title",
4512: "Connections properties"));
4513: jButtonCancel
4514: .setMnemonic(I18n.getString(
4515: "connectionDialog.buttonCancelMnemonic", "c")
4516: .charAt(0));
4517: jButtonOK.setMnemonic(I18n.getString(
4518: "connectionDialog.buttonOKMnemonic", "o").charAt(0));
4519: jButtonOK1.setMnemonic(I18n.getString(
4520: "connectionDialog.buttonOK1Mnemonic", "t").charAt(0));
4521: I18n
4522: .getString(
4523: "connectionDialog.textPane1",
4524: "Press the test button.\\n\\niReport will look in the classpath for a valid hibernate configuration.");
4525: I18n
4526: .getString(
4527: "connectionDialog.textPane2",
4528: "iReport will search for persistence.xml files within the META-INF directory of any CLASSPATH element");
4529: I18n
4530: .getString(
4531: "connectionDialog.textArea1",
4532: "ATTENTION! Passwords are stored in clear text. If you dont specify a password now, iReport will ask you for one only when required and will not save it.");
4533:
4534: jTextFieldXMLTimeZoneValue.setText(I18n.getString(
4535: "timezone.default", "Default"));
4536: jTextFieldXMLLocaleValue.setText(I18n.getString(
4537: "timezone.default", "Default"));
4538:
4539: ((javax.swing.border.TitledBorder) jPanel3.getBorder())
4540: .setTitle(it.businesslogic.ireport.util.I18n.getString(
4541: "connectionDialog.borderXMLLocaleTimeZone",
4542: "Locale / Time zone"));
4543:
4544: jLabelXMLLocale.setText(I18n.getString(
4545: "connectionDialog.labelXMLLocale", "Locale"));
4546: jLabelXMLTimeZone.setText(I18n.getString(
4547: "connectionDialog.labelXMLTimeZone", "Time zone"));
4548: jLabelXMLDatePattern
4549: .setText(I18n.getString(
4550: "connectionDialog.labelXMLDatePattern",
4551: "Date pattern"));
4552: jLabelXMLNumberPattern.setText(I18n.getString(
4553: "connectionDialog.labelXMLNumberPattern",
4554: "Number pattern"));
4555: jButtonXMLDatePattern.setText(I18n.getString(
4556: "connectionDialog.buttonXMLDatePattern", "Create..."));
4557: jButtonXMLNumberPattern
4558: .setText(I18n.getString(
4559: "connectionDialog.buttonXMLNumberPattern",
4560: "Create..."));
4561: jButtonXMLLocale.setText(I18n.getString(
4562: "connectionDialog.buttonXMLLocale", "Select..."));
4563: jButtonXMLTimeZone.setText(I18n.getString(
4564: "connectionDialog.buttonXMLTimeZone", "Select..."));
4565: }
4566:
4567: public IReportConnection createConnection(int selectedConnectionType) {
4568: IReportConnection irConn = null;
4569:
4570: if (selectedConnectionType == 0) {
4571: irConn = new JDBCConnection();
4572: irConn.setName(this .jTextFieldName.getText().trim());
4573: ((JDBCConnection) irConn)
4574: .setServerAddress(this .jTextFieldServerAddress
4575: .getText().trim());
4576: ((JDBCConnection) irConn).setDatabase(this .jTextFieldDBName
4577: .getText().trim());
4578: ((JDBCConnection) irConn)
4579: .setUsername(this .jTextFieldUsername.getText()
4580: .trim());
4581: if (jCheckBoxSavePassword.isSelected())
4582: ((JDBCConnection) irConn)
4583: .setPassword(this .jTextFieldPassword.getText());
4584: else
4585: ((JDBCConnection) irConn).setPassword("");
4586: ((JDBCConnection) irConn)
4587: .setSavePassword(jCheckBoxSavePassword.isSelected());
4588: ((JDBCConnection) irConn)
4589: .setJDBCDriver((this .jComboBoxJDBCDriver
4590: .getSelectedItem() + "").trim());
4591: if ((this .jComboBoxJDBCDriver.getSelectedItem() + "")
4592: .trim().length() == 0) {
4593: javax.swing.JOptionPane
4594: .showMessageDialog(
4595: this ,
4596: I18n
4597: .getString(
4598: "messages.connectionDialog.jdbc.invalidDriver",
4599: "Please insert a valid JDBC driver!"),
4600: I18n
4601: .getString(
4602: "messages.connectionDialog.jdbc.invalidDriverCaption",
4603: "Invalid driver!"),
4604: javax.swing.JOptionPane.WARNING_MESSAGE);
4605: return null;
4606: }
4607:
4608: if (this .jTextFieldJDBCUrl.getText().trim().length() == 0) {
4609: javax.swing.JOptionPane
4610: .showMessageDialog(
4611: this ,
4612: I18n
4613: .getString(
4614: "messages.connectionDialog.jdbc.invalidUrl",
4615: "Please insert a valid JDBC URL!"),
4616: I18n
4617: .getString(
4618: "messages.connectionDialog.jdbc.invalidUrlCaption",
4619: "Invalid url!"),
4620: javax.swing.JOptionPane.WARNING_MESSAGE);
4621: return null;
4622: }
4623: ((JDBCConnection) irConn).setUrl(this .jTextFieldJDBCUrl
4624: .getText().trim());
4625: } else if (selectedConnectionType == 2) {
4626: irConn = new JavaBeanDataSourceConnection();
4627: irConn.setName(this .jTextFieldName.getText().trim());
4628: ((JavaBeanDataSourceConnection) irConn)
4629: .setFactoryClass(this .jTextFieldJBSetFactoryClass
4630: .getText().trim());
4631: ((JavaBeanDataSourceConnection) irConn)
4632: .setMethodToCall(this .jTextFieldJBSetMethodToCall
4633: .getText().trim());
4634: ((JavaBeanDataSourceConnection) irConn)
4635: .setUseFieldDescription(this .jCheckBoxisUseFieldDescription
4636: .isSelected());
4637: if (jRadioButtonJBSetArray.isSelected()) {
4638: ((JavaBeanDataSourceConnection) irConn)
4639: .setType(JavaBeanDataSourceConnection.BEAN_ARRAY);
4640: } else {
4641: ((JavaBeanDataSourceConnection) irConn)
4642: .setType(JavaBeanDataSourceConnection.BEAN_COLLECTION);
4643: }
4644: } else if (selectedConnectionType == 3) {
4645: irConn = new JRCustomDataSourceConnection();
4646: irConn.setName(this .jTextFieldName.getText().trim());
4647: ((JRCustomDataSourceConnection) irConn)
4648: .setFactoryClass(this .jTextFieldJRCustomDataSourceFactoryClass
4649: .getText().trim());
4650: ((JRCustomDataSourceConnection) irConn)
4651: .setMethodToCall(this .jTextFieldJRCustomDataSourceMethod
4652: .getText().trim());
4653: } else if (selectedConnectionType == 4) {
4654:
4655: irConn = new JRCSVDataSourceConnection();
4656: irConn.setName(this .jTextFieldName.getText().trim());
4657: ((JRCSVDataSourceConnection) irConn)
4658: .setFilename(this .jTextFieldCSVFilename.getText()
4659: .trim());
4660:
4661: if (jRadioButtonCVSSeparatorComma.isSelected())
4662: ((JRCSVDataSourceConnection) irConn)
4663: .setFieldDelimiter(",");
4664: if (jRadioButtonCVSSeparatorTab.isSelected())
4665: ((JRCSVDataSourceConnection) irConn)
4666: .setFieldDelimiter("\t");
4667: if (jRadioButtonCVSSeparatorSpace.isSelected())
4668: ((JRCSVDataSourceConnection) irConn)
4669: .setFieldDelimiter(" ");
4670: if (jRadioButtonCVSSeparatorSemicolon.isSelected())
4671: ((JRCSVDataSourceConnection) irConn)
4672: .setFieldDelimiter(";");
4673: if (jRadioButtonCVSSeparatorNewLine.isSelected())
4674: ((JRCSVDataSourceConnection) irConn)
4675: .setFieldDelimiter("\n");
4676: if (jRadioButtonCVSSeparatorOther.isSelected())
4677: ((JRCSVDataSourceConnection) irConn)
4678: .setFieldDelimiter(jTextFieldCVSSeparatorText
4679: .getText());
4680:
4681: if (jRadioButtonCVSSeparatorComma1.isSelected())
4682: ((JRCSVDataSourceConnection) irConn)
4683: .setRecordDelimiter(",");
4684: if (jRadioButtonCVSSeparatorTab1.isSelected())
4685: ((JRCSVDataSourceConnection) irConn)
4686: .setRecordDelimiter("\t");
4687: if (jRadioButtonCVSSeparatorSpace1.isSelected())
4688: ((JRCSVDataSourceConnection) irConn)
4689: .setRecordDelimiter(" ");
4690: if (jRadioButtonCVSSeparatorSemicolon1.isSelected())
4691: ((JRCSVDataSourceConnection) irConn)
4692: .setRecordDelimiter(";");
4693: if (jRadioButtonCVSSeparatorNewLine1.isSelected())
4694: ((JRCSVDataSourceConnection) irConn)
4695: .setRecordDelimiter("\n");
4696: if (jRadioButtonCVSSeparatorOther1.isSelected())
4697: ((JRCSVDataSourceConnection) irConn)
4698: .setRecordDelimiter(jTextFieldCVSSeparatorText1
4699: .getText());
4700:
4701: ((JRCSVDataSourceConnection) irConn)
4702: .setCustomDateFormat(jCheckBoxCVSDateFormat
4703: .isSelected() ? jTextFieldCVSDateFormat
4704: .getText() : "");
4705: ((JRCSVDataSourceConnection) irConn)
4706: .setUseFirstRowAsHeader(jCheckBoxCVSFirstRowAsHeader
4707: .isSelected());
4708:
4709: DefaultListModel dlm = (DefaultListModel) this .jListCVSColumns
4710: .getModel();
4711: Vector columnsNames = new Vector();
4712: for (int k = 0; k < dlm.size(); ++k) {
4713: columnsNames.add(dlm.elementAt(k) + "");
4714: }
4715:
4716: ((JRCSVDataSourceConnection) irConn)
4717: .setColumnNames(columnsNames);
4718:
4719: if (columnsNames.size() == 0) {
4720: if (JOptionPane
4721: .showConfirmDialog(
4722: this ,
4723: I18n
4724: .getString(
4725: "messages.connectionDialog.notAllColumnsDefined",
4726: "You have not defined any column for your CSV file. Continue anyway?"),
4727: "", JOptionPane.INFORMATION_MESSAGE) != JOptionPane.OK_OPTION) {
4728: return null;
4729: }
4730: }
4731: if (((JRCSVDataSourceConnection) irConn)
4732: .getFieldDelimiter().equals(
4733: ((JRCSVDataSourceConnection) irConn)
4734: .getRecordDelimiter())) {
4735: if (JOptionPane
4736: .showConfirmDialog(
4737: this ,
4738: I18n
4739: .getString(
4740: "messages.connectionDialog.duplicatedDelimiter",
4741: "Field delimiter char is the same as the record delimiter. Continue anyway?"),
4742: "", JOptionPane.INFORMATION_MESSAGE) != JOptionPane.OK_OPTION) {
4743: return null;
4744: }
4745: }
4746: } else if (selectedConnectionType == 1) {
4747: irConn = new JRXMLDataSourceConnection();
4748: irConn.setName(this .jTextFieldName.getText().trim());
4749: ((JRXMLDataSourceConnection) irConn)
4750: .setFilename(this .jTextFieldXMLFile.getText()
4751: .trim());
4752: ((JRXMLDataSourceConnection) irConn)
4753: .setSelectExpression(this .jTextFieldRecordPath
4754: .getText().trim());
4755: ((JRXMLDataSourceConnection) irConn)
4756: .setUseConnection(jRadioButtonXML_connection
4757: .isSelected());
4758:
4759: ((JRXMLDataSourceConnection) irConn)
4760: .setDatePattern(jTextFieldXMLDatePattern.getText());
4761: ((JRXMLDataSourceConnection) irConn)
4762: .setNumberPattern(jTextFieldXMLNumberPattern
4763: .getText());
4764: ((JRXMLDataSourceConnection) irConn)
4765: .setLocale(this .tmpXMLLocale);
4766: ((JRXMLDataSourceConnection) irConn)
4767: .setTimeZone(this .tmpXMLTimeZone);
4768: } else if (selectedConnectionType == 5) {
4769: irConn = new JRDataSourceProviderConnection();
4770: irConn.setName(this .jTextFieldName.getText().trim());
4771: ((JRDataSourceProviderConnection) irConn).getProperties()
4772: .put(
4773: "JRDataSourceProvider",
4774: this .jTextFieldJRDataSourceProvider
4775: .getText().trim());
4776: } else if (selectedConnectionType == 6) {
4777: irConn = new JRHibernateConnection();
4778: irConn.setName(this .jTextFieldName.getText().trim());
4779: } else if (selectedConnectionType == 7) {
4780: irConn = new EJBQLConnection();
4781: irConn.setName(this .jTextFieldName.getText().trim());
4782: if (jTextFieldPersistanceUnit.getText().trim().length() != 0) {
4783: irConn.getProperties().put("PersistenceUnit",
4784: jTextFieldPersistanceUnit.getText().trim());
4785: }
4786: } else if (selectedConnectionType == 8) {
4787:
4788: if (this .jComboBoxMondrianJdbc.getSelectedIndex() < 0) {
4789: javax.swing.JOptionPane
4790: .showMessageDialog(
4791: this ,
4792: I18n
4793: .getString(
4794: "messages.connectionDialog.setJDBCConnection",
4795: "You have to choose a JDBC connection in order to configure the Mondrian OLAP connection.\nIf JDBC connection are not yet available, please create one before creating this connection."),
4796: I18n
4797: .getString(
4798: "messages.connectionDialog.setJDBCConnectionCaption",
4799: "Invalid JDBC connection!"),
4800: javax.swing.JOptionPane.WARNING_MESSAGE);
4801: return null;
4802: }
4803:
4804: if (this .jTextFieldCatalogURI.getText().trim().length() == 0) {
4805: javax.swing.JOptionPane
4806: .showMessageDialog(
4807: this ,
4808: I18n
4809: .getString(
4810: "messages.connectionDialog.setCatalogUri",
4811: "Please set the Catalog URI"),
4812: I18n
4813: .getString(
4814: "messages.connectionDialog.setCatalogUriCaption",
4815: "Invalid URI!"),
4816: javax.swing.JOptionPane.WARNING_MESSAGE);
4817: return null;
4818: }
4819:
4820: irConn = new MondrianConnection();
4821: irConn.setName(this .jTextFieldName.getText().trim());
4822: irConn.getProperties().put(MondrianConnection.CATALOG_URI,
4823: jTextFieldCatalogURI.getText().trim());
4824: irConn.getProperties().put(
4825: MondrianConnection.CONNECTION_NAME,
4826: jComboBoxMondrianJdbc.getSelectedItem() + "");
4827:
4828: } else if (selectedConnectionType == 9) {
4829: irConn = new JRSpringLoadedHibernateConnection();
4830: irConn.setName(this .jTextFieldName.getText().trim());
4831: ((JRSpringLoadedHibernateConnection) irConn)
4832: .setSessionFactoryBeanId(jTextFieldSLHSessionFactory
4833: .getText());
4834: ((JRSpringLoadedHibernateConnection) irConn)
4835: .setSpringConfig(jTextFieldSLHSpringConfig
4836: .getText());
4837: } else if (selectedConnectionType == 10) {
4838: irConn = new QueryExecuterConnection();
4839: irConn.setName(this .jTextFieldName.getText().trim());
4840: } else if (selectedConnectionType == 11) {
4841: irConn = new JREmptyDatasourceConnection();
4842: irConn.setName(this .jTextFieldName.getText().trim());
4843: ((JREmptyDatasourceConnection) irConn)
4844: .setRecords(((javax.swing.SpinnerNumberModel) jSpinnerNumRecords
4845: .getModel()).getNumber().intValue());
4846: } else if (selectedConnectionType == 12) {
4847:
4848: irConn = new JRCustomConnection();
4849: irConn.setName(this .jTextFieldName.getText().trim());
4850: ((JRCustomConnection) irConn)
4851: .setIReportConnectionClassName(jTextFieldIReportConnectionClassName
4852: .getText());
4853: HashMap map = new HashMap();
4854: DefaultTableModel dtm = (DefaultTableModel) jTableCustomProperties
4855: .getModel();
4856: for (int i = 0; i < dtm.getRowCount(); ++i) {
4857: String key = "" + dtm.getValueAt(i, 0);
4858: String value = "" + dtm.getValueAt(i, 1);
4859: map.put(key, value);
4860: }
4861: ((JRCustomConnection) irConn)
4862: .setInnerConnectionProperties(map);
4863: } else if (selectedConnectionType == 13) {
4864:
4865: /**
4866: * Copyright (C) 2005, 2006 CINCOM SYSTEMS, INC.
4867: * All Rights Reserved
4868: * www.cincom.com
4869: *
4870: */
4871: irConn = new JRXMLADataSourceConnection();
4872: irConn.setName(this .jTextFieldName.getText().trim());
4873:
4874: if (this .jTextFieldXMLAUrl.getText().trim().length() == 0) {
4875: javax.swing.JOptionPane
4876: .showMessageDialog(
4877: this ,
4878: I18n
4879: .getString(
4880: "messages.connectionDialog.xmla.invalidURL",
4881: "Please specify a valid server URL"),
4882: I18n
4883: .getString(
4884: "messages.connectionDialog.xmla.invalidProperty",
4885: "Invalid property!"),
4886: javax.swing.JOptionPane.WARNING_MESSAGE);
4887: return null;
4888: }
4889:
4890: ((JRXMLADataSourceConnection) irConn)
4891: .setUrl(this .jTextFieldXMLAUrl.getText().trim());
4892:
4893: if (this .jComboBoxXMLADatasource.getSelectedIndex() < 0) {
4894: javax.swing.JOptionPane
4895: .showMessageDialog(
4896: this ,
4897: I18n
4898: .getString(
4899: "messages.connectionDialog.xmla.invalidDatasource",
4900: "Please specify a valid Datasource"),
4901: I18n
4902: .getString(
4903: "messages.connectionDialog.setJDBCConnectionCaption",
4904: "Invalid JDBC connection!"),
4905: javax.swing.JOptionPane.WARNING_MESSAGE);
4906: return null;
4907: }
4908:
4909: ((JRXMLADataSourceConnection) irConn)
4910: .setDatasource(((String) this .jComboBoxXMLADatasource
4911: .getSelectedItem()).trim());
4912:
4913: if (this .jComboBoxXMLACatalog.getSelectedIndex() < 0) {
4914: javax.swing.JOptionPane
4915: .showMessageDialog(
4916: this ,
4917: I18n
4918: .getString(
4919: "messages.connectionDialog.xmla.invalidCatalog",
4920: "Please specify a valid Catalog"),
4921: I18n
4922: .getString(
4923: "messages.connectionDialog.setJDBCConnectionCaption",
4924: "Invalid JDBC connection!"),
4925: javax.swing.JOptionPane.WARNING_MESSAGE);
4926: return null;
4927: }
4928:
4929: ((JRXMLADataSourceConnection) irConn)
4930: .setCatalog(((String) this .jComboBoxXMLACatalog
4931: .getSelectedItem()).trim());
4932:
4933: if (this .jComboBoxXMLACube.getSelectedIndex() < 0) {
4934: javax.swing.JOptionPane
4935: .showMessageDialog(
4936: this ,
4937: I18n
4938: .getString(
4939: "messages.connectionDialog.xmla.invalidCube",
4940: "Please specify a valid Cube"),
4941: I18n
4942: .getString(
4943: "messages.connectionDialog.setJDBCConnectionCaption",
4944: "Invalid JDBC connection!"),
4945: javax.swing.JOptionPane.WARNING_MESSAGE);
4946: return null;
4947: }
4948:
4949: ((JRXMLADataSourceConnection) irConn)
4950: .setCube(((String) this .jComboBoxXMLACube
4951: .getSelectedItem()).trim());
4952:
4953: ((JRXMLADataSourceConnection) irConn)
4954: .setUsername(this .jTextFieldUsername1.getText()
4955: .trim());
4956: if (jCheckBoxSavePassword1.isSelected())
4957: ((JRXMLADataSourceConnection) irConn)
4958: .setPassword(this .jTextFieldPassword1.getText());
4959: else
4960: ((JRXMLADataSourceConnection) irConn).setPassword("");
4961: ((JRXMLADataSourceConnection) irConn)
4962: .setSavePassword(jCheckBoxSavePassword1
4963: .isSelected());
4964:
4965: /* end of modification */
4966: }
4967:
4968: return irConn;
4969: }
4970:
4971: /**
4972: * Copyright (C) 2005, 2006 CINCOM SYSTEMS, INC.
4973: * All Rights Reserved
4974: * www.cincom.com
4975: *
4976: */
4977: private class jComboBoxCatListener implements
4978: java.awt.event.ActionListener {
4979: public void actionPerformed(java.awt.event.ActionEvent evt) {
4980: jComboBoxCatActionPerformed(evt);
4981: }
4982: }
4983:
4984: jComboBoxCatListener catListener = new jComboBoxCatListener();
4985:
4986: private class jComboBoxdsListener implements
4987: java.awt.event.ActionListener {
4988: public void actionPerformed(java.awt.event.ActionEvent evt) {
4989: jComboBoxDatasourceActionPerformed(evt);
4990: }
4991: }
4992:
4993: jComboBoxdsListener dsListener = new jComboBoxdsListener();
4994:
4995: private void jComboBoxDatasourceActionPerformed(
4996: java.awt.event.ActionEvent evt) {
4997:
4998: jComboBoxXMLACatalog.removeActionListener(catListener);
4999: if (this .jComboBoxXMLADatasource.getItemCount() == 0
5000: || this .jComboBoxXMLADatasource.getSelectedIndex() == -1) {
5001: return;
5002: }
5003: String urlstr = this .jTextFieldXMLAUrl.getText().trim();
5004: rex.metadata.ServerMetadata smd = new rex.metadata.ServerMetadata(
5005: urlstr, (Component) getParent());
5006: if (smd.isValidUrl() == false) {
5007: JOptionPane
5008: .showMessageDialog(
5009: (Component) getParent(),
5010: I18n
5011: .getString(
5012: "messages.connectionDialog.xmla.invalidUrl",
5013: "Unable to connect to XMLA server."),
5014: "", JOptionPane.INFORMATION_MESSAGE);
5015: return;
5016: }
5017:
5018: this .jComboBoxXMLACatalog.removeAllItems();
5019: this .jComboBoxXMLACube.removeAllItems();
5020:
5021: DataSourceTreeElement dste[] = smd.discoverDataSources();
5022:
5023: if (dste == null || dste.length == 0) {
5024: JOptionPane
5025: .showMessageDialog(
5026: (Component) getParent(),
5027: I18n
5028: .getString(
5029: "messages.connectionDialog.xmla.noDatasource",
5030: "No Datasources found."),
5031: "", JOptionPane.INFORMATION_MESSAGE);
5032: return;
5033: }
5034: //filling catalogs
5035: boolean found = false;
5036: int intI = 0;
5037: while (!found && intI < dste.length) {
5038: if (dste[intI].getDataSourceInfo().compareTo(
5039: (String) this .jComboBoxXMLADatasource
5040: .getSelectedItem()) == 0) {
5041: found = true;
5042: } else {
5043: intI++;
5044: }
5045: }
5046: if (!found) {
5047: return;
5048: }
5049: rex.graphics.datasourcetree.elements.DataSourceTreeElement catalogs[] = dste[intI]
5050: .getChildren();
5051: if (catalogs == null || catalogs.length == 0) {
5052: JOptionPane
5053: .showMessageDialog(
5054: (Component) getParent(),
5055: I18n
5056: .getString(
5057: "messages.connectionDialog.xmla.noCatalogs",
5058: "No catalogs found for selected datasource."),
5059: "", JOptionPane.INFORMATION_MESSAGE);
5060: return;
5061: }
5062: this .jComboBoxXMLACatalog.removeAllItems();
5063:
5064: for (intI = 0; intI < catalogs.length; intI++) {
5065: this .jComboBoxXMLACatalog
5066: .addItem(((rex.graphics.datasourcetree.elements.CatalogElement) catalogs[intI])
5067: .toString());
5068: }
5069:
5070: found = false;
5071: intI = 0;
5072: while (!found && intI < catalogs.length) {
5073: if (catalogs[intI].toString().trim().compareTo(
5074: (String) this .jComboBoxXMLACatalog
5075: .getSelectedItem()) == 0) {
5076: found = true;
5077: } else {
5078: intI++;
5079: }
5080: }
5081: if (!found) {
5082: return;
5083: }
5084: rex.graphics.datasourcetree.elements.DataSourceTreeElement cubes[] = catalogs[intI]
5085: .getChildren();
5086: if (cubes == null || cubes.length == 0) {
5087: return;
5088: }
5089: this .jComboBoxXMLACube.removeAllItems();
5090: for (intI = 0; intI < cubes.length; intI++) {
5091: this .jComboBoxXMLACube
5092: .addItem(((rex.graphics.datasourcetree.elements.CubeElement) cubes[intI])
5093: .toString());
5094: }
5095: jComboBoxXMLACatalog.addActionListener(catListener);
5096:
5097: }
5098:
5099: private void jComboBoxCatActionPerformed(
5100: java.awt.event.ActionEvent evt) {
5101:
5102: jComboBoxXMLADatasource.removeActionListener(dsListener);
5103:
5104: if (this .jComboBoxXMLACatalog.getItemCount() == 0
5105: || this .jComboBoxXMLACatalog.getSelectedIndex() == -1) {
5106: return;
5107: }
5108: String urlstr = this .jTextFieldXMLAUrl.getText().trim();
5109: rex.metadata.ServerMetadata smd = new rex.metadata.ServerMetadata(
5110: urlstr, (Component) getParent());
5111: if (smd.isValidUrl() == false) {
5112: JOptionPane
5113: .showMessageDialog(
5114: (Component) getParent(),
5115: I18n
5116: .getString(
5117: "messages.connectionDialog.xmla.invalidUrl",
5118: "Unable to connect to XMLA server."),
5119: "", JOptionPane.INFORMATION_MESSAGE);
5120: return;
5121: }
5122:
5123: this .jComboBoxXMLACube.removeAllItems();
5124:
5125: rex.graphics.datasourcetree.elements.DataSourceTreeElement dste[] = smd
5126: .discoverDataSources();
5127: if (dste == null || dste.length == 0) {
5128: JOptionPane
5129: .showMessageDialog(
5130: (Component) getParent(),
5131: I18n
5132: .getString(
5133: "messages.connectionDialog.xmla.noDatasource",
5134: "No Datasources found."),
5135: "", JOptionPane.INFORMATION_MESSAGE);
5136: return;
5137: }
5138: boolean found = false;
5139: int intI = 0;
5140: while (!found && intI < dste.length) {
5141: if (dste[intI].getDataSourceInfo().compareTo(
5142: (String) this .jComboBoxXMLADatasource
5143: .getSelectedItem()) == 0) {
5144: found = true;
5145: } else {
5146: intI++;
5147: }
5148: }
5149: if (!found) {
5150: return;
5151: }
5152: rex.graphics.datasourcetree.elements.DataSourceTreeElement catalogs[] = dste[intI]
5153: .getChildren();
5154: if (catalogs == null || catalogs.length == 0) {
5155: JOptionPane
5156: .showMessageDialog(
5157: (Component) getParent(),
5158: I18n
5159: .getString(
5160: "messages.connectionDialog.xmla.noCatalogs",
5161: "No catalogs found for selected datasource."),
5162: "", JOptionPane.INFORMATION_MESSAGE);
5163: return;
5164: }
5165: //add catalogs
5166: this .jComboBoxXMLACatalog.removeAllItems();
5167: for (intI = 0; intI < catalogs.length; intI++) {
5168: this .jComboBoxXMLACatalog
5169: .addItem(((rex.graphics.datasourcetree.elements.CatalogElement) catalogs[intI])
5170: .toString());
5171: }
5172: found = false;
5173: intI = 0;
5174: while (!found && intI < catalogs.length) {
5175: if (catalogs[intI].toString().compareTo(
5176: (String) this .jComboBoxXMLACatalog
5177: .getSelectedItem()) == 0) {
5178: found = true;
5179: } else {
5180: intI++;
5181: found = false;
5182: }
5183: }
5184: if (!found) {
5185: return;
5186: }
5187: rex.graphics.datasourcetree.elements.DataSourceTreeElement cubes[] = catalogs[intI]
5188: .getChildren();
5189: if (cubes == null || cubes.length == 0) {
5190: JOptionPane.showMessageDialog((Component) getParent(), I18n
5191: .getString(
5192: "messages.connectionDialog.xmla.noCubes",
5193: "No cubes found for selected datasource."),
5194: "", JOptionPane.INFORMATION_MESSAGE);
5195: return;
5196: }
5197: this .jComboBoxXMLACube.removeAllItems();
5198: for (intI = 0; intI < cubes.length; intI++) {
5199: this .jComboBoxXMLACube
5200: .addItem(((rex.graphics.datasourcetree.elements.CubeElement) cubes[intI])
5201: .toString());
5202: }
5203: jComboBoxXMLADatasource.addActionListener(dsListener);
5204:
5205: }
5206: }
|