Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Obuchowicz2020-05-29 11:03:39 +0000
committerAndrew Obuchowicz2020-06-16 12:03:48 +0000
commit147635377ac84ccc17dc141dd0db7376b7af7dd6 (patch)
tree009ebc2bbe01861d61563459da2e7a3636db476b
parent09d0ed787d0758af4467a123accf18cc839024ca (diff)
downloadeclipse.platform.ui-147635377ac84ccc17dc141dd0db7376b7af7dd6.tar.gz
eclipse.platform.ui-147635377ac84ccc17dc141dd0db7376b7af7dd6.tar.xz
eclipse.platform.ui-147635377ac84ccc17dc141dd0db7376b7af7dd6.zip
Bug 532938 - Show restart warning on "Apply and Close" click
Change-Id: I350050a1eda9687cbe8e89660229f4b4dd80e65e Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java59
1 files changed, 27 insertions, 32 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java
index c9498b970e5..39691e0a8f3 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java
@@ -278,6 +278,33 @@ public class ViewsPreferencePage extends PreferencePage implements IWorkbenchPre
} catch (BackingStoreException e) {
WorkbenchPlugin.log("Failed to set SWT renderer preferences", e); //$NON-NLS-1$
}
+
+ if (engine != null) {
+ ITheme theme = getSelectedTheme();
+ boolean themeChanged = theme != null && !theme.equals(currentTheme);
+ boolean colorsAndFontsThemeChanged = !PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getId()
+ .equals(currentColorsAndFontsTheme.getId());
+ boolean tabCornersChanged = !useRoundTabs.getSelection() != apiStore
+ .getBoolean(IWorkbenchPreferenceConstants.USE_ROUND_TABS);
+
+ if (theme != null) {
+ currentTheme = theme;
+ }
+
+ ColorsAndFontsTheme colorsAndFontsTheme = getSelectedColorsAndFontsTheme();
+ if (colorsAndFontsTheme != null) {
+ currentColorsAndFontsTheme = colorsAndFontsTheme;
+ }
+
+ themeComboDecorator.hide();
+ colorFontsDecorator.hide();
+
+ if (themeChanged || colorsAndFontsThemeChanged || tabCornersChanged) {
+ MessageDialog.openWarning(getShell(), WorkbenchMessages.ThemeChangeWarningTitle,
+ WorkbenchMessages.ThemeChangeWarningText);
+ }
+ }
+
return super.performOk();
}
@@ -328,38 +355,6 @@ public class ViewsPreferencePage extends PreferencePage implements IWorkbenchPre
return super.performCancel();
}
- @Override
- protected void performApply() {
- super.performApply();
- if (engine != null) {
- ITheme theme = getSelectedTheme();
- IPreferenceStore apiStore = PrefUtil.getAPIPreferenceStore();
- boolean themeChanged = theme != null && !theme.equals(currentTheme);
- boolean colorsAndFontsThemeChanged = !PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getId()
- .equals(currentColorsAndFontsTheme.getId());
- boolean tabCornersChanged = !useRoundTabs.getSelection() != apiStore
- .getBoolean(IWorkbenchPreferenceConstants.USE_ROUND_TABS);
-
- if (theme != null) {
- currentTheme = theme;
- }
-
- ColorsAndFontsTheme colorsAndFontsTheme = getSelectedColorsAndFontsTheme();
- if (colorsAndFontsTheme != null) {
- currentColorsAndFontsTheme = colorsAndFontsTheme;
- }
-
- themeComboDecorator.hide();
- colorFontsDecorator.hide();
-
- if (themeChanged || colorsAndFontsThemeChanged || tabCornersChanged) {
- MessageDialog.openWarning(getShell(), WorkbenchMessages.ThemeChangeWarningTitle,
- WorkbenchMessages.ThemeChangeWarningText);
- }
- }
-
- }
-
private void createColorsAndFontsThemeCombo(Composite composite) {
new Label(composite, SWT.NONE).setText(WorkbenchMessages.ViewsPreference_currentTheme);
colorsAndFontsThemeCombo = new ComboViewer(composite, SWT.READ_ONLY);

Back to the top