KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdl > ui > view > PortTypeConfigurationPanel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 /*
21  * PortTypeConfigurationPanel.java
22  *
23  * Created on August 25, 2006, 1:17 PM
24  */

25
26 package org.netbeans.modules.xml.wsdl.ui.view;
27
28 import java.util.HashMap JavaDoc;
29 import java.util.List JavaDoc;
30 import java.util.Map JavaDoc;
31 import javax.swing.JTextField JavaDoc;
32
33 import org.netbeans.api.project.Project;
34 import org.netbeans.modules.xml.wsdl.model.WSDLModel;
35 import org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent;
36
37 /**
38  *
39  * @author radval
40  */

41 public class PortTypeConfigurationPanel extends javax.swing.JPanel JavaDoc {
42     
43     private Project mProject;
44     
45     private boolean mIsShowMessageComboBoxes = false;
46     
47     private WSDLModel mModel;
48     
49     /** Creates new form PortTypeConfigurationPanel */
50     public PortTypeConfigurationPanel(Project project) {
51         this(project, false, null);
52     }
53     
54     public PortTypeConfigurationPanel(Project project, boolean isShowMessageComboBoxes) {
55         mProject = project;
56         this.mIsShowMessageComboBoxes = isShowMessageComboBoxes;
57         initComponents();
58     }
59     
60     public PortTypeConfigurationPanel(Project project, boolean isShowMessageComboBoxes, WSDLModel model) {
61         mProject = project;
62         this.mIsShowMessageComboBoxes = isShowMessageComboBoxes;
63         mModel = model;
64         initComponents();
65     }
66     
67     /** Mattise require default constructor otherwise will not load in design view of mattise
68      **/

69     public PortTypeConfigurationPanel() {
70         initComponents();
71     }
72     
73     /** This method is called from within the constructor to
74      * initialize the form.
75      * WARNING: Do NOT modify this code. The content of this method is
76      * always regenerated by the Form Editor.
77      */

78     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
79
private void initComponents() {
80         portTypeNameLabel = new javax.swing.JLabel JavaDoc();
81         portTypeNameTextField = new javax.swing.JTextField JavaDoc();
82         operationConfigurationPanel1 = new org.netbeans.modules.xml.wsdl.ui.view.OperationConfigurationPanel(this.mProject, this.mIsShowMessageComboBoxes, mModel);
83
84         setFocusCycleRoot(true);
85         portTypeNameLabel.setLabelFor(portTypeNameTextField);
86         org.openide.awt.Mnemonics.setLocalizedText(portTypeNameLabel, org.openide.util.NbBundle.getMessage(PortTypeConfigurationPanel.class, "PortTypeConfigurationPanel.portTypeNameLabel.text"));
87
88         operationConfigurationPanel1.setFocusable(false);
89
90         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
91         this.setLayout(layout);
92         layout.setHorizontalGroup(
93             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
94             .add(layout.createSequentialGroup()
95                 .addContainerGap()
96                 .add(portTypeNameLabel)
97                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
98                 .add(portTypeNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
99                 .add(21, 21, 21))
100             .add(layout.createSequentialGroup()
101                 .add(operationConfigurationPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 584, Short.MAX_VALUE)
102                 .addContainerGap())
103         );
104         layout.setVerticalGroup(
105             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
106             .add(layout.createSequentialGroup()
107                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
108                     .add(portTypeNameLabel)
109                     .add(portTypeNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
110                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
111                 .add(operationConfigurationPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 377, Short.MAX_VALUE)
112                 .addContainerGap())
113         );
114     }// </editor-fold>//GEN-END:initComponents
115

116     
117     public void setInputMessages(String JavaDoc[] existingMessages, String JavaDoc newMessageName, javax.swing.event.DocumentListener JavaDoc msgNameDocumentListener) {
118         this.operationConfigurationPanel1.setInputMessages(existingMessages, newMessageName, msgNameDocumentListener);
119     }
120     
121     public void setOutputMessages(String JavaDoc[] existingMessages, String JavaDoc newMessageName, javax.swing.event.DocumentListener JavaDoc msgNameDocumentListener) {
122         this.operationConfigurationPanel1.setOutputMessages(existingMessages, newMessageName, msgNameDocumentListener);
123     }
124     
125     public void setFaultMessages(String JavaDoc[] existingMessages, String JavaDoc newMessageName, javax.swing.event.DocumentListener JavaDoc msgNameDocumentListener) {
126         this.operationConfigurationPanel1.setFaultMessages(existingMessages, newMessageName, msgNameDocumentListener);
127     }
128     
129     public boolean isNewOutputMessage() {
130        return operationConfigurationPanel1.isNewOutputMessage();
131     }
132     
133     public boolean isNewInputMessage() {
134        return operationConfigurationPanel1.isNewInputMessage();
135     }
136     
137     
138     public boolean isNewFaultMessage() {
139        return operationConfigurationPanel1.isNewFaultMessage();
140     }
141     
142     public String JavaDoc getPortTypeName() {
143         return this.portTypeNameTextField.getText();
144     }
145     
146     public void setPortTypeName(String JavaDoc portTypeName) {
147         this.portTypeNameTextField.setText(portTypeName);
148     }
149     
150     public String JavaDoc getOperationName() {
151         return this.operationConfigurationPanel1.getOperationName();
152     }
153     
154     public void setOperationName(String JavaDoc operationName) {
155         this.operationConfigurationPanel1.setOperationName(operationName);
156     }
157     
158     public OperationType getOperationType() {
159         return this.operationConfigurationPanel1.getOperationType();
160     }
161     
162     public Map JavaDoc<String JavaDoc, String JavaDoc> getNamespaceToPrefixMap() {
163         return operationConfigurationPanel1.getNamespaceToPrefixMap();
164     }
165     
166     public List JavaDoc<PartAndElementOrTypeTableModel.PartAndElementOrType> getInputMessageParts() {
167         return this.operationConfigurationPanel1.getInputMessageParts();
168     }
169         
170     public List JavaDoc<PartAndElementOrTypeTableModel.PartAndElementOrType> getOutputMessageParts() {
171         return this.operationConfigurationPanel1.getOutputMessageParts();
172     }
173
174     public List JavaDoc<PartAndElementOrTypeTableModel.PartAndElementOrType> getFaultMessageParts() {
175         return this.operationConfigurationPanel1.getFaultMessageParts();
176     }
177     
178      public String JavaDoc getNewOutputMessageName() {
179         return this.operationConfigurationPanel1.getOutputMessageName();
180     }
181     
182     
183     public String JavaDoc getNewInputMessageName() {
184         return this.operationConfigurationPanel1.getInputMessageName();
185     }
186
187
188     public String JavaDoc getNewFaultMessageName() {
189         return this.operationConfigurationPanel1.getFaultMessageName();
190     }
191     
192     public JTextField JavaDoc getPortTypeNameTextField() {
193         return this.portTypeNameTextField;
194     }
195     
196     public JTextField JavaDoc getOperationNameTextField() {
197         return this.operationConfigurationPanel1.getOperationNameTextField();
198     }
199     
200     public static void main(String JavaDoc[] args) {
201         
202 /* JFrame frame = new JFrame();
203         frame.getContentPane().setLayout(new BorderLayout());
204         PortTypeConfigurationPanel p = new PortTypeConfigurationPanel();
205         frame.getContentPane().add(p, BorderLayout.CENTER);
206         frame.setSize(200, 200);
207         frame.setVisible(true);*/

208         
209         
210     }
211     
212     // Variables declaration - do not modify//GEN-BEGIN:variables
213
private org.netbeans.modules.xml.wsdl.ui.view.OperationConfigurationPanel operationConfigurationPanel1;
214     private javax.swing.JLabel JavaDoc portTypeNameLabel;
215     private javax.swing.JTextField JavaDoc portTypeNameTextField;
216     // End of variables declaration//GEN-END:variables
217

218 }
219
Popular Tags