Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
import org.eclipse.ui.menus.IMenuService;
import org.eclipse.ui.model.IContributionService;
import org.eclipse.ui.operations.IWorkbenchOperationSupport;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
import org.eclipse.ui.progress.IProgressService;
import org.eclipse.ui.progress.WorkbenchJob;
import org.eclipse.ui.services.IDisposable;
Expand Down Expand Up @@ -3690,8 +3691,8 @@ public void setRescaleAtRuntimePropertyFromPreference() {
+ " is configured (e.g., via the INI), but the according preference should be preferred instead." //$NON-NLS-1$
));
} else {
boolean rescaleAtRuntime = ConfigurationScope.INSTANCE.getNode(WorkbenchPlugin.PI_WORKBENCH)
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME, true);
boolean rescaleAtRuntime = new ScopedPreferenceStore(ConfigurationScope.INSTANCE,
WorkbenchPlugin.PI_WORKBENCH).getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME);
System.setProperty(SWT_RESCALE_AT_RUNTIME_PROPERTY, Boolean.toString(rescaleAtRuntime));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_THEME_ASSOCIATION;
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_THEME_ID;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -58,6 +59,7 @@
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.preference.IPersistentPreferenceStore;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.ArrayContentProvider;
Expand Down Expand Up @@ -88,6 +90,7 @@
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.themes.IThemeDescriptor;
import org.eclipse.ui.internal.util.PrefUtil;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
import org.eclipse.ui.themes.IThemeManager;
import org.osgi.service.prefs.BackingStoreException;

Expand Down Expand Up @@ -238,8 +241,8 @@ private void createRescaleAtRuntimeCheckButton(Composite parent) {
}
createLabel(parent, ""); //$NON-NLS-1$

boolean initialStateRescaleAtRuntime = ConfigurationScope.INSTANCE.getNode(WorkbenchPlugin.PI_WORKBENCH)
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME, true);
boolean initialStateRescaleAtRuntime = new ScopedPreferenceStore(ConfigurationScope.INSTANCE,
WorkbenchPlugin.PI_WORKBENCH).getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME);
rescaleAtRuntime = createCheckButton(parent, WorkbenchMessages.RescaleAtRuntimeEnabled,
initialStateRescaleAtRuntime);
if (!DPIUtil.isSetupCompatibleToMonitorSpecificScaling()) {
Expand Down Expand Up @@ -486,16 +489,17 @@ public boolean performOk() {

boolean isRescaleAtRuntimeChanged = false;
if (rescaleAtRuntime != null) {
IEclipsePreferences configurationScopeNode = ConfigurationScope.INSTANCE
.getNode(WorkbenchPlugin.PI_WORKBENCH);
IPersistentPreferenceStore configurationScopeNode = new ScopedPreferenceStore(ConfigurationScope.INSTANCE,
WorkbenchPlugin.PI_WORKBENCH);
boolean initialStateRescaleAtRuntime = configurationScopeNode
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME, true);
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME);
isRescaleAtRuntimeChanged = initialStateRescaleAtRuntime != rescaleAtRuntime.getSelection();
configurationScopeNode.putBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME,
rescaleAtRuntime.getSelection());
configurationScopeNode.setValue(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME,
Boolean.toString(rescaleAtRuntime.getSelection()));
try {
configurationScopeNode.flush();
} catch (BackingStoreException e) {
configurationScopeNode.save();
} catch (IOException e) {
WorkbenchPlugin.log("Failed to set monitor-specific scaling preference", e); //$NON-NLS-1$
}
}

Expand Down Expand Up @@ -625,6 +629,12 @@ protected void performDefaults() {
IPreferenceStore apiStore = PrefUtil.getAPIPreferenceStore();
useColoredLabels.setSelection(apiStore.getDefaultBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS));

if (rescaleAtRuntime != null) {
IPreferenceStore configurationStore = new ScopedPreferenceStore(ConfigurationScope.INSTANCE,
WorkbenchPlugin.PI_WORKBENCH);
rescaleAtRuntime.setSelection(
configurationStore.getDefaultBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME));
}
enableMru.setSelection(defaultPrefs.getBoolean(StackRenderer.MRU_KEY_DEFAULT, StackRenderer.MRU_DEFAULT));
super.performDefaults();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void initializeDefaultPreferences() {
node.putBoolean(IWorkbenchPreferenceConstants.LINK_NAVIGATOR_TO_EDITOR,
false);

node.putBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME, true);
node.putBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS, true);
node.putBoolean(
IWorkbenchPreferenceConstants.SHOW_TEXT_ON_PERSPECTIVE_BAR,
Expand Down
Loading