KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > autoupdate > LoginPanel


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.autoupdate;
21
22 import java.beans.Customizer JavaDoc;
23 import org.openide.util.NbBundle;
24
25 class LoginPanel extends javax.swing.JPanel JavaDoc {
26
27     Wizard.Validator validator;
28
29     Settings settings = null;
30
31     static final long serialVersionUID =-3335860872113235775L;
32
33     /** customizer panel */
34     private javax.swing.JPanel JavaDoc customizer = null;
35
36     private java.awt.GridBagConstraints JavaDoc gridBagConstraints1 = new java.awt.GridBagConstraints JavaDoc();
37
38     /** Creates new form FirstPanel */
39     public LoginPanel(Wizard.Validator validator) {
40         putClientProperty("WizardPanel_autoWizardStyle", Boolean.TRUE); // NOI18N
41
putClientProperty("WizardPanel_contentDisplayed", Boolean.TRUE); // NOI18N
42
putClientProperty("WizardPanel_contentNumbered", Boolean.TRUE); // NOI18N
43
putClientProperty("WizardPanel_contentSelectedIndex", new Integer JavaDoc(0)); // NOI18N
44
putClientProperty("WizardPanel_contentData", new String JavaDoc[] { // NOI18N
45
getBundle("WIZ_First"),
46             getBundle("WIZ_Select"),
47             getBundle("WIZ_Download"),
48             getBundle("WIZ_View")
49         });
50         setName(getBundle("LAB_Login"));
51         initComponents ();
52         initAccessibility();
53         setPreferredSize(new java.awt.Dimension JavaDoc(500, 380));
54         
55         settings = Settings.getShared();
56
57         this.validator = validator;
58         
59         gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTHWEST;
60         gridBagConstraints1.weightx = 1.0;
61         gridBagConstraints1.weighty = 1.0;
62     }
63     
64     void setCustomizer(javax.swing.JPanel JavaDoc panel, AutoupdateType at) {
65         setName(getBundle("LAB_Login") + " - " + at.getName());
66         
67         if (customizer != null)
68             this.remove(customizer);
69         customizer = panel;
70         if (customizer != null) {
71             ((Customizer JavaDoc)customizer).setObject(at);
72             this.add(customizer, gridBagConstraints1);
73         }
74     }
75     
76     /** This method is called from within the constructor to
77      * initialize the form.
78      * WARNING: Do NOT modify this code. The content of this method is
79      * always regenerated by the FormEditor.
80      */

81     private void initComponents() {//GEN-BEGIN:initComponents
82

83         setLayout(new java.awt.GridBagLayout JavaDoc());
84
85     }//GEN-END:initComponents
86

87     private void initAccessibility(){
88         getAccessibleContext().setAccessibleDescription(getBundle("ACSD_LoginPanel"));
89     }
90     // Variables declaration - do not modify//GEN-BEGIN:variables
91
// End of variables declaration//GEN-END:variables
92

93     private static String JavaDoc getBundle( String JavaDoc key ) {
94         return NbBundle.getMessage( LoginPanel.class, key );
95     }
96 }
97
Popular Tags