1 19 20 package org.netbeans.modules.websvc.dev.wizard; 21 22 import java.awt.Component ; 23 import java.util.HashSet ; 24 import java.util.Set ; 25 import javax.swing.JComponent ; 26 import javax.swing.event.ChangeListener ; 27 28 import org.openide.WizardDescriptor; 29 import org.openide.WizardValidationException; 30 import org.openide.util.HelpCtx; 31 32 36 public class WebServiceMethodChooser implements WizardDescriptor.Panel, WizardDescriptor.FinishablePanel, WizardDescriptor.ValidatingPanel { 37 38 private WebServiceMethodChooserPanel component; 39 private WizardDescriptor wizardDescriptor; 40 41 42 public WebServiceMethodChooser() { 43 } 44 45 public Component getComponent() { 46 if (component == null) 47 component = new WebServiceMethodChooserPanel(); 48 49 return component; 50 } 51 52 public HelpCtx getHelp() { 53 HelpCtx helpCtx = null; 54 if (getComponent() != null && (helpCtx = component.getHelpCtx()) != null) 55 return helpCtx; 56 57 return new HelpCtx(WebServiceMethodChooser.class); 58 } 59 60 public void readSettings(Object settings) { 61 wizardDescriptor = (WizardDescriptor) settings; 62 component.read (wizardDescriptor); 63 64 Object substitute = ((JComponent ) component).getClientProperty("NewProjectWizard_Title"); if (substitute != null) 68 wizardDescriptor.putProperty("NewProjectWizard_Title", substitute); } 70 71 public void storeSettings(Object settings) { 72 WizardDescriptor d = (WizardDescriptor) settings; 73 component.store(d); 74 ((WizardDescriptor) d).putProperty("NewProjectWizard_Title", null); } 76 77 public boolean isValid() { 78 return component.valid(wizardDescriptor); 79 } 80 81 private final Set listeners = new HashSet (1); 82 83 public void addChangeListener(ChangeListener l) { 84 synchronized (listeners) { 85 listeners.add(l); 86 } 87 } 88 89 public void removeChangeListener(ChangeListener l) { 90 synchronized (listeners) { 91 listeners.remove(l); 92 } 93 } 94 95 public boolean isFinishPanel() { 96 return true; 97 } 98 99 public void validate() throws WizardValidationException { 100 component.validate(wizardDescriptor); 101 } 102 103 } 104 | Popular Tags |