diff options
6 files changed, 32 insertions, 15 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java index 6dc96d2da..1611e62b1 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2021 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -35,6 +35,7 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; /** * This is a dialog that can host a {@link CompareEditorInput}. @@ -199,7 +200,8 @@ public class CompareDialog extends TrayDialog implements IPropertyChangeListener @Override protected IDialogSettings getDialogBoundsSettings() { - IDialogSettings compareSettings = CompareUIPlugin.getDefault().getDialogSettings(); + IDialogSettings compareSettings = PlatformUI + .getDialogSettingsProvider(FrameworkUtil.getBundle(CompareDialog.class)).getDialogSettings(); String sectionName = this.getClass().getName(); IDialogSettings dialogSettings = compareSettings.getSection(sectionName); if (dialogSettings == null) { diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java index 38ba6b8a4..4f4103c3d 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2017 Aleksandra Wozniak and others. + * Copyright (c) 2008, 2021 Aleksandra Wozniak and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -60,10 +60,12 @@ import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.forms.events.ExpansionAdapter; import org.eclipse.ui.forms.events.ExpansionEvent; import org.eclipse.ui.forms.widgets.ExpandableComposite; import org.eclipse.ui.part.ResourceTransfer; +import org.osgi.framework.FrameworkUtil; /** * This is a dialog that can invoke the compare editor on chosen files. @@ -812,7 +814,9 @@ public class CompareWithOtherResourceDialog extends TitleAreaDialog { @Override protected IDialogSettings getDialogBoundsSettings() { String sectionName = getClass().getName() + "_dialogBounds"; //$NON-NLS-1$ - IDialogSettings settings = CompareUIPlugin.getDefault().getDialogSettings(); + IDialogSettings settings = PlatformUI + .getDialogSettingsProvider(FrameworkUtil.getBundle(CompareWithOtherResourceDialog.class)) + .getDialogSettings(); IDialogSettings section = settings.getSection(sectionName); if (section == null) section = settings.addNewSection(sectionName); diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java index 4ee2b924b..be6ff9a38 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2021 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -25,6 +25,7 @@ import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; /** @@ -51,7 +52,8 @@ public abstract class ResizableDialog extends Dialog { fBundle= bundle; - fSettings= CompareUIPlugin.getDefault().getDialogSettings(); + fSettings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(ResizableDialog.class)) + .getDialogSettings(); } public void setHelpContextId(String contextId) { diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java index a25a8fb4f..f03a532dd 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2021 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -33,7 +33,9 @@ import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.Wizard; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.actions.WorkspaceModifyOperation; +import org.osgi.framework.FrameworkUtil; public class PatchWizard extends Wizard { @@ -78,7 +80,9 @@ public class PatchWizard extends Wizard { } private void initializeDialogSettings() { - IDialogSettings workbenchSettings= CompareUIPlugin.getDefault().getDialogSettings(); + IDialogSettings workbenchSettings = PlatformUI + .getDialogSettingsProvider(FrameworkUtil.getBundle(PatchWizard.class)).getDialogSettings(); + IDialogSettings section= workbenchSettings.getSection(DIALOG_SETTINGS_KEY); if (section == null) { fHasNewDialogSettings= true; @@ -182,7 +186,8 @@ public class PatchWizard extends Wizard { // Save the dialog settings if (fHasNewDialogSettings) { - IDialogSettings workbenchSettings = CompareUIPlugin.getDefault().getDialogSettings(); + IDialogSettings workbenchSettings = PlatformUI + .getDialogSettingsProvider(FrameworkUtil.getBundle(PatchWizardDialog.class)).getDialogSettings(); IDialogSettings section = workbenchSettings.getSection(DIALOG_SETTINGS_KEY); section = workbenchSettings.addNewSection(DIALOG_SETTINGS_KEY); setDialogSettings(section); diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java index a2a42d850..f4bb2990c 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizardDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2021 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -13,12 +13,13 @@ *******************************************************************************/ package org.eclipse.compare.internal.patch; -import org.eclipse.compare.internal.CompareUIPlugin; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; public class PatchWizardDialog extends WizardDialog { private static final String PATCH_WIZARD_SETTINGS_SECTION = "PatchWizard"; //$NON-NLS-1$ @@ -32,7 +33,8 @@ public class PatchWizardDialog extends WizardDialog { @Override protected IDialogSettings getDialogBoundsSettings() { - IDialogSettings settings = CompareUIPlugin.getDefault().getDialogSettings(); + IDialogSettings settings = PlatformUI + .getDialogSettingsProvider(FrameworkUtil.getBundle(PatchWizardDialog.class)).getDialogSettings(); IDialogSettings section = settings.getSection(PATCH_WIZARD_SETTINGS_SECTION); if (section == null) { section = settings.addNewSection(PATCH_WIZARD_SETTINGS_SECTION); diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java index 54797a874..5c9efba78 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2018 IBM Corporation and others. + * Copyright (c) 2005, 2021 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -19,7 +19,6 @@ import java.util.Iterator; import java.util.regex.Pattern; import org.eclipse.compare.CompareConfiguration; -import org.eclipse.compare.CompareUI; import org.eclipse.compare.internal.ComparePreferencePage; import org.eclipse.compare.internal.CompareUIPlugin; import org.eclipse.compare.internal.ICompareUIConstants; @@ -58,11 +57,13 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.forms.events.ExpansionAdapter; import org.eclipse.ui.forms.events.ExpansionEvent; import org.eclipse.ui.forms.widgets.ExpandableComposite; import org.eclipse.ui.forms.widgets.Form; import org.eclipse.ui.forms.widgets.FormToolkit; +import org.osgi.framework.FrameworkUtil; public class PreviewPatchPage2 extends WizardPage { @@ -675,7 +676,8 @@ public class PreviewPatchPage2 extends WizardPage { } private void restoreWidgetValues() { - IDialogSettings dialogSettings = CompareUI.getPlugin().getDialogSettings(); + IDialogSettings dialogSettings = PlatformUI + .getDialogSettingsProvider(FrameworkUtil.getBundle(PreviewPatchPage2.class)).getDialogSettings(); settings = dialogSettings.getSection(PREVIEWPATCHPAGE_NAME); if (settings == null) { settings = dialogSettings.addNewSection(PREVIEWPATCHPAGE_NAME); |