KickJava   Java API By Example, From Geeks To Geeks.

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


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.project.ui;
21
22 import java.text.MessageFormat JavaDoc;
23 import javax.swing.JComponent JavaDoc;
24
25 import org.openide.WizardDescriptor;
26 //import org.netbeans.spi.project.ui.templates.support.InstantiatingIterator;
27
import org.openide.filesystems.FileObject;
28
29 import org.openide.loaders.TemplateWizard;
30 import org.openide.util.NbBundle;
31
32 public final class NewProjectWizard extends TemplateWizard {
33
34     private FileObject templatesFO;
35     private MessageFormat JavaDoc format;
36
37     public NewProjectWizard (FileObject fo) {
38         this.templatesFO = fo;
39         putProperty (TemplatesPanelGUI.TEMPLATES_FOLDER, templatesFO);
40         format = new MessageFormat JavaDoc (NbBundle.getBundle (NewFileWizard.class).getString ("LBL_NewProjectWizard_MessageFormat"));
41         //setTitleFormat( new MessageFormat( "{0}") );
42
}
43         
44     public void updateState () {
45         super.updateState ();
46         String JavaDoc substitute = (String JavaDoc)getProperty ("NewProjectWizard_Title"); // NOI18N
47
String JavaDoc title;
48         if (substitute == null) {
49             title = NbBundle.getBundle (NewProjectWizard.class).getString ("LBL_NewProjectWizard_Title"); // NOI18N
50
} else {
51             Object JavaDoc[] args = new Object JavaDoc[] {
52                     NbBundle.getBundle (NewProjectWizard.class).getString ("LBL_NewProjectWizard_Subtitle"), // NOI18N
53
substitute};
54             title = format.format (args);
55         }
56         super.setTitle (title);
57     }
58     
59     public void setTitle (String JavaDoc ignore) {}
60     
61     protected WizardDescriptor.Panel createTemplateChooser() {
62         WizardDescriptor.Panel panel = new TemplatesPanel ();
63         JComponent JavaDoc jc = (JComponent JavaDoc)panel.getComponent ();
64         jc.setPreferredSize( new java.awt.Dimension JavaDoc (500, 340) );
65         jc.setName (NbBundle.getBundle (NewProjectWizard.class).getString ("LBL_NewProjectWizard_Name")); // NOI18N
66
jc.getAccessibleContext ().setAccessibleName (NbBundle.getBundle (NewProjectWizard.class).getString ("ACSN_NewProjectWizard")); // NOI18N
67
jc.getAccessibleContext ().setAccessibleDescription (NbBundle.getBundle (NewProjectWizard.class).getString ("ACSD_NewProjectWizard")); // NOI18N
68
jc.putClientProperty ("WizardPanel_contentSelectedIndex", new Integer JavaDoc (0)); // NOI18N
69
jc.putClientProperty ("WizardPanel_contentData", new String JavaDoc[] { // NOI18N
70
NbBundle.getBundle (NewProjectWizard.class).getString ("LBL_NewProjectWizard_Name"), // NOI18N
71
NbBundle.getBundle (NewProjectWizard.class).getString ("LBL_NewProjectWizard_Dots")}); // NOI18N
72

73         return panel;
74     }
75     
76 }
77
Popular Tags