1 19 20 package org.netbeans.modules.websvc.core.jaxws.nodes; 21 22 import org.openide.DialogDisplayer; 23 import org.openide.NotifyDescriptor; 24 import org.openide.util.NbBundle; 25 26 30 public class RefreshClientDialog extends javax.swing.JPanel { 31 32 static final int CLOSE = 0; 33 static final int DO_NOTHING = 1; 34 static final int DOWNLOAD_WSDL = 2; 35 36 private String url; 37 38 private RefreshClientDialog(String url) { 39 this.url=url; 40 initComponents(); 41 } 42 43 public static int open(String url) { 44 String title = NbBundle.getMessage(RefreshClientDialog.class, "MSG_ConfirmClientRefresh"); 45 RefreshClientDialog delDialog = new RefreshClientDialog(url); 46 NotifyDescriptor desc = new NotifyDescriptor.Confirmation(delDialog, title, NotifyDescriptor.YES_NO_OPTION); 47 Object result = DialogDisplayer.getDefault().notify(desc); 48 if (result.equals(NotifyDescriptor.CLOSED_OPTION)) { 49 return CLOSE; 50 } else if (result.equals(NotifyDescriptor.NO_OPTION)) { 51 return CLOSE; 52 } else if (delDialog.downloadWsdl()) { 53 return DOWNLOAD_WSDL; 54 } 55 else return DO_NOTHING; 56 57 } 58 59 private boolean downloadWsdl() { 60 return downloadWsdlCheckBox.isSelected(); 61 } 62 63 68 private void initComponents() { 70 java.awt.GridBagConstraints gridBagConstraints; 71 72 downloadWsdlCheckBox = new javax.swing.JCheckBox (); 73 jLabel1 = new javax.swing.JLabel (); 74 jLabel3 = new javax.swing.JLabel (); 75 76 setLayout(new java.awt.GridBagLayout ()); 77 78 downloadWsdlCheckBox.setMnemonic(org.openide.util.NbBundle.getMessage(RefreshClientDialog.class, "MSG_DownloadWsdl_mnem").charAt(0)); 79 downloadWsdlCheckBox.setText(org.openide.util.NbBundle.getMessage(RefreshClientDialog.class, "MSG_DownloadWsdl", new Object [] {url})); 80 gridBagConstraints = new java.awt.GridBagConstraints (); 81 gridBagConstraints.gridx = 0; 82 gridBagConstraints.gridy = 1; 83 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 84 gridBagConstraints.weightx = 1.0; 85 add(downloadWsdlCheckBox, gridBagConstraints); 86 87 jLabel1.setText(org.openide.util.NbBundle.getMessage(RefreshClientDialog.class, "HINT_DownloadWsdl")); 88 gridBagConstraints = new java.awt.GridBagConstraints (); 89 gridBagConstraints.gridx = 0; 90 gridBagConstraints.gridy = 2; 91 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 92 gridBagConstraints.insets = new java.awt.Insets (0, 22, 0, 0); 93 add(jLabel1, gridBagConstraints); 94 95 jLabel3.setText(org.openide.util.NbBundle.getMessage(RefreshClientDialog.class, "HINT_RefreshClient")); 96 gridBagConstraints = new java.awt.GridBagConstraints (); 97 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 98 gridBagConstraints.insets = new java.awt.Insets (0, 0, 20, 0); 99 add(jLabel3, gridBagConstraints); 100 101 } 103 104 private javax.swing.JCheckBox downloadWsdlCheckBox; 106 private javax.swing.JLabel jLabel1; 107 private javax.swing.JLabel jLabel3; 108 110 } 111 | Popular Tags |