KickJava   Java API By Example, From Geeks To Geeks.

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


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 import org.openide.util.NbBundle;
23
24 /**
25  * EnvEntryPanel.java
26  * Panel for adding/editing env entries
27  *
28  * Created on April 11, 2005
29  * @author mkuchtiak
30  */

31 public class EnvEntryPanel extends javax.swing.JPanel JavaDoc {
32
33     /** Creates new form FilterMappingPanel */
34     public EnvEntryPanel() {
35         initComponents();
36         org.netbeans.modules.xml.multiview.Utils.makeTextAreaLikeTextField(descriptionTA, nameTF);
37     }
38
39     void setEnvEntryName(String JavaDoc name) {
40         nameTF.setText(name);
41     }
42     
43     void setEnvEntryType(String JavaDoc type) {
44         typeCB.setSelectedItem(type);
45     }
46     
47     void setEnvEntryValue(String JavaDoc val) {
48         valueTF.setText(val);
49     }
50     
51     void setDescription(String JavaDoc val) {
52         descriptionTA.setText(val);
53     }
54     
55     String JavaDoc getEnvEntryName() {
56         return nameTF.getText();
57     }
58     
59     String JavaDoc getEnvEntryType() {
60         return (String JavaDoc)typeCB.getSelectedItem();
61     }
62     
63     String JavaDoc getEnvEntryValue() {
64         return valueTF.getText();
65     }
66     
67     String JavaDoc getDescription() {
68         return descriptionTA.getText();
69     }
70     
71     javax.swing.JTextField JavaDoc getNameTF() {
72         return nameTF;
73     }
74     
75     /** This method is called from within the constructor to
76      * initialize the form.
77      * WARNING: Do NOT modify this code. The content of this method is
78      * always regenerated by the Form Editor.
79      */

80     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
81
private void initComponents() {
82         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
83
84         buttonGroup1 = new javax.swing.ButtonGroup JavaDoc();
85         nameLabel = new javax.swing.JLabel JavaDoc();
86         nameTF = new javax.swing.JTextField JavaDoc();
87         typeLabel = new javax.swing.JLabel JavaDoc();
88         typeCB = new javax.swing.JComboBox JavaDoc();
89         valueLabel = new javax.swing.JLabel JavaDoc();
90         valueTF = new javax.swing.JTextField JavaDoc();
91         descriptionLabel = new javax.swing.JLabel JavaDoc();
92         descriptionTA = new javax.swing.JTextArea JavaDoc();
93
94         setLayout(new java.awt.GridBagLayout JavaDoc());
95
96         nameLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryName_mnem").charAt(0));
97         nameLabel.setLabelFor(nameTF);
98         nameLabel.setText(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryName"));
99         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
100         gridBagConstraints.gridx = 0;
101         gridBagConstraints.gridy = 0;
102         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
103         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
104         add(nameLabel, gridBagConstraints);
105
106         nameTF.setColumns(20);
107         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
108         gridBagConstraints.gridx = 1;
109         gridBagConstraints.gridy = 0;
110         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
111         gridBagConstraints.weightx = 1.0;
112         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
113         add(nameTF, gridBagConstraints);
114
115         typeLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryType_mnem").charAt(0));
116         typeLabel.setLabelFor(typeCB);
117         typeLabel.setText(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryType"));
118         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
119         gridBagConstraints.gridx = 0;
120         gridBagConstraints.gridy = 1;
121         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
122         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
123         add(typeLabel, gridBagConstraints);
124
125         typeCB.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "java.lang.String", "java.lang.Boolean", "java.lang.Character", "java.lang.Integer", "java.lang.Byte", "java.lang.Short", "java.lang.Long", "java.lang.Float", "java.lang.Double" }));
126         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
127         gridBagConstraints.gridx = 1;
128         gridBagConstraints.gridy = 1;
129         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
130         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
131         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
132         add(typeCB, gridBagConstraints);
133
134         valueLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryValue_mnem").charAt(0));
135         valueLabel.setLabelFor(valueTF);
136         valueLabel.setText(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_EnvEntryValue"));
137         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
138         gridBagConstraints.gridx = 0;
139         gridBagConstraints.gridy = 2;
140         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
141         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
142         add(valueLabel, gridBagConstraints);
143
144         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
145         gridBagConstraints.gridx = 1;
146         gridBagConstraints.gridy = 2;
147         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
148         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
149         add(valueTF, gridBagConstraints);
150
151         descriptionLabel.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_description_mnem").charAt(0));
152         descriptionLabel.setLabelFor(descriptionTA);
153         descriptionLabel.setText(org.openide.util.NbBundle.getMessage(EnvEntryPanel.class, "LBL_description"));
154         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
155         gridBagConstraints.gridx = 0;
156         gridBagConstraints.gridy = 3;
157         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
158         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
159         add(descriptionLabel, gridBagConstraints);
160
161         descriptionTA.setRows(3);
162         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
163         gridBagConstraints.gridx = 1;
164         gridBagConstraints.gridy = 3;
165         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
166         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 12);
167         add(descriptionTA, gridBagConstraints);
168
169     }
170     // </editor-fold>//GEN-END:initComponents
171

172     
173     // Variables declaration - do not modify//GEN-BEGIN:variables
174
private javax.swing.ButtonGroup JavaDoc buttonGroup1;
175     private javax.swing.JLabel JavaDoc descriptionLabel;
176     private javax.swing.JTextArea JavaDoc descriptionTA;
177     private javax.swing.JLabel JavaDoc nameLabel;
178     private javax.swing.JTextField JavaDoc nameTF;
179     private javax.swing.JComboBox JavaDoc typeCB;
180     private javax.swing.JLabel JavaDoc typeLabel;
181     private javax.swing.JLabel JavaDoc valueLabel;
182     private javax.swing.JTextField JavaDoc valueTF;
183     // End of variables declaration//GEN-END:variables
184

185 }
186
Popular Tags