1 19 20 package org.netbeans.modules.j2ee.earproject.ui.wizards; 21 22 import java.io.File ; 23 import javax.swing.JPanel ; 24 import javax.swing.event.DocumentListener ; 25 import org.openide.WizardDescriptor; 26 27 abstract class SettingsPanel extends JPanel { 28 29 abstract void store (WizardDescriptor settings); 30 31 abstract void read (WizardDescriptor settings); 32 33 abstract boolean valid (WizardDescriptor settings); 34 35 abstract void addNameListener(DocumentListener dl); 36 37 protected static File findExistingParent(String path) { 38 File ret = new File (path).getParentFile(); 39 while (ret != null && !ret.exists()) { 40 ret = ret.getParentFile(); 41 } 42 return ret; 43 } 44 45 static boolean isValidProjectName(String projectName) { 46 return projectName.length() != 0 47 && projectName.indexOf('*') < 0 48 && projectName.indexOf('/') < 0 49 && projectName.indexOf('\\') < 0 50 && projectName.indexOf(':') < 0; 51 } 52 53 } 54 | Popular Tags |