@Override public void performDefaults() { if (mainComposite == null) { return; } objects.setEnabled(true); objects.setValues(new String[] {}); libraries.setEnabled(true); libraries.setValues(new String[] {}); librarySearchPath.setEnabled(true); librarySearchPath.setValues(new String[] {}); disablePredefinedExtrnalDirs.setEnabled(true); disablePredefinedExtrnalDirs.setSelection(false); }
@Override public void setEnabled(final boolean enabled) { if (mainComposite == null) { return; } objects.setEnabled(enabled); libraries.setEnabled(enabled); librarySearchPath.setEnabled(enabled); disablePredefinedExtrnalDirs.setEnabled(enabled); }
@Override public void dispose() { if (mainComposite != null) { mainComposite.dispose(); mainComposite = null; objects.dispose(); libraries.dispose(); librarySearchPath.dispose(); disablePredefinedExtrnalDirs.dispose(); } }
@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); } }
@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; }