1 19 20 package org.netbeans.modules.tasklist.bugs.scarab; 21 22 import org.netbeans.modules.tasklist.bugs.BugQuery; 23 import org.netbeans.modules.tasklist.bugs.QueryPanelIF; 24 import org.netbeans.modules.tasklist.bugs.BugEngine; 25 import org.netbeans.modules.tasklist.bugs.ProjectDesc; 26 import org.netbeans.modules.tasklist.bugs.javanet.ProjectList; 27 import org.netbeans.modules.tasklist.bugs.issuezilla.Issuezilla; 28 import org.openide.util.RequestProcessor; 29 30 import javax.swing.*; 31 import java.awt.event.ActionListener ; 32 import java.awt.event.ActionEvent ; 33 import java.net.URL ; 34 import java.net.MalformedURLException ; 35 36 41 public class SourcePanel extends javax.swing.JPanel implements QueryPanelIF { 42 43 46 public SourcePanel() { 47 initComponents(); 48 49 serviceTextField.addActionListener(new ActionListener () { 50 public void actionPerformed(ActionEvent e) { 51 try { 52 serviceExampleLabel.setText("probing..."); 53 final URL url = new URL (serviceTextField.getText()); 54 serviceExampleLabel.setText("Server OK"); 55 } catch (MalformedURLException e1) { 56 serviceExampleLabel.setText("Invalid server URL!"); 57 } 58 } 59 }); 60 } 61 62 63 public BugQuery getQueryOptions(final BugQuery inQuery) { 64 final ScarabBugQuery sbq = new ScarabBugQuery(inQuery); 65 sbq.setBaseUrl(serviceTextField.getText()); 66 sbq.setQueryString(customTextField.getText()); 67 sbq.setAttributeName(Issue.SUMMARY,summaryField.getText()); 68 sbq.setAttributeName(Issue.STATUS,statusField.getText()); 69 sbq.setAttributeName(Issue.COMPONENT,componentField.getText()); 70 sbq.setAttributeName(Issue.SUBCOMPONENT,subcomponentField.getText()); 71 sbq.setAttributeName(Issue.ASSIGNED_TO,assignedToField.getText()); 72 sbq.setAttributeName(Issue.PRIORITY,priorityField.getText()); 73 sbq.setAttributeName(Issue.TARGET,targetField.getText()); 74 sbq.setAttributeName(Issue.VOTES,votesField.getText()); 75 sbq.setAttributeName(Issue.KEYWORDS,keywordsField.getText()); 76 return sbq; 77 } 78 79 84 private void initComponents() { 86 java.awt.GridBagConstraints gridBagConstraints; 87 88 buttonGroup1 = new javax.swing.ButtonGroup (); 89 jLabel4 = new javax.swing.JLabel (); 90 serviceLabel = new javax.swing.JLabel (); 91 serviceTextField = new javax.swing.JTextField (); 92 serviceExampleLabel = new javax.swing.JLabel (); 93 customLabel = new javax.swing.JLabel (); 94 customTextField = new javax.swing.JTextField (); 95 customExLabel = new javax.swing.JLabel (); 96 jPanel1 = new javax.swing.JPanel (); 97 summaryLabel = new javax.swing.JLabel (); 98 priorityLabel = new javax.swing.JLabel (); 99 componentLabel = new javax.swing.JLabel (); 100 subcomponentLabel = new javax.swing.JLabel (); 101 keywordsLabel = new javax.swing.JLabel (); 102 assignedToLabel = new javax.swing.JLabel (); 103 statusLabel = new javax.swing.JLabel (); 104 targetLabel = new javax.swing.JLabel (); 105 votesLabel = new javax.swing.JLabel (); 106 summaryField = new javax.swing.JTextField (); 107 statusField = new javax.swing.JTextField (); 108 componentField = new javax.swing.JTextField (); 109 subcomponentField = new javax.swing.JTextField (); 110 assignedToField = new javax.swing.JTextField (); 111 priorityField = new javax.swing.JTextField (); 112 targetField = new javax.swing.JTextField (); 113 votesField = new javax.swing.JTextField (); 114 keywordsField = new javax.swing.JTextField (); 115 116 jLabel4.setText("jLabel4"); 117 118 setLayout(new java.awt.GridBagLayout ()); 119 120 serviceLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("ServiceUrl_Label")); 121 gridBagConstraints = new java.awt.GridBagConstraints (); 122 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 123 add(serviceLabel, gridBagConstraints); 124 125 serviceTextField.setColumns(60); 126 gridBagConstraints = new java.awt.GridBagConstraints (); 127 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 128 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 129 gridBagConstraints.weightx = 1.0; 130 gridBagConstraints.insets = new java.awt.Insets (0, 6, 0, 0); 131 add(serviceTextField, gridBagConstraints); 132 133 serviceExampleLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("ServiceUrlExample_Label")); 134 serviceExampleLabel.setEnabled(false); 135 gridBagConstraints = new java.awt.GridBagConstraints (); 136 gridBagConstraints.gridx = 0; 137 gridBagConstraints.gridy = 1; 138 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 139 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 140 gridBagConstraints.weightx = 1.0; 141 gridBagConstraints.insets = new java.awt.Insets (6, 6, 0, 0); 142 add(serviceExampleLabel, gridBagConstraints); 143 144 customLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("Query_Label")); 145 gridBagConstraints = new java.awt.GridBagConstraints (); 146 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 147 gridBagConstraints.insets = new java.awt.Insets (6, 24, 0, 0); 148 add(customLabel, gridBagConstraints); 149 150 customTextField.setColumns(60); 151 gridBagConstraints = new java.awt.GridBagConstraints (); 152 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 153 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 154 gridBagConstraints.weightx = 1.0; 155 gridBagConstraints.insets = new java.awt.Insets (6, 6, 0, 0); 156 add(customTextField, gridBagConstraints); 157 158 customExLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("QueryExample_Label")); 159 customExLabel.setEnabled(false); 160 gridBagConstraints = new java.awt.GridBagConstraints (); 161 gridBagConstraints.gridx = 0; 162 gridBagConstraints.gridy = 3; 163 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 164 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 165 gridBagConstraints.weightx = 1.0; 166 gridBagConstraints.insets = new java.awt.Insets (6, 6, 0, 0); 167 add(customExLabel, gridBagConstraints); 168 169 jPanel1.setLayout(new java.awt.GridBagLayout ()); 170 171 jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("AttributeMappings_Label"))); 172 jPanel1.setToolTipText("Enter names for scarab's attributes to match NetBeans Tasklist names."); 173 summaryLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("Summary_Label")); 174 gridBagConstraints = new java.awt.GridBagConstraints (); 175 gridBagConstraints.gridx = 0; 176 gridBagConstraints.gridy = 1; 177 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 178 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 179 jPanel1.add(summaryLabel, gridBagConstraints); 180 181 priorityLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("Priority_Label")); 182 gridBagConstraints = new java.awt.GridBagConstraints (); 183 gridBagConstraints.gridx = 0; 184 gridBagConstraints.gridy = 8; 185 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 186 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 187 jPanel1.add(priorityLabel, gridBagConstraints); 188 189 componentLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("Component_Label")); 190 gridBagConstraints = new java.awt.GridBagConstraints (); 191 gridBagConstraints.gridx = 0; 192 gridBagConstraints.gridy = 3; 193 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 194 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 195 jPanel1.add(componentLabel, gridBagConstraints); 196 197 subcomponentLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("Subcomponent_Label")); 198 gridBagConstraints = new java.awt.GridBagConstraints (); 199 gridBagConstraints.gridx = 0; 200 gridBagConstraints.gridy = 4; 201 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 202 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 203 jPanel1.add(subcomponentLabel, gridBagConstraints); 204 205 keywordsLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("Keywords_Label")); 206 gridBagConstraints = new java.awt.GridBagConstraints (); 207 gridBagConstraints.gridx = 0; 208 gridBagConstraints.gridy = 11; 209 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 210 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 211 jPanel1.add(keywordsLabel, gridBagConstraints); 212 213 assignedToLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("AssignedTo_Label")); 214 gridBagConstraints = new java.awt.GridBagConstraints (); 215 gridBagConstraints.gridx = 0; 216 gridBagConstraints.gridy = 7; 217 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 218 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 219 jPanel1.add(assignedToLabel, gridBagConstraints); 220 221 statusLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("Status_Label")); 222 gridBagConstraints = new java.awt.GridBagConstraints (); 223 gridBagConstraints.gridx = 0; 224 gridBagConstraints.gridy = 2; 225 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 226 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 227 jPanel1.add(statusLabel, gridBagConstraints); 228 229 targetLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("Target_Label")); 230 gridBagConstraints = new java.awt.GridBagConstraints (); 231 gridBagConstraints.gridx = 0; 232 gridBagConstraints.gridy = 9; 233 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 234 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 235 jPanel1.add(targetLabel, gridBagConstraints); 236 237 votesLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/tasklist/bugs/scarab/Bundle").getString("Votes_Label")); 238 gridBagConstraints = new java.awt.GridBagConstraints (); 239 gridBagConstraints.gridx = 0; 240 gridBagConstraints.gridy = 10; 241 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 242 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 243 jPanel1.add(votesLabel, gridBagConstraints); 244 245 summaryField.setText("Summary"); 246 gridBagConstraints = new java.awt.GridBagConstraints (); 247 gridBagConstraints.gridx = 1; 248 gridBagConstraints.gridy = 1; 249 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 250 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 251 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 252 gridBagConstraints.weightx = 1.0; 253 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 254 jPanel1.add(summaryField, gridBagConstraints); 255 256 statusField.setText("Status"); 257 gridBagConstraints = new java.awt.GridBagConstraints (); 258 gridBagConstraints.gridx = 1; 259 gridBagConstraints.gridy = 2; 260 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 261 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 262 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 263 gridBagConstraints.weightx = 1.0; 264 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 265 jPanel1.add(statusField, gridBagConstraints); 266 267 componentField.setText("Component"); 268 gridBagConstraints = new java.awt.GridBagConstraints (); 269 gridBagConstraints.gridx = 1; 270 gridBagConstraints.gridy = 3; 271 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 272 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 273 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 274 gridBagConstraints.weightx = 1.0; 275 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 276 jPanel1.add(componentField, gridBagConstraints); 277 278 subcomponentField.setText("Subcomponent"); 279 gridBagConstraints = new java.awt.GridBagConstraints (); 280 gridBagConstraints.gridx = 1; 281 gridBagConstraints.gridy = 4; 282 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 283 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 284 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 285 gridBagConstraints.weightx = 1.0; 286 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 287 jPanel1.add(subcomponentField, gridBagConstraints); 288 289 assignedToField.setText("AssignedTo"); 290 gridBagConstraints = new java.awt.GridBagConstraints (); 291 gridBagConstraints.gridx = 1; 292 gridBagConstraints.gridy = 7; 293 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 294 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 295 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 296 gridBagConstraints.weightx = 1.0; 297 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 298 jPanel1.add(assignedToField, gridBagConstraints); 299 300 priorityField.setText("Priority"); 301 gridBagConstraints = new java.awt.GridBagConstraints (); 302 gridBagConstraints.gridx = 1; 303 gridBagConstraints.gridy = 8; 304 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 305 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 306 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 307 gridBagConstraints.weightx = 1.0; 308 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 309 jPanel1.add(priorityField, gridBagConstraints); 310 311 targetField.setText("Target"); 312 gridBagConstraints = new java.awt.GridBagConstraints (); 313 gridBagConstraints.gridx = 1; 314 gridBagConstraints.gridy = 9; 315 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 316 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 317 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 318 gridBagConstraints.weightx = 1.0; 319 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 320 jPanel1.add(targetField, gridBagConstraints); 321 322 votesField.setText("Votes"); 323 gridBagConstraints = new java.awt.GridBagConstraints (); 324 gridBagConstraints.gridx = 1; 325 gridBagConstraints.gridy = 10; 326 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 327 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 328 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 329 gridBagConstraints.weightx = 1.0; 330 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 331 jPanel1.add(votesField, gridBagConstraints); 332 333 keywordsField.setText("Keywords"); 334 gridBagConstraints = new java.awt.GridBagConstraints (); 335 gridBagConstraints.gridx = 1; 336 gridBagConstraints.gridy = 11; 337 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 338 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 339 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 340 gridBagConstraints.weightx = 1.0; 341 gridBagConstraints.insets = new java.awt.Insets (2, 5, 0, 0); 342 jPanel1.add(keywordsField, gridBagConstraints); 343 344 gridBagConstraints = new java.awt.GridBagConstraints (); 345 gridBagConstraints.gridx = 1; 346 gridBagConstraints.gridy = 4; 347 gridBagConstraints.gridwidth = 2; 348 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 349 add(jPanel1, gridBagConstraints); 350 351 } 353 354 public javax.swing.JTextField assignedToField; 356 public javax.swing.JLabel assignedToLabel; 357 public javax.swing.ButtonGroup buttonGroup1; 358 public javax.swing.JTextField componentField; 359 public javax.swing.JLabel componentLabel; 360 public javax.swing.JLabel customExLabel; 361 public javax.swing.JLabel customLabel; 362 public javax.swing.JTextField customTextField; 363 public javax.swing.JLabel jLabel4; 364 public javax.swing.JPanel jPanel1; 365 public javax.swing.JTextField keywordsField; 366 public javax.swing.JLabel keywordsLabel; 367 public javax.swing.JTextField priorityField; 368 public javax.swing.JLabel priorityLabel; 369 public javax.swing.JLabel serviceExampleLabel; 370 public javax.swing.JLabel serviceLabel; 371 public javax.swing.JTextField serviceTextField; 372 public javax.swing.JTextField statusField; 373 public javax.swing.JLabel statusLabel; 374 public javax.swing.JTextField subcomponentField; 375 public javax.swing.JLabel subcomponentLabel; 376 public javax.swing.JTextField summaryField; 377 public javax.swing.JLabel summaryLabel; 378 public javax.swing.JTextField targetField; 379 public javax.swing.JLabel targetLabel; 380 public javax.swing.JTextField votesField; 381 public javax.swing.JLabel votesLabel; 382 384 } 385 | Popular Tags |