1 19 20 package org.openide.loaders; 21 22 import javax.swing.event.ChangeListener ; 23 import org.openide.WizardDescriptor; 24 import org.openide.nodes.Node; 25 import org.openide.util.HelpCtx; 26 27 31 final class TemplateWizardPanel1 implements WizardDescriptor.Panel<WizardDescriptor> { 32 private TemplateWizard1 templateWizard1UI; 33 34 private ChangeListener listener; 35 36 private TemplateWizard1 getPanelUI () { 37 if (templateWizard1UI == null) { 38 templateWizard1UI = new TemplateWizard1 (); 39 templateWizard1UI.addChangeListener (listener); 40 } 41 return templateWizard1UI; 42 } 43 44 48 public void addChangeListener (ChangeListener l) { 49 if (listener != null) throw new IllegalStateException (); 50 if (templateWizard1UI != null) 51 templateWizard1UI.addChangeListener (l); 52 listener = l; 53 } 54 55 58 public void removeChangeListener (ChangeListener l) { 59 listener = null; 60 if (templateWizard1UI != null) 61 templateWizard1UI.removeChangeListener (l); 62 } 63 64 72 public java.awt.Component getComponent() { 73 return getPanelUI (); 74 } 75 76 79 public HelpCtx getHelp () { 80 if (templateWizard1UI != null) { 81 if (templateWizard1UI.getExplorerManager().getRootContext() != Node.EMPTY) { 82 return new HelpCtx(TemplateWizard1.class.getName()+"."+ templateWizard1UI.getExplorerManager().getRootContext().getName()); 84 } 85 } 86 return new HelpCtx (TemplateWizard1.class); 87 } 88 89 93 public boolean isValid() { 94 if (templateWizard1UI == null) 95 return false; 96 return getPanelUI ().implIsValid (); 97 } 98 99 104 public void readSettings(WizardDescriptor settings) { 105 getPanelUI ().implReadSettings (settings); 106 } 107 108 117 public void storeSettings(WizardDescriptor settings) { 118 getPanelUI ().implStoreSettings (settings); 119 } 120 121 } 122 | Popular Tags |