diff options
author | Alexander Kurtakov | 2021-09-17 14:59:35 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2021-09-17 15:51:09 +0000 |
commit | 51b10119aa2606ab53880269619be88e47c653ad (patch) | |
tree | 2ff8ca0d1aefb0e362db39917e024d65d67fdc61 /examples | |
parent | 71be7d1f1054d0c8950bfe2331091364515e0edd (diff) | |
download | eclipse.platform.swt-51b10119aa2606ab53880269619be88e47c653ad.tar.gz eclipse.platform.swt-51b10119aa2606ab53880269619be88e47c653ad.tar.xz eclipse.platform.swt-51b10119aa2606ab53880269619be88e47c653ad.zip |
Bug 575983 - Stop disposing colors in swt
Cleanup examples.
Change-Id: Ied859cb9edafae8609b47a18aeff52ae3d9e4b09
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/185563
Tested-by: Platform Bot <platform-bot@eclipse.org>
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'examples')
8 files changed, 3 insertions, 45 deletions
diff --git a/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF b/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF index ed667d156a..9bbf5adabe 100644 --- a/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF +++ b/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %plugin.SWTStandaloneExampleSet.name Bundle-SymbolicName: org.eclipse.swt.examples; singleton:=true -Bundle-Version: 3.107.0.qualifier +Bundle-Version: 3.107.100.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 diff --git a/examples/org.eclipse.swt.examples/pom.xml b/examples/org.eclipse.swt.examples/pom.xml index dbdc91487a..2c8db029e0 100644 --- a/examples/org.eclipse.swt.examples/pom.xml +++ b/examples/org.eclipse.swt.examples/pom.xml @@ -19,6 +19,6 @@ </parent> <groupId>org.eclipse.swt</groupId> <artifactId>org.eclipse.swt.examples</artifactId> - <version>3.107.0-SNAPSHOT</version> + <version>3.107.100-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java index 3dff73b6b0..3fcad824ff 100644 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java +++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.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 @@ -393,23 +393,16 @@ class CTabFolderTab extends Tab { @Override void resetColorsAndFonts () { super.resetColorsAndFonts (); - Color oldColor = selectionForegroundColor; selectionForegroundColor = null; setSelectionForeground (); - if (oldColor != null) oldColor.dispose(); - oldColor = selectionBackgroundColor; selectionBackgroundColor = null; setSelectionBackground (); - if (oldColor != null) oldColor.dispose(); Font oldFont = itemFont; itemFont = null; setItemFont (); if (oldFont != null) oldFont.dispose(); - oldColor = itemForegroundColor; itemForegroundColor = null; setItemForeground (); - if (oldColor != null) oldColor.dispose(); - oldColor = itemBackgroundColor; itemBackgroundColor = null; setItemBackground (); } diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LinkTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LinkTab.java index 7e4fcb3e10..968e3bc871 100644 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LinkTab.java +++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LinkTab.java @@ -128,10 +128,8 @@ class LinkTab extends Tab { @Override void resetColorsAndFonts () { super.resetColorsAndFonts (); - Color oldColor = linkForegroundColor; linkForegroundColor = null; setLinkForeground (); - if (oldColor != null) oldColor.dispose(); } @Override diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java index dae02bd126..8b8f307e9d 100644 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java +++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java @@ -1622,14 +1622,10 @@ abstract class Tab { * and fonts to default settings as well. */ void resetColorsAndFonts () { - Color oldColor = foregroundColor; foregroundColor = null; setExampleWidgetForeground (); - if (oldColor != null) oldColor.dispose(); - oldColor = backgroundColor; backgroundColor = null; setExampleWidgetBackground (); - if (oldColor != null) oldColor.dispose(); Font oldFont = font; font = null; setExampleWidgetFont (); diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java index 1a6c1c7ba3..3a0c15d3d3 100644 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java +++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java @@ -453,38 +453,26 @@ class TableTab extends ScrollableTab { @Override void resetColorsAndFonts () { super.resetColorsAndFonts (); - Color oldColor = itemForegroundColor; itemForegroundColor = null; setItemForeground (); - if (oldColor != null) oldColor.dispose(); - oldColor = itemBackgroundColor; itemBackgroundColor = null; setItemBackground (); - if (oldColor != null) oldColor.dispose(); Font oldFont = font; itemFont = null; setItemFont (); if (oldFont != null) oldFont.dispose(); - oldColor = cellForegroundColor; cellForegroundColor = null; setCellForeground (); - if (oldColor != null) oldColor.dispose(); - oldColor = cellBackgroundColor; cellBackgroundColor = null; setCellBackground (); - if (oldColor != null) oldColor.dispose(); oldFont = font; cellFont = null; setCellFont (); if (oldFont != null) oldFont.dispose(); - oldColor = headerBackgroundColor; headerBackgroundColor = null; setHeaderBackground (); - if (oldColor != null) oldColor.dispose(); - oldColor = headerForegroundColor; headerForegroundColor = null; setHeaderForeground (); - if (oldColor != null) oldColor.dispose(); } /** diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java index eccf154c29..57e511154d 100644 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java +++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java @@ -579,38 +579,26 @@ class TreeTab extends ScrollableTab { @Override void resetColorsAndFonts () { super.resetColorsAndFonts (); - Color oldColor = itemForegroundColor; itemForegroundColor = null; setItemForeground (); - if (oldColor != null) oldColor.dispose(); - oldColor = itemBackgroundColor; itemBackgroundColor = null; setItemBackground (); - if (oldColor != null) oldColor.dispose(); Font oldFont = font; itemFont = null; setItemFont (); if (oldFont != null) oldFont.dispose(); - oldColor = cellForegroundColor; cellForegroundColor = null; setCellForeground (); - if (oldColor != null) oldColor.dispose(); - oldColor = cellBackgroundColor; cellBackgroundColor = null; setCellBackground (); - if (oldColor != null) oldColor.dispose(); oldFont = font; cellFont = null; setCellFont (); if (oldFont != null) oldFont.dispose(); - oldColor = headerBackgroundColor; headerBackgroundColor = null; setHeaderBackground (); - if (oldColor != null) oldColor.dispose(); - oldColor = headerForegroundColor; headerForegroundColor = null; setHeaderForeground (); - if (oldColor != null) oldColor.dispose(); } diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java index 304a7c9fe2..1071e9678b 100644 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java +++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java @@ -1215,15 +1215,10 @@ public class TextEditor { if (textFont != null) textFont.dispose(); textFont = null; - if (textForeground != null) textForeground.dispose(); textForeground = null; - if (textBackground != null) textBackground.dispose(); textBackground = null; - if (strikeoutColor != null) strikeoutColor.dispose(); strikeoutColor = null; - if (underlineColor != null) underlineColor.dispose(); underlineColor = null; - if (borderColor != null) borderColor.dispose(); borderColor = null; if (font != null) font.dispose(); |