KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > exceptions > ReportPanel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.exceptions;
21
22 import java.awt.Cursor JavaDoc;
23 import java.net.MalformedURLException JavaDoc;
24 import org.openide.awt.HtmlBrowser;
25
26 /**
27  *
28  * @author jindra
29  */

30 public class ReportPanel extends javax.swing.JPanel JavaDoc {
31     private final ExceptionsSettings exSettings = new ExceptionsSettings();
32     
33     /** Creates new form ReportPanel */
34     public ReportPanel() {
35         initComponents();
36     }
37     
38     /** This method is called from within the constructor to
39      * initialize the form.
40      * WARNING: Do NOT modify this code. The content of this method is
41      * always regenerated by the Form Editor.
42      */

43     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
44
private void initComponents() {
45
46         jLabel3 = new javax.swing.JLabel JavaDoc();
47         jLabel5 = new javax.swing.JLabel JavaDoc();
48         jLabel6 = new javax.swing.JLabel JavaDoc();
49         jLabel6.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
50         jLabel1 = new javax.swing.JLabel JavaDoc();
51         loginField = new javax.swing.JTextField JavaDoc();
52         jSeparator1 = new javax.swing.JSeparator JavaDoc();
53         jLabel9 = new javax.swing.JLabel JavaDoc();
54         summaryField = new javax.swing.JTextField JavaDoc();
55         jLabel4 = new javax.swing.JLabel JavaDoc();
56         jScrollPane1 = new javax.swing.JScrollPane JavaDoc();
57         commentArea = new javax.swing.JTextArea JavaDoc();
58         jLabel2 = new javax.swing.JLabel JavaDoc();
59
60         jLabel3.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel3.text")); // NOI18N
61

62         jLabel5.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel5.text")); // NOI18N
63

64         jLabel6.setForeground(new java.awt.Color JavaDoc(0, 0, 255));
65         jLabel6.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel6.text")); // NOI18N
66
jLabel6.addMouseListener(new java.awt.event.MouseAdapter JavaDoc() {
67             public void mouseClicked(java.awt.event.MouseEvent JavaDoc evt) {
68                 registerClicked(evt);
69             }
70         });
71
72         jLabel1.setLabelFor(loginField);
73         jLabel1.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel1.text")); // NOI18N
74

75         loginField.setText(exSettings.getUserName());
76
77         jLabel9.setLabelFor(summaryField);
78         jLabel9.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel9.text")); // NOI18N
79

80         summaryField.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.summaryField.text")); // NOI18N
81

82         jLabel4.setLabelFor(commentArea);
83         jLabel4.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel4.text")); // NOI18N
84

85         commentArea.setColumns(20);
86         commentArea.setRows(5);
87         jScrollPane1.setViewportView(commentArea);
88         commentArea.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.commentArea.AccessibleContext.accessibleName")); // NOI18N
89
commentArea.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.commentArea.AccessibleContext.accessibleDescription")); // NOI18N
90

91         jLabel2.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel2.text")); // NOI18N
92

93         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
94         this.setLayout(layout);
95         layout.setHorizontalGroup(
96             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
97             .add(layout.createSequentialGroup()
98                 .addContainerGap()
99                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
100                     .add(layout.createSequentialGroup()
101                         .add(jLabel5)
102                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
103                         .add(jLabel6))
104                     .add(layout.createSequentialGroup()
105                         .add(jLabel1)
106                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
107                         .add(loginField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE))
108                     .add(jLabel2)
109                     .add(org.jdesktop.layout.GroupLayout.TRAILING, jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
110                     .add(jLabel4)
111                     .add(layout.createSequentialGroup()
112                         .add(jLabel9)
113                         .add(28, 28, 28)
114                         .add(summaryField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 287, Short.MAX_VALUE))
115                     .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
116                     .add(jLabel3))
117                 .addContainerGap())
118         );
119         layout.setVerticalGroup(
120             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
121             .add(layout.createSequentialGroup()
122                 .addContainerGap()
123                 .add(jLabel3)
124                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
125                 .add(jLabel2)
126                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
127                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
128                     .add(jLabel5)
129                     .add(jLabel6))
130                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
131                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
132                     .add(jLabel1)
133                     .add(loginField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
134                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
135                 .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
136                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
137                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
138                     .add(jLabel9)
139                     .add(summaryField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
140                 .add(4, 4, 4)
141                 .add(jLabel4)
142                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
143                 .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 216, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
144                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
145         );
146
147         loginField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.loginField.AccessibleContext.accessibleName")); // NOI18N
148
loginField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.loginField.AccessibleContext.accessibleDescription")); // NOI18N
149
summaryField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.summaryField.AccessibleContext.accessibleName")); // NOI18N
150
summaryField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.summaryField.AccessibleContext.accessibleDescription")); // NOI18N
151

152         getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.AccessibleContext.accessibleName")); // NOI18N
153
getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.AccessibleContext.accessibleDescription")); // NOI18N
154
}// </editor-fold>//GEN-END:initComponents
155
private void registerClicked(java.awt.event.MouseEvent JavaDoc evt) {//GEN-FIRST:event_registerClicked
156
try {
157         HtmlBrowser.URLDisplayer.getDefault().showURL(new java.net.URL JavaDoc(org.openide.util.NbBundle.getMessage(ReportPanel.class, "REGISTRATION_URL")));
158     } catch (MalformedURLException JavaDoc ex) {
159         java.util.logging.Logger.getLogger(ReportPanel.class.getName()).log(java.util.logging.Level.INFO, ex.getMessage(), ex);
160     }//GEN-LAST:event_registerClicked
161
}
162
163 public void saveUserName(){
164     String JavaDoc login = loginField.getText();
165     if ((login!=null)&&(login.length()!=0)) exSettings.setUserName(login);
166 }
167
168 public String JavaDoc getSummary(){
169     return summaryField.getText();
170 }
171
172 public String JavaDoc getComment(){
173     return commentArea.getText();
174 }
175
176 public void setSummary(String JavaDoc str){
177     summaryField.setText(str);
178 }
179
180     // Variables declaration - do not modify//GEN-BEGIN:variables
181
private javax.swing.JTextArea JavaDoc commentArea;
182     private javax.swing.JLabel JavaDoc jLabel1;
183     private javax.swing.JLabel JavaDoc jLabel2;
184     private javax.swing.JLabel JavaDoc jLabel3;
185     private javax.swing.JLabel JavaDoc jLabel4;
186     private javax.swing.JLabel JavaDoc jLabel5;
187     private javax.swing.JLabel JavaDoc jLabel6;
188     private javax.swing.JLabel JavaDoc jLabel9;
189     private javax.swing.JScrollPane JavaDoc jScrollPane1;
190     private javax.swing.JSeparator JavaDoc jSeparator1;
191     private javax.swing.JTextField JavaDoc loginField;
192     private javax.swing.JTextField JavaDoc summaryField;
193     // End of variables declaration//GEN-END:variables
194
}
195
Popular Tags