1 19 package org.netbeans.modules.xml.tools.generator; 20 21 import java.awt.event.*; 22 import java.beans.*; 23 import javax.swing.*; 24 import java.net.URL ; 25 import java.net.MalformedURLException ; 26 27 32 public final class SAXGeneratorVersionPanel extends SAXGeneratorAbstractPanel implements ActionListener { 33 34 35 private static final long serialVersionUID =-3731567998368428526L; 36 37 38 39 public SAXGeneratorVersionPanel() { 40 } 45 46 51 private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; 53 54 descTextArea = new javax.swing.JTextArea (); 55 jaxpLabel = new javax.swing.JLabel (); 56 jaxpVersionComboBox = new javax.swing.JComboBox (); 57 versionLabel = new javax.swing.JLabel (); 58 versionComboBox = new javax.swing.JComboBox (); 59 propagateSAXCheckBox = new javax.swing.JCheckBox (); 60 61 setLayout(new java.awt.GridBagLayout ()); 62 63 setPreferredSize(new java.awt.Dimension (480, 350)); 64 setName(Util.THIS.getString ("SAXGeneratorVersionPanel.Form.name")); 65 descTextArea.setWrapStyleWord(true); 66 descTextArea.setLineWrap(true); 67 descTextArea.setEditable(false); 68 descTextArea.setForeground(new java.awt.Color (102, 102, 153)); 69 descTextArea.setFont(javax.swing.UIManager.getFont ("Label.font")); 70 descTextArea.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/xml/tools/generator/Bundle").getString("DESC_saxw_versions")); 71 descTextArea.setDisabledTextColor(javax.swing.UIManager.getColor ("Label.foreground")); 72 descTextArea.setEnabled(false); 73 descTextArea.setOpaque(false); 74 gridBagConstraints = new java.awt.GridBagConstraints (); 75 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 76 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 77 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; 78 add(descTextArea, gridBagConstraints); 79 80 jaxpLabel.setText(Util.THIS.getString ("SAXGeneratorVersionPanel.jaxpLabel.text")); 81 jaxpLabel.setForeground(java.awt.Color.black); 82 jaxpLabel.setLabelFor(jaxpVersionComboBox); 83 gridBagConstraints = new java.awt.GridBagConstraints (); 84 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 85 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 86 gridBagConstraints.insets = new java.awt.Insets (12, 0, 0, 0); 87 add(jaxpLabel, gridBagConstraints); 88 89 gridBagConstraints = new java.awt.GridBagConstraints (); 90 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 91 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 92 gridBagConstraints.weightx = 1.0; 93 gridBagConstraints.insets = new java.awt.Insets (12, 12, 0, 0); 94 add(jaxpVersionComboBox, gridBagConstraints); 95 96 versionLabel.setText(Util.THIS.getString ("SAXGeneratorCustomizer.versionLabel.text")); 97 versionLabel.setForeground(java.awt.Color.black); 98 versionLabel.setLabelFor(versionComboBox); 99 gridBagConstraints = new java.awt.GridBagConstraints (); 100 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 101 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 102 gridBagConstraints.insets = new java.awt.Insets (12, 0, 0, 0); 103 add(versionLabel, gridBagConstraints); 104 105 gridBagConstraints = new java.awt.GridBagConstraints (); 106 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 107 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 108 gridBagConstraints.weightx = 1.0; 109 gridBagConstraints.insets = new java.awt.Insets (12, 12, 0, 0); 110 add(versionComboBox, gridBagConstraints); 111 112 propagateSAXCheckBox.setText(Util.THIS.getString ("SAXGeneratorVersionPanel.propagateSAXCheckBox.text")); 113 gridBagConstraints = new java.awt.GridBagConstraints (); 114 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 115 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 116 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 117 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 118 gridBagConstraints.weightx = 1.0; 119 gridBagConstraints.weighty = 1.0; 120 gridBagConstraints.insets = new java.awt.Insets (12, 0, 0, 0); 121 add(propagateSAXCheckBox, gridBagConstraints); 122 123 } 125 protected void updateModel() { 126 model.setSAXversion(versionComboBox.getSelectedIndex() + 1); 127 model.setJAXPversion(jaxpVersionComboBox.getSelectedIndex() + 1); 128 model.setPropagateSAX(propagateSAXCheckBox.isSelected()); 129 } 130 131 protected void initView() { 132 initComponents(); 133 134 jaxpLabel.setDisplayedMnemonic(Util.THIS.getChar("SAXGeneratorVersionPanel.jaxpLabel.mne")); versionLabel.setDisplayedMnemonic(Util.THIS.getChar("SAXGeneratorCustomizer.versionLabel.mne")); propagateSAXCheckBox.setMnemonic(Util.THIS.getChar("SAXGeneratorVersionPanel.propagateSAXCheckBox.mne")); 140 String items[] = new String [] {"SAX 1.0", "SAX 2.0"}; ComboBoxModel cbModel = new DefaultComboBoxModel(items); 142 versionComboBox.setModel(cbModel); 143 cbModel.setSelectedItem(items[model.getSAXversion() - 1]); 144 145 items = new String [] {"JAXP 1.0", "JAXP 1.1"}; cbModel = new DefaultComboBoxModel(items); 147 jaxpVersionComboBox.setModel(cbModel); 148 cbModel.setSelectedItem(items[model.getJAXPversion() - 1]); 149 150 initAccessibility(); 151 } 152 153 protected void updateView() { 154 } 155 156 public void actionPerformed(java.awt.event.ActionEvent p1) { 157 updateModel(); 158 } 159 160 private javax.swing.JComboBox jaxpVersionComboBox; 162 private javax.swing.JTextArea descTextArea; 163 private javax.swing.JLabel versionLabel; 164 private javax.swing.JCheckBox propagateSAXCheckBox; 165 private javax.swing.JLabel jaxpLabel; 166 private javax.swing.JComboBox versionComboBox; 167 169 171 public void initAccessibility(){ 172 173 propagateSAXCheckBox.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_propagateSAXCheckBox")); 174 propagateSAXCheckBox.getAccessibleContext().setAccessibleName(Util.THIS.getString("ACSN_propagateSAXCheckBox")); 175 176 jaxpVersionComboBox.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_jaxpVersionComboBox")); 177 propagateSAXCheckBox.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_propagateSAXCheckBox")); 178 179 versionComboBox.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_versionComboBox")); 180 181 this.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_SAXGeneratorVersionPanel")); 182 } 183 } 184 | Popular Tags |