2
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
* Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
6
* The contents of this file are subject to the terms of either the GNU
7
* General Public License Version 2 only ("GPL") or the Common
8
* Development and Distribution License("CDDL") (collectively, the
9
* "License"). You may not use this file except in compliance with the
10
* License. You can obtain a copy of the License at
11
* http://www.netbeans.org/cddl-gplv2.html
12
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
* specific language governing permissions and limitations under the
14
* License. When distributing the software, include this License Header
15
* Notice in each file and include the License file at
16
* nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
17
* particular file as subject to the "Classpath" exception as provided
18
* by Sun in the GPL Version 2 section of the License file that
19
* accompanied this code. If applicable, add the following below the
20
* License Header, with the fields enclosed by brackets [] replaced by
21
* your own identifying information:
22
* "Portions Copyrighted [year] [name of copyright owner]"
26
* The Original Software is NetBeans. The Initial Developer of the Original
27
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
28
* Microsystems, Inc. All Rights Reserved.
30
* If you wish your version of this file to be governed by only the CDDL
31
* or only the GPL Version 2, indicate your decision by adding
32
* "[Contributor] elects to include this software in this distribution
33
* under the [CDDL or GPL Version 2] license." If you do not indicate a
34
* single choice of license, a recipient has the option to distribute
35
* your version of this file under either the CDDL, the GPL Version 2 or
36
* to extend the choice of license to its licensees as provided above.
37
* However, if you add GPL Version 2 code and therefore, elected the GPL
38
* Version 2 license, then the option applies only if the new code is
39
* made subject to such option by the copyright holder.
42
package org.netbeans.modules.apisupport.project.ui.customizer;
44
import java.beans.PropertyChangeEvent;
45
import org.netbeans.modules.apisupport.project.universe.NbPlatform;
46
import org.netbeans.spi.project.ui.support.ProjectCustomizer;
47
import org.openide.util.NbBundle;
50
* Represents <em>Compiling</em> panel in Netbeans Module customizer.
52
* @author Martin Krauskopf
54
final class CustomizerCompiling extends NbPropertyPanel.Single {
56
CustomizerCompiling(final SingleModuleProperties props, ProjectCustomizer.Category category) {
57
super(props, CustomizerCompiling.class, category);
64
debug.setSelected(getBooleanProperty(SingleModuleProperties.BUILD_COMPILER_DEBUG));
65
deprecation.setSelected(getBooleanProperty(SingleModuleProperties.BUILD_COMPILER_DEPRECATION));
66
options.setText(getProperty(SingleModuleProperties.JAVAC_COMPILERARGS));
67
NbPlatform platform = getProperties().getActivePlatform();
68
options.setEnabled(platform == null || platform.getHarnessVersion() >= NbPlatform.HARNESS_VERSION_50u1); // #71631
72
public void propertyChange(PropertyChangeEvent evt) {
73
super.propertyChange(evt);
74
if (SingleModuleProperties.JAVAC_COMPILERARGS.equals(evt.getPropertyName())) {
75
options.setText(getProperty(SingleModuleProperties.JAVAC_COMPILERARGS));
77
if (SingleModuleProperties.NB_PLATFORM_PROPERTY.equals(evt.getPropertyName())) {
78
NbPlatform platform = getProperties().getActivePlatform();
79
options.setEnabled(platform == null || platform.getHarnessVersion() >= NbPlatform.HARNESS_VERSION_50u1);
85
setBooleanProperty(SingleModuleProperties.BUILD_COMPILER_DEBUG, debug.isSelected());
86
setBooleanProperty(SingleModuleProperties.BUILD_COMPILER_DEPRECATION, deprecation.isSelected());
87
setProperty(SingleModuleProperties.JAVAC_COMPILERARGS, options.getText());
90
/** This method is called from within the constructor to
91
* initialize the form.
92
* WARNING: Do NOT modify this code. The content of this method is
93
* always regenerated by the Form Editor.
95
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
96
private void initComponents() {
97
deprecation = new javax.swing.JCheckBox();
98
debug = new javax.swing.JCheckBox();
99
optionsLabel = new javax.swing.JLabel();
100
options = new javax.swing.JTextField();
102
org.openide.awt.Mnemonics.setLocalizedText(deprecation, org.openide.util.NbBundle.getMessage(CustomizerCompiling.class, "CTL_ReportDeprecation"));
104
org.openide.awt.Mnemonics.setLocalizedText(debug, org.openide.util.NbBundle.getMessage(CustomizerCompiling.class, "CTL_GenerateDebugInfo"));
106
optionsLabel.setLabelFor(options);
107
org.openide.awt.Mnemonics.setLocalizedText(optionsLabel, NbBundle.getMessage(CustomizerCompiling.class, "LBL_additional_compiler_options"));
109
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
110
this.setLayout(layout);
111
layout.setHorizontalGroup(
112
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
113
.add(layout.createSequentialGroup()
114
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
117
.add(layout.createSequentialGroup()
119
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
120
.add(options, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE)))
123
layout.setVerticalGroup(
124
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
125
.add(layout.createSequentialGroup()
127
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
129
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
130
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
132
.add(options, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
133
.addContainerGap(233, Short.MAX_VALUE))
135
}// </editor-fold>//GEN-END:initComponents
138
// Variables declaration - do not modify//GEN-BEGIN:variables
139
private javax.swing.JCheckBox debug;
140
private javax.swing.JCheckBox deprecation;
141
private javax.swing.JTextField options;
142
private javax.swing.JLabel optionsLabel;
143
// End of variables declaration//GEN-END:variables
145
private static String getMessage(String key) {
146
return NbBundle.getMessage(CustomizerCompiling.class, key);
149
private void initAccessibility() {
150
debug.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_Debug"));
151
deprecation.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_Deprecation"));