1 19 20 package org.netbeans.modules.tasklist.usertasks; 21 22 import org.openide.awt.Mnemonics; 23 import org.openide.util.NbBundle; 24 import org.netbeans.modules.tasklist.usertasks.model.UserTask; 25 26 36 public class UserTaskDuePanel extends javax.swing.JPanel { 37 38 private static final long serialVersionUID = 1; 39 40 41 public UserTaskDuePanel() { 42 initComponents(); 43 initA11y(); 44 } 45 46 public UserTaskDuePanel(UserTask task) { 47 this(); 48 detailsArea.setText(task.getDetails()); 49 descriptionFld.setText(task.getSummary()); 50 } 51 52 57 private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; 59 60 jLabel1 = new javax.swing.JLabel (); 61 descriptionFld = new javax.swing.JTextField (); 62 jLabel2 = new javax.swing.JLabel (); 63 jScrollPane1 = new javax.swing.JScrollPane (); 64 detailsArea = new javax.swing.JTextArea (); 65 66 setLayout(new java.awt.GridBagLayout ()); 67 68 jLabel1.setLabelFor(descriptionFld); 69 72 gridBagConstraints = new java.awt.GridBagConstraints (); 73 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 74 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 75 gridBagConstraints.insets = new java.awt.Insets (12, 12, 0, 12); 76 add(jLabel1, gridBagConstraints); 77 78 descriptionFld.setEnabled(false); 79 gridBagConstraints = new java.awt.GridBagConstraints (); 80 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 81 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 82 gridBagConstraints.weightx = 1.0; 83 gridBagConstraints.insets = new java.awt.Insets (2, 12, 0, 12); 84 add(descriptionFld, gridBagConstraints); 85 86 jLabel2.setLabelFor(detailsArea); 87 90 gridBagConstraints = new java.awt.GridBagConstraints (); 91 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 92 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 93 gridBagConstraints.insets = new java.awt.Insets (12, 12, 0, 12); 94 add(jLabel2, gridBagConstraints); 95 96 detailsArea.setPreferredSize(new java.awt.Dimension (400, 200)); 97 detailsArea.setEnabled(false); 98 jScrollPane1.setViewportView(detailsArea); 99 100 gridBagConstraints = new java.awt.GridBagConstraints (); 101 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 102 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 103 gridBagConstraints.weightx = 1.0; 104 gridBagConstraints.weighty = 1.0; 105 gridBagConstraints.insets = new java.awt.Insets (2, 12, 11, 11); 106 add(jScrollPane1, gridBagConstraints); 107 108 } 110 private void initA11y() { 111 120 121 Mnemonics.setLocalizedText(jLabel1, NbBundle.getMessage( 122 UserTaskDuePanel.class, "Brief_Description")); Mnemonics.setLocalizedText(jLabel2, NbBundle.getMessage( 124 UserTaskDuePanel.class, "DetailsLabel")); 126 this.getAccessibleContext().setAccessibleDescription( 128 NbBundle.getMessage(UserTaskDuePanel.class, 129 "ACSD_DuePanel")); descriptionFld.getAccessibleContext().setAccessibleName( 131 NbBundle.getMessage(UserTaskDuePanel.class, 132 "ACSD_Brief_Description")); detailsArea.getAccessibleContext().setAccessibleName( 134 NbBundle.getMessage(UserTaskDuePanel.class, 135 "ACSD_Details")); } 137 138 139 private javax.swing.JTextField descriptionFld; 141 private javax.swing.JTextArea detailsArea; 142 private javax.swing.JLabel jLabel1; 143 private javax.swing.JLabel jLabel2; 144 private javax.swing.JScrollPane jScrollPane1; 145 147 } 148 | Popular Tags |