1 19 20 package org.netbeans.modules.j2ee.ejbjarproject.ui.customizer; 21 22 import java.io.File ; 23 import javax.swing.JFileChooser ; 24 import javax.swing.event.ListDataEvent ; 25 import javax.swing.event.ListDataListener ; 26 import org.netbeans.api.queries.CollocationQuery; 27 import org.openide.filesystems.FileObject; 28 import org.openide.filesystems.FileUtil; 29 import org.openide.util.HelpCtx; 30 import org.openide.util.NbBundle; 31 import org.netbeans.modules.j2ee.ejbjarproject.EjbJarProject; 32 import org.netbeans.spi.project.support.ant.PropertyUtils; 33 34 38 public class CustomizerSources extends javax.swing.JPanel implements HelpCtx.Provider { 39 40 private File projectFld; 41 42 public CustomizerSources( EjbJarProjectProperties uiProperties ) { 43 initComponents(); 44 jScrollPane1.getViewport().setBackground( sourceRoots.getBackground() ); 45 jScrollPane2.getViewport().setBackground( testRoots.getBackground() ); 46 47 sourceRoots.setModel( uiProperties.SOURCE_ROOTS_MODEL ); 48 testRoots.setModel( uiProperties.TEST_ROOTS_MODEL ); 49 sourceRoots.getTableHeader().setReorderingAllowed(false); 50 testRoots.getTableHeader().setReorderingAllowed(false); 51 52 FileObject projectFolder = uiProperties.getProject().getProjectDirectory(); 53 File pf = FileUtil.toFile( projectFolder ); 54 this.projectLocation.setText( pf == null ? "" : pf.getPath() ); this.projectFld = pf; 56 57 jTextFieldConfigFilesFolder.setDocument(uiProperties.META_INF_MODEL); 58 59 EjbJarSourceRootsUi.EditMediator emSR = EjbJarSourceRootsUi.registerEditMediator( 60 (EjbJarProject)uiProperties.getProject(), 61 ((EjbJarProject)uiProperties.getProject()).getSourceRoots(), 62 sourceRoots, 63 addSourceRoot, 64 removeSourceRoot, 65 upSourceRoot, 66 downSourceRoot); 67 68 EjbJarSourceRootsUi.EditMediator emTSR = EjbJarSourceRootsUi.registerEditMediator( 69 (EjbJarProject)uiProperties.getProject(), 70 ((EjbJarProject)uiProperties.getProject()).getTestSourceRoots(), 71 testRoots, 72 addTestRoot, 73 removeTestRoot, 74 upTestRoot, 75 downTestRoot); 76 77 emSR.setRelatedEditMediator( emTSR ); 78 emTSR.setRelatedEditMediator( emSR ); 79 this.sourceLevel.setModel(uiProperties.JAVAC_SOURCE_MODEL); 80 uiProperties.JAVAC_SOURCE_MODEL.addListDataListener(new ListDataListener () { 81 public void intervalAdded(ListDataEvent e) { 82 enableSourceLevel (); 83 } 84 85 public void intervalRemoved(ListDataEvent e) { 86 enableSourceLevel (); 87 } 88 89 public void contentsChanged(ListDataEvent e) { 90 enableSourceLevel (); 91 } 92 }); 93 enableSourceLevel (); 94 } 95 96 public HelpCtx getHelpCtx() { 97 return new HelpCtx (CustomizerSources.class); 98 } 99 100 private void enableSourceLevel () { 101 this.sourceLevel.setEnabled(sourceLevel.getItemCount()>0); 102 } 103 104 109 private void initComponents() { 111 java.awt.GridBagConstraints gridBagConstraints; 112 113 jLabel1 = new javax.swing.JLabel (); 114 projectLocation = new javax.swing.JTextField (); 115 jLabelConfigFilesFolder = new javax.swing.JLabel (); 116 jTextFieldConfigFilesFolder = new javax.swing.JTextField (); 117 jButtonBrowse = new javax.swing.JButton (); 118 sourceRootsPanel = new javax.swing.JPanel (); 119 jLabel2 = new javax.swing.JLabel (); 120 jScrollPane1 = new javax.swing.JScrollPane (); 121 sourceRoots = new javax.swing.JTable (); 122 addSourceRoot = new javax.swing.JButton (); 123 removeSourceRoot = new javax.swing.JButton (); 124 upSourceRoot = new javax.swing.JButton (); 125 downSourceRoot = new javax.swing.JButton (); 126 testRootsPanel = new javax.swing.JPanel (); 127 jLabel3 = new javax.swing.JLabel (); 128 jScrollPane2 = new javax.swing.JScrollPane (); 129 testRoots = new javax.swing.JTable (); 130 addTestRoot = new javax.swing.JButton (); 131 removeTestRoot = new javax.swing.JButton (); 132 upTestRoot = new javax.swing.JButton (); 133 downTestRoot = new javax.swing.JButton (); 134 jPanel1 = new javax.swing.JPanel (); 135 jLabel4 = new javax.swing.JLabel (); 136 sourceLevel = new javax.swing.JComboBox (); 137 jPanel2 = new javax.swing.JPanel (); 138 139 setLayout(new java.awt.GridBagLayout ()); 140 141 jLabel1.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_ProjectFolder").charAt(0)); 142 jLabel1.setLabelFor(projectLocation); 143 jLabel1.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("CTL_ProjectFolder")); 144 gridBagConstraints = new java.awt.GridBagConstraints (); 145 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 146 gridBagConstraints.insets = new java.awt.Insets (0, 0, 12, 12); 147 add(jLabel1, gridBagConstraints); 148 149 projectLocation.setEditable(false); 150 gridBagConstraints = new java.awt.GridBagConstraints (); 151 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 152 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 153 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 154 gridBagConstraints.weightx = 1.0; 155 gridBagConstraints.insets = new java.awt.Insets (0, 0, 12, 0); 156 add(projectLocation, gridBagConstraints); 157 158 jLabelConfigFilesFolder.setDisplayedMnemonic(NbBundle.getMessage(CustomizerSources.class, "MNE_ConfigFilesFolder").charAt(0)); 159 jLabelConfigFilesFolder.setLabelFor(jTextFieldConfigFilesFolder); 160 jLabelConfigFilesFolder.setText(org.openide.util.NbBundle.getMessage(CustomizerSources.class, "CTL_ConfigFilesFolder")); 161 gridBagConstraints = new java.awt.GridBagConstraints (); 162 gridBagConstraints.gridx = 0; 163 gridBagConstraints.gridy = 1; 164 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 165 gridBagConstraints.insets = new java.awt.Insets (0, 0, 0, 12); 166 add(jLabelConfigFilesFolder, gridBagConstraints); 167 168 gridBagConstraints = new java.awt.GridBagConstraints (); 169 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 170 gridBagConstraints.weightx = 1.0; 171 gridBagConstraints.insets = new java.awt.Insets (0, 0, 0, 12); 172 add(jTextFieldConfigFilesFolder, gridBagConstraints); 173 jTextFieldConfigFilesFolder.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(CustomizerSources.class, "ACSD_CustomizerSources_ConfigFilesFolder")); 174 175 jButtonBrowse.setMnemonic(NbBundle.getMessage(CustomizerSources.class, "MNE_ConfigFilesFolderBrowse").charAt(0)); 176 jButtonBrowse.setText(org.openide.util.NbBundle.getMessage(CustomizerSources.class, "LBL_Browse_JButton")); 177 jButtonBrowse.addActionListener(new java.awt.event.ActionListener () { 178 public void actionPerformed(java.awt.event.ActionEvent evt) { 179 jButtonBrowseActionPerformed(evt); 180 } 181 }); 182 183 gridBagConstraints = new java.awt.GridBagConstraints (); 184 gridBagConstraints.gridx = 2; 185 gridBagConstraints.gridy = 1; 186 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 187 gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; 188 add(jButtonBrowse, gridBagConstraints); 189 jButtonBrowse.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(CustomizerSources.class, "ACSD_CustomizerSources_ConfigFilesFolderBrowse")); 190 191 sourceRootsPanel.setLayout(new java.awt.GridBagLayout ()); 192 193 jLabel2.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_SourceRoots").charAt(0)); 194 jLabel2.setLabelFor(sourceRoots); 195 jLabel2.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("CTL_SourceRoots")); 196 gridBagConstraints = new java.awt.GridBagConstraints (); 197 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 198 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 199 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 200 gridBagConstraints.insets = new java.awt.Insets (0, 0, 6, 0); 201 sourceRootsPanel.add(jLabel2, gridBagConstraints); 202 203 sourceRoots.setModel(new javax.swing.table.DefaultTableModel ( 204 new Object [][] { 205 {null, null}, 206 {null, null}, 207 {null, null}, 208 {null, null} 209 }, 210 new String [] { 211 "Package Folder", "Label" 212 } 213 ) { 214 Class [] types = new Class [] { 215 java.lang.Object .class, java.lang.String .class 216 }; 217 boolean[] canEdit = new boolean [] { 218 false, false 219 }; 220 221 public Class getColumnClass(int columnIndex) { 222 return types [columnIndex]; 223 } 224 225 public boolean isCellEditable(int rowIndex, int columnIndex) { 226 return canEdit [columnIndex]; 227 } 228 }); 229 jScrollPane1.setViewportView(sourceRoots); 230 231 gridBagConstraints = new java.awt.GridBagConstraints (); 232 gridBagConstraints.gridx = 0; 233 gridBagConstraints.gridy = 1; 234 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 235 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 236 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 237 gridBagConstraints.weightx = 1.0; 238 gridBagConstraints.weighty = 1.0; 239 gridBagConstraints.insets = new java.awt.Insets (0, 0, 0, 12); 240 sourceRootsPanel.add(jScrollPane1, gridBagConstraints); 241 242 addSourceRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_AddSourceRoot").charAt(0)); 243 addSourceRoot.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("CTL_AddSourceRoot")); 244 gridBagConstraints = new java.awt.GridBagConstraints (); 245 gridBagConstraints.gridx = 1; 246 gridBagConstraints.gridy = 1; 247 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 248 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 249 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 250 sourceRootsPanel.add(addSourceRoot, gridBagConstraints); 251 252 removeSourceRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_RemoveSourceRoot").charAt(0)); 253 removeSourceRoot.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("CTL_RemoveSourceRoot")); 254 gridBagConstraints = new java.awt.GridBagConstraints (); 255 gridBagConstraints.gridx = 1; 256 gridBagConstraints.gridy = 2; 257 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 258 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 259 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 260 gridBagConstraints.insets = new java.awt.Insets (6, 0, 0, 0); 261 sourceRootsPanel.add(removeSourceRoot, gridBagConstraints); 262 263 upSourceRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_UpSourceRoot").charAt(0)); 264 upSourceRoot.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("CTL_UpSourceRoot")); 265 gridBagConstraints = new java.awt.GridBagConstraints (); 266 gridBagConstraints.gridx = 1; 267 gridBagConstraints.gridy = 3; 268 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 269 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 270 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 271 gridBagConstraints.insets = new java.awt.Insets (12, 0, 0, 0); 272 sourceRootsPanel.add(upSourceRoot, gridBagConstraints); 273 274 downSourceRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_DownSourceRoot").charAt(0)); 275 downSourceRoot.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("CTL_DownSourceRoot")); 276 gridBagConstraints = new java.awt.GridBagConstraints (); 277 gridBagConstraints.gridx = 1; 278 gridBagConstraints.gridy = 4; 279 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 280 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 281 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 282 gridBagConstraints.insets = new java.awt.Insets (6, 0, 0, 0); 283 sourceRootsPanel.add(downSourceRoot, gridBagConstraints); 284 285 gridBagConstraints = new java.awt.GridBagConstraints (); 286 gridBagConstraints.gridx = 0; 287 gridBagConstraints.gridy = 2; 288 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 289 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 290 gridBagConstraints.weightx = 1.0; 291 gridBagConstraints.weighty = 0.45; 292 gridBagConstraints.insets = new java.awt.Insets (12, 0, 0, 0); 293 add(sourceRootsPanel, gridBagConstraints); 294 295 testRootsPanel.setLayout(new java.awt.GridBagLayout ()); 296 297 jLabel3.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_TestRoots").charAt(0)); 298 jLabel3.setLabelFor(testRoots); 299 jLabel3.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("CTL_TestRoots")); 300 gridBagConstraints = new java.awt.GridBagConstraints (); 301 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 302 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 303 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 304 gridBagConstraints.weightx = 1.0; 305 gridBagConstraints.insets = new java.awt.Insets (0, 0, 6, 0); 306 testRootsPanel.add(jLabel3, gridBagConstraints); 307 308 testRoots.setModel(new javax.swing.table.DefaultTableModel ( 309 new Object [][] { 310 {null, null}, 311 {null, null}, 312 {null, null}, 313 {null, null} 314 }, 315 new String [] { 316 "Package Folder", "Label" 317 } 318 ) { 319 Class [] types = new Class [] { 320 java.lang.Object .class, java.lang.String .class 321 }; 322 boolean[] canEdit = new boolean [] { 323 false, false 324 }; 325 326 public Class getColumnClass(int columnIndex) { 327 return types [columnIndex]; 328 } 329 330 public boolean isCellEditable(int rowIndex, int columnIndex) { 331 return canEdit [columnIndex]; 332 } 333 }); 334 jScrollPane2.setViewportView(testRoots); 335 336 gridBagConstraints = new java.awt.GridBagConstraints (); 337 gridBagConstraints.gridx = 0; 338 gridBagConstraints.gridy = 1; 339 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 340 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 341 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 342 gridBagConstraints.weightx = 1.0; 343 gridBagConstraints.weighty = 1.0; 344 testRootsPanel.add(jScrollPane2, gridBagConstraints); 345 346 addTestRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_AddTestRoot").charAt(0)); 347 addTestRoot.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("CTL_AddTestRoot")); 348 gridBagConstraints = new java.awt.GridBagConstraints (); 349 gridBagConstraints.gridx = 1; 350 gridBagConstraints.gridy = 1; 351 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 352 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 353 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 354 gridBagConstraints.insets = new java.awt.Insets (0, 12, 6, 0); 355 testRootsPanel.add(addTestRoot, gridBagConstraints); 356 357 removeTestRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_RemoveTestRoot").charAt(0)); 358 removeTestRoot.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("CTL_RemoveTestRoot")); 359 gridBagConstraints = new java.awt.GridBagConstraints (); 360 gridBagConstraints.gridx = 1; 361 gridBagConstraints.gridy = 2; 362 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 363 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 364 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 365 gridBagConstraints.insets = new java.awt.Insets (0, 12, 12, 0); 366 testRootsPanel.add(removeTestRoot, gridBagConstraints); 367 368 upTestRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_UpTestRoot").charAt(0)); 369 upTestRoot.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("CTL_UpTestRoot")); 370 gridBagConstraints = new java.awt.GridBagConstraints (); 371 gridBagConstraints.gridx = 1; 372 gridBagConstraints.gridy = 3; 373 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 374 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 375 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 376 gridBagConstraints.insets = new java.awt.Insets (0, 12, 6, 0); 377 testRootsPanel.add(upTestRoot, gridBagConstraints); 378 379 downTestRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_DownTestRoot").charAt(0)); 380 downTestRoot.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("CTL_DownTestRoot")); 381 gridBagConstraints = new java.awt.GridBagConstraints (); 382 gridBagConstraints.gridx = 1; 383 gridBagConstraints.gridy = 4; 384 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 385 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 386 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 387 gridBagConstraints.insets = new java.awt.Insets (0, 12, 0, 0); 388 testRootsPanel.add(downTestRoot, gridBagConstraints); 389 390 gridBagConstraints = new java.awt.GridBagConstraints (); 391 gridBagConstraints.gridx = 0; 392 gridBagConstraints.gridy = 3; 393 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 394 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 395 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 396 gridBagConstraints.weightx = 1.0; 397 gridBagConstraints.weighty = 0.45; 398 gridBagConstraints.insets = new java.awt.Insets (12, 0, 0, 0); 399 add(testRootsPanel, gridBagConstraints); 400 401 jPanel1.setLayout(new java.awt.GridBagLayout ()); 402 403 jLabel4.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("MNE_SourceLevel").charAt(0)); 404 jLabel4.setLabelFor(sourceLevel); 405 jLabel4.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("TXT_SourceLevel")); 406 gridBagConstraints = new java.awt.GridBagConstraints (); 407 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 408 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 409 gridBagConstraints.insets = new java.awt.Insets (0, 0, 0, 12); 410 jPanel1.add(jLabel4, gridBagConstraints); 411 412 gridBagConstraints = new java.awt.GridBagConstraints (); 413 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 414 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 415 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 416 gridBagConstraints.weightx = 0.75; 417 jPanel1.add(sourceLevel, gridBagConstraints); 418 sourceLevel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("AN_SourceLevel")); 419 sourceLevel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbjarproject/ui/customizer/Bundle").getString("AD_SourceLevel")); 420 421 gridBagConstraints = new java.awt.GridBagConstraints (); 422 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 423 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 424 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 425 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 426 gridBagConstraints.weightx = 1.0; 427 jPanel1.add(jPanel2, gridBagConstraints); 428 429 gridBagConstraints = new java.awt.GridBagConstraints (); 430 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 431 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 432 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 433 gridBagConstraints.weightx = 1.0; 434 gridBagConstraints.insets = new java.awt.Insets (12, 0, 0, 0); 435 add(jPanel1, gridBagConstraints); 436 437 } 438 440 private void jButtonBrowseActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser chooser = new JFileChooser (); 442 FileUtil.preventFileChooserSymlinkTraversal(chooser, null); 443 chooser.setFileSelectionMode (JFileChooser.DIRECTORIES_ONLY); 444 File fileName = new File (jTextFieldConfigFilesFolder.getText()); 445 File configFiles = fileName.isAbsolute() ? fileName : new File (projectFld, fileName.getPath()); 446 if (configFiles.isAbsolute()) { 447 chooser.setSelectedFile(configFiles); 448 } else { 449 chooser.setSelectedFile(projectFld); 450 } 451 if ( JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) { 452 File selected = FileUtil.normalizeFile(chooser.getSelectedFile()); 453 String newConfigFiles; 454 if (CollocationQuery.areCollocated(projectFld, selected)) { 455 newConfigFiles = PropertyUtils.relativizeFile(projectFld, selected); 456 } else { 457 newConfigFiles = selected.getPath(); 458 } 459 jTextFieldConfigFilesFolder.setText(newConfigFiles); 460 } 461 } 463 464 private javax.swing.JButton addSourceRoot; 466 private javax.swing.JButton addTestRoot; 467 private javax.swing.JButton downSourceRoot; 468 private javax.swing.JButton downTestRoot; 469 private javax.swing.JButton jButtonBrowse; 470 private javax.swing.JLabel jLabel1; 471 private javax.swing.JLabel jLabel2; 472 private javax.swing.JLabel jLabel3; 473 private javax.swing.JLabel jLabel4; 474 private javax.swing.JLabel jLabelConfigFilesFolder; 475 private javax.swing.JPanel jPanel1; 476 private javax.swing.JPanel jPanel2; 477 private javax.swing.JScrollPane jScrollPane1; 478 private javax.swing.JScrollPane jScrollPane2; 479 private javax.swing.JTextField jTextFieldConfigFilesFolder; 480 private javax.swing.JTextField projectLocation; 481 private javax.swing.JButton removeSourceRoot; 482 private javax.swing.JButton removeTestRoot; 483 private javax.swing.JComboBox sourceLevel; 484 private javax.swing.JTable sourceRoots; 485 private javax.swing.JPanel sourceRootsPanel; 486 private javax.swing.JTable testRoots; 487 private javax.swing.JPanel testRootsPanel; 488 private javax.swing.JButton upSourceRoot; 489 private javax.swing.JButton upTestRoot; 490 492 } 493 | Popular Tags |