001: /*
002: * EJBQLConnectionEditor.java
003: *
004: * Created on March 27, 2007, 1:18 PM
005: */
006:
007: package it.businesslogic.ireport.connection.gui;
008:
009: import it.businesslogic.ireport.IReportConnection;
010: import it.businesslogic.ireport.IReportConnectionEditor;
011: import it.businesslogic.ireport.connection.JRHibernateConnection;
012: import it.businesslogic.ireport.util.I18n;
013:
014: /**
015: *
016: * @author gtoffoli
017: */
018: public class JRHibernateConnectionEditor extends javax.swing.JPanel
019: implements IReportConnectionEditor {
020:
021: private IReportConnection iReportConnection = null;
022: private boolean init = false;
023:
024: /** Creates new form EJBQLConnectionEditor */
025: public JRHibernateConnectionEditor() {
026: initComponents();
027: applyI18n();
028: }
029:
030: /** This method is called from within the constructor to
031: * initialize the form.
032: * WARNING: Do NOT modify this code. The content of this method is
033: * always regenerated by the Form Editor.
034: */
035: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
036: private void initComponents() {
037: java.awt.GridBagConstraints gridBagConstraints;
038:
039: jPanelHibernate = new javax.swing.JPanel();
040: jLabel8 = new javax.swing.JLabel();
041: jLabel1 = new javax.swing.JLabel();
042:
043: setLayout(new java.awt.BorderLayout());
044:
045: jPanelHibernate.setLayout(new java.awt.GridBagLayout());
046:
047: jLabel8
048: .setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
049: jLabel8
050: .setIcon(new javax.swing.ImageIcon(
051: getClass()
052: .getResource(
053: "/it/businesslogic/ireport/icons/hibernate.png")));
054: jLabel8.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
055: jLabel8
056: .setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
057: gridBagConstraints = new java.awt.GridBagConstraints();
058: gridBagConstraints.gridy = 1;
059: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
060: jPanelHibernate.add(jLabel8, gridBagConstraints);
061:
062: jLabel1.setText("jLabel1");
063: jLabel1.setVerticalAlignment(javax.swing.SwingConstants.TOP);
064: gridBagConstraints = new java.awt.GridBagConstraints();
065: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
066: gridBagConstraints.weightx = 1.0;
067: gridBagConstraints.weighty = 1.0;
068: jPanelHibernate.add(jLabel1, gridBagConstraints);
069:
070: add(jPanelHibernate, java.awt.BorderLayout.CENTER);
071:
072: }// </editor-fold>//GEN-END:initComponents
073:
074: // Variables declaration - do not modify//GEN-BEGIN:variables
075: private javax.swing.JLabel jLabel1;
076: private javax.swing.JLabel jLabel8;
077: private javax.swing.JPanel jPanelHibernate;
078:
079: // End of variables declaration//GEN-END:variables
080:
081: public void setIReportConnection(IReportConnection c) {
082: this .iReportConnection = c;
083: }
084:
085: public IReportConnection getIReportConnection() {
086:
087: IReportConnection irConn = new JRHibernateConnection();
088: iReportConnection = irConn;
089: return iReportConnection;
090: }
091:
092: public void applyI18n() {
093: jLabel1
094: .setText("<html>"
095: + I18n
096: .getString(
097: "connectionDialog.textPane1",
098: "Press the test button.\n\niReport will look in the classpath for a valid hibernate configuration."));
099: }
100:
101: }
|