KickJava   Java API By Example, From Geeks To Geeks.

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


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 Developer 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 java.util.ArrayList JavaDoc;
24 import java.util.Enumeration JavaDoc;
25 import java.util.Iterator JavaDoc;
26 import java.util.List JavaDoc;
27 import javax.swing.JComponent JavaDoc;
28 import javax.swing.JPanel JavaDoc;
29 import javax.swing.ListCellRenderer JavaDoc;
30 import javax.swing.event.DocumentEvent JavaDoc;
31 import javax.swing.event.DocumentListener JavaDoc;
32 import javax.swing.event.ListDataEvent JavaDoc;
33 import javax.swing.event.ListDataListener JavaDoc;
34 import org.netbeans.api.project.ant.AntArtifact;
35 import org.netbeans.modules.java.j2seproject.J2SEProjectUtil;
36 import org.netbeans.spi.project.support.ant.AntProjectHelper;
37 import org.netbeans.spi.project.support.ant.PropertyUtils;
38 import org.openide.DialogDisplayer;
39 import org.openide.NotifyDescriptor;
40 import org.openide.util.HelpCtx;
41 import org.openide.util.NbBundle;
42
43 /** Customizer for general project attributes.
44  *
45  * @author phrebejk
46  */

47 public class CustomizerJar extends JPanel JavaDoc implements HelpCtx.Provider {
48     
49     public CustomizerJar( J2SEProjectProperties uiProperties ) {
50         initComponents();
51         
52         jTextFieldDistDir.setDocument( uiProperties.DIST_JAR_MODEL );
53         jTextFieldExcludes.setDocument( uiProperties.BUILD_CLASSES_EXCLUDES_MODEL );
54         
55         uiProperties.JAR_COMPRESS_MODEL.setMnemonic( jCheckBoxCommpress.getMnemonic() );
56         jCheckBoxCommpress.setModel( uiProperties.JAR_COMPRESS_MODEL );
57     }
58     
59     public HelpCtx getHelpCtx() {
60         return new HelpCtx( CustomizerJar.class );
61     }
62         
63     
64     /** This method is called from within the constructor to
65      * initialize the form.
66      * WARNING: Do NOT modify this code. The content of this method is
67      * always regenerated by the Form Editor.
68      */

69     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
70
private void initComponents() {
71         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
72
73         jLabelDistDir = new javax.swing.JLabel JavaDoc();
74         jTextFieldDistDir = new javax.swing.JTextField JavaDoc();
75         jLabel2 = new javax.swing.JLabel JavaDoc();
76         jTextFieldExcludes = new javax.swing.JTextField JavaDoc();
77         jCheckBoxCommpress = new javax.swing.JCheckBox JavaDoc();
78         excludeMessage = new javax.swing.JLabel JavaDoc();
79
80         setLayout(new java.awt.GridBagLayout JavaDoc());
81
82         jLabelDistDir.setLabelFor(jTextFieldDistDir);
83         org.openide.awt.Mnemonics.setLocalizedText(jLabelDistDir, org.openide.util.NbBundle.getMessage(CustomizerJar.class, "LBL_CustomizeJar_DistDir_JTextField"));
84         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
85         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
86         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 12, 12);
87         add(jLabelDistDir, gridBagConstraints);
88
89         jTextFieldDistDir.setEditable(false);
90         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
91         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
92         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
93         gridBagConstraints.weightx = 1.0;
94         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 12, 0);
95         add(jTextFieldDistDir, gridBagConstraints);
96         jTextFieldDistDir.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(CustomizerJar.class).getString("AD_jTextFieldDistDir"));
97
98         jLabel2.setLabelFor(jTextFieldExcludes);
99         org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(CustomizerJar.class, "LBL_CustomizeJar_Excludes_JTextField"));
100         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
101         gridBagConstraints.gridx = 0;
102         gridBagConstraints.gridy = 1;
103         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
104         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 0, 12);
105         add(jLabel2, gridBagConstraints);
106
107         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
108         gridBagConstraints.gridx = 1;
109         gridBagConstraints.gridy = 1;
110         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
111         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
112         gridBagConstraints.weightx = 1.0;
113         add(jTextFieldExcludes, gridBagConstraints);
114         jTextFieldExcludes.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(CustomizerJar.class).getString("AD_jTextFieldExcludes"));
115
116         org.openide.awt.Mnemonics.setLocalizedText(jCheckBoxCommpress, org.openide.util.NbBundle.getMessage(CustomizerJar.class, "LBL_CustomizeJar_Commpres_JCheckBox"));
117         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
118         gridBagConstraints.gridx = 0;
119         gridBagConstraints.gridy = 3;
120         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
121         gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
122         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
123         gridBagConstraints.weighty = 1.0;
124         add(jCheckBoxCommpress, gridBagConstraints);
125         jCheckBoxCommpress.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(CustomizerJar.class).getString("AD_jCheckBoxCompress"));
126
127         excludeMessage.setLabelFor(jTextFieldExcludes);
128         org.openide.awt.Mnemonics.setLocalizedText(excludeMessage, java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/ui/customizer/Bundle").getString("LBL_CustomizerJar_ExcludeMessage"));
129         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
130         gridBagConstraints.gridx = 1;
131         gridBagConstraints.gridy = 2;
132         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
133         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
134         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
135         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 6, 0);
136         add(excludeMessage, gridBagConstraints);
137
138     }
139     // </editor-fold>//GEN-END:initComponents
140

141     
142     // Variables declaration - do not modify//GEN-BEGIN:variables
143
private javax.swing.JLabel JavaDoc excludeMessage;
144     private javax.swing.JCheckBox JavaDoc jCheckBoxCommpress;
145     private javax.swing.JLabel JavaDoc jLabel2;
146     private javax.swing.JLabel JavaDoc jLabelDistDir;
147     private javax.swing.JTextField JavaDoc jTextFieldDistDir;
148     private javax.swing.JTextField JavaDoc jTextFieldExcludes;
149     // End of variables declaration//GEN-END:variables
150

151 }
152
Popular Tags