@Override public boolean saveProperties(final IProject project) { try { QualifiedName qualifiedName = new QualifiedName( ProjectBuildPropertyData.QUALIFIER, LinkerLibrariesOptionsData.ADDITIONAL_OBJECTS_PROPERTY); String newValue = ListConverter.convertFromList(objects.getValues()); String oldValue = project.getPersistentProperty(qualifiedName); if (newValue != null && !newValue.equals(oldValue)) { project.setPersistentProperty(qualifiedName, newValue); } qualifiedName = new QualifiedName( ProjectBuildPropertyData.QUALIFIER, LinkerLibrariesOptionsData.LINKER_LIBRARIES_PROPERTY); newValue = ListConverter.convertFromList(libraries.getValues()); oldValue = project.getPersistentProperty(qualifiedName); if (newValue != null && !newValue.equals(oldValue)) { project.setPersistentProperty(qualifiedName, newValue); } qualifiedName = new QualifiedName( ProjectBuildPropertyData.QUALIFIER, LinkerLibrariesOptionsData.LINKER_LIBRARY_SEARCH_PATH_PROPERTY); newValue = ListConverter.convertFromList(librarySearchPath.getValues()); oldValue = project.getPersistentProperty(qualifiedName); if (newValue != null && !newValue.equals(oldValue)) { project.setPersistentProperty(qualifiedName, newValue); } qualifiedName = new QualifiedName( ProjectBuildPropertyData.QUALIFIER, LinkerLibrariesOptionsData.DISABLE_EXTERNAL_DIRS_PROPERTY); newValue = disablePredefinedExtrnalDirs.getSelection() ? "true" : "false"; oldValue = project.getPersistentProperty(qualifiedName); if (!newValue.equals(oldValue)) { project.setPersistentProperty(qualifiedName, newValue); } } catch (CoreException e) { ErrorReporter.logExceptionStackTrace(e); return false; } return true; }
@Override public void loadProperties(final IProject project) { try { String temp = project.getPersistentProperty( new QualifiedName( ProjectBuildPropertyData.QUALIFIER, LinkerLibrariesOptionsData.ADDITIONAL_OBJECTS_PROPERTY)); objects.setValues(ListConverter.convertToList(temp)); temp = project.getPersistentProperty( new QualifiedName( ProjectBuildPropertyData.QUALIFIER, LinkerLibrariesOptionsData.LINKER_LIBRARIES_PROPERTY)); libraries.setValues(ListConverter.convertToList(temp)); temp = project.getPersistentProperty( new QualifiedName( ProjectBuildPropertyData.QUALIFIER, LinkerLibrariesOptionsData.LINKER_LIBRARY_SEARCH_PATH_PROPERTY)); librarySearchPath.setValues(ListConverter.convertToList(temp)); temp = project.getPersistentProperty( new QualifiedName( ProjectBuildPropertyData.QUALIFIER, LinkerLibrariesOptionsData.DISABLE_EXTERNAL_DIRS_PROPERTY)); disablePredefinedExtrnalDirs.setSelection("true".equals(temp) ? true : false); } catch (CoreException e) { objects.setValues(new String[] {}); libraries.setValues(new String[] {}); librarySearchPath.setValues(new String[] {}); disablePredefinedExtrnalDirs.setEnabled(false); } }