1 19 20 package org.netbeans.modules.websvc.wsdl.wizard; 21 22 import java.awt.Component ; 23 import java.util.ArrayList ; 24 import java.util.Iterator ; 25 import java.util.List ; 26 import javax.swing.JTextField ; 27 import javax.swing.event.ChangeEvent ; 28 import javax.swing.event.ChangeListener ; 29 import org.netbeans.api.project.Project; 30 import org.netbeans.api.project.SourceGroup; 31 import org.openide.WizardDescriptor; 32 import org.openide.loaders.TemplateWizard; 33 import org.openide.util.HelpCtx; 34 35 39 final class WsdlPanel implements WizardDescriptor.Panel { 40 41 private final List <ChangeListener > listeners = new ArrayList <ChangeListener >(); 42 private WsdlUIPanel gui; 43 44 private Project project; 45 private TemplateWizard templateWizard; 46 47 WsdlPanel(Project project, SourceGroup[] folders) { 48 this.project = project; 49 } 50 51 TemplateWizard getTemplateWizard() { 52 return templateWizard; 53 } 54 55 void setNameTF(JTextField nameTF) { 56 gui.attachFileNameListener(nameTF); 57 } 58 59 public Component getComponent() { 60 if (gui == null) { 61 gui=new WsdlUIPanel(this); 62 } 63 return gui; 64 } 65 66 public Project getProject(){ 67 return project; 68 } 69 70 public HelpCtx getHelp() { 71 return new HelpCtx(WsdlPanel.class); 72 } 73 74 public boolean isValid() { 75 return true; 76 } 77 78 public void addChangeListener(ChangeListener l) { 79 listeners.add(l); 80 } 81 82 public void removeChangeListener(ChangeListener l) { 83 listeners.remove(l); 84 } 85 86 protected void fireChange() { 87 ChangeEvent e = new ChangeEvent (this); 88 Iterator <ChangeListener > it = listeners.iterator(); 89 while (it.hasNext()) { 90 it.next().stateChanged(e); 91 } 92 } 93 94 public void readSettings( Object settings ) { 95 templateWizard = (TemplateWizard)settings; 96 } 97 98 public void storeSettings(Object settings) { 99 if ( WizardDescriptor.PREVIOUS_OPTION.equals( ((WizardDescriptor)settings).getValue() ) ) { 100 return; 101 } 102 if ( WizardDescriptor.CANCEL_OPTION.equals( ((WizardDescriptor)settings).getValue() ) ) { 103 return; 104 } 105 ((WizardDescriptor)settings).putProperty ("NewFileWizard_Title", null); } 107 108 String getNS() { 109 return gui.getNS(); 110 } 111 112 String getWsName() { 113 return gui.getWsName(); 114 } 115 116 WsdlUIPanel.SchemaInfo[] getSchemas() { 117 return gui.getSchemas(); 118 } 119 120 boolean isImport() { 121 return gui.isImport(); 122 } 123 124 } 125 | Popular Tags |