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 OneWayOperationPanel 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 public OneWayOperationPanel(Project project, 56 Document operationNameTextFieldDocument, 57 Map <String , String > namespaceToPrefixMap, 58 boolean isShowMessageComboBoxes, WSDLModel model) { 59 this.mProject = project; 60 this.mCommonOperationTextFieldDocument = operationNameTextFieldDocument; 61 this.namespaceToPrefixMap = namespaceToPrefixMap; 62 this.mIsShowMessageComboBoxes = isShowMessageComboBoxes; 63 mModel = model; 64 initComponents(); 65 initGUI(); 66 } 67 68 70 public OneWayOperationPanel() { 71 initComponents(); 72 initGUI(); 73 } 74 75 80 private void initComponents() { 82 OperationNameLabel = new javax.swing.JLabel (); 83 operationNameTextField = new javax.swing.JTextField (); 84 if(mCommonOperationTextFieldDocument != null) { 85 operationNameTextField.setDocument(mCommonOperationTextFieldDocument); 86 } 87 operationTypeLabel = new javax.swing.JLabel (); 88 operationTypeComboBox = new javax.swing.JComboBox (); 89 jLabel1 = new javax.swing.JLabel (); 90 jPanel1 = new javax.swing.JPanel (); 91 inputMessagePartsConfigurationTable = new org.netbeans.modules.xml.wsdl.ui.view.CommonMessageConfigurationPanel(mProject, namespaceToPrefixMap, mModel); 92 inputMessageNameConfigurationPanel1 = new MessageNameConfigurationPanel(this.inputMessagePartsConfigurationTable); 93 94 OperationNameLabel.setLabelFor(operationNameTextField); 95 org.openide.awt.Mnemonics.setLocalizedText(OperationNameLabel, org.openide.util.NbBundle.getMessage(OneWayOperationPanel.class, "OneWayOperationPanel.OperationNameLabel.text")); 97 operationTypeLabel.setLabelFor(operationTypeComboBox); 98 org.openide.awt.Mnemonics.setLocalizedText(operationTypeLabel, org.openide.util.NbBundle.getMessage(OneWayOperationPanel.class, "OneWayOperationPanel.operationTypeLabel.text")); 100 operationTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel (new String [] { "Request-Response Operation", "One-Way Operation" })); 101 102 jLabel1.setLabelFor(inputMessageNameConfigurationPanel1); 103 org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(OneWayOperationPanel.class, "OneWayOperationPanel.jLabel1.text")); 105 org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); 106 jPanel1.setLayout(jPanel1Layout); 107 jPanel1Layout.setHorizontalGroup( 108 jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 109 .add(inputMessagePartsConfigurationTable, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 344, Short.MAX_VALUE) 110 .add(inputMessageNameConfigurationPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE) 111 ); 112 jPanel1Layout.setVerticalGroup( 113 jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 114 .add(jPanel1Layout.createSequentialGroup() 115 .add(inputMessageNameConfigurationPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 116 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 117 .add(inputMessagePartsConfigurationTable, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 118 .add(22, 22, 22)) 119 ); 120 121 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); 122 this.setLayout(layout); 123 layout.setHorizontalGroup( 124 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 125 .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() 126 .addContainerGap() 127 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 128 .add(OperationNameLabel) 129 .add(operationTypeLabel) 130 .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 131 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 132 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) 133 .add(org.jdesktop.layout.GroupLayout.LEADING, operationTypeComboBox, 0, 344, Short.MAX_VALUE) 134 .add(org.jdesktop.layout.GroupLayout.LEADING, operationNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE) 135 .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 136 .addContainerGap()) 137 ); 138 layout.setVerticalGroup( 139 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 140 .add(layout.createSequentialGroup() 141 .addContainerGap() 142 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 143 .add(OperationNameLabel) 144 .add(operationNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 145 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 146 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 147 .add(operationTypeLabel) 148 .add(operationTypeComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 149 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 150 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 151 .add(jLabel1) 152 .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 153 .add(78, 78, 78)) 154 ); 155 } 157 158 public void setInputMessages(String [] existingMessages, String newMessageName, javax.swing.event.DocumentListener msgNameDocumentListener) { 159 inputMessageNameConfigurationPanel1.setMessages(existingMessages, newMessageName, msgNameDocumentListener); 160 } 161 162 public boolean isNewInputMessage() { 163 return inputMessageNameConfigurationPanel1.isNewMessage(); 164 } 165 166 public boolean isNewOutputMessage() { 167 return false; 168 } 169 170 171 public boolean isNewFaultMessage() { 172 return false; 173 } 174 175 public String getOutputMessageName() { 176 return null; 177 } 178 179 180 public String getInputMessageName() { 181 return this.inputMessageNameConfigurationPanel1.getMessageName(); 182 } 183 184 185 public String getFaultMessageName() { 186 return null; 187 } 188 189 public String getOperationName() { 190 return this.operationNameTextField.getText(); 191 } 192 193 public void setOperationName(String operationName) { 194 this.operationNameTextField.setText(operationName); 195 } 196 197 public OperationType getOperationType() { 198 return (OperationType) this.operationTypeComboBox.getSelectedItem(); 199 } 200 201 public JComboBox getOperationTypeComboBox() { 202 return this.operationTypeComboBox; 203 } 204 205 public List <PartAndElementOrTypeTableModel.PartAndElementOrType> getInputMessageParts() { 206 return inputMessagePartsConfigurationTable.getPartAndElementOrType(); 207 } 208 209 public List <PartAndElementOrTypeTableModel.PartAndElementOrType> getOutputMessageParts() { 210 return null; 211 } 212 213 public List <PartAndElementOrTypeTableModel.PartAndElementOrType> getFaultMessageParts() { 214 return null; 215 } 216 217 private void initGUI() { 218 inputMessagePartsConfigurationTable.addNewRow(); 219 inputMessagePartsConfigurationTable.clearSelection(); 220 inputMessageNameConfigurationPanel1.setVisible(this.mIsShowMessageComboBoxes); 221 if (mIsShowMessageComboBoxes) { 222 jLabel1.setLabelFor(inputMessageNameConfigurationPanel1); 223 } else { 224 jLabel1.setLabelFor(inputMessagePartsConfigurationTable); 225 } 226 } 227 228 public JTextField getOperationNameTextField() { 229 return this.operationNameTextField; 230 } 231 232 233 public static void main(String [] args) { 234 235 241 242 243 } 244 245 private OperationType selectedOperationType; 246 private JPanel operationCardPanel; 247 248 private javax.swing.JLabel OperationNameLabel; 250 private org.netbeans.modules.xml.wsdl.ui.view.MessageNameConfigurationPanel inputMessageNameConfigurationPanel1; 251 private org.netbeans.modules.xml.wsdl.ui.view.CommonMessageConfigurationPanel inputMessagePartsConfigurationTable; 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 259 } 260 | Popular Tags |