1 19 20 package org.netbeans.modules.exceptions; 21 22 import java.awt.Cursor ; 23 import java.net.MalformedURLException ; 24 import org.openide.awt.HtmlBrowser; 25 26 30 public class ReportPanel extends javax.swing.JPanel { 31 private final ExceptionsSettings exSettings = new ExceptionsSettings(); 32 33 34 public ReportPanel() { 35 initComponents(); 36 } 37 38 43 private void initComponents() { 45 46 jLabel3 = new javax.swing.JLabel (); 47 jLabel5 = new javax.swing.JLabel (); 48 jLabel6 = new javax.swing.JLabel (); 49 jLabel6.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 50 jLabel1 = new javax.swing.JLabel (); 51 loginField = new javax.swing.JTextField (); 52 jSeparator1 = new javax.swing.JSeparator (); 53 jLabel9 = new javax.swing.JLabel (); 54 summaryField = new javax.swing.JTextField (); 55 jLabel4 = new javax.swing.JLabel (); 56 jScrollPane1 = new javax.swing.JScrollPane (); 57 commentArea = new javax.swing.JTextArea (); 58 jLabel2 = new javax.swing.JLabel (); 59 60 jLabel3.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel3.text")); 62 jLabel5.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel5.text")); 64 jLabel6.setForeground(new java.awt.Color (0, 0, 255)); 65 jLabel6.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel6.text")); jLabel6.addMouseListener(new java.awt.event.MouseAdapter () { 67 public void mouseClicked(java.awt.event.MouseEvent evt) { 68 registerClicked(evt); 69 } 70 }); 71 72 jLabel1.setLabelFor(loginField); 73 jLabel1.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel1.text")); 75 loginField.setText(exSettings.getUserName()); 76 77 jLabel9.setLabelFor(summaryField); 78 jLabel9.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel9.text")); 80 summaryField.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.summaryField.text")); 82 jLabel4.setLabelFor(commentArea); 83 jLabel4.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel4.text")); 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")); commentArea.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.commentArea.AccessibleContext.accessibleDescription")); 91 jLabel2.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel2.text")); 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")); loginField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.loginField.AccessibleContext.accessibleDescription")); summaryField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.summaryField.AccessibleContext.accessibleName")); summaryField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.summaryField.AccessibleContext.accessibleDescription")); 152 getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.AccessibleContext.accessibleName")); getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.AccessibleContext.accessibleDescription")); }private void registerClicked(java.awt.event.MouseEvent evt) { try { 157 HtmlBrowser.URLDisplayer.getDefault().showURL(new java.net.URL (org.openide.util.NbBundle.getMessage(ReportPanel.class, "REGISTRATION_URL"))); 158 } catch (MalformedURLException ex) { 159 java.util.logging.Logger.getLogger(ReportPanel.class.getName()).log(java.util.logging.Level.INFO, ex.getMessage(), ex); 160 }} 162 163 public void saveUserName(){ 164 String login = loginField.getText(); 165 if ((login!=null)&&(login.length()!=0)) exSettings.setUserName(login); 166 } 167 168 public String getSummary(){ 169 return summaryField.getText(); 170 } 171 172 public String getComment(){ 173 return commentArea.getText(); 174 } 175 176 public void setSummary(String str){ 177 summaryField.setText(str); 178 } 179 180 private javax.swing.JTextArea commentArea; 182 private javax.swing.JLabel jLabel1; 183 private javax.swing.JLabel jLabel2; 184 private javax.swing.JLabel jLabel3; 185 private javax.swing.JLabel jLabel4; 186 private javax.swing.JLabel jLabel5; 187 private javax.swing.JLabel jLabel6; 188 private javax.swing.JLabel jLabel9; 189 private javax.swing.JScrollPane jScrollPane1; 190 private javax.swing.JSeparator jSeparator1; 191 private javax.swing.JTextField loginField; 192 private javax.swing.JTextField summaryField; 193 } 195 | Popular Tags |