KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > core > webservices > ui > panels > EnterWSDLUrlPanel


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-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.websvc.core.webservices.ui.panels;
21
22 import javax.swing.JPanel JavaDoc;
23 import javax.swing.JLabel JavaDoc;
24 import javax.swing.JComboBox JavaDoc;
25 import org.openide.util.NbBundle;
26 import java.awt.GridBagLayout JavaDoc;
27 import java.awt.GridBagConstraints JavaDoc;
28 import java.awt.Insets JavaDoc;
29 import java.awt.Dimension JavaDoc;
30
31 public class EnterWSDLUrlPanel extends JPanel JavaDoc {
32     private String JavaDoc defaultWSDLUrl;
33
34     public EnterWSDLUrlPanel(String JavaDoc defaultWSDLUrl) {
35         this.defaultWSDLUrl = defaultWSDLUrl;
36         initComponents();
37         populateWSDLUrls();
38
39     }
40     
41     private void populateWSDLUrls() {
42         String JavaDoc[] urls = new String JavaDoc[]{defaultWSDLUrl}; //FIX-ME:what else shd we include?
43
for(int i = 0; i < urls.length; i++) {
44             wsdlURLComboBox.addItem(urls[i]);
45         }
46     }
47     
48     public String JavaDoc getSelectedWSDLUrl() {
49         return wsdlURLComboBox.getSelectedItem().toString();
50     }
51     
52     private void initComponents() {
53         inputLabel = new JLabel JavaDoc(NbBundle.getMessage(EnterWSDLUrlPanel.class, "LBL_Input_WSDL_Url"));
54         wsdlURLComboBox = new JComboBox JavaDoc();
55         wsdlURLComboBox.setEditable(true);
56         
57         setLayout(new GridBagLayout JavaDoc());
58         GridBagConstraints JavaDoc gbc = new GridBagConstraints JavaDoc();
59         gbc.gridx = 0;
60         gbc.gridy = 0;
61         gbc.insets = new Insets JavaDoc(6,6,6,6);
62         gbc.anchor = GridBagConstraints.WEST;
63         gbc.fill = GridBagConstraints.HORIZONTAL;
64         add(inputLabel, gbc);
65         gbc.gridy = 1;
66         gbc.weightx = 2.0;
67         add(wsdlURLComboBox, gbc);
68     }
69     
70     private JLabel JavaDoc inputLabel;
71     private JComboBox JavaDoc wsdlURLComboBox;
72     
73 }
74
Popular Tags