KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > wizards > AttrDialog


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.web.wizards;
21
22 /**
23  *
24  * @author mk115033
25  */

26 public class AttrDialog extends javax.swing.JPanel JavaDoc {
27
28     /** Creates new form AttrDialog */
29     public AttrDialog() {
30         initComponents();
31     }
32     /** Creates new form AttrDialog */
33     public AttrDialog(String JavaDoc attrName, String JavaDoc attrType, boolean required, boolean rtexpr) {
34         initComponents();
35         jTextField1.setText(attrName);
36         jComboBox1.setSelectedItem(attrType);
37         jCheckBox1.setSelected(required);
38         if (rtexpr) jRadioButton1.setSelected(true);
39         else jRadioButton2.setSelected(true);
40
41         
42     }
43     public String JavaDoc getAttrName(){
44         return jTextField1.getText().trim();
45     }
46     public String JavaDoc getAttrType(){
47         return (String JavaDoc)jComboBox1.getSelectedItem();
48     }
49     public boolean isRequired(){
50         return jCheckBox1.isSelected();
51     }
52     public boolean isRtexpr(){
53         return jRadioButton1.isSelected();
54     }
55     
56     javax.swing.JTextField JavaDoc getAttrNameTF() {
57         return jTextField1;
58     }
59
60     /** This method is called from within the constructor to
61      * initialize the form.
62      * WARNING: Do NOT modify this code. The content of this method is
63      * always regenerated by the Form Editor.
64      */

65     private void initComponents() {//GEN-BEGIN:initComponents
66
java.awt.GridBagConstraints JavaDoc gridBagConstraints;
67
68         buttonGroup1 = new javax.swing.ButtonGroup JavaDoc();
69         jLabel1 = new javax.swing.JLabel JavaDoc();
70         jLabel2 = new javax.swing.JLabel JavaDoc();
71         jTextField1 = new javax.swing.JTextField JavaDoc();
72         jComboBox1 = new javax.swing.JComboBox JavaDoc();
73         jCheckBox1 = new javax.swing.JCheckBox JavaDoc();
74         jPanel1 = new javax.swing.JPanel JavaDoc();
75         jRadioButton1 = new javax.swing.JRadioButton JavaDoc();
76         jRadioButton2 = new javax.swing.JRadioButton JavaDoc();
77
78         setLayout(new java.awt.GridBagLayout JavaDoc());
79
80         getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_DESC_AttrDialog"));
81         jLabel1.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_AttrName_mnem").charAt(0));
82         jLabel1.setLabelFor(jTextField1);
83         jLabel1.setText(org.openide.util.NbBundle.getMessage(AttrDialog.class, "LBL_AttrName"));
84         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
85         gridBagConstraints.gridx = 0;
86         gridBagConstraints.gridy = 0;
87         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
88         gridBagConstraints.weightx = 1.0;
89         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 6, 0);
90         add(jLabel1, gridBagConstraints);
91
92         jLabel2.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_AttrType_mnem").charAt(0));
93         jLabel2.setLabelFor(jComboBox1);
94         jLabel2.setText(org.openide.util.NbBundle.getMessage(AttrDialog.class, "LBL_AttrType"));
95         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
96         gridBagConstraints.gridx = 0;
97         gridBagConstraints.gridy = 1;
98         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
99         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 6, 6, 0);
100         add(jLabel2, gridBagConstraints);
101
102         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
103         gridBagConstraints.gridx = 1;
104         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
105         gridBagConstraints.weightx = 1.0;
106         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 6, 0);
107         add(jTextField1, gridBagConstraints);
108         jTextField1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("LBL_AttrName"));
109
110         jComboBox1.setEditable(true);
111         jComboBox1.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "java.lang.String", "boolean", "char", "byte", "short", "int", "long", "float", "double", "java.lang.Boolean", "java.lang.Character", "java.lang.Byte", "java.lang.Short", "java.lang.Integer", "java.lang.Long", "java.lang.Float", "java.lang.Double", "java.lang.Object" }));
112         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
113         gridBagConstraints.gridx = 1;
114         gridBagConstraints.gridy = 1;
115         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
116         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
117         gridBagConstraints.weightx = 1.0;
118         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 6, 6, 0);
119         add(jComboBox1, gridBagConstraints);
120         jComboBox1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("LBL_AttrType"));
121
122         jCheckBox1.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_AttrRequired_mnem").charAt(0));
123         jCheckBox1.setText(org.openide.util.NbBundle.getMessage(AttrDialog.class, "OPT_attrRequired"));
124         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
125         gridBagConstraints.gridx = 1;
126         gridBagConstraints.gridy = 2;
127         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
128         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
129         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 6, 6, 0);
130         add(jCheckBox1, gridBagConstraints);
131         jCheckBox1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("OPT_attrRequired"));
132
133         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
134         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
135         gridBagConstraints.weightx = 3.0;
136         add(jPanel1, gridBagConstraints);
137
138         jRadioButton1.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_AttrRequestTime_mnem").charAt(0));
139         jRadioButton1.setSelected(true);
140         jRadioButton1.setText(org.openide.util.NbBundle.getMessage(AttrDialog.class, "OPT_attrRequestTime"));
141         buttonGroup1.add(jRadioButton1);
142         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
143         gridBagConstraints.gridx = 1;
144         gridBagConstraints.gridy = 3;
145         gridBagConstraints.gridwidth = 2;
146         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
147         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 6, 0, 6);
148         add(jRadioButton1, gridBagConstraints);
149         jRadioButton1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("OPT_attrRequestTime"));
150
151         jRadioButton2.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("A11Y_AttrJspTranslationTime_mnem").charAt(0));
152         jRadioButton2.setText(org.openide.util.NbBundle.getMessage(AttrDialog.class, "OPT_attrTranslationTime"));
153         buttonGroup1.add(jRadioButton2);
154         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
155         gridBagConstraints.gridx = 1;
156         gridBagConstraints.gridy = 4;
157         gridBagConstraints.gridwidth = 2;
158         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
159         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 6, 6, 6);
160         add(jRadioButton2, gridBagConstraints);
161         jRadioButton2.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/wizards/Bundle").getString("OPT_attrTranslationTime"));
162
163     }//GEN-END:initComponents
164

165     
166     // Variables declaration - do not modify//GEN-BEGIN:variables
167
private javax.swing.ButtonGroup JavaDoc buttonGroup1;
168     private javax.swing.JCheckBox JavaDoc jCheckBox1;
169     private javax.swing.JComboBox JavaDoc jComboBox1;
170     private javax.swing.JLabel JavaDoc jLabel1;
171     private javax.swing.JLabel JavaDoc jLabel2;
172     private javax.swing.JPanel JavaDoc jPanel1;
173     private javax.swing.JRadioButton JavaDoc jRadioButton1;
174     private javax.swing.JRadioButton JavaDoc jRadioButton2;
175     private javax.swing.JTextField JavaDoc jTextField1;
176     // End of variables declaration//GEN-END:variables
177

178 }
179
Popular Tags