1 19 20 package org.netbeans.modules.project.ui; 21 22 import java.text.MessageFormat ; 23 import javax.swing.JComponent ; 24 25 import org.openide.WizardDescriptor; 26 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 format; 36 37 public NewProjectWizard (FileObject fo) { 38 this.templatesFO = fo; 39 putProperty (TemplatesPanelGUI.TEMPLATES_FOLDER, templatesFO); 40 format = new MessageFormat (NbBundle.getBundle (NewFileWizard.class).getString ("LBL_NewProjectWizard_MessageFormat")); 41 } 43 44 public void updateState () { 45 super.updateState (); 46 String substitute = (String )getProperty ("NewProjectWizard_Title"); String title; 48 if (substitute == null) { 49 title = NbBundle.getBundle (NewProjectWizard.class).getString ("LBL_NewProjectWizard_Title"); } else { 51 Object [] args = new Object [] { 52 NbBundle.getBundle (NewProjectWizard.class).getString ("LBL_NewProjectWizard_Subtitle"), substitute}; 54 title = format.format (args); 55 } 56 super.setTitle (title); 57 } 58 59 public void setTitle (String ignore) {} 60 61 protected WizardDescriptor.Panel createTemplateChooser() { 62 WizardDescriptor.Panel panel = new TemplatesPanel (); 63 JComponent jc = (JComponent )panel.getComponent (); 64 jc.setPreferredSize( new java.awt.Dimension (500, 340) ); 65 jc.setName (NbBundle.getBundle (NewProjectWizard.class).getString ("LBL_NewProjectWizard_Name")); jc.getAccessibleContext ().setAccessibleName (NbBundle.getBundle (NewProjectWizard.class).getString ("ACSN_NewProjectWizard")); jc.getAccessibleContext ().setAccessibleDescription (NbBundle.getBundle (NewProjectWizard.class).getString ("ACSD_NewProjectWizard")); jc.putClientProperty ("WizardPanel_contentSelectedIndex", new Integer (0)); jc.putClientProperty ("WizardPanel_contentData", new String [] { NbBundle.getBundle (NewProjectWizard.class).getString ("LBL_NewProjectWizard_Name"), NbBundle.getBundle (NewProjectWizard.class).getString ("LBL_NewProjectWizard_Dots")}); 73 return panel; 74 } 75 76 } 77 | Popular Tags |