Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-06-24 11:53:04 -0400
committerMichael Valenta2003-06-24 11:53:04 -0400
commit578e1ad9ed4a0f4d801dfe464a73f6de4fd948db (patch)
tree222fea48fbf7f2121fd18646aef3ffef7d751f4f
parent3f98483de5952245abb80fe060cd16e089b4894e (diff)
downloadeclipse.platform.team-578e1ad9ed4a0f4d801dfe464a73f6de4fd948db.tar.gz
eclipse.platform.team-578e1ad9ed4a0f4d801dfe464a73f6de4fd948db.tar.xz
eclipse.platform.team-578e1ad9ed4a0f4d801dfe464a73f6de4fd948db.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
index c5448920a..d940676cd 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
@@ -39,11 +39,13 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
import org.eclipse.core.settings.IMemento;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.Team;
@@ -989,4 +991,29 @@ public class CVSProviderPlugin extends Plugin {
public IPath getSettingsLocation() {
return getStateLocation().append("settings");
}
+
+ public SettingsStore getProjectSettings(IProject project) throws CoreException {
+ QualifiedName settingsPropertyName = new QualifiedName(ID, "settings");
+ Object cached = project.getSessionProperty(settingsPropertyName);
+ if (cached instanceof SettingsStore) {
+ return (SettingsStore)cached;
+ }
+ try {
+ final SettingsStore store = new SettingsStore(project.getFolder(new Path(".settings").append(ID)).getLocation().toFile());
+ store.load();
+ project.setSessionProperty(settingsPropertyName, store);
+ store.addPropertyChangeListener(new Preferences.IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ try {
+ store.store(ID);
+ } catch (IOException e) {
+ log(IStatus.ERROR, "Error storing plugin settings", e);
+ }
+ }
+ });
+ return store;
+ } catch (IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, ID, 0, "Error loading plugin settings", e));
+ }
+ }
}

Back to the top