KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > archive > wizard > StatusPanel


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.archive.wizard;
21
22 import java.awt.BorderLayout JavaDoc;
23 import javax.swing.JComponent JavaDoc;
24 import javax.swing.SwingUtilities JavaDoc;
25
26 class StatusPanel extends javax.swing.JPanel JavaDoc {
27     
28     /** Creates new form StatusPanel */
29     public StatusPanel() {
30         initComponents();
31     }
32     
33     /** This method is called from within the constructor to
34      * initialize the form.
35      * WARNING: Do NOT modify this code. The content of this method is
36      * always regenerated by the Form Editor.
37      */

38     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
39
private void initComponents() {
40         currently = new javax.swing.JLabel JavaDoc();
41         actionDescription = new javax.swing.JLabel JavaDoc();
42         progressIndicator = new javax.swing.JPanel JavaDoc();
43
44         currently.setText(org.openide.util.NbBundle.getMessage(StatusPanel.class, "LBL_StatusPanel_currently"));
45
46         progressIndicator.setLayout(new java.awt.BorderLayout JavaDoc());
47
48         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
49         this.setLayout(layout);
50         layout.setHorizontalGroup(
51             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
52             .add(layout.createSequentialGroup()
53                 .add(currently)
54                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
55                 .add(actionDescription, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE))
56             .add(progressIndicator, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 257, Short.MAX_VALUE)
57         );
58         layout.setVerticalGroup(
59             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
60             .add(layout.createSequentialGroup()
61                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
62                     .add(currently)
63                     .add(actionDescription, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
64                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
65                 .add(progressIndicator, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
66                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
67         );
68     }// </editor-fold>//GEN-END:initComponents
69

70     
71     // Variables declaration - do not modify//GEN-BEGIN:variables
72
private javax.swing.JLabel JavaDoc actionDescription;
73     private javax.swing.JLabel JavaDoc currently;
74     private javax.swing.JPanel JavaDoc progressIndicator;
75     // End of variables declaration//GEN-END:variables
76

77     void setIndicator(final JComponent JavaDoc throbber) {
78         progressIndicator.add(throbber, BorderLayout.CENTER);
79     }
80     
81     void setActionDescription(final String JavaDoc newValue) {
82         SwingUtilities.invokeLater(new Runnable JavaDoc() {
83             public void run() {
84                 actionDescription.setText(newValue);
85             }
86         });
87     }
88 }
89
Popular Tags