1 19 20 package org.netbeans.modules.j2ee.ddloaders.web.multiview; 21 22 29 public class ResEnvRefPanel extends javax.swing.JPanel { 30 31 32 public ResEnvRefPanel() { 33 initComponents(); 34 org.netbeans.modules.xml.multiview.Utils.makeTextAreaLikeTextField(descriptionTA, nameTF); 35 } 36 37 void setResEnvRefName(String name) { 38 nameTF.setText(name); 39 } 40 41 void setResEnvRefType(String value) { 42 typeCB.setSelectedItem(value); 43 } 44 45 void setDescription(String value) { 46 descriptionTA.setText(value); 47 } 48 49 String getResEnvRefName() { 50 return nameTF.getText(); 51 } 52 53 String getResEnvRefType() { 54 return (String )typeCB.getEditor().getItem(); 55 } 56 57 String getDescription() { 58 return descriptionTA.getText(); 59 } 60 61 javax.swing.JTextField getNameTF() { 62 return nameTF; 63 } 64 65 javax.swing.JTextField getTypeTF() { 66 return (javax.swing.JTextField )typeCB.getEditor().getEditorComponent(); 67 } 68 69 74 private void initComponents() { 76 java.awt.GridBagConstraints gridBagConstraints; 77 78 buttonGroup1 = new javax.swing.ButtonGroup (); 79 nameLabel = new javax.swing.JLabel (); 80 nameTF = new javax.swing.JTextField (); 81 typeLabel = new javax.swing.JLabel (); 82 typeCB = new javax.swing.JComboBox (); 83 descriptionLabel = new javax.swing.JLabel (); 84 descriptionTA = new javax.swing.JTextArea (); 85 86 setLayout(new java.awt.GridBagLayout ()); 87 88 nameLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_ResRefName_mnem").charAt(0)); 89 nameLabel.setLabelFor(nameTF); 90 nameLabel.setText(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_ResRefName")); 91 gridBagConstraints = new java.awt.GridBagConstraints (); 92 gridBagConstraints.gridx = 0; 93 gridBagConstraints.gridy = 0; 94 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 95 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 96 add(nameLabel, gridBagConstraints); 97 98 nameTF.setColumns(20); 99 gridBagConstraints = new java.awt.GridBagConstraints (); 100 gridBagConstraints.gridx = 1; 101 gridBagConstraints.gridy = 0; 102 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 103 gridBagConstraints.weightx = 1.0; 104 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 105 add(nameTF, gridBagConstraints); 106 107 typeLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_ResType_mnem").charAt(0)); 108 typeLabel.setLabelFor(typeCB); 109 typeLabel.setText(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_ResType")); 110 gridBagConstraints = new java.awt.GridBagConstraints (); 111 gridBagConstraints.gridx = 0; 112 gridBagConstraints.gridy = 1; 113 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 114 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 115 add(typeLabel, gridBagConstraints); 116 117 typeCB.setEditable(true); 118 typeCB.setModel(new javax.swing.DefaultComboBoxModel (new String [] { "javax.jms.Queue", "javax.jms.Topic" })); 119 gridBagConstraints = new java.awt.GridBagConstraints (); 120 gridBagConstraints.gridx = 1; 121 gridBagConstraints.gridy = 1; 122 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 123 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 124 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 125 add(typeCB, gridBagConstraints); 126 127 descriptionLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_description_mnem").charAt(0)); 128 descriptionLabel.setLabelFor(descriptionTA); 129 descriptionLabel.setText(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_description")); 130 gridBagConstraints = new java.awt.GridBagConstraints (); 131 gridBagConstraints.gridx = 0; 132 gridBagConstraints.gridy = 2; 133 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 134 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 0); 135 add(descriptionLabel, gridBagConstraints); 136 137 descriptionTA.setRows(3); 138 gridBagConstraints = new java.awt.GridBagConstraints (); 139 gridBagConstraints.gridx = 1; 140 gridBagConstraints.gridy = 2; 141 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 142 gridBagConstraints.insets = new java.awt.Insets (5, 12, 0, 12); 143 add(descriptionTA, gridBagConstraints); 144 145 } 146 148 149 private javax.swing.ButtonGroup buttonGroup1; 151 private javax.swing.JLabel descriptionLabel; 152 private javax.swing.JTextArea descriptionTA; 153 private javax.swing.JLabel nameLabel; 154 private javax.swing.JTextField nameTF; 155 private javax.swing.JComboBox typeCB; 156 private javax.swing.JLabel typeLabel; 157 159 } 160 | Popular Tags |