Skip to content

Commit

Permalink
Merge pull request #4 from zelenyhleb/1-settings-dropped
Browse files Browse the repository at this point in the history
added store::save after set value
  • Loading branch information
zelenyhleb committed May 13, 2024
2 parents e46d245 + 331b9af commit 5e09c28
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
*******************************************************************************/
package ru.zelenyhleb.etape.preferences.core;

import java.io.IOException;

import org.eclipse.core.runtime.Platform;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.preferences.ScopedPreferenceStore;

public final class Preference {
Expand All @@ -38,6 +42,12 @@ public String get() {

public void set(String value) {
store.setValue(key, value);
try {
store.save();
} catch (IOException e) {
Platform.getLog(getClass())
.error(NLS.bind("Can not save preference value {1} to preference {0}", key, value), e); //$NON-NLS-1$
}
}

public String key() {
Expand Down

0 comments on commit 5e09c28

Please sign in to comment.