1 19 20 25 26 package org.netbeans.modules.xml.wsdl.ui.view; 27 28 import java.util.HashMap ; 29 import java.util.List ; 30 import java.util.Map ; 31 32 import javax.swing.JComboBox ; 33 import javax.swing.JPanel ; 34 import javax.swing.JTextField ; 35 import javax.swing.text.Document ; 36 37 import org.netbeans.api.project.Project; 38 import org.netbeans.modules.xml.wsdl.model.WSDLModel; 39 40 41 45 public class NotificationOperationPanel extends javax.swing.JPanel implements OperationConfigurationPanel.OperationConfiguration { 46 47 private Project mProject = null; 48 private Document mCommonOperationTextFieldDocument; 49 private Map <String , String > namespaceToPrefixMap = new HashMap <String , String >(); 50 private boolean mIsShowMessageComboBoxes = false; 51 private WSDLModel mModel; 52 53 55 56 57 58 public NotificationOperationPanel(Project project, 59 Document operationNameTextFieldDocument, 60 Map <String , String > namespaceToPrefixMap, 61 boolean isShowMessageComboBoxes, WSDLModel model) { 62 this.mProject = project; 63 this.mCommonOperationTextFieldDocument = operationNameTextFieldDocument; 64 this.namespaceToPrefixMap = namespaceToPrefixMap; 65 this.mIsShowMessageComboBoxes = isShowMessageComboBoxes; 66 mModel = model; 67 initComponents(); 68 initGUI(); 69 } 70 71 73 public NotificationOperationPanel() { 74 initComponents(); 75 initGUI(); 76 } 77 78 83 private void initComponents() { 85 OperationNameLabel = new javax.swing.JLabel (); 86 operationNameTextField = new javax.swing.JTextField (); 87 if(mCommonOperationTextFieldDocument != null) { 88 operationNameTextField.setDocument(mCommonOperationTextFieldDocument); 89 } 90 operationTypeLabel = new javax.swing.JLabel (); 91 operationTypeComboBox = new javax.swing.JComboBox (); 92 jLabel1 = new javax.swing.JLabel (); 93 jPanel1 = new javax.swing.JPanel (); 94 outputMessagePartsConfigurationTable = new org.netbeans.modules.xml.wsdl.ui.view.CommonMessageConfigurationPanel(mProject, namespaceToPrefixMap, mModel); 95 outputMessageNameConfigurationPanel1 = new MessageNameConfigurationPanel(outputMessagePartsConfigurationTable); 96 97 OperationNameLabel.setLabelFor(operationNameTextField); 98 org.openide.awt.Mnemonics.setLocalizedText(OperationNameLabel, org.openide.util.NbBundle.getMessage(NotificationOperationPanel.class, "NotificationOperationPanel.OperationNameLabel.text")); 100 operationTypeLabel.setLabelFor(operationTypeComboBox); 101 org.openide.awt.Mnemonics.setLocalizedText(operationTypeLabel, org.openide.util.NbBundle.getMessage(NotificationOperationPanel.class, "NotificationOperationPanel.operationTypeLabel.text")); 103 operationTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel (new String [] { "Request-Response Operation", "One-Way Operation" })); 104 105 org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(NotificationOperationPanel.class, "NotificationOperationPanel.jLabel1.text")); 107 org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); 108 jPanel1.setLayout(jPanel1Layout); 109 jPanel1Layout.setHorizontalGroup( 110 jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 111 .add(outputMessagePartsConfigurationTable, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 354, Short.MAX_VALUE) 112 .add(outputMessageNameConfigurationPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 354, Short.MAX_VALUE) 113 ); 114 jPanel1Layout.setVerticalGroup( 115 jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 116 .add(jPanel1Layout.createSequentialGroup() 117 .add(outputMessageNameConfigurationPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 118 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 119 .add(outputMessagePartsConfigurationTable, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 120 .add(20, 20, 20)) 121 ); 122 123 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); 124 this.setLayout(layout); 125 layout.setHorizontalGroup( 126 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 127 .add(layout.createSequentialGroup() 128 .addContainerGap() 129 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 130 .add(OperationNameLabel) 131 .add(operationTypeLabel) 132 .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 133 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 134 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) 135 .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 136 .add(org.jdesktop.layout.GroupLayout.LEADING, operationTypeComboBox, 0, 354, Short.MAX_VALUE) 137 .add(org.jdesktop.layout.GroupLayout.LEADING, operationNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 354, Short.MAX_VALUE)) 138 .addContainerGap()) 139 ); 140 layout.setVerticalGroup( 141 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 142 .add(layout.createSequentialGroup() 143 .addContainerGap() 144 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 145 .add(OperationNameLabel) 146 .add(operationNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 147 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 148 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 149 .add(operationTypeLabel) 150 .add(operationTypeComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 151 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 152 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 153 .add(jLabel1) 154 .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 155 .add(97, 97, 97)) 156 ); 157 } 159 160 public void setOutputMessages(String [] existingMessages, String newMessageName, javax.swing.event.DocumentListener msgNameDocumentListener) { 161 outputMessageNameConfigurationPanel1.setMessages(existingMessages, newMessageName, msgNameDocumentListener); 162 } 163 164 public boolean isNewOutputMessage() { 165 return outputMessageNameConfigurationPanel1.isNewMessage(); 166 } 167 168 public boolean isNewInputMessage() { 169 return false; 170 } 171 172 173 public boolean isNewFaultMessage() { 174 return false; 175 } 176 177 public String getOutputMessageName() { 178 return this.outputMessageNameConfigurationPanel1.getMessageName(); 179 } 180 181 182 public String getInputMessageName() { 183 return null; 184 } 185 186 187 public String getFaultMessageName() { 188 return null; 189 } 190 191 public String getOperationName() { 192 return this.operationNameTextField.getText(); 193 } 194 195 public void setOperationName(String operationName) { 196 this.operationNameTextField.setText(operationName); 197 } 198 199 public OperationType getOperationType() { 200 return (OperationType) this.operationTypeComboBox.getSelectedItem(); 201 } 202 203 public JComboBox getOperationTypeComboBox() { 204 return this.operationTypeComboBox; 205 } 206 207 public List <PartAndElementOrTypeTableModel.PartAndElementOrType> getInputMessageParts() { 208 return null; 209 } 210 211 public List <PartAndElementOrTypeTableModel.PartAndElementOrType> getOutputMessageParts() { 212 return outputMessagePartsConfigurationTable.getPartAndElementOrType(); 213 } 214 215 public List <PartAndElementOrTypeTableModel.PartAndElementOrType> getFaultMessageParts() { 216 return null; 217 } 218 219 private void initGUI() { 220 outputMessagePartsConfigurationTable.addNewRow(); 221 outputMessagePartsConfigurationTable.clearSelection(); 222 outputMessageNameConfigurationPanel1.setVisible(this.mIsShowMessageComboBoxes); 223 if (mIsShowMessageComboBoxes) { 224 jLabel1.setLabelFor(outputMessageNameConfigurationPanel1); 225 } else { 226 jLabel1.setLabelFor(outputMessagePartsConfigurationTable); 227 } 228 } 229 230 public JTextField getOperationNameTextField() { 231 return this.operationNameTextField; 232 } 233 234 235 public static void main(String [] args) { 236 237 244 245 } 246 247 private OperationType selectedOperationType; 248 private JPanel operationCardPanel; 249 250 private javax.swing.JLabel OperationNameLabel; 252 private javax.swing.JLabel jLabel1; 253 private javax.swing.JPanel jPanel1; 254 private javax.swing.JTextField operationNameTextField; 255 private javax.swing.JComboBox operationTypeComboBox; 256 private javax.swing.JLabel operationTypeLabel; 257 private org.netbeans.modules.xml.wsdl.ui.view.MessageNameConfigurationPanel outputMessageNameConfigurationPanel1; 258 private org.netbeans.modules.xml.wsdl.ui.view.CommonMessageConfigurationPanel outputMessagePartsConfigurationTable; 259 261 } 262 | Popular Tags |