KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > customizers > webservice > WebServicesCustomizer


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 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.webservice;
20
21 import java.util.ResourceBundle JavaDoc;
22
23 import org.netbeans.modules.j2ee.sun.share.configbean.WebServices;
24 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.BaseCustomizer;
25
26
27 /**
28  *
29  * @author Peter Williams
30  */

31 public class WebServicesCustomizer extends BaseCustomizer {
32
33     static final ResourceBundle JavaDoc bundle = ResourceBundle.getBundle(
34        "org.netbeans.modules.j2ee.sun.share.configbean.customizers.webservice.Bundle"); // NOI18N
35

36     /** The bean currently being customized, or null if there isn't one
37      */

38     private WebServices theBean;
39
40     /** Creates new form ServiceRefCustomizer */
41     public WebServicesCustomizer() {
42         initComponents();
43         initUserComponents();
44     }
45
46     public WebServices getBean() {
47         return theBean;
48     }
49
50     /** This method is called from within the constructor to
51      * initialize the form.
52      * WARNING: Do NOT modify this code. The content of this method is
53      * always regenerated by the Form Editor.
54      */

55     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
56
private void initComponents() {
57         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
58
59         jLblWebServicesDescription = new javax.swing.JLabel JavaDoc();
60         jPnlFiller = new javax.swing.JPanel JavaDoc();
61
62         setLayout(new java.awt.GridBagLayout JavaDoc());
63
64         jLblWebServicesDescription.setText(bundle.getString("LBL_WebServiceCustomizerDescription"));
65         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
66         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
67         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
68         gridBagConstraints.weightx = 1.0;
69         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 6, 5, 5);
70         add(jLblWebServicesDescription, gridBagConstraints);
71
72         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
73         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
74         gridBagConstraints.weightx = 1.0;
75         gridBagConstraints.weighty = 1.0;
76         add(jPnlFiller, gridBagConstraints);
77
78     }// </editor-fold>//GEN-END:initComponents
79

80     // Variables declaration - do not modify//GEN-BEGIN:variables
81
private javax.swing.JLabel JavaDoc jLblWebServicesDescription;
82     private javax.swing.JPanel JavaDoc jPnlFiller;
83     // End of variables declaration//GEN-END:variables
84

85     private void initUserComponents() {
86         // Add title panel
87
addTitlePanel(bundle.getString("TITLE_WebServices"));
88         getAccessibleContext().setAccessibleName(bundle.getString("ACSN_WebServices")); // NOI18N
89
getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_WebServices")); // NOI18N
90

91         // insert user defined panels here.
92

93         // Add error panel
94
addErrorPanel();
95     }
96
97     protected void initFields() {
98     }
99
100     protected void addListeners() {
101         super.addListeners();
102     }
103     
104     protected void removeListeners() {
105         super.removeListeners();
106     }
107     
108     protected boolean setBean(Object JavaDoc bean) {
109         boolean result = super.setBean(bean);
110
111         if(bean instanceof WebServices) {
112             theBean = (WebServices) bean;
113             result = true;
114         } else {
115             // if bean is not a WebServices, then it shouldn't have passed Base either.
116
assert (result == false) :
117                 "WebServicesCustomizer was passed wrong bean type in setBean(Object bean)"; // NOI18N
118

119             theBean = null;
120             result = false;
121         }
122
123         return result;
124     }
125
126     public String JavaDoc getHelpId() {
127         return "AS_CFG_WebServices"; // NOI18N
128
}
129 }
130
Popular Tags