1 19 20 package org.netbeans.modules.web.struts.wizards; 21 22 import java.awt.Component ; 23 import java.util.HashSet ; 24 import java.util.Set ; 25 import javax.swing.event.ChangeListener ; 26 27 import org.openide.WizardDescriptor; 28 import org.openide.util.HelpCtx; 29 30 import org.netbeans.api.project.Project; 31 32 36 public class ActionPanel1 implements WizardDescriptor.Panel, WizardDescriptor.FinishablePanel { 37 38 private WizardDescriptor wizardDescriptor; 39 private ActionPanel1Visual component; 40 private Project project; 41 42 43 public ActionPanel1(Project project) { 44 this.project=project; 45 } 46 47 Project getProject() { 48 return project; 49 } 50 51 public Component getComponent() { 52 if (component == null) 53 component = new ActionPanel1Visual(this); 54 55 return component; 56 } 57 58 public boolean isValid() { 59 getComponent(); 60 return component.valid(wizardDescriptor); 61 } 62 63 public void readSettings(Object settings) { 64 wizardDescriptor = (WizardDescriptor) settings; 65 component.read(wizardDescriptor); 66 Object substitute = ((javax.swing.JComponent ) component).getClientProperty("NewFileWizard_Title"); if (substitute != null) 70 wizardDescriptor.putProperty("NewFileWizard_Title", substitute); } 72 73 public void storeSettings(Object settings) { 74 WizardDescriptor desc = (WizardDescriptor) settings; 75 component.store(desc); 76 } 77 78 public HelpCtx getHelp() { 79 return new HelpCtx(ActionPanel1.class); 80 } 81 82 private final Set listeners = new HashSet (1); 83 84 public final void addChangeListener(ChangeListener l) { 85 synchronized (listeners) { 86 listeners.add(l); 87 } 88 } 89 public final void removeChangeListener(ChangeListener l) { 90 synchronized (listeners) { 91 listeners.remove(l); 92 } 93 } 94 95 public boolean isFinishPanel() { 96 return isValid(); 97 } 98 99 } 100 | Popular Tags |