KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > j2seproject > ui > customizer > CustomizerSources


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 Deve1loper 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.java.j2seproject.ui.customizer;
21
22 import java.io.File JavaDoc;
23 import javax.swing.event.ListDataEvent JavaDoc;
24 import javax.swing.event.ListDataListener JavaDoc;
25 import org.netbeans.spi.java.project.support.ui.IncludeExcludeVisualizer;
26 import org.openide.DialogDescriptor;
27 import org.openide.DialogDisplayer;
28 import org.openide.NotifyDescriptor;
29 import org.openide.filesystems.FileObject;
30 import org.openide.filesystems.FileUtil;
31 import org.openide.util.HelpCtx;
32 import org.openide.util.NbBundle;
33
34 /**
35  * Customizer panel "Sources": source roots, level, includes/excludes.
36  * @author Tomas Zezula
37  */

38 public class CustomizerSources extends javax.swing.JPanel JavaDoc implements HelpCtx.Provider {
39
40     private final J2SEProjectProperties uiProperties;
41
42     public CustomizerSources( J2SEProjectProperties uiProperties ) {
43         this.uiProperties = uiProperties;
44         initComponents();
45         jScrollPane1.getViewport().setBackground( sourceRoots.getBackground() );
46         jScrollPane2.getViewport().setBackground( testRoots.getBackground() );
47         
48         sourceRoots.setModel( uiProperties.SOURCE_ROOTS_MODEL );
49         testRoots.setModel( uiProperties.TEST_ROOTS_MODEL );
50         sourceRoots.getTableHeader().setReorderingAllowed(false);
51         testRoots.getTableHeader().setReorderingAllowed(false);
52         
53         FileObject projectFolder = uiProperties.getProject().getProjectDirectory();
54         File JavaDoc pf = FileUtil.toFile( projectFolder );
55         this.projectLocation.setText( pf == null ? "" : pf.getPath() ); // NOI18N
56

57         
58         J2SESourceRootsUi.EditMediator emSR = J2SESourceRootsUi.registerEditMediator(
59             uiProperties.getProject(),
60             uiProperties.getProject().getSourceRoots(),
61             sourceRoots,
62             addSourceRoot,
63             removeSourceRoot,
64             upSourceRoot,
65             downSourceRoot);
66         
67         J2SESourceRootsUi.EditMediator emTSR = J2SESourceRootsUi.registerEditMediator(
68             uiProperties.getProject(),
69             uiProperties.getProject().getTestSourceRoots(),
70             testRoots,
71             addTestRoot,
72             removeTestRoot,
73             upTestRoot,
74             downTestRoot);
75         
76         emSR.setRelatedEditMediator( emTSR );
77         emTSR.setRelatedEditMediator( emSR );
78         this.sourceLevel.setEditable(false);
79         this.sourceLevel.setModel(uiProperties.JAVAC_SOURCE_MODEL);
80         this.sourceLevel.setRenderer(uiProperties.JAVAC_SOURCE_RENDERER);
81         uiProperties.JAVAC_SOURCE_MODEL.addListDataListener(new ListDataListener JavaDoc () {
82             public void intervalAdded(ListDataEvent JavaDoc e) {
83                 enableSourceLevel ();
84             }
85
86             public void intervalRemoved(ListDataEvent JavaDoc e) {
87                 enableSourceLevel ();
88             }
89
90             public void contentsChanged(ListDataEvent JavaDoc e) {
91                 enableSourceLevel ();
92             }
93         });
94         enableSourceLevel ();
95     }
96
97     public HelpCtx getHelpCtx() {
98         return new HelpCtx (CustomizerSources.class);
99     }
100     
101     private void enableSourceLevel () {
102         this.sourceLevel.setEnabled(sourceLevel.getItemCount()>0);
103     }
104     
105     /** This method is called from within the constructor to
106      * initialize the form.
107      * WARNING: Do NOT modify this code. The content of this method is
108      * always regenerated by the Form Editor.
109      */

110     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
111
private void initComponents() {
112         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
113
114         jLabel1 = new javax.swing.JLabel JavaDoc();
115         projectLocation = new javax.swing.JTextField JavaDoc();
116         sourceRootsPanel = new javax.swing.JPanel JavaDoc();
117         jLabel2 = new javax.swing.JLabel JavaDoc();
118         jScrollPane1 = new javax.swing.JScrollPane JavaDoc();
119         sourceRoots = new javax.swing.JTable JavaDoc();
120         addSourceRoot = new javax.swing.JButton JavaDoc();
121         removeSourceRoot = new javax.swing.JButton JavaDoc();
122         upSourceRoot = new javax.swing.JButton JavaDoc();
123         downSourceRoot = new javax.swing.JButton JavaDoc();
124         testRootsPanel = new javax.swing.JPanel JavaDoc();
125         jLabel3 = new javax.swing.JLabel JavaDoc();
126         jScrollPane2 = new javax.swing.JScrollPane JavaDoc();
127         testRoots = new javax.swing.JTable JavaDoc();
128         addTestRoot = new javax.swing.JButton JavaDoc();
129         removeTestRoot = new javax.swing.JButton JavaDoc();
130         upTestRoot = new javax.swing.JButton JavaDoc();
131         downTestRoot = new javax.swing.JButton JavaDoc();
132         jPanel1 = new javax.swing.JPanel JavaDoc();
133         jLabel4 = new javax.swing.JLabel JavaDoc();
134         sourceLevel = new javax.swing.JComboBox JavaDoc();
135         includeExcludeButton = new javax.swing.JButton JavaDoc();
136
137         setLayout(new java.awt.GridBagLayout JavaDoc());
138
139         jLabel1.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_ProjectFolder").charAt(0));
140         jLabel1.setLabelFor(projectLocation);
141         java.util.ResourceBundle JavaDoc bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle"); // NOI18N
142
jLabel1.setText(bundle.getString("CTL_ProjectFolder")); // NOI18N
143
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
144         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
145         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 12);
146         add(jLabel1, gridBagConstraints);
147
148         projectLocation.setEditable(false);
149         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
150         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
151         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
152         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
153         gridBagConstraints.weightx = 1.0;
154         add(projectLocation, gridBagConstraints);
155         projectLocation.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_CustomizerSources_projectLocation")); // NOI18N
156

157         sourceRootsPanel.setLayout(new java.awt.GridBagLayout JavaDoc());
158
159         jLabel2.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_SourceRoots").charAt(0));
160         jLabel2.setLabelFor(sourceRoots);
161         jLabel2.setText(bundle.getString("CTL_SourceRoots")); // NOI18N
162
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
163         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
164         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
165         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
166         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 6, 0);
167         sourceRootsPanel.add(jLabel2, gridBagConstraints);
168
169         sourceRoots.setModel(new javax.swing.table.DefaultTableModel JavaDoc(
170             new Object JavaDoc [][] {
171                 {null, null},
172                 {null, null},
173                 {null, null},
174                 {null, null}
175             },
176             new String JavaDoc [] {
177                 "Package Folder", "Label"
178             }
179         ) {
180             Class JavaDoc[] types = new Class JavaDoc [] {
181                 java.lang.Object JavaDoc.class, java.lang.String JavaDoc.class
182             };
183             boolean[] canEdit = new boolean [] {
184                 false, false
185             };
186
187             public Class JavaDoc getColumnClass(int columnIndex) {
188                 return types [columnIndex];
189             }
190
191             public boolean isCellEditable(int rowIndex, int columnIndex) {
192                 return canEdit [columnIndex];
193             }
194         });
195         jScrollPane1.setViewportView(sourceRoots);
196         sourceRoots.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_CustomizerSources_sourceRoots")); // NOI18N
197

198         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
199         gridBagConstraints.gridx = 0;
200         gridBagConstraints.gridy = 1;
201         gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
202         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
203         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
204         gridBagConstraints.weightx = 1.0;
205         gridBagConstraints.weighty = 1.0;
206         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 12);
207         sourceRootsPanel.add(jScrollPane1, gridBagConstraints);
208
209         addSourceRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_AddSourceRoot").charAt(0));
210         addSourceRoot.setText(bundle.getString("CTL_AddSourceRoot")); // NOI18N
211
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
212         gridBagConstraints.gridx = 1;
213         gridBagConstraints.gridy = 1;
214         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
215         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
216         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
217         sourceRootsPanel.add(addSourceRoot, gridBagConstraints);
218         addSourceRoot.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_CustomizerSources_addSourceRoot")); // NOI18N
219

220         removeSourceRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_RemoveSourceRoot").charAt(0));
221         removeSourceRoot.setText(bundle.getString("CTL_RemoveSourceRoot")); // NOI18N
222
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
223         gridBagConstraints.gridx = 1;
224         gridBagConstraints.gridy = 2;
225         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
226         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
227         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
228         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 0, 0, 0);
229         sourceRootsPanel.add(removeSourceRoot, gridBagConstraints);
230         removeSourceRoot.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_CustomizerSources_removeSourceRoot")); // NOI18N
231

232         upSourceRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_UpSourceRoot").charAt(0));
233         upSourceRoot.setText(bundle.getString("CTL_UpSourceRoot")); // NOI18N
234
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
235         gridBagConstraints.gridx = 1;
236         gridBagConstraints.gridy = 3;
237         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
238         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
239         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
240         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 0, 0);
241         sourceRootsPanel.add(upSourceRoot, gridBagConstraints);
242         upSourceRoot.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_CustomizerSources_upSourceRoot")); // NOI18N
243

244         downSourceRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_DownSourceRoot").charAt(0));
245         downSourceRoot.setText(bundle.getString("CTL_DownSourceRoot")); // NOI18N
246
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
247         gridBagConstraints.gridx = 1;
248         gridBagConstraints.gridy = 4;
249         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
250         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
251         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
252         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 0, 0, 0);
253         sourceRootsPanel.add(downSourceRoot, gridBagConstraints);
254         downSourceRoot.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_CustomizerSources_downSourceRoot")); // NOI18N
255

256         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
257         gridBagConstraints.gridx = 0;
258         gridBagConstraints.gridy = 1;
259         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
260         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
261         gridBagConstraints.weightx = 1.0;
262         gridBagConstraints.weighty = 0.45;
263         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 0, 0);
264         add(sourceRootsPanel, gridBagConstraints);
265
266         testRootsPanel.setLayout(new java.awt.GridBagLayout JavaDoc());
267
268         jLabel3.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_TestRoots").charAt(0));
269         jLabel3.setLabelFor(testRoots);
270         jLabel3.setText(bundle.getString("CTL_TestRoots")); // NOI18N
271
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
272         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
273         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
274         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
275         gridBagConstraints.weightx = 1.0;
276         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 6, 0);
277         testRootsPanel.add(jLabel3, gridBagConstraints);
278
279         testRoots.setModel(new javax.swing.table.DefaultTableModel JavaDoc(
280             new Object JavaDoc [][] {
281                 {null, null},
282                 {null, null},
283                 {null, null},
284                 {null, null}
285             },
286             new String JavaDoc [] {
287                 "Package Folder", "Label"
288             }
289         ) {
290             Class JavaDoc[] types = new Class JavaDoc [] {
291                 java.lang.Object JavaDoc.class, java.lang.String JavaDoc.class
292             };
293             boolean[] canEdit = new boolean [] {
294                 false, false
295             };
296
297             public Class JavaDoc getColumnClass(int columnIndex) {
298                 return types [columnIndex];
299             }
300
301             public boolean isCellEditable(int rowIndex, int columnIndex) {
302                 return canEdit [columnIndex];
303             }
304         });
305         jScrollPane2.setViewportView(testRoots);
306         testRoots.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_CustomizerSources_testRoots")); // NOI18N
307

308         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
309         gridBagConstraints.gridx = 0;
310         gridBagConstraints.gridy = 1;
311         gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
312         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
313         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
314         gridBagConstraints.weightx = 1.0;
315         gridBagConstraints.weighty = 1.0;
316         testRootsPanel.add(jScrollPane2, gridBagConstraints);
317
318         addTestRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_AddTestRoot").charAt(0));
319         addTestRoot.setText(bundle.getString("CTL_AddTestRoot")); // NOI18N
320
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
321         gridBagConstraints.gridx = 1;
322         gridBagConstraints.gridy = 1;
323         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
324         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
325         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
326         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 12, 6, 0);
327         testRootsPanel.add(addTestRoot, gridBagConstraints);
328         addTestRoot.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_CustomizerSources_addTestRoot")); // NOI18N
329

330         removeTestRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_RemoveTestRoot").charAt(0));
331         removeTestRoot.setText(bundle.getString("CTL_RemoveTestRoot")); // NOI18N
332
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
333         gridBagConstraints.gridx = 1;
334         gridBagConstraints.gridy = 2;
335         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
336         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
337         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
338         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 12, 12, 0);
339         testRootsPanel.add(removeTestRoot, gridBagConstraints);
340         removeTestRoot.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_CustomizerSources_removeTestRoot")); // NOI18N
341

342         upTestRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_UpTestRoot").charAt(0));
343         upTestRoot.setText(bundle.getString("CTL_UpTestRoot")); // NOI18N
344
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
345         gridBagConstraints.gridx = 1;
346         gridBagConstraints.gridy = 3;
347         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
348         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
349         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
350         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 12, 6, 0);
351         testRootsPanel.add(upTestRoot, gridBagConstraints);
352         upTestRoot.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_CustomizerSources_upTestRoot")); // NOI18N
353

354         downTestRoot.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_DownTestRoot").charAt(0));
355         downTestRoot.setText(bundle.getString("CTL_DownTestRoot")); // NOI18N
356
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
357         gridBagConstraints.gridx = 1;
358         gridBagConstraints.gridy = 4;
359         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
360         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
361         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
362         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 12, 0, 0);
363         testRootsPanel.add(downTestRoot, gridBagConstraints);
364         downTestRoot.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_CustomizerSources_downTestRoot")); // NOI18N
365

366         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
367         gridBagConstraints.gridx = 0;
368         gridBagConstraints.gridy = 2;
369         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
370         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
371         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
372         gridBagConstraints.weightx = 1.0;
373         gridBagConstraints.weighty = 0.45;
374         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 0, 0);
375         add(testRootsPanel, gridBagConstraints);
376
377         jPanel1.setLayout(new java.awt.GridBagLayout JavaDoc());
378
379         jLabel4.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("MNE_SourceLevel").charAt(0));
380         jLabel4.setLabelFor(sourceLevel);
381         jLabel4.setText(bundle.getString("TXT_SourceLevel")); // NOI18N
382
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
383         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
384         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 12);
385         jPanel1.add(jLabel4, gridBagConstraints);
386
387         sourceLevel.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "1.4", "1.5" }));
388         sourceLevel.setMinimumSize(this.sourceLevel.getPreferredSize());
389         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
390         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
391         gridBagConstraints.weightx = 1.0;
392         jPanel1.add(sourceLevel, gridBagConstraints);
393         sourceLevel.getAccessibleContext().setAccessibleName(bundle.getString("AN_SourceLevel")); // NOI18N
394
sourceLevel.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_SourceLevel")); // NOI18N
395

396         org.openide.awt.Mnemonics.setLocalizedText(includeExcludeButton, org.openide.util.NbBundle.getMessage(CustomizerSources.class, "CustomizerSources.includeExcludeButton")); // NOI18N
397
includeExcludeButton.addActionListener(new java.awt.event.ActionListener JavaDoc() {
398             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
399                 includeExcludeButtonActionPerformed(evt);
400             }
401         });
402         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
403         gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
404         jPanel1.add(includeExcludeButton, gridBagConstraints);
405
406         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
407         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
408         gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
409         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
410         gridBagConstraints.weightx = 1.0;
411         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 0, 0);
412         add(jPanel1, gridBagConstraints);
413     }// </editor-fold>//GEN-END:initComponents
414

415 private void includeExcludeButtonActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_includeExcludeButtonActionPerformed
416
IncludeExcludeVisualizer v = new IncludeExcludeVisualizer();
417     uiProperties.loadIncludesExcludes(v);
418     DialogDescriptor dd = new DialogDescriptor(v.getVisualizerPanel(),
419             NbBundle.getMessage(CustomizerSources.class, "CustomizerSources.title.includeExclude"));
420     dd.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION);
421     if (NotifyDescriptor.OK_OPTION.equals(DialogDisplayer.getDefault().notify(dd))) {
422         uiProperties.storeIncludesExcludes(v);
423     }
424 }//GEN-LAST:event_includeExcludeButtonActionPerformed
425

426     
427     // Variables declaration - do not modify//GEN-BEGIN:variables
428
private javax.swing.JButton JavaDoc addSourceRoot;
429     private javax.swing.JButton JavaDoc addTestRoot;
430     private javax.swing.JButton JavaDoc downSourceRoot;
431     private javax.swing.JButton JavaDoc downTestRoot;
432     private javax.swing.JButton JavaDoc includeExcludeButton;
433     private javax.swing.JLabel JavaDoc jLabel1;
434     private javax.swing.JLabel JavaDoc jLabel2;
435     private javax.swing.JLabel JavaDoc jLabel3;
436     private javax.swing.JLabel JavaDoc jLabel4;
437     private javax.swing.JPanel JavaDoc jPanel1;
438     private javax.swing.JScrollPane JavaDoc jScrollPane1;
439     private javax.swing.JScrollPane JavaDoc jScrollPane2;
440     private javax.swing.JTextField JavaDoc projectLocation;
441     private javax.swing.JButton JavaDoc removeSourceRoot;
442     private javax.swing.JButton JavaDoc removeTestRoot;
443     private javax.swing.JComboBox JavaDoc sourceLevel;
444     private javax.swing.JTable JavaDoc sourceRoots;
445     private javax.swing.JPanel JavaDoc sourceRootsPanel;
446     private javax.swing.JTable JavaDoc testRoots;
447     private javax.swing.JPanel JavaDoc testRootsPanel;
448     private javax.swing.JButton JavaDoc upSourceRoot;
449     private javax.swing.JButton JavaDoc upTestRoot;
450     // End of variables declaration//GEN-END:variables
451

452 }
453
Popular Tags