KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > project > ui > OpeningProjectPanel


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.project.ui;
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  * @author Jan Lahoda
32  */

33 public class OpeningProjectPanel extends javax.swing.JPanel JavaDoc {
34
35     private JComponent JavaDoc progress;
36
37     /** Creates new form OpeningProjectPanel */
38     public OpeningProjectPanel(ProgressHandle handle) {
39         progress = ProgressHandleFactory.createProgressComponent(handle);
40         initComponents();
41         //#67914: On macosx, the background of JTextField is white even if non-editable:
42
nameOfTheProject.setBackground(javax.swing.UIManager.getColor("Panel.background")); // NOI18N
43
}
44     
45     /** This method is called from within the constructor to
46      * initialize the form.
47      * WARNING: Do NOT modify this code. The content of this method is
48      * always regenerated by the Form Editor.
49      */

50     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
51
private void initComponents() {
52         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
53
54         jLabel1 = new javax.swing.JLabel JavaDoc();
55         innerPanel = new javax.swing.JPanel JavaDoc();
56         nameOfTheProject = new javax.swing.JTextField JavaDoc();
57         jPanel1 = new javax.swing.JPanel JavaDoc();
58
59         setBorder(javax.swing.BorderFactory.createEmptyBorder(11, 11, 11, 11));
60         setLayout(new java.awt.GridBagLayout JavaDoc());
61
62         jLabel1.setText(org.openide.util.NbBundle.getMessage(OpeningProjectPanel.class, "LBL_Opening_Projects", new Object JavaDoc[] {})); // NOI18N
63
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
64         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
65         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 6, 6);
66         add(jLabel1, gridBagConstraints);
67
68         innerPanel.add(progress, BorderLayout.CENTER);
69         innerPanel.setLayout(new java.awt.BorderLayout JavaDoc());
70         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
71         gridBagConstraints.gridx = 0;
72         gridBagConstraints.gridy = 1;
73         gridBagConstraints.gridwidth = 2;
74         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
75         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
76         gridBagConstraints.weightx = 1.0;
77         add(innerPanel, gridBagConstraints);
78
79         nameOfTheProject.setColumns(20);
80         nameOfTheProject.setEditable(false);
81         nameOfTheProject.setFont(javax.swing.UIManager.getFont("Label.font"));
82         nameOfTheProject.setBorder(null);
83         nameOfTheProject.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground"));
84         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
85         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
86         gridBagConstraints.weightx = 1.0;
87         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 6, 0);
88         add(nameOfTheProject, gridBagConstraints);
89         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
90         gridBagConstraints.gridx = 0;
91         gridBagConstraints.gridy = 2;
92         gridBagConstraints.gridwidth = 2;
93         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
94         gridBagConstraints.weightx = 1.0;
95         gridBagConstraints.weighty = 1.0;
96         add(jPanel1, gridBagConstraints);
97     }// </editor-fold>//GEN-END:initComponents
98

99     
100     // Variables declaration - do not modify//GEN-BEGIN:variables
101
public javax.swing.JPanel JavaDoc innerPanel;
102     public javax.swing.JLabel JavaDoc jLabel1;
103     public javax.swing.JPanel JavaDoc jPanel1;
104     public javax.swing.JTextField JavaDoc nameOfTheProject;
105     // End of variables declaration//GEN-END:variables
106

107     public void setProjectName(final String JavaDoc name) {
108         nameOfTheProject.setText(name);
109     }
110 }
111
Popular Tags