1 19 20 package org.netbeans.modules.websvc.core.webservices.ui.panels; 21 22 import javax.swing.JPanel ; 23 import javax.swing.JLabel ; 24 import javax.swing.JComboBox ; 25 import org.openide.util.NbBundle; 26 import java.awt.GridBagLayout ; 27 import java.awt.GridBagConstraints ; 28 import java.awt.Insets ; 29 import java.awt.Dimension ; 30 31 public class EnterWSDLUrlPanel extends JPanel { 32 private String defaultWSDLUrl; 33 34 public EnterWSDLUrlPanel(String defaultWSDLUrl) { 35 this.defaultWSDLUrl = defaultWSDLUrl; 36 initComponents(); 37 populateWSDLUrls(); 38 39 } 40 41 private void populateWSDLUrls() { 42 String [] urls = new String []{defaultWSDLUrl}; for(int i = 0; i < urls.length; i++) { 44 wsdlURLComboBox.addItem(urls[i]); 45 } 46 } 47 48 public String getSelectedWSDLUrl() { 49 return wsdlURLComboBox.getSelectedItem().toString(); 50 } 51 52 private void initComponents() { 53 inputLabel = new JLabel (NbBundle.getMessage(EnterWSDLUrlPanel.class, "LBL_Input_WSDL_Url")); 54 wsdlURLComboBox = new JComboBox (); 55 wsdlURLComboBox.setEditable(true); 56 57 setLayout(new GridBagLayout ()); 58 GridBagConstraints gbc = new GridBagConstraints (); 59 gbc.gridx = 0; 60 gbc.gridy = 0; 61 gbc.insets = new Insets (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 inputLabel; 71 private JComboBox wsdlURLComboBox; 72 73 } 74 | Popular Tags |