/** * ************************************************************************* Restore the default * values for this project * * @param project ************************************************************************ */ public void restoreDefaults() { for (ProjectDatabaseProperty prop : ProjectDatabaseProperty.values()) { String defaultVal = getDefaultValue(prop); try { m_project.setPersistentProperty(prop.getKey(), defaultVal); } catch (CoreException e) { System.err.println("Cannot set default value for " + prop.getKey()); } } }
/** * ************************************************************************* Restore project * properties * * @param project ************************************************************************ */ @SuppressWarnings("unchecked") private void restoreProjectProperties(ProjectDatabaseProperty property) { HashMap<QualifiedName, Object> properties = null; try { properties = new HashMap<QualifiedName, Object>(m_project.getPersistentProperties()); } catch (CoreException e1) { System.err.println( "Cannot retrieve persistent propertier for project " + m_project.getName()); return; } if (!properties.containsKey(property.getKey())) { try { String defaultVal = getDefaultValue(property); m_project.setPersistentProperty(property.getKey(), defaultVal); } catch (CoreException e) { System.err.println("Cannot set default value for property " + property.getKey()); } } }