private boolean isFreeEntryPropertyIndex(int index, @NonNull EditableProperties ep) { return !ep.containsKey(getEntryNameProperty(index)); }
private static boolean updateBuildProperties (EditableProperties ep) { boolean changed = false; ScalaPlatform[] installedPlatforms = ScalaPlatformManager.getDefault().getPlatforms(null, new Specification ("Std",null)); //NOI18N for (int i=0; i<installedPlatforms.length; i++) { //Handle only platforms created by this module if (!installedPlatforms[i].equals (ScalaPlatformManager.getDefault().getDefaultPlatform()) && installedPlatforms[i] instanceof J2SEPlatformImpl) { String systemName = ((J2SEPlatformImpl)installedPlatforms[i]).getAntName(); String key = PlatformConvertor.createName(systemName,"home"); //NOI18N if (!ep.containsKey (key)) { try { PlatformConvertor.generatePlatformProperties(installedPlatforms[i], systemName, ep); changed = true; } catch (PlatformConvertor.BrokenPlatformException b) { Logger.getLogger(J2SEPlatformModule.class.getName()).info("Platform: " + installedPlatforms[i].getDisplayName() +" is missing: " + b.getMissingTool()); } catch (IOException ioe) { Exceptions.printStackTrace(ioe); } } } } return changed; }
J2EEProjectProperties.removeObsoleteLibraryLocations(props); if (!props.containsKey(ProjectProperties.INCLUDES)) { props.setProperty(ProjectProperties.INCLUDES, "**"); // NOI18N if (!props.containsKey(ProjectProperties.EXCLUDES)) { props.setProperty(ProjectProperties.EXCLUDES, ""); // NOI18N if (!props.containsKey("build.generated.sources.dir")) { // NOI18N props.setProperty("build.generated.sources.dir", "${build.dir}/generated-sources"); // NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_ENABLED))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_ENABLED, "true"); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_ENABLED_IN_EDITOR))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_ENABLED_IN_EDITOR, "true"); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_RUN_ALL_PROCESSORS))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_RUN_ALL_PROCESSORS, "true"); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_PROCESSORS_LIST))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_PROCESSORS_LIST, ""); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_SOURCE_OUTPUT))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_SOURCE_OUTPUT, "${build.generated.sources.dir}/ap-source-output"); //NOI18N if (!props.containsKey(ProjectProperties.JAVAC_PROCESSORPATH))props.setProperty(ProjectProperties.JAVAC_PROCESSORPATH,"${" + ProjectProperties.JAVAC_CLASSPATH + "}"); //NOI18N if (!props.containsKey("javac.test.processorpath"))props.setProperty("javac.test.processorpath", "${" + ProjectProperties.JAVAC_TEST_CLASSPATH + "}"); // NOI18N
J2EEProjectProperties.removeObsoleteLibraryLocations(props); if (!props.containsKey(ProjectProperties.INCLUDES)) { props.setProperty(ProjectProperties.INCLUDES, "**"); // NOI18N if (!props.containsKey(ProjectProperties.EXCLUDES)) { props.setProperty(ProjectProperties.EXCLUDES, ""); // NOI18N if (!props.containsKey("build.generated.sources.dir")) { // NOI18N props.setProperty("build.generated.sources.dir", "${build.dir}/generated-sources"); // NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_ENABLED))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_ENABLED, "true"); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_ENABLED_IN_EDITOR))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_ENABLED_IN_EDITOR, "true"); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_RUN_ALL_PROCESSORS))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_RUN_ALL_PROCESSORS, "true"); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_PROCESSORS_LIST))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_PROCESSORS_LIST, ""); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_SOURCE_OUTPUT))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_SOURCE_OUTPUT, "${build.generated.sources.dir}/ap-source-output"); //NOI18N if (!props.containsKey(ProjectProperties.JAVAC_PROCESSORPATH))props.setProperty(ProjectProperties.JAVAC_PROCESSORPATH,"${" + ProjectProperties.JAVAC_CLASSPATH + "}"); //NOI18N if (!props.containsKey("javac.test.processorpath"))props.setProperty("javac.test.processorpath", "${" + ProjectProperties.JAVAC_TEST_CLASSPATH + "}"); // NOI18N
/** * Updates the value of existing property in editable properties if value differs. * If value is not set or is set empty, removes property from editable properties * unless storeEmpty==true, in which case the property is preserved and set to empty * in editable properties. * * @param name property to be updated * @param value new property value * @param projectProperties project editable properties * @param privateProperties private project editable properties * @param storeEmpty true==keep empty properties in editable properties, false==remove empty properties * @return true if private properties have been edited */ private boolean updateProperty(@NonNull String name, String value, @NonNull EditableProperties projectProperties, @NonNull EditableProperties privateProperties, boolean storeEmpty) { boolean changePrivate = PRIVATE_PROPERTIES.contains(name) || privateProperties.containsKey(name); EditableProperties ep = changePrivate ? privateProperties : projectProperties; if(changePrivate) { projectProperties.remove(name); } if (!Utilities.compareObjects(value, ep.getProperty(name))) { if (value != null && (value.length() > 0 || storeEmpty)) { ep.setProperty(name, value); } else { ep.remove(name); } return changePrivate; } return false; }
private void storeRest(@NonNull EditableProperties editableProps, @NonNull EditableProperties privProps) { if(!editableProps.containsKey(MANIFEST_CUSTOM_CODEBASE) && !privProps.containsKey(MANIFEST_CUSTOM_CODEBASE)) { editableProps.setProperty(MANIFEST_CUSTOM_CODEBASE, "*"); // NOI18N editableProps.setComment(MANIFEST_CUSTOM_CODEBASE, new String[]{"# " + NbBundle.getMessage(JFXProjectUtils.class, "COMMENT_manifest_custom_codebase")}, false); // NOI18N if(!editableProps.containsKey(MANIFEST_CUSTOM_PERMISSIONS) && !privProps.containsKey(MANIFEST_CUSTOM_PERMISSIONS)) { editableProps.setProperty(MANIFEST_CUSTOM_PERMISSIONS, ""); // NOI18N editableProps.setComment(MANIFEST_CUSTOM_PERMISSIONS, new String[]{"# " + NbBundle.getMessage(JFXProjectUtils.class, "COMMENT_manifest_custom_permissions")}, false); // NOI18N
props.setProperty(WebProjectProperties.DEBUG_CLASSPATH, Utils.correctDebugClassPath(debugClassPath)); if (!props.containsKey(ProjectProperties.INCLUDES)) { props.setProperty(ProjectProperties.INCLUDES, "**"); // NOI18N if (!props.containsKey(ProjectProperties.EXCLUDES)) { props.setProperty(ProjectProperties.EXCLUDES, ""); // NOI18N if (!props.containsKey("build.generated.sources.dir")) { // NOI18N props.setProperty("build.generated.sources.dir", "${build.dir}/generated-sources"); // NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_ENABLED))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_ENABLED, "true"); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_ENABLED_IN_EDITOR))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_ENABLED_IN_EDITOR, "true"); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_RUN_ALL_PROCESSORS))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_RUN_ALL_PROCESSORS, "true"); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_PROCESSORS_LIST))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_PROCESSORS_LIST, ""); //NOI18N if (!props.containsKey(ProjectProperties.ANNOTATION_PROCESSING_SOURCE_OUTPUT))props.setProperty(ProjectProperties.ANNOTATION_PROCESSING_SOURCE_OUTPUT, "${build.generated.sources.dir}/ap-source-output"); //NOI18N if (!props.containsKey(ProjectProperties.JAVAC_PROCESSORPATH))props.setProperty(ProjectProperties.JAVAC_PROCESSORPATH,"${" + ProjectProperties.JAVAC_CLASSPATH + "}"); //NOI18N if (!props.containsKey("javac.test.processorpath"))props.setProperty("javac.test.processorpath", "${" + ProjectProperties.JAVAC_TEST_CLASSPATH + "}"); // NOI18N if (!props.containsKey(WebProjectProperties.J2EE_COPY_STATIC_FILES_ON_SAVE)) { boolean b = Boolean.parseBoolean(props.getProperty(WebProjectProperties.J2EE_COMPILE_ON_SAVE)); props.setProperty(WebProjectProperties.J2EE_COPY_STATIC_FILES_ON_SAVE, b ? "true" : "false");