KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > i18n > wizard > ProgressWizardPanel


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.i18n.wizard;
22
23 import org.openide.util.NbBundle;
24 import javax.swing.JPanel JavaDoc;
25
26
27 /**
28  * Panel to monitor long tasks in i18n wizard. Namely searchnig
29  * for hard codes strings and replacing the hard coded string
30  * with internationalized ones.
31  *
32  * @author Peter Zavadsky
33  */

34 final class ProgressWizardPanel extends JPanel JavaDoc {
35
36     /** Creates new form ProgressPanel */
37     public ProgressWizardPanel(boolean withSubProgress) {
38         initComponents();
39     this.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(AdditionalWizardPanel.class).getString("ACS_ProgressWizardPanel"));
40         
41         if(!withSubProgress) {
42             remove(subLabel);
43             remove(subProgress);
44         }
45         
46         setPreferredSize(I18nWizardDescriptor.PREFERRED_DIMENSION);
47     }
48
49     
50     /** Sets text of main label. */
51     public void setMainText(String JavaDoc text) {
52         mainLabel.setText(text);
53     }
54     
55     /** Sets text of sub label. */
56     public void setSubText(String JavaDoc text) {
57         subLabel.setText(text);
58     }
59
60     /** Sets main progress bar value. */
61     public void setMainProgress(int value) {
62         mainProgress.setValue(value);
63     }
64     
65     /** Sets sub progress bar value. */
66     public void setSubProgress(int value) {
67         subProgress.setValue(value);
68     }
69     
70     /** This method is called from within the constructor to
71      * initialize the form.
72      * WARNING: Do NOT modify this code. The content of this method is
73      * always regenerated by the Form Editor.
74      */

75     private void initComponents() {//GEN-BEGIN:initComponents
76
mainLabel = new javax.swing.JLabel JavaDoc();
77         mainProgress = new javax.swing.JProgressBar JavaDoc();
78         subLabel = new javax.swing.JLabel JavaDoc();
79         subProgress = new javax.swing.JProgressBar JavaDoc();
80         setLayout(new java.awt.GridBagLayout JavaDoc());
81         java.awt.GridBagConstraints JavaDoc gridBagConstraints1;
82         
83         
84         gridBagConstraints1 = new java.awt.GridBagConstraints JavaDoc();
85         gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTHWEST;
86         add(mainLabel, gridBagConstraints1);
87         
88         
89         
90         gridBagConstraints1 = new java.awt.GridBagConstraints JavaDoc();
91         gridBagConstraints1.gridx = 0;
92         gridBagConstraints1.gridy = 1;
93         gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
94         gridBagConstraints1.insets = new java.awt.Insets JavaDoc(7, 0, 0, 0);
95         gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTH;
96         gridBagConstraints1.weightx = 1.0;
97         add(mainProgress, gridBagConstraints1);
98         
99         
100         
101         gridBagConstraints1 = new java.awt.GridBagConstraints JavaDoc();
102         gridBagConstraints1.gridx = 0;
103         gridBagConstraints1.gridy = 2;
104         gridBagConstraints1.insets = new java.awt.Insets JavaDoc(11, 0, 0, 0);
105         gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTHWEST;
106         add(subLabel, gridBagConstraints1);
107         
108         
109         
110         gridBagConstraints1 = new java.awt.GridBagConstraints JavaDoc();
111         gridBagConstraints1.gridx = 0;
112         gridBagConstraints1.gridy = 3;
113         gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
114         gridBagConstraints1.insets = new java.awt.Insets JavaDoc(7, 0, 0, 0);
115         gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTH;
116         gridBagConstraints1.weightx = 1.0;
117         add(subProgress, gridBagConstraints1);
118         
119     }//GEN-END:initComponents
120

121
122     // Variables declaration - do not modify//GEN-BEGIN:variables
123
private javax.swing.JLabel JavaDoc mainLabel;
124     private javax.swing.JProgressBar JavaDoc mainProgress;
125     private javax.swing.JLabel JavaDoc subLabel;
126     private javax.swing.JProgressBar JavaDoc subProgress;
127     // End of variables declaration//GEN-END:variables
128

129 }
130
131
Popular Tags