private static void removeServerClasspathProperties(EditableProperties ep) { ep.remove(J2EE_PLATFORM_CLASSPATH); ep.remove(J2EE_PLATFORM_EMBEDDABLE_EJB_CLASSPATH); ep.remove(J2EE_PLATFORM_WSCOMPILE_CLASSPATH); ep.remove(J2EE_PLATFORM_WSIMPORT_CLASSPATH); ep.remove(J2EE_PLATFORM_WSGEN_CLASSPATH); ep.remove(J2EE_PLATFORM_WSIT_CLASSPATH); ep.remove(J2EE_PLATFORM_JWSDP_CLASSPATH); ep.remove(J2EE_SERVER_HOME); }
private void storeJSCallbacks(final EditableProperties props) { if (jsCallbacksChanged && jsCallbacks != null) { for (Map.Entry<String,String> entry : jsCallbacks.entrySet()) { if(entry.getValue() != null && !entry.getValue().isEmpty()) { props.setProperty(JAVASCRIPT_CALLBACK_PREFIX + entry.getKey(), entry.getValue()); //NOI18N } else { props.remove(JAVASCRIPT_CALLBACK_PREFIX + entry.getKey()); } } } }
public void updateProperties(EditableProperties projectProperties) { if (licensePath != null) { projectProperties.setProperty(LICENSE_PATH, licensePath); } else { projectProperties.remove(LICENSE_PATH); } if (licenseName != null) { projectProperties.setProperty(LICENSE_NAME, licenseName); } else { projectProperties.remove(LICENSE_NAME); } } }
public void updateProperties(EditableProperties projectProperties) { if (licensePath != null) { projectProperties.setProperty(LICENSE_PATH, licensePath); } else { projectProperties.remove(LICENSE_PATH); } if (licenseName != null) { projectProperties.setProperty(LICENSE_NAME, licenseName); } else { projectProperties.remove(LICENSE_NAME); } } }
private void storeResources(final EditableProperties props) { if (lazyJarsChanged) { //Remove old way if exists props.remove(DOWNLOAD_MODE_LAZY_JARS); final Iterator<Map.Entry<String,String>> it = props.entrySet().iterator(); while (it.hasNext()) { if (it.next().getKey().startsWith(DOWNLOAD_MODE_LAZY_JAR)) { it.remove(); } } for (File lazyJar : lazyJars) { props.setProperty(String.format(DOWNLOAD_MODE_LAZY_FORMAT, lazyJar.getName()), "true"); //NOI18N } } }
public static void removeProperty(final AntProjectHelper helper, String[] propertyNames, String propertiesPath) { EditableProperties ep = helper.getProperties(propertiesPath); for (String name : propertyNames) { ep.remove(name); } helper.putProperties(propertiesPath, ep); }
/** Set jaxws.endorsed.dir property for wsimport, wsgen tasks * to specify jvmarg value : -Djava.endorsed.dirs=${jaxws.endorsed.dir}" */ public static void setJaxWsEndorsedDirProperty(EditableProperties ep) { String oldJaxWsEndorsedDirs = ep.getProperty(ENDORSED_DIR_PROPERTY); String javaVersion = System.getProperty("java.specification.version"); //NOI18N if ("1.6".equals(javaVersion)) { //NOI18N String jaxWsEndorsedDirs = getJaxWsApiDir(); if (jaxWsEndorsedDirs != null && !jaxWsEndorsedDirs.equals(oldJaxWsEndorsedDirs)) { ep.setProperty(ENDORSED_DIR_PROPERTY, jaxWsEndorsedDirs); } } else { if (oldJaxWsEndorsedDirs != null) { ep.remove(ENDORSED_DIR_PROPERTY); } } }
projectProperties.put(PROP_BUILD_ACTION, buildTextField.getText()); } else { projectProperties.remove(PROP_BUILD_ACTION); prefs.put(PROP_BUILD_ACTION, buildTextField.getText()); projectProperties.put(PROP_CLEAN_ACTION, cleanTextField.getText()); } else { projectProperties.remove(PROP_CLEAN_ACTION); prefs.put(PROP_CLEAN_ACTION, cleanTextField.getText()); projectProperties.put(PROP_REBUILD_ACTION, rebuildTextField.getText()); } else { projectProperties.remove(PROP_REBUILD_ACTION); prefs.put(PROP_REBUILD_ACTION, rebuildTextField.getText());
/** * Remove from ep all prop related properties that represent * entries not present in config * * @param ep editable properties */ private void cleanEntryPropertiesIfEmpty(String config, EditableProperties ep) { assert !configNameWrong(config); List<String> toRemove = new LinkedList<String>(); for(String prop : ep.keySet()) { if(isEntryNameProperty(prop)) { String name = ep.get(prop); if(!hasEntry(config, name)) { toRemove.add(prop); } } } for(String prop : toRemove) { ep.remove(prop); ep.remove(getEntryValueProperty(prop)); ep.remove(getEntryHiddenProperty(prop)); } }
private void setOrRemove(@NonNull EditableProperties props, @NonNull String name, String value) { if (value != null) { props.setProperty(name, value); } else { props.remove(name); } }
void upgradeProjectProperties() { EditableProperties properties = project.getHelper().getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); // specific upgrades upgradePhpUnit(properties); // general key replace for (Map.Entry<String, String> entry : UPGRADE_KEYS.entrySet()) { String property = properties.getProperty(entry.getKey()); if (property != null) { properties.remove(entry.getKey()); properties.put(entry.getValue(), property); } } project.getHelper().putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, properties); }
/** * If property not present in config configuration, remove it from editable properties. * This is to propagate property deletions in config to property files * @param name * @param config * @param ep * @return true if properties have been edited */ private boolean cleanPropertyIfEmpty(@NonNull String name, String config, @NonNull EditableProperties ep) { if(!isPropertySet(config, name)) { ep.remove(name); return true; } return false; }
public void run() { try { EditableProperties props = PropertyUtils.getGlobalProperties(); for (int i=0; i < VOLUME_TYPES.length; i++) { String property = LIB_PREFIX + libraryImpl.getName() + '.' + VOLUME_TYPES[i]; //NOI18N props.remove(property); } PropertyUtils.putGlobalProperties(props); } catch (IOException ioe) { ErrorManager.getDefault().notify (ioe); } } });
public void run() { try { EditableProperties props = PropertyUtils.getGlobalProperties(); for (int i=0; i < VOLUME_TYPES.length; i++) { String property = LIB_PREFIX + libraryImpl.getName() + '.' + VOLUME_TYPES[i]; //NOI18N props.remove(property); } PropertyUtils.putGlobalProperties(props); } catch (IOException ioe) { ErrorManager.getDefault().notify (ioe); } } });
public void run() { try { EditableProperties props = PropertyUtils.getGlobalProperties(); for (int i = 0; i < VOLUME_TYPES.length; i++) { String property = LIB_PREFIX + libraryImpl.getName() + '.' + VOLUME_TYPES[i]; //NOI18N props.remove(property); } PropertyUtils.putGlobalProperties(props); } catch (IOException ioe) { ErrorManager.getDefault().notify(ioe); } } });
public void run() { try { EditableProperties props = PropertyUtils.getGlobalProperties(); for (int i=0; i < VOLUME_TYPES.length; i++) { String property = LIB_PREFIX + libraryImpl.getName() + '.' + VOLUME_TYPES[i]; //NOI18N props.remove(property); } PropertyUtils.putGlobalProperties(props); } catch (IOException ioe) { ErrorManager.getDefault().notify (ioe); } } });
public void run() { // remove "libs.XXX.classpath" from project.properties - not needed for shared project AntProjectHelper helper = uiProperties.getProject().getAntProjectHelper(); EditableProperties ep = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH); List<String> l = new ArrayList<String>(); l.addAll(ep.keySet()); for (String key : l) { if (key.startsWith("libs.") && key.endsWith(".classpath")) { // NOI18N ep.remove(key); } } helper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, ep); // remove all libs.XXX.classpath.libfile.XXX props from private properties EditableProperties privateProps = helper.getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH); J2EEProjectProperties.removeObsoleteLibraryLocations(privateProps); helper.putProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH, privateProps); try { ProjectManager.getDefault().saveProject(uiProperties.getProject()); } catch (IOException ex) { Exceptions.printStackTrace(ex); } }}); }
private static void configureRunAsInternalServer(ProjectProperties projectProperties, EditableProperties sharedProperties, EditableProperties privateProperties) { String hostname = projectProperties.getHostname(); Integer port = projectProperties.getPort(); String router = projectProperties.getRouter(); assert hostname != null; assert port != null; privateProperties.put(PhpProjectProperties.HOSTNAME, hostname); privateProperties.put(PhpProjectProperties.PORT, String.valueOf(port)); if (StringUtils.hasText(router)) { privateProperties.put(PhpProjectProperties.ROUTER, router); } // XXX remove index.file from properties, so run/debug project can then work privateProperties.remove(PhpProjectProperties.INDEX_FILE); }
public void setActiveConfiguration(Config c) throws IllegalArgumentException, IOException { if (c != DEFAULT && !configs.values().contains(c)) { throw new IllegalArgumentException(); } final String n = c.name; EditableProperties ep = p.getUpdateHelper().getProperties(CONFIG_PROPS_PATH); if (Utilities.compareObjects(n, ep.getProperty(PROP_CONFIG))) { return; } if (n != null) { ep.setProperty(PROP_CONFIG, n); } else { ep.remove(PROP_CONFIG); } p.getUpdateHelper().putProperties(CONFIG_PROPS_PATH, ep); pcs.firePropertyChange(ProjectConfigurationProvider.PROP_CONFIGURATION_ACTIVE, null, null); ProjectManager.getDefault().saveProject(p); assert p.getProjectDirectory().getFileObject(CONFIG_PROPS_PATH) != null; }
@Override public void setActiveConfiguration(Config c) throws IOException { if (c != DEFAULT && !configs.values().contains(c)) { throw new IllegalArgumentException(); } final String n = c.name; EditableProperties ep = project.getHelper().getProperties(CONFIG_PROPS_PATH); if (Utilities.compareObjects(n, ep.getProperty(PROP_CONFIG))) { return; } if (n != null) { ep.setProperty(PROP_CONFIG, n); } else { ep.remove(PROP_CONFIG); } project.getHelper().putProperties(CONFIG_PROPS_PATH, ep); pcs.firePropertyChange(ProjectConfigurationProvider.PROP_CONFIGURATION_ACTIVE, null, null); ProjectManager.getDefault().saveProject(project); assert project.getProjectDirectory().getFileObject(CONFIG_PROPS_PATH) != null; }