KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > apisupport > project > ui > customizer > CustomizerCompiling


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.apisupport.project.ui.customizer;
21
22 import java.beans.PropertyChangeEvent JavaDoc;
23 import org.netbeans.modules.apisupport.project.universe.NbPlatform;
24 import org.openide.util.NbBundle;
25
26 /**
27  * Represents <em>Compiling</em> panel in Netbeans Module customizer.
28  *
29  * @author Martin Krauskopf
30  */

31 final class CustomizerCompiling extends NbPropertyPanel.Single {
32
33     CustomizerCompiling(final SingleModuleProperties props) {
34         super(props, CustomizerCompiling.class);
35         initComponents();
36         initAccessibility();
37         refresh();
38     }
39     
40     void refresh() {
41         debug.setSelected(getBooleanProperty(SingleModuleProperties.BUILD_COMPILER_DEBUG));
42         deprecation.setSelected(getBooleanProperty(SingleModuleProperties.BUILD_COMPILER_DEPRECATION));
43         options.setText(getProperty(SingleModuleProperties.JAVAC_COMPILERARGS));
44         NbPlatform platform = getProperties().getActivePlatform();
45         options.setEnabled(platform == null || platform.getHarnessVersion() >= NbPlatform.HARNESS_VERSION_50u1); // #71631
46
}
47     
48     public void propertyChange(PropertyChangeEvent JavaDoc evt) {
49         super.propertyChange(evt);
50         if (SingleModuleProperties.JAVAC_COMPILERARGS.equals(evt.getPropertyName())) {
51             options.setText(getProperty(SingleModuleProperties.JAVAC_COMPILERARGS));
52         }
53         if (SingleModuleProperties.NB_PLATFORM_PROPERTY.equals(evt.getPropertyName())) {
54             NbPlatform platform = getProperties().getActivePlatform();
55             options.setEnabled(platform == null || platform.getHarnessVersion() >= NbPlatform.HARNESS_VERSION_50u1);
56         }
57     }
58     
59     public void store() {
60         setBooleanProperty(SingleModuleProperties.BUILD_COMPILER_DEBUG, debug.isSelected());
61         setBooleanProperty(SingleModuleProperties.BUILD_COMPILER_DEPRECATION, deprecation.isSelected());
62         setProperty(SingleModuleProperties.JAVAC_COMPILERARGS, options.getText());
63     }
64     
65     /** This method is called from within the constructor to
66      * initialize the form.
67      * WARNING: Do NOT modify this code. The content of this method is
68      * always regenerated by the Form Editor.
69      */

70     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
71
private void initComponents() {
72         deprecation = new javax.swing.JCheckBox JavaDoc();
73         debug = new javax.swing.JCheckBox JavaDoc();
74         optionsLabel = new javax.swing.JLabel JavaDoc();
75         options = new javax.swing.JTextField JavaDoc();
76
77         org.openide.awt.Mnemonics.setLocalizedText(deprecation, org.openide.util.NbBundle.getMessage(CustomizerCompiling.class, "CTL_ReportDeprecation"));
78
79         org.openide.awt.Mnemonics.setLocalizedText(debug, org.openide.util.NbBundle.getMessage(CustomizerCompiling.class, "CTL_GenerateDebugInfo"));
80
81         optionsLabel.setLabelFor(options);
82         org.openide.awt.Mnemonics.setLocalizedText(optionsLabel, NbBundle.getMessage(CustomizerCompiling.class, "LBL_additional_compiler_options"));
83
84         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
85         this.setLayout(layout);
86         layout.setHorizontalGroup(
87             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
88             .add(layout.createSequentialGroup()
89                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
90                     .add(debug)
91                     .add(deprecation)
92                     .add(layout.createSequentialGroup()
93                         .add(optionsLabel)
94                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
95                         .add(options, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE)))
96                 .addContainerGap())
97         );
98         layout.setVerticalGroup(
99             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
100             .add(layout.createSequentialGroup()
101                 .add(debug)
102                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
103                 .add(deprecation)
104                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
105                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
106                     .add(optionsLabel)
107                     .add(options, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
108                 .addContainerGap(233, Short.MAX_VALUE))
109         );
110     }// </editor-fold>//GEN-END:initComponents
111

112     
113     // Variables declaration - do not modify//GEN-BEGIN:variables
114
private javax.swing.JCheckBox JavaDoc debug;
115     private javax.swing.JCheckBox JavaDoc deprecation;
116     private javax.swing.JTextField JavaDoc options;
117     private javax.swing.JLabel JavaDoc optionsLabel;
118     // End of variables declaration//GEN-END:variables
119

120     private static String JavaDoc getMessage(String JavaDoc key) {
121         return NbBundle.getMessage(CustomizerCompiling.class, key);
122     }
123     
124     private void initAccessibility() {
125         debug.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_Debug"));
126         deprecation.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_Deprecation"));
127     }
128     
129 }
130
Popular Tags