KickJava   Java API By Example, From Geeks To Geeks.

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


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  * ResEnvRefPanel.java
24  * Panel for adding/editing resource env. references
25  *
26  * Created on April 11, 2005
27  * @author mkuchtiak
28  */

29 public class ResEnvRefPanel extends javax.swing.JPanel JavaDoc {
30
31     /** Creates new form ResRefPanel */
32     public ResEnvRefPanel() {
33         initComponents();
34         org.netbeans.modules.xml.multiview.Utils.makeTextAreaLikeTextField(descriptionTA, nameTF);
35     }
36
37     void setResEnvRefName(String JavaDoc name) {
38         nameTF.setText(name);
39     }
40
41     void setResEnvRefType(String JavaDoc value) {
42         typeCB.setSelectedItem(value);
43     }
44     
45     void setDescription(String JavaDoc value) {
46         descriptionTA.setText(value);
47     }
48     
49     String JavaDoc getResEnvRefName() {
50         return nameTF.getText();
51     }
52     
53     String JavaDoc getResEnvRefType() {
54         return (String JavaDoc)typeCB.getEditor().getItem();
55     }
56     
57     String JavaDoc getDescription() {
58         return descriptionTA.getText();
59     }
60     
61     javax.swing.JTextField JavaDoc getNameTF() {
62         return nameTF;
63     }
64     
65     javax.swing.JTextField JavaDoc getTypeTF() {
66         return (javax.swing.JTextField JavaDoc)typeCB.getEditor().getEditorComponent();
67     }
68     
69     /** This method is called from within the constructor to
70      * initialize the form.
71      * WARNING: Do NOT modify this code. The content of this method is
72      * always regenerated by the Form Editor.
73      */

74     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
75
private void initComponents() {
76         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
77
78         buttonGroup1 = new javax.swing.ButtonGroup JavaDoc();
79         nameLabel = new javax.swing.JLabel JavaDoc();
80         nameTF = new javax.swing.JTextField JavaDoc();
81         typeLabel = new javax.swing.JLabel JavaDoc();
82         typeCB = new javax.swing.JComboBox JavaDoc();
83         descriptionLabel = new javax.swing.JLabel JavaDoc();
84         descriptionTA = new javax.swing.JTextArea JavaDoc();
85
86         setLayout(new java.awt.GridBagLayout JavaDoc());
87
88         nameLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_ResRefName_mnem").charAt(0));
89         nameLabel.setLabelFor(nameTF);
90         nameLabel.setText(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_ResRefName"));
91         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
92         gridBagConstraints.gridx = 0;
93         gridBagConstraints.gridy = 0;
94         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
95         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
96         add(nameLabel, gridBagConstraints);
97
98         nameTF.setColumns(20);
99         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
100         gridBagConstraints.gridx = 1;
101         gridBagConstraints.gridy = 0;
102         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
103         gridBagConstraints.weightx = 1.0;
104         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
105         add(nameTF, gridBagConstraints);
106
107         typeLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_ResType_mnem").charAt(0));
108         typeLabel.setLabelFor(typeCB);
109         typeLabel.setText(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_ResType"));
110         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
111         gridBagConstraints.gridx = 0;
112         gridBagConstraints.gridy = 1;
113         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
114         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
115         add(typeLabel, gridBagConstraints);
116
117         typeCB.setEditable(true);
118         typeCB.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "javax.jms.Queue", "javax.jms.Topic" }));
119         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
120         gridBagConstraints.gridx = 1;
121         gridBagConstraints.gridy = 1;
122         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
123         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
124         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
125         add(typeCB, gridBagConstraints);
126
127         descriptionLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_description_mnem").charAt(0));
128         descriptionLabel.setLabelFor(descriptionTA);
129         descriptionLabel.setText(org.openide.util.NbBundle.getMessage(ResEnvRefPanel.class, "LBL_description"));
130         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
131         gridBagConstraints.gridx = 0;
132         gridBagConstraints.gridy = 2;
133         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
134         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
135         add(descriptionLabel, gridBagConstraints);
136
137         descriptionTA.setRows(3);
138         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
139         gridBagConstraints.gridx = 1;
140         gridBagConstraints.gridy = 2;
141         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
142         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
143         add(descriptionTA, gridBagConstraints);
144
145     }
146     // </editor-fold>//GEN-END:initComponents
147

148     
149     // Variables declaration - do not modify//GEN-BEGIN:variables
150
private javax.swing.ButtonGroup JavaDoc buttonGroup1;
151     private javax.swing.JLabel JavaDoc descriptionLabel;
152     private javax.swing.JTextArea JavaDoc descriptionTA;
153     private javax.swing.JLabel JavaDoc nameLabel;
154     private javax.swing.JTextField JavaDoc nameTF;
155     private javax.swing.JComboBox JavaDoc typeCB;
156     private javax.swing.JLabel JavaDoc typeLabel;
157     // End of variables declaration//GEN-END:variables
158

159 }
160
Popular Tags