KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > core > jaxws > nodes > RefreshClientDialog


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.jaxws.nodes;
21
22 import org.openide.DialogDisplayer;
23 import org.openide.NotifyDescriptor;
24 import org.openide.util.NbBundle;
25
26 /**
27  *
28  * @author Milan Kuchtiak
29  */

30 public class RefreshClientDialog extends javax.swing.JPanel JavaDoc {
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 JavaDoc url;
37     
38     private RefreshClientDialog(String JavaDoc url) {
39         this.url=url;
40         initComponents();
41     }
42
43     public static int open(String JavaDoc url) {
44         String JavaDoc 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 JavaDoc 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     /** This method is called from within the constructor to
64      * initialize the form.
65      * WARNING: Do NOT modify this code. The content of this method is
66      * always regenerated by the Form Editor.
67      */

68     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
69
private void initComponents() {
70         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
71
72         downloadWsdlCheckBox = new javax.swing.JCheckBox JavaDoc();
73         jLabel1 = new javax.swing.JLabel JavaDoc();
74         jLabel3 = new javax.swing.JLabel JavaDoc();
75
76         setLayout(new java.awt.GridBagLayout JavaDoc());
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 JavaDoc[] {url}));
80         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
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 JavaDoc();
89         gridBagConstraints.gridx = 0;
90         gridBagConstraints.gridy = 2;
91         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
92         gridBagConstraints.insets = new java.awt.Insets JavaDoc(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 JavaDoc();
97         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
98         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 20, 0);
99         add(jLabel3, gridBagConstraints);
100
101     }// </editor-fold>//GEN-END:initComponents
102

103     
104     // Variables declaration - do not modify//GEN-BEGIN:variables
105
private javax.swing.JCheckBox JavaDoc downloadWsdlCheckBox;
106     private javax.swing.JLabel JavaDoc jLabel1;
107     private javax.swing.JLabel JavaDoc jLabel3;
108     // End of variables declaration//GEN-END:variables
109

110 }
111
Popular Tags