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: * FileDetails.java
028: *
029: * Created on 20 maggio 2004, 10.39
030: *
031: */
032:
033: package it.businesslogic.ireport.plugin.massivecompiler;
034:
035: import it.businesslogic.ireport.util.I18n;
036:
037: /**
038: *
039: * @author Administrator
040: */
041: public class FileDetails extends javax.swing.JDialog {
042:
043: /** Creates new form FileDetails */
044: public FileDetails(java.awt.Frame parent, boolean modal) {
045: super (parent, modal);
046: initComponents();
047: this .setSize(300, 380);
048: applyI18n();
049: it.businesslogic.ireport.util.Misc.centerFrame(this );
050: }
051:
052: /** This method is called from within the constructor to
053: * initialize the form.
054: * WARNING: Do NOT modify this code. The content of this method is
055: * always regenerated by the Form Editor.
056: */
057: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
058: private void initComponents() {
059: java.awt.GridBagConstraints gridBagConstraints;
060:
061: jPanel1 = new javax.swing.JPanel();
062: jLabelFileName = new javax.swing.JLabel();
063: jTextFieldFile = new javax.swing.JTextField();
064: jLabelFileName1 = new javax.swing.JLabel();
065: jTextFieldStatus = new javax.swing.JTextField();
066: jLabelFileName2 = new javax.swing.JLabel();
067: jScrollPane1 = new javax.swing.JScrollPane();
068: jTextAreaMessage = new javax.swing.JTextArea();
069: jButtonClose = new javax.swing.JButton();
070:
071: getContentPane().setLayout(new java.awt.GridBagLayout());
072:
073: addWindowListener(new java.awt.event.WindowAdapter() {
074: public void windowClosing(java.awt.event.WindowEvent evt) {
075: closeDialog(evt);
076: }
077: });
078:
079: jPanel1.setLayout(new java.awt.GridBagLayout());
080:
081: jLabelFileName.setText("File");
082: gridBagConstraints = new java.awt.GridBagConstraints();
083: gridBagConstraints.gridx = 0;
084: gridBagConstraints.gridy = 0;
085: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
086: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
087: gridBagConstraints.weightx = 1.0;
088: jPanel1.add(jLabelFileName, gridBagConstraints);
089:
090: jTextFieldFile.setEditable(false);
091: gridBagConstraints = new java.awt.GridBagConstraints();
092: gridBagConstraints.gridx = 0;
093: gridBagConstraints.gridy = 1;
094: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
095: jPanel1.add(jTextFieldFile, gridBagConstraints);
096:
097: jLabelFileName1.setText("Satus");
098: gridBagConstraints = new java.awt.GridBagConstraints();
099: gridBagConstraints.gridx = 0;
100: gridBagConstraints.gridy = 2;
101: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
102: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
103: gridBagConstraints.weightx = 1.0;
104: gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
105: jPanel1.add(jLabelFileName1, gridBagConstraints);
106:
107: jTextFieldStatus.setEditable(false);
108: gridBagConstraints = new java.awt.GridBagConstraints();
109: gridBagConstraints.gridx = 0;
110: gridBagConstraints.gridy = 3;
111: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
112: jPanel1.add(jTextFieldStatus, gridBagConstraints);
113:
114: jLabelFileName2.setText("Last error message");
115: gridBagConstraints = new java.awt.GridBagConstraints();
116: gridBagConstraints.gridx = 0;
117: gridBagConstraints.gridy = 4;
118: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
119: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
120: gridBagConstraints.weightx = 1.0;
121: gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
122: jPanel1.add(jLabelFileName2, gridBagConstraints);
123:
124: jTextAreaMessage.setEditable(false);
125: jScrollPane1.setViewportView(jTextAreaMessage);
126:
127: gridBagConstraints = new java.awt.GridBagConstraints();
128: gridBagConstraints.gridx = 0;
129: gridBagConstraints.gridy = 5;
130: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
131: gridBagConstraints.weightx = 1.0;
132: gridBagConstraints.weighty = 1.0;
133: jPanel1.add(jScrollPane1, gridBagConstraints);
134:
135: jButtonClose.setText("Close");
136: jButtonClose
137: .addActionListener(new java.awt.event.ActionListener() {
138: public void actionPerformed(
139: java.awt.event.ActionEvent evt) {
140: jButtonCloseActionPerformed(evt);
141: }
142: });
143:
144: gridBagConstraints = new java.awt.GridBagConstraints();
145: gridBagConstraints.gridx = 0;
146: gridBagConstraints.gridy = 6;
147: gridBagConstraints.weightx = 0.2;
148: gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
149: jPanel1.add(jButtonClose, gridBagConstraints);
150:
151: gridBagConstraints = new java.awt.GridBagConstraints();
152: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
153: gridBagConstraints.weightx = 1.0;
154: gridBagConstraints.weighty = 1.0;
155: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
156: getContentPane().add(jPanel1, gridBagConstraints);
157:
158: pack();
159: }// </editor-fold>//GEN-END:initComponents
160:
161: private void jButtonCloseActionPerformed(
162: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloseActionPerformed
163: this .setVisible(false);
164: dispose();
165: }//GEN-LAST:event_jButtonCloseActionPerformed
166:
167: /** Closes the dialog */
168: private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
169: setVisible(false);
170: dispose();
171: }//GEN-LAST:event_closeDialog
172:
173: /**
174: * @param args the command line arguments
175: */
176: public static void main(String args[]) {
177: new FileDetails(new javax.swing.JFrame(), true)
178: .setVisible(true);
179: }
180:
181: // Variables declaration - do not modify//GEN-BEGIN:variables
182: private javax.swing.JButton jButtonClose;
183: private javax.swing.JLabel jLabelFileName;
184: private javax.swing.JLabel jLabelFileName1;
185: private javax.swing.JLabel jLabelFileName2;
186: private javax.swing.JPanel jPanel1;
187: private javax.swing.JScrollPane jScrollPane1;
188: private javax.swing.JTextArea jTextAreaMessage;
189: private javax.swing.JTextField jTextFieldFile;
190: private javax.swing.JTextField jTextFieldStatus;
191:
192: // End of variables declaration//GEN-END:variables
193:
194: public void setFileEntry(FileEntry fe) {
195: try {
196: this .jTextFieldFile
197: .setText(fe.getFile().getCanonicalPath());
198: } catch (Exception ex) {
199: }
200:
201: this .jTextFieldStatus.setText(fe.decodeStatus(fe.getStatus()));
202: this .jTextAreaMessage.setText(fe.getMessage());
203: }
204:
205: public void applyI18n() {
206: // Start autogenerated code ----------------------
207: jButtonClose.setText(I18n.getString("fileDetails.buttonClose",
208: "Close"));
209: jLabelFileName.setText(I18n.getString(
210: "fileDetails.labelFileName", "File"));
211: jLabelFileName1.setText(I18n.getString(
212: "fileDetails.labelFileName1", "Satus"));
213: jLabelFileName2.setText(I18n.getString(
214: "fileDetails.labelFileName2", "Last error message"));
215: // End autogenerated code ----------------------
216: }
217: }
|