private void prepareProject(String platformName) throws IOException { scratch = makeScratchDir(this); projdir = scratch.createFolder("proj"); AntProjectHelper helper = ProjectGenerator.createProject(projdir, "org.netbeans.modules.web.project"); pm = ProjectManager.getDefault(); pp = pm.findProject(projdir); EditableProperties props = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); props.setProperty("javac.source", "${def}"); props.setProperty("platform.active", platformName); props.setProperty("def", "1.2"); helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, props); props = PropertyUtils.getGlobalProperties(); props.put("default.javac.source", "4.3"); PropertyUtils.putGlobalProperties(props); sources = projdir.createFolder("src"); }
private static String createAntName(String name) { if (name == null || name.length() == 0) { throw new IllegalArgumentException(); } String antName = PropertyUtils.getUsablePropertyName(name); if (platformExists(antName)) { String baseName = antName; int index = 1; antName = baseName + Integer.toString(index); while (platformExists(antName)) { index++; antName = baseName + Integer.toString(index); } } return antName; }
@Messages({ "WARN_MakeSharable.absolutePath=<html>Please make sure that the absolute path in the Libraries Folder field is valid for all users.<html>", "WARN_makeSharable.relativePath=<html>Please make sure that the relative path in the Libraries Folder field is valid for all users.<html>" }) boolean isValidPanel() { String location = getLibraryLocation(); boolean wrong = false; if (new File(location).isAbsolute()) { settings.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, WARN_MakeSharable_absolutePath()); wrong = true; } else { File projectLoc = FileUtil.toFile(helper.getProjectDirectory()); File libLoc = PropertyUtils.resolveFile(projectLoc, location); if (!CollocationQuery.areCollocated(projectLoc, libLoc)) { settings.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, WARN_makeSharable_relativePath()); wrong = true; } } if (!wrong) { settings.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, null); } return true; }