KickJava   Java API By Example, From Geeks To Geeks.

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

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

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

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

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

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

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