Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2009-04-13 15:47:51 +0000
committerChris Goldthorpe2009-04-13 15:47:51 +0000
commit36069864e7fe8825f48cd89ae561ebacbdbafb0a (patch)
tree2b7f3634c122a3de9b1d077be7e638b157e52502
parentf221b89dab87711a86d87ba8a6d12406dbb98887 (diff)
downloadeclipse.platform.ua-36069864e7fe8825f48cd89ae561ebacbdbafb0a.tar.gz
eclipse.platform.ua-36069864e7fe8825f48cd89ae561ebacbdbafb0a.tar.xz
eclipse.platform.ua-36069864e7fe8825f48cd89ae561ebacbdbafb0a.zip
Add function to restore font scale to default
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/FontSelection.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/FontSelection.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/FontSelection.java
index d7a6d299f..8d14a3e15 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/FontSelection.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/FontSelection.java
@@ -13,6 +13,7 @@ package org.eclipse.ui.internal.intro.impl;
import org.eclipse.core.runtime.IProduct;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.resource.JFaceResources;
@@ -78,6 +79,16 @@ public class FontSelection {
} catch (BackingStoreException e) {
}
}
+
+ // Set the scale factor to it's default
+ public static void resetScalePercentage() {
+ InstanceScope instanceScope = new InstanceScope();
+ IEclipsePreferences iprefs = instanceScope.getNode(IntroPlugin.PLUGIN_ID);
+ DefaultScope defaultScope = new DefaultScope();
+ IEclipsePreferences dprefs = defaultScope.getNode(IntroPlugin.PLUGIN_ID);
+ String defaultScale = dprefs.get(SCALE_FACTOR, "0"); //$NON-NLS-1$
+ iprefs.put(SCALE_FACTOR, defaultScale);
+ }
public static String getFontStyle() {
IProduct product = Platform.getProduct();

Back to the top