KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > ddloaders > web > multiview > ResRefPanel


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.j2ee.ddloaders.web.multiview;
21
22 /**
23  * ResRefPanel.java
24  * Panel for adding/editing resource references
25  *
26  * Created on April 11, 2005
27  * @author mkuchtiak
28  */

29 public class ResRefPanel extends javax.swing.JPanel JavaDoc {
30
31     /** Creates new form ResRefPanel */
32     public ResRefPanel() {
33         initComponents();
34         org.netbeans.modules.xml.multiview.Utils.makeTextAreaLikeTextField(descriptionTA, nameTF);
35     }
36
37     void setResRefName(String JavaDoc name) {
38         nameTF.setText(name);
39     }
40
41     void setResType(String JavaDoc value) {
42         typeCB.setSelectedItem(value);
43     }
44     
45     void setResAuth(String JavaDoc value) {
46         authCB.setSelectedItem(value);
47     }
48     
49     void setResScope(String JavaDoc value) {
50         scopeCB.setSelectedItem(value);
51     }
52     
53     void setDescription(String JavaDoc value) {
54         descriptionTA.setText(value);
55     }
56     
57     String JavaDoc getResRefName() {
58         return nameTF.getText();
59     }
60     
61     String JavaDoc getResType() {
62         return (String JavaDoc)typeCB.getEditor().getItem();
63     }
64     
65     String JavaDoc getResAuth() {
66         return (String JavaDoc)authCB.getSelectedItem();
67     }
68     
69     String JavaDoc getResScope() {
70         return (String JavaDoc)scopeCB.getSelectedItem();
71     }
72     
73     String JavaDoc getDescription() {
74         return descriptionTA.getText();
75     }
76     
77     javax.swing.JTextField JavaDoc getNameTF() {
78         return nameTF;
79     }
80     
81     javax.swing.JTextField JavaDoc getTypeTF() {
82         return (javax.swing.JTextField JavaDoc)typeCB.getEditor().getEditorComponent();
83     }
84     
85     /** This method is called from within the constructor to
86      * initialize the form.
87      * WARNING: Do NOT modify this code. The content of this method is
88      * always regenerated by the Form Editor.
89      */

90     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
91
private void initComponents() {
92         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
93
94         buttonGroup1 = new javax.swing.ButtonGroup JavaDoc();
95         nameLabel = new javax.swing.JLabel JavaDoc();
96         nameTF = new javax.swing.JTextField JavaDoc();
97         typeLabel = new javax.swing.JLabel JavaDoc();
98         typeCB = new javax.swing.JComboBox JavaDoc();
99         authLabel = new javax.swing.JLabel JavaDoc();
100         authCB = new javax.swing.JComboBox JavaDoc();
101         scopeLabel = new javax.swing.JLabel JavaDoc();
102         scopeCB = new javax.swing.JComboBox JavaDoc();
103         descriptionLabel = new javax.swing.JLabel JavaDoc();
104         descriptionTA = new javax.swing.JTextArea JavaDoc();
105
106         setLayout(new java.awt.GridBagLayout JavaDoc());
107
108         nameLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResRefName_mnem").charAt(0));
109         nameLabel.setLabelFor(nameTF);
110         nameLabel.setText(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResRefName"));
111         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
112         gridBagConstraints.gridx = 0;
113         gridBagConstraints.gridy = 0;
114         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
115         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
116         add(nameLabel, gridBagConstraints);
117
118         nameTF.setColumns(20);
119         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
120         gridBagConstraints.gridx = 1;
121         gridBagConstraints.gridy = 0;
122         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
123         gridBagConstraints.weightx = 1.0;
124         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
125         add(nameTF, gridBagConstraints);
126
127         typeLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResType_mnem").charAt(0));
128         typeLabel.setLabelFor(typeCB);
129         typeLabel.setText(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResType"));
130         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
131         gridBagConstraints.gridx = 0;
132         gridBagConstraints.gridy = 1;
133         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
134         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
135         add(typeLabel, gridBagConstraints);
136
137         typeCB.setEditable(true);
138         typeCB.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "javax.sql.DataSource", "javax.jms.ConnectionFactory", "javax.mail.Session", "java.net.URL" }));
139         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
140         gridBagConstraints.gridx = 1;
141         gridBagConstraints.gridy = 1;
142         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
143         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
144         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
145         add(typeCB, gridBagConstraints);
146
147         authLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResAuth_mnem").charAt(0));
148         authLabel.setLabelFor(authCB);
149         authLabel.setText(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResAuth"));
150         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
151         gridBagConstraints.gridx = 0;
152         gridBagConstraints.gridy = 2;
153         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
154         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
155         add(authLabel, gridBagConstraints);
156
157         authCB.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "Container", "Application" }));
158         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
159         gridBagConstraints.gridx = 1;
160         gridBagConstraints.gridy = 2;
161         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
162         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
163         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
164         add(authCB, gridBagConstraints);
165
166         scopeLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResSharingScope_mnem").charAt(0));
167         scopeLabel.setLabelFor(scopeCB);
168         scopeLabel.setText(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_ResSharingScope"));
169         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
170         gridBagConstraints.gridx = 0;
171         gridBagConstraints.gridy = 3;
172         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
173         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
174         add(scopeLabel, gridBagConstraints);
175
176         scopeCB.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "Shareable", "Unshareable" }));
177         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
178         gridBagConstraints.gridx = 1;
179         gridBagConstraints.gridy = 3;
180         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
181         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
182         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
183         add(scopeCB, gridBagConstraints);
184
185         descriptionLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_description_mnem").charAt(0));
186         descriptionLabel.setLabelFor(descriptionTA);
187         descriptionLabel.setText(org.openide.util.NbBundle.getMessage(ResRefPanel.class, "LBL_description"));
188         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
189         gridBagConstraints.gridx = 0;
190         gridBagConstraints.gridy = 4;
191         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
192         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
193         add(descriptionLabel, gridBagConstraints);
194
195         descriptionTA.setRows(3);
196         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
197         gridBagConstraints.gridx = 1;
198         gridBagConstraints.gridy = 4;
199         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
200         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
201         add(descriptionTA, gridBagConstraints);
202
203     }
204     // </editor-fold>//GEN-END:initComponents
205

206     
207     // Variables declaration - do not modify//GEN-BEGIN:variables
208
private javax.swing.JComboBox JavaDoc authCB;
209     private javax.swing.JLabel JavaDoc authLabel;
210     private javax.swing.ButtonGroup JavaDoc buttonGroup1;
211     private javax.swing.JLabel JavaDoc descriptionLabel;
212     private javax.swing.JTextArea JavaDoc descriptionTA;
213     private javax.swing.JLabel JavaDoc nameLabel;
214     private javax.swing.JTextField JavaDoc nameTF;
215     private javax.swing.JComboBox JavaDoc scopeCB;
216     private javax.swing.JLabel JavaDoc scopeLabel;
217     private javax.swing.JComboBox JavaDoc typeCB;
218     private javax.swing.JLabel JavaDoc typeLabel;
219     // End of variables declaration//GEN-END:variables
220

221 }
222
Popular Tags