Skip to content

Commit cffae32

Browse files
committed
Stop using deprecated APIs in readme example
1 parent 4fa0cba commit cffae32

File tree

1 file changed

+7
-2
lines changed
  • examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool

1 file changed

+7
-2
lines changed

examples/org.eclipse.ui.examples.readmetool/Eclipse UI Examples Readme Tool/org/eclipse/ui/examples/readmetool/ReadmePreferencePage.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2006 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -14,6 +14,7 @@
1414

1515
package org.eclipse.ui.examples.readmetool;
1616

17+
import org.eclipse.core.runtime.preferences.InstanceScope;
1718
import org.eclipse.jface.preference.IPreferenceStore;
1819
import org.eclipse.jface.preference.PreferencePage;
1920
import org.eclipse.swt.SWT;
@@ -31,6 +32,7 @@
3132
import org.eclipse.ui.IWorkbench;
3233
import org.eclipse.ui.IWorkbenchPreferencePage;
3334
import org.eclipse.ui.PlatformUI;
35+
import org.osgi.service.prefs.BackingStoreException;
3436

3537
/**
3638
* This class implements a sample preference page that is added to the
@@ -287,7 +289,10 @@ protected void performDefaults() {
287289
@Override
288290
public boolean performOk() {
289291
storeValues();
290-
ReadmePlugin.getDefault().savePluginPreferences();
292+
try {
293+
InstanceScope.INSTANCE.getNode(ReadmePlugin.PLUGIN_ID).flush();
294+
} catch (BackingStoreException e) {
295+
}
291296
return true;
292297
}
293298

0 commit comments

Comments
 (0)