1 19 20 package org.netbeans.modules.web.freeform.ui; 21 22 import java.awt.Component ; 23 import java.io.BufferedReader ; 24 import java.io.File ; 25 import java.io.InputStreamReader ; 26 import java.util.Enumeration ; 27 import java.util.HashSet ; 28 import java.util.Iterator ; 29 import java.util.List ; 30 import java.util.Set ; 31 import javax.swing.event.ChangeEvent ; 32 import javax.swing.event.ChangeListener ; 33 import org.netbeans.modules.ant.freeform.spi.support.NewFreeformProjectSupport; 34 import org.netbeans.modules.java.freeform.spi.support.NewJavaFreeformProjectSupport; 35 import org.openide.ErrorManager; 36 import org.openide.WizardDescriptor; 37 import org.openide.filesystems.FileObject; 38 import org.openide.filesystems.FileStateInvalidException; 39 import org.openide.filesystems.FileUtil; 40 import org.openide.util.HelpCtx; 41 import org.openide.util.NbBundle; 42 43 46 47 public class WebClasspathWizardPanel implements WizardDescriptor.Panel { 48 49 private WebClasspathPanel component; 50 private WizardDescriptor wizardDescriptor; 51 52 public WebClasspathWizardPanel() { 53 getComponent().setName(NbBundle.getMessage(NewWebFreeformProjectWizardIterator.class, "TXT_NewWebFreeformProjectWizardIterator_WebSources_Classpath")); } 55 56 public Component getComponent() { 57 if (component == null) { 58 component = new WebClasspathPanel(); 59 } 60 return component; 61 } 62 63 public HelpCtx getHelp() { 64 return new HelpCtx( WebClasspathWizardPanel.class ); 65 } 66 67 public boolean isValid() { 68 return true; 69 } 70 71 private final Set listeners = new HashSet (1); 72 public final void addChangeListener(ChangeListener l) { 73 synchronized (listeners) { 74 listeners.add(l); 75 } 76 } 77 public final void removeChangeListener(ChangeListener l) { 78 synchronized (listeners) { 79 listeners.remove(l); 80 } 81 } 82 protected final void fireChangeEvent() { 83 Iterator it; 84 synchronized (listeners) { 85 it = new HashSet (listeners).iterator(); 86 } 87 ChangeEvent ev = new ChangeEvent (this); 88 while (it.hasNext()) { 89 ((ChangeListener )it.next()).stateChanged(ev); 90 } 91 } 92 93 public void readSettings(Object settings) { 94 wizardDescriptor = (WizardDescriptor) settings; 95 wizardDescriptor.putProperty("NewProjectWizard_Title", component.getClientProperty("NewProjectWizard_Title")); File baseFolder = (File )wizardDescriptor.getProperty(NewFreeformProjectSupport.PROP_PROJECT_LOCATION); 97 File nbProjectFolder = (File )wizardDescriptor.getProperty(NewFreeformProjectSupport.PROP_PROJECT_FOLDER); 98 component.setProjectFolders(baseFolder, nbProjectFolder); 99 } 100 101 public void storeSettings(Object settings) { 102 wizardDescriptor = (WizardDescriptor) settings; 103 wizardDescriptor.putProperty(NewWebFreeformProjectWizardIterator.PROP_WEB_CLASSPATH, component.getClasspath()); 104 } 105 106 } 107 | Popular Tags |