KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > bluej > upgrade > AutoUpgradePanel


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.bluej.upgrade;
21
22 import java.awt.Dialog JavaDoc;
23 import java.util.ArrayList JavaDoc;
24 import java.util.ResourceBundle JavaDoc;
25 import javax.swing.JPanel JavaDoc;
26 import javax.swing.event.ChangeListener JavaDoc;
27 import org.openide.util.NbBundle;
28
29
30 /**
31  * @author Jiri Rechtacek
32  */

33 final class AutoUpgradePanel extends JPanel JavaDoc {
34
35     String JavaDoc source;
36
37     /** Creates new form UpgradePanel */
38     public AutoUpgradePanel (String JavaDoc directory) {
39         this.source = directory;
40         initComponents();
41         initAccessibility();
42     }
43
44     /** Remove a listener to changes of the panel's validity.
45      * @param l the listener to remove
46      */

47     void removeChangeListener(ChangeListener JavaDoc l) {
48         changeListeners.remove(l);
49     }
50
51     /** Add a listener to changes of the panel's validity.
52      * @param l the listener to add
53      * @see #isValid
54      */

55     void addChangeListener(ChangeListener JavaDoc l) {
56         if (!changeListeners.contains(l)) {
57             changeListeners.add(l);
58         }
59     }
60
61     private void initAccessibility() {
62         this.getAccessibleContext().setAccessibleDescription(bundle.getString("MSG_Confirmation")); // NOI18N
63
}
64     
65     
66     /** This method is called from within the constructor to
67      * initialize the form.
68      * WARNING: Do NOT modify this code. The content of this method is
69      * always regenerated by the Form Editor.
70      */

71     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
72
private void initComponents() {
73         txtVersions = new javax.swing.JTextArea JavaDoc();
74
75         setLayout(new java.awt.BorderLayout JavaDoc());
76
77         setName(bundle.getString("LBL_UpgradePanel_Name"));
78         txtVersions.setBackground(getBackground());
79         txtVersions.setColumns(50);
80         txtVersions.setEditable(false);
81         txtVersions.setFont(new java.awt.Font JavaDoc("Dialog", 0, 12));
82         txtVersions.setLineWrap(true);
83         txtVersions.setRows(3);
84         txtVersions.setText(NbBundle.getMessage (AutoUpgradePanel.class, "MSG_Confirmation", source));
85         txtVersions.setWrapStyleWord(true);
86         txtVersions.setMinimumSize(new java.awt.Dimension JavaDoc(100, 50));
87         add(txtVersions, java.awt.BorderLayout.CENTER);
88
89     }
90     // </editor-fold>//GEN-END:initComponents
91

92     // Variables declaration - do not modify//GEN-BEGIN:variables
93
private javax.swing.JTextArea JavaDoc txtVersions;
94     // End of variables declaration//GEN-END:variables
95

96     private static final ResourceBundle JavaDoc bundle = NbBundle.getBundle(AutoUpgradePanel.class);
97     private ArrayList JavaDoc changeListeners = new ArrayList JavaDoc(1);
98     
99 }
100
Popular Tags