001: /*
002: * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved.
003: * http://www.jaspersoft.com.
004: *
005: * Unless you have purchased a commercial license agreement from JasperSoft,
006: * the following license terms apply:
007: *
008: * This program is free software; you can redistribute it and/or modify
009: * it under the terms of the GNU General Public License version 2 as published by
010: * the Free Software Foundation.
011: *
012: * This program is distributed WITHOUT ANY WARRANTY; and without the
013: * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
014: * See the GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
018: * or write to:
019: *
020: * Free Software Foundation, Inc.,
021: * 59 Temple Place - Suite 330,
022: * Boston, MA USA 02111-1307
023: *
024: *
025: *
026: *
027: * OracleOptions.java
028: *
029: * Created on 12 aprile 2005, 16.22
030: *
031: */
032:
033: package it.businesslogic.ireport.plugin.oracle;
034:
035: import it.businesslogic.ireport.util.I18n;
036:
037: /**
038: *
039: * @author Administrator
040: */
041: public class OracleOptions extends javax.swing.JDialog {
042:
043: /** Creates new form OracleOptions */
044: public OracleOptions(java.awt.Frame parent, boolean modal) {
045: super (parent, modal);
046: initComponents();
047:
048: jTextFieldLanguage
049: .setText(it.businesslogic.ireport.gui.MainFrame
050: .getMainInstance().getProperties().getProperty(
051: "oracle_language", ""));
052: jTextFieldTerritory
053: .setText(it.businesslogic.ireport.gui.MainFrame
054: .getMainInstance().getProperties().getProperty(
055: "oracle_territory", ""));
056:
057: it.businesslogic.ireport.util.Misc.centerFrame(this );
058: applyI18n();
059: pack();
060: }
061:
062: /** This method is called from within the constructor to
063: * initialize the form.
064: * WARNING: Do NOT modify this code. The content of this method is
065: * always regenerated by the Form Editor.
066: */
067: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
068: private void initComponents() {
069: java.awt.GridBagConstraints gridBagConstraints;
070:
071: jPanel1 = new javax.swing.JPanel();
072: jLabel1 = new javax.swing.JLabel();
073: jTextFieldLanguage = new javax.swing.JTextField();
074: jLabel2 = new javax.swing.JLabel();
075: jTextFieldTerritory = new javax.swing.JTextField();
076: jPanel2 = new javax.swing.JPanel();
077: jButton1 = new javax.swing.JButton();
078: jButton2 = new javax.swing.JButton();
079:
080: getContentPane().setLayout(new java.awt.GridBagLayout());
081:
082: setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
083: jPanel1.setLayout(new java.awt.GridBagLayout());
084:
085: jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(
086: javax.swing.BorderFactory.createEtchedBorder(),
087: "Oracle options"));
088: jPanel1.setMinimumSize(new java.awt.Dimension(350, 110));
089: jPanel1.setPreferredSize(new java.awt.Dimension(350, 110));
090: jLabel1
091: .setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
092: jLabel1.setText("Language");
093: gridBagConstraints = new java.awt.GridBagConstraints();
094: gridBagConstraints.gridy = 0;
095: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
096: gridBagConstraints.insets = new java.awt.Insets(8, 8, 0, 4);
097: jPanel1.add(jLabel1, gridBagConstraints);
098:
099: gridBagConstraints = new java.awt.GridBagConstraints();
100: gridBagConstraints.gridy = 0;
101: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
102: gridBagConstraints.weightx = 1.0;
103: gridBagConstraints.insets = new java.awt.Insets(8, 0, 0, 8);
104: jPanel1.add(jTextFieldLanguage, gridBagConstraints);
105:
106: jLabel2
107: .setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
108: jLabel2.setText("Territory");
109: gridBagConstraints = new java.awt.GridBagConstraints();
110: gridBagConstraints.gridy = 1;
111: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
112: gridBagConstraints.insets = new java.awt.Insets(4, 8, 8, 4);
113: jPanel1.add(jLabel2, gridBagConstraints);
114:
115: jTextFieldTerritory
116: .addActionListener(new java.awt.event.ActionListener() {
117: public void actionPerformed(
118: java.awt.event.ActionEvent evt) {
119: jTextFieldTerritoryActionPerformed(evt);
120: }
121: });
122:
123: gridBagConstraints = new java.awt.GridBagConstraints();
124: gridBagConstraints.gridy = 1;
125: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
126: gridBagConstraints.weightx = 1.0;
127: gridBagConstraints.insets = new java.awt.Insets(4, 0, 8, 8);
128: jPanel1.add(jTextFieldTerritory, gridBagConstraints);
129:
130: gridBagConstraints = new java.awt.GridBagConstraints();
131: gridBagConstraints.gridx = 0;
132: gridBagConstraints.gridy = 0;
133: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
134: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
135: gridBagConstraints.weightx = 1.0;
136: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
137: getContentPane().add(jPanel1, gridBagConstraints);
138:
139: jButton1.setText("Save");
140: jButton1.addActionListener(new java.awt.event.ActionListener() {
141: public void actionPerformed(java.awt.event.ActionEvent evt) {
142: jButton1ActionPerformed(evt);
143: }
144: });
145:
146: jPanel2.add(jButton1);
147:
148: jButton2.setText("Cancel");
149: jButton2.addActionListener(new java.awt.event.ActionListener() {
150: public void actionPerformed(java.awt.event.ActionEvent evt) {
151: jButton2ActionPerformed(evt);
152: }
153: });
154:
155: jPanel2.add(jButton2);
156:
157: gridBagConstraints = new java.awt.GridBagConstraints();
158: gridBagConstraints.gridy = 1;
159: gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
160: gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
161: gridBagConstraints.weighty = 1.0;
162: gridBagConstraints.insets = new java.awt.Insets(4, 0, 4, 4);
163: getContentPane().add(jPanel2, gridBagConstraints);
164:
165: pack();
166: }// </editor-fold>//GEN-END:initComponents
167:
168: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
169: it.businesslogic.ireport.gui.MainFrame.getMainInstance()
170: .getProperties().setProperty("oracle_language",
171: jTextFieldLanguage.getText());
172: it.businesslogic.ireport.gui.MainFrame.getMainInstance()
173: .getProperties().setProperty("oracle_territory",
174: jTextFieldTerritory.getText());
175: this .setVisible(true);
176: this .dispose();
177: }//GEN-LAST:event_jButton1ActionPerformed
178:
179: private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
180: this .setVisible(true);
181: this .dispose();
182: }//GEN-LAST:event_jButton2ActionPerformed
183:
184: private void jTextFieldTerritoryActionPerformed(
185: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldTerritoryActionPerformed
186:
187: }//GEN-LAST:event_jTextFieldTerritoryActionPerformed
188:
189: // Variables declaration - do not modify//GEN-BEGIN:variables
190: private javax.swing.JButton jButton1;
191: private javax.swing.JButton jButton2;
192: private javax.swing.JLabel jLabel1;
193: private javax.swing.JLabel jLabel2;
194: private javax.swing.JPanel jPanel1;
195: private javax.swing.JPanel jPanel2;
196: private javax.swing.JTextField jTextFieldLanguage;
197: private javax.swing.JTextField jTextFieldTerritory;
198:
199: // End of variables declaration//GEN-END:variables
200:
201: public void applyI18n() {
202: // Start autogenerated code ----------------------
203: jButton1.setText(I18n
204: .getString("oracleOptions.button1", "Save"));
205: jButton2.setText(I18n.getString("oracleOptions.button2",
206: "Cancel"));
207: jLabel1.setText(I18n.getString("oracleOptions.label1",
208: "Language"));
209: jLabel2.setText(I18n.getString("oracleOptions.label2",
210: "Territory"));
211: // End autogenerated code ----------------------
212: ((javax.swing.border.TitledBorder) jPanel1.getBorder())
213: .setTitle(I18n.getString(
214: "oracleOptions.panelBorder.OracleOptions",
215: "OracleOptions"));
216: }
217: }
|