1 19 20 package org.netbeans.modules.apisupport.project.ui.customizer; 21 22 import java.beans.PropertyChangeEvent ; 23 import org.netbeans.modules.apisupport.project.universe.NbPlatform; 24 import org.openide.util.NbBundle; 25 26 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); } 47 48 public void propertyChange(PropertyChangeEvent 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 70 private void initComponents() { 72 deprecation = new javax.swing.JCheckBox (); 73 debug = new javax.swing.JCheckBox (); 74 optionsLabel = new javax.swing.JLabel (); 75 options = new javax.swing.JTextField (); 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 } 112 113 private javax.swing.JCheckBox debug; 115 private javax.swing.JCheckBox deprecation; 116 private javax.swing.JTextField options; 117 private javax.swing.JLabel optionsLabel; 118 120 private static String getMessage(String 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 |