KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > autoupdate > catalog > ModuleUpdaterProgress


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
21 package org.netbeans.modules.autoupdate.catalog;
22
23 import java.awt.BorderLayout JavaDoc;
24 import javax.swing.JComponent JavaDoc;
25 import javax.swing.SwingUtilities JavaDoc;
26 import org.netbeans.api.progress.ProgressHandle;
27 import org.netbeans.api.progress.ProgressHandleFactory;
28
29 /**
30  *
31  */

32 public class ModuleUpdaterProgress extends javax.swing.JPanel JavaDoc {
33
34     private JComponent JavaDoc progress;
35     private ProgressHandle handle;
36
37     /**
38      * Creates new form ModuleUpdaterProgress
39      */

40     public ModuleUpdaterProgress(ProgressHandle handle) {
41         progress = ProgressHandleFactory.createProgressComponent(handle);
42         this.handle = handle;
43         initComponents();
44     }
45     
46     /** This method is called from within the constructor to
47      * initialize the form.
48      * WARNING: Do NOT modify this code. The content of this method is
49      * always regenerated by the Form Editor.
50      */

51     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
52
private void initComponents() {
53         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
54
55         innerPanel = new javax.swing.JPanel JavaDoc();
56         message = ProgressHandleFactory.createDetailLabelComponent (handle);
57
58         setLayout(new java.awt.GridBagLayout JavaDoc());
59
60         setBorder(javax.swing.BorderFactory.createEmptyBorder(11, 11, 11, 11));
61         innerPanel.setLayout(new java.awt.BorderLayout JavaDoc());
62
63         innerPanel.add(progress, BorderLayout.CENTER);
64
65         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
66         gridBagConstraints.gridx = 0;
67         gridBagConstraints.gridy = 1;
68         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
69         gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
70         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
71         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
72         gridBagConstraints.weightx = 1.0;
73         add(innerPanel, gridBagConstraints);
74
75         message.setLabelFor(innerPanel);
76         message.setPreferredSize(new java.awt.Dimension JavaDoc(350, 20));
77         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
78         gridBagConstraints.gridx = 0;
79         gridBagConstraints.gridy = 0;
80         gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
81         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
82         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 6, 0);
83         add(message, gridBagConstraints);
84
85     }// </editor-fold>//GEN-END:initComponents
86

87     
88     // Variables declaration - do not modify//GEN-BEGIN:variables
89
public javax.swing.JPanel JavaDoc innerPanel;
90     public javax.swing.JLabel JavaDoc message;
91     // End of variables declaration//GEN-END:variables
92

93 }
94
Popular Tags