diff options
author | Alexander Kurtakov | 2020-11-16 11:27:08 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2020-11-16 11:27:08 +0000 |
commit | cb30c6c311d9c5533c881b196cbb1eb95242d89b (patch) | |
tree | ecbaf9f66498af09cba13bf8978791ec05b46383 | |
parent | adb7b4b03ddd44a0011c57ab4710447b1f6dde73 (diff) | |
download | eclipse.platform-cb30c6c311d9c5533c881b196cbb1eb95242d89b.tar.gz eclipse.platform-cb30c6c311d9c5533c881b196cbb1eb95242d89b.tar.xz eclipse.platform-cb30c6c311d9c5533c881b196cbb1eb95242d89b.zip |
Stop using deprecated AbstractUIPlugin.getDialogSettings()Y20201117-1200S4_18_0_M3I20201120-0320I20201119-0730I20201118-1800I20201118-0600I20201117-1800I20201117-0600I20201116-1800
Change-Id: I943de01bdfaaad8fb2c1f03b6abd736234ab1768
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
9 files changed, 34 insertions, 24 deletions
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/EditAntHomeEntryAction.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/EditAntHomeEntryAction.java index 17dabca67..608135992 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/EditAntHomeEntryAction.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/EditAntHomeEntryAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -16,7 +16,6 @@ package org.eclipse.ant.internal.ui.launchConfigurations; import org.eclipse.ant.core.AntCorePlugin; import org.eclipse.ant.core.AntCorePreferences; import org.eclipse.ant.internal.launching.launchConfigurations.AntHomeClasspathEntry; -import org.eclipse.ant.internal.ui.AntUIPlugin; import org.eclipse.ant.internal.ui.IAntUIConstants; import org.eclipse.ant.internal.ui.preferences.AntPreferencesMessages; import org.eclipse.core.resources.ResourcesPlugin; @@ -29,6 +28,8 @@ import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.DirectoryDialog; +import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; /** * Edits the Ant Home classpath entry. @@ -52,7 +53,7 @@ public class EditAntHomeEntryAction extends RuntimeClasspathAction { @Override public void run() { - IDialogSettings dialogSettings = AntUIPlugin.getDefault().getDialogSettings(); + IDialogSettings dialogSettings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(EditAntHomeEntryAction.class)).getDialogSettings(); String lastUsedPath = dialogSettings.get(IAntUIConstants.DIALOGSTORE_LASTANTHOME); if (lastUsedPath == null) { lastUsedPath = ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString(); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/SetTargetsDialog.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/SetTargetsDialog.java index b5ec172ab..1da7c503d 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/SetTargetsDialog.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/SetTargetsDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -14,7 +14,6 @@ package org.eclipse.ant.internal.ui.launchConfigurations; import org.eclipse.ant.internal.core.IAntCoreConstants; -import org.eclipse.ant.internal.ui.AntUIPlugin; import org.eclipse.ant.launching.IAntLaunchConstants; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; @@ -24,6 +23,8 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; public class SetTargetsDialog extends Dialog { @@ -73,7 +74,7 @@ public class SetTargetsDialog extends Dialog { @Override protected IDialogSettings getDialogBoundsSettings() { - IDialogSettings settings = AntUIPlugin.getDefault().getDialogSettings(); + IDialogSettings settings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(SetTargetsDialog.class)).getDialogSettings(); IDialogSettings section = settings.getSection(DIALOG_SETTINGS_SECTION); if (section == null) { section = settings.addNewSection(DIALOG_SETTINGS_SECTION); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/VariableInputDialog.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/VariableInputDialog.java index 5a263e68b..e683664f2 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/VariableInputDialog.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/VariableInputDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -13,7 +13,6 @@ *******************************************************************************/ package org.eclipse.ant.internal.ui.launchConfigurations; -import org.eclipse.ant.internal.ui.AntUIPlugin; import org.eclipse.debug.ui.StringVariableSelectionDialog; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; @@ -29,6 +28,8 @@ import org.eclipse.swt.widgets.Control; 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.osgi.framework.FrameworkUtil; public class VariableInputDialog extends Dialog { @@ -111,7 +112,7 @@ public class VariableInputDialog extends Dialog { @Override protected IDialogSettings getDialogBoundsSettings() { - IDialogSettings settings = AntUIPlugin.getDefault().getDialogSettings(); + IDialogSettings settings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(VariableInputDialog.class)).getDialogSettings(); IDialogSettings section = settings.getSection(DIALOG_SETTINGS_SECTION); if (section == null) { section = settings.addNewSection(DIALOG_SETTINGS_SECTION); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java index 83d938f5c..c56306160 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -53,6 +53,8 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Tree; +import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; public class AntClasspathBlock { @@ -74,7 +76,7 @@ public class AntClasspathBlock { private String antHome; - private IDialogSettings dialogSettings = AntUIPlugin.getDefault().getDialogSettings(); + private IDialogSettings dialogSettings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(AntClasspathBlock.class)).getDialogSettings(); private IAntBlockContainer container; diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPage.java index 997a522e1..290ad7798 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2020 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.List; import org.eclipse.ant.core.IAntClasspathEntry; import org.eclipse.ant.internal.core.AntObject; -import org.eclipse.ant.internal.ui.AntUIPlugin; import org.eclipse.ant.internal.ui.ColumnSorter; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogSettings; @@ -43,6 +42,7 @@ import org.eclipse.swt.widgets.TabItem; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; /** * Provides the generic implementation for a sub-page in the Ant preference page. @@ -203,7 +203,7 @@ public abstract class AntPage { } }); - restoreColumnSettings(AntUIPlugin.getDefault().getDialogSettings(), sorters); + restoreColumnSettings(PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(AntPage.class)).getDialogSettings(), sorters); } /** diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java index fcb1d6139..6faa00823 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -54,6 +54,8 @@ import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; public class AntPropertiesBlock { @@ -193,7 +195,7 @@ public class AntPropertiesBlock { public void createControl(Composite top, String propertyLabel, String propertyFileLabel) { Font font = top.getFont(); - dialogSettings = AntUIPlugin.getDefault().getDialogSettings(); + dialogSettings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(AntPropertiesBlock.class)).getDialogSettings(); Label label = new Label(top, SWT.NONE); GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntRuntimePreferencePage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntRuntimePreferencePage.java index 40cfd9783..ec36b2120 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntRuntimePreferencePage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntRuntimePreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -36,6 +36,7 @@ import org.eclipse.swt.widgets.TabFolder; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; /** * Ant preference page to set the classpath, tasks, types and properties. @@ -104,7 +105,7 @@ public class AntRuntimePreferencePage extends PreferencePage implements IWorkben @Override public boolean performOk() { AntCorePreferences prefs = AntCorePlugin.getPlugin().getPreferences(); - IDialogSettings settings = AntUIPlugin.getDefault().getDialogSettings(); + IDialogSettings settings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(AntRuntimePreferencePage.class)).getDialogSettings(); prefs.setAntHomeClasspathEntries(classpathPage.getAntHomeEntries()); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileSelectionDialog.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileSelectionDialog.java index 92941dc90..046d8aec4 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileSelectionDialog.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -32,11 +32,13 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.dialogs.ElementTreeSelectionDialog; import org.eclipse.ui.dialogs.ISelectionStatusValidator; import org.eclipse.ui.model.WorkbenchContentProvider; import org.eclipse.ui.model.WorkbenchLabelProvider; import org.eclipse.ui.views.navigator.ResourceComparator; +import org.osgi.framework.FrameworkUtil; public class FileSelectionDialog extends ElementTreeSelectionDialog { @@ -78,7 +80,7 @@ public class FileSelectionDialog extends ElementTreeSelectionDialog { button.setText(fFilterMessage); button.setFont(parent.getFont()); - IDialogSettings settings = AntUIPlugin.getDefault().getDialogSettings(); + IDialogSettings settings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(FileSelectionDialog.class)).getDialogSettings(); fShowAll = settings.getBoolean(DIALOG_SETTING); String lastPath = settings.get(LAST_CONTAINER); @@ -112,7 +114,7 @@ public class FileSelectionDialog extends ElementTreeSelectionDialog { @Override public boolean close() { - IDialogSettings settings = AntUIPlugin.getDefault().getDialogSettings(); + IDialogSettings settings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(FileSelectionDialog.class)).getDialogSettings(); settings.put(DIALOG_SETTING, fShowAll); Object[] result = getResult(); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/SearchForBuildFilesDialog.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/SearchForBuildFilesDialog.java index c906193de..dd0b6e9ed 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/SearchForBuildFilesDialog.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/SearchForBuildFilesDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -20,7 +20,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.eclipse.ant.internal.core.IAntCoreConstants; -import org.eclipse.ant.internal.ui.AntUIPlugin; import org.eclipse.ant.internal.ui.IAntUIHelpContextIds; import org.eclipse.ant.internal.ui.IAntUIPreferenceConstants; import org.eclipse.core.resources.IFile; @@ -49,6 +48,7 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.ui.IWorkingSet; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog; +import org.osgi.framework.FrameworkUtil; /** * This dialog allows the user to search for Ant build files whose names match a given pattern. The search may be performed on the entire workspace or @@ -86,7 +86,7 @@ public class SearchForBuildFilesDialog extends InputDialog { /** * The dialog settings used to persist this dialog's settings. */ - private static IDialogSettings settings = AntUIPlugin.getDefault().getDialogSettings(); + private static IDialogSettings settings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(SearchForBuildFilesDialog.class)).getDialogSettings(); /** * Initialize any dialog settings that haven't been set. |