Bug 572002: Adapt use of SWTs Color to current recommendation
- Change to Color constructors without Device
- Remove calls to Color.dispose
- Adapt to removed ColorManager
Change-Id: I4e9791a7a9557f8b9f58bafd7a7fd43b14e99682
diff --git a/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsoleColorAdapter.java b/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsoleColorAdapter.java
index 24fc7cf..b80142a 100644
--- a/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsoleColorAdapter.java
+++ b/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsoleColorAdapter.java
@@ -18,6 +18,7 @@
import java.util.List;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.statet.jcommons.collections.ImCollections;
@@ -30,7 +31,6 @@
import org.eclipse.statet.ecommons.preferences.core.util.PreferenceUtils;
import org.eclipse.statet.ecommons.preferences.ui.RGBPref;
import org.eclipse.statet.ecommons.text.ui.presentation.ITextPresentationConstants;
-import org.eclipse.statet.ecommons.ui.SharedUIResources;
import org.eclipse.statet.ecommons.ui.util.UIAccess;
import org.eclipse.statet.nico.core.runtime.SubmitType;
@@ -123,10 +123,8 @@
for (final String streamId : STREAM_IDS) {
final NIConsoleOutputStream stream= console.getStream(streamId);
if (stream != null) {
- stream.setColor(SharedUIResources.getColors().getColor(
- getPrefValue(getForegroundColorPref(streamId)) ));
- stream.setBackgroundColor(SharedUIResources.getColors().getColor(
- getPrefValue(getBackgroundColorPref(streamId)) ));
+ stream.setColor(getColor(getForegroundColorPref(streamId)));
+ stream.setBackgroundColor(getColor(getBackgroundColorPref(streamId)));
stream.setFontStyle(getFontStyle(streamId));
}
}
@@ -137,9 +135,12 @@
this.console= null;
}
- private <T> @Nullable T getPrefValue(final @Nullable Preference<T> preference) {
+ private @Nullable Color getColor(final @Nullable Preference<@Nullable RGB> preference) {
if (preference != null) {
- return this.prefAccess.getPreferenceValue(preference);
+ final RGB rgb= this.prefAccess.getPreferenceValue(preference);
+ if (rgb != null) {
+ return new Color(rgb);
+ }
}
return null;
}
diff --git a/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsoleOutputStream.java b/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsoleOutputStream.java
index 5b02576..53c8e9e 100644
--- a/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsoleOutputStream.java
+++ b/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsoleOutputStream.java
@@ -15,6 +15,7 @@
package org.eclipse.statet.nico.ui.console;
import java.io.IOException;
+import java.util.Objects;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.swt.graphics.Color;
@@ -136,10 +137,10 @@
* @param newColor color of this stream, or {@code null}
*/
public void setColor(final @Nullable Color newColor) {
- final Color old= this.color;
- if (old == null || !old.equals(newColor)) {
+ final Color oldColor= this.color;
+ if (!Objects.equals(oldColor, newColor)) {
this.color= newColor;
- this.console.firePropertyChange(this, IConsoleConstants.P_STREAM_COLOR, old, newColor);
+ this.console.firePropertyChange(this, IConsoleConstants.P_STREAM_COLOR, oldColor, newColor);
}
}
diff --git a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/RUIPlugin.java b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/RUIPlugin.java
index c951585..b4de7ff 100644
--- a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/RUIPlugin.java
+++ b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/RUIPlugin.java
@@ -47,7 +47,6 @@
import org.eclipse.statet.ecommons.preferences.core.PreferenceAccess;
import org.eclipse.statet.ecommons.preferences.core.util.PreferenceUtils;
import org.eclipse.statet.ecommons.text.ui.settings.TextStyleManager;
-import org.eclipse.statet.ecommons.ui.SharedUIResources;
import org.eclipse.statet.ecommons.ui.util.ImageDescriptorRegistry;
import org.eclipse.statet.ecommons.ui.util.ImageRegistryUtil;
@@ -388,8 +387,7 @@
if (!this.started) {
throw new IllegalStateException("Plug-in is not started.");
}
- this.rTextStyles= new TextStyleManager(SharedUIResources.getColors(),
- getPreferenceStore(),
+ this.rTextStyles= new TextStyleManager(getPreferenceStore(),
RUIPreferenceConstants.R.TS_GROUP_ID );
PreferencesUtil.getSettingsChangeNotifier().addManageListener(this.rTextStyles);
}
@@ -401,8 +399,7 @@
if (!this.started) {
throw new IllegalStateException("Plug-in is not started.");
}
- this.rdTextStyles= new TextStyleManager(SharedUIResources.getColors(),
- getPreferenceStore(),
+ this.rdTextStyles= new TextStyleManager(getPreferenceStore(),
RUIPreferenceConstants.Rd.TS_GROUP_ID );
PreferencesUtil.getSettingsChangeNotifier().addManageListener(this.rdTextStyles);
}
diff --git a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/datafilterview/ExpandableRowComposite.java b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/datafilterview/ExpandableRowComposite.java
index cc9cc8e..677b7cb 100644
--- a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/datafilterview/ExpandableRowComposite.java
+++ b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/datafilterview/ExpandableRowComposite.java
@@ -44,7 +44,6 @@
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
@@ -73,8 +72,6 @@
import org.eclipse.statet.jcommons.lang.NonNullByDefault;
import org.eclipse.statet.jcommons.lang.Nullable;
-import org.eclipse.statet.ecommons.ui.SharedUIResources;
-
/**
* This composite is capable of expanding or collapsing a single client that is
@@ -844,12 +841,12 @@
protected Color computeActiveToggleColor() {
final Display display= getDisplay();
- final RGB selection= display.getSystemColor(SWT.COLOR_LIST_SELECTION).getRGB();
- final RGB background= getBackground().getRGB();
- return SharedUIResources.getColors().getColor(new RGB(
- (63 + 3 * selection.red + 2 * background.red) / 6,
- (63 + 3 * selection.green + 2 *background.green) / 6,
- (63 + 3 * selection.blue + 2 * background.blue) / 6 ));
+ final Color selection= display.getSystemColor(SWT.COLOR_LIST_SELECTION);
+ final Color background= getBackground();
+ return new Color(
+ (63 + 3 * selection.getRed() + 2 * background.getRed()) / 6,
+ (63 + 3 * selection.getGreen() + 2 *background.getGreen()) / 6,
+ (63 + 3 * selection.getBlue() + 2 * background.getBlue()) / 6 );
}
/**
diff --git a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/intable/PresentationConfig.java b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/intable/PresentationConfig.java
index 89d8d64..78dd951 100644
--- a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/intable/PresentationConfig.java
+++ b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/intable/PresentationConfig.java
@@ -26,11 +26,11 @@
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.themes.ColorUtil;
import org.eclipse.statet.jcommons.collections.CopyOnWriteIdentityListSet;
import org.eclipse.statet.jcommons.lang.Disposable;
+import org.eclipse.statet.ecommons.ui.swt.ColorUtils;
import org.eclipse.statet.ecommons.waltable.config.AbstractRegistryConfiguration;
import org.eclipse.statet.ecommons.waltable.config.CellConfigAttributes;
import org.eclipse.statet.ecommons.waltable.config.IConfigRegistry;
@@ -130,24 +130,24 @@
this.bodyGridColor= display.getSystemColor(SWT.COLOR_GRAY);
this.bodyBackgroundColor= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
this.bodyEvenRowBackgroundColor= this.bodyBackgroundColor;
- this.bodyOddRowBackgroundColor= new Color(display, ColorUtil.blend(
- display.getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW).getRGB(),
- this.bodyEvenRowBackgroundColor.getRGB(), 20 ));
+ this.bodyOddRowBackgroundColor= ColorUtils.blend(
+ display.getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW),
+ this.bodyEvenRowBackgroundColor, 0.20f );
this.bodyForegroundColor= display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- this.headerSelectionBackgroundColor= new Color(display, ColorUtil.blend(
- display.getSystemColor(SWT.COLOR_LIST_SELECTION).getRGB(),
- this.headerBackgroundColor.getRGB(), 25 ));
+ this.headerSelectionBackgroundColor= ColorUtils.blend(
+ display.getSystemColor(SWT.COLOR_LIST_SELECTION),
+ this.headerBackgroundColor, 0.25f );
this.headerSelectionForegroundColor= this.headerForegroundColor;
- this.headerPlaceholderColor= new Color(display, ColorUtil.blend(
- this.bodyGridColor.getRGB(),
- this.headerBackgroundColor.getRGB(), 25 ));
+ this.headerPlaceholderColor= ColorUtils.blend(
+ this.bodyGridColor,
+ this.headerBackgroundColor, 0.25f );
- this.headerFullSelectionBackgroundColor= new Color(display, ColorUtil.blend(
- display.getSystemColor(SWT.COLOR_LIST_SELECTION).getRGB(),
- display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW).getRGB(), 25 ));
+ this.headerFullSelectionBackgroundColor= ColorUtils.blend(
+ display.getSystemColor(SWT.COLOR_LIST_SELECTION),
+ display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW), 0.25f );
this.headerFullSelectionForegroundColor= display.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW);
this.bodySelectionBackgroundColor= display.getSystemColor(SWT.COLOR_LIST_SELECTION);
@@ -173,11 +173,6 @@
if (fontRegistry != null) {
fontRegistry.removeListener(this);
}
-
- this.bodyOddRowBackgroundColor.dispose();
- this.headerSelectionBackgroundColor.dispose();
- this.headerFullSelectionBackgroundColor.dispose();
- this.headerPlaceholderColor.dispose();
}
diff --git a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RAlphaChooser.java b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RAlphaChooser.java
index 55b163a..1d6d6d2 100644
--- a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RAlphaChooser.java
+++ b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RAlphaChooser.java
@@ -23,7 +23,6 @@
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
@@ -55,16 +54,16 @@
}
}
- public static Color createPreviewColor(final Display display, final ColorAlphaDef baseColor) {
- return createPreviewColor(display, baseColor.getAlpha255(), baseColor);
+ public static Color createPreviewColor(final ColorAlphaDef baseColor) {
+ return createPreviewColor(baseColor.getAlpha255(), baseColor);
}
- public static Color createPreviewColor(final Display display, final int alpha255, final ColorDef baseColor) {
+ public static Color createPreviewColor(final int alpha255, final ColorDef baseColor) {
if (baseColor == null) {
- return new Color(display, alpha255, alpha255, alpha255);
+ return new Color(alpha255, alpha255, alpha255);
}
final int white = 255 - alpha255;
- return new Color(display,
+ return new Color(
white + (baseColor.getRed() * alpha255) / 255,
white + (baseColor.getGreen() * alpha255) / 255,
white + (baseColor.getBlue() * alpha255) / 255 );
@@ -93,7 +92,7 @@
final Composite composite = create();
composite.setLayout(LayoutUtils.newTabGrid(3));
- fSelector = new AlphaSelector(composite);
+ fSelector = new AlphaSelector(composite, composite.getBackground());
fSelector.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2));
{ final IObjValueListener<Double> textListener = new IObjValueListener<>() {
@@ -236,7 +235,7 @@
case 0:
if (fInitialValue != null) {
if (fInitialSWTColor == null) {
- fInitialSWTColor = createPreviewColor(getDisplay(), fInitial255, fBaseColor);
+ fInitialSWTColor = createPreviewColor(fInitial255, fBaseColor);
}
color = fInitialSWTColor;
}
@@ -244,7 +243,7 @@
case 1:
if (fCurrentValue != null) {
if (fCurrentSWTColor == null) {
- fCurrentSWTColor = createPreviewColor(getDisplay(), fCurrent255, fBaseColor);
+ fCurrentSWTColor = createPreviewColor(fCurrent255, fBaseColor);
}
color = fCurrentSWTColor;
}
@@ -264,7 +263,6 @@
}
final int v255 = 255 - Math.round(value * 255);
if (fCurrentSWTColor != null && v255 != fCurrent255) {
- fCurrentSWTColor.dispose();
fCurrentSWTColor = null;
}
fCurrentValue = value;
@@ -296,16 +294,6 @@
protected void onDispose() {
fStatusControl = null;
super.onDispose();
- if (fInitialSWTColor != null) {
- fInitialSWTColor.dispose();
- fInitial255 = -1;
- fInitialSWTColor = null;
- }
- if (fCurrentSWTColor != null) {
- fCurrentSWTColor.dispose();
- fCurrent255 = -1;
- fCurrentSWTColor = null;
- }
}
}
diff --git a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RColorChooser.java b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RColorChooser.java
index 87c7d88..5a631c7 100644
--- a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RColorChooser.java
+++ b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RColorChooser.java
@@ -28,7 +28,6 @@
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
@@ -69,8 +68,8 @@
}
}
- public static Color createPreviewColor(final Display display, final ColorDef colorDef) {
- return new Color(display, colorDef.getRed(), colorDef.getGreen(), colorDef.getBlue());
+ public static Color createPreviewColor(final ColorDef colorDef) {
+ return new Color(colorDef.getRed(), colorDef.getGreen(), colorDef.getBlue());
}
@@ -85,7 +84,7 @@
final Composite composite = create();
composite.setLayout(LayoutUtils.newTabGrid(1));
- fPalette = new ColorPalette(composite);
+ fPalette = new ColorPalette(composite, composite.getBackground());
fPalette.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
fPalette.setColors(colors);
@@ -148,7 +147,7 @@
final Composite composite = create();
composite.setLayout(LayoutUtils.newTabGrid(4));
- fSelector = new RGBSelector(composite);
+ fSelector = new RGBSelector(composite, composite.getBackground());
fSelector.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 5));
{ final String[] fieldLabels = new String[] { "&Red", "&Green", "&Blue" };
@@ -311,7 +310,7 @@
final Composite composite = create();
composite.setLayout(LayoutUtils.newTabGrid(3));
- fSelector = new HSVSelector(composite);
+ fSelector = new HSVSelector(composite, composite.getBackground());
fSelector.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 4));
{ final String[] fieldLabels = new String[] { "&Hue:", "&Saturation:", "&Value:" };
@@ -475,8 +474,8 @@
alpha = (fInitialValue instanceof ColorAlphaDef);
if (fInitialSWTColor == null) {
fInitialSWTColor = (alpha) ?
- RAlphaChooser.createPreviewColor(getDisplay(), ((ColorAlphaDef) fInitialValue).getAlpha255(), fInitialValue) :
- createPreviewColor(getDisplay(), fInitialValue);
+ RAlphaChooser.createPreviewColor(((ColorAlphaDef) fInitialValue).getAlpha255(), fInitialValue) :
+ createPreviewColor(fInitialValue);
}
color = fInitialSWTColor;
}
@@ -486,8 +485,8 @@
alpha = (fCurrentValue instanceof ColorAlphaDef);
if (fCurrentSWTColor == null) {
fCurrentSWTColor = (alpha) ?
- RAlphaChooser.createPreviewColor(getDisplay(), ((ColorAlphaDef) fCurrentValue).getAlpha255(), fCurrentValue) :
- createPreviewColor(getDisplay(), fCurrentValue);
+ RAlphaChooser.createPreviewColor(((ColorAlphaDef) fCurrentValue).getAlpha255(), fCurrentValue) :
+ createPreviewColor(fCurrentValue);
}
color = fCurrentSWTColor;
}
@@ -524,7 +523,6 @@
return;
}
if (fCurrentSWTColor != null && !value.equals(fCurrentValue)) {
- fCurrentSWTColor.dispose();
fCurrentSWTColor = null;
}
fCurrentValue = value;
@@ -568,14 +566,6 @@
protected void onDispose() {
fStatusControl = null;
super.onDispose();
- if (fInitialSWTColor != null) {
- fInitialSWTColor.dispose();
- fInitialSWTColor = null;
- }
- if (fCurrentSWTColor != null) {
- fCurrentSWTColor.dispose();
- fCurrentSWTColor = null;
- }
}
}
diff --git a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RFontFamilyChooser.java b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RFontFamilyChooser.java
index 672da61..a99b4d6 100644
--- a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RFontFamilyChooser.java
+++ b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/r/ui/graphics/RFontFamilyChooser.java
@@ -50,6 +50,11 @@
private static final String GENERIC = "Generic"; //$NON-NLS-1$
+ private static final ImList<String> VALUES= ImCollections.newList(
+ "serif", //$NON-NLS-1$
+ "sansserif", //$NON-NLS-1$
+ "mono" ); //$NON-NLS-1$
+
public static void drawPreview(final GC gc,
final int x, final int y, final int width, final int height,
@@ -125,11 +130,6 @@
protected static abstract class GenericTab extends ToolTab {
- private static final ImList<String> VALUES= ImCollections.newList(
- "serif", //$NON-NLS-1$
- "sansserif", //$NON-NLS-1$
- "mono" ); //$NON-NLS-1$
-
private Button[] fButtons;
diff --git a/rtm/org.eclipse.statet.rtm.base.ui/src/org/eclipse/statet/rtm/base/ui/rexpr/AlphaType.java b/rtm/org.eclipse.statet.rtm.base.ui/src/org/eclipse/statet/rtm/base/ui/rexpr/AlphaType.java
index e775b3d..dd64288 100644
--- a/rtm/org.eclipse.statet.rtm.base.ui/src/org/eclipse/statet/rtm/base/ui/rexpr/AlphaType.java
+++ b/rtm/org.eclipse.statet.rtm.base.ui/src/org/eclipse/statet/rtm/base/ui/rexpr/AlphaType.java
@@ -110,8 +110,7 @@
gc.drawRectangle(4, 4, size.x - 9, size.y - 9);
if (this.currentValue != null) {
if (this.currentSWTColor == null) {
- this.currentSWTColor= new Color(this.detail.getDisplay(),
- this.current255, this.current255, this.current255);
+ this.currentSWTColor= new Color(this.current255, this.current255, this.current255);
}
RAlphaChooser.drawPreview(gc, 5, 5, size.x - 11, size.y - 11, this.currentSWTColor);
}
@@ -127,10 +126,6 @@
if (this.alphaChooser != null) {
this.alphaChooser.dispose();
}
- if (this.currentSWTColor != null) {
- this.currentSWTColor.dispose();
- this.currentSWTColor= null;
- }
return;
default:
break;
@@ -177,7 +172,6 @@
if (value != null) {
final int v255= 255 - Math.round(value * 255);
if (this.currentSWTColor != null && v255 != this.current255) {
- this.currentSWTColor.dispose();
this.currentSWTColor= null;
}
this.currentValue= value;
diff --git a/rtm/org.eclipse.statet.rtm.base.ui/src/org/eclipse/statet/rtm/base/ui/rexpr/ColorType.java b/rtm/org.eclipse.statet.rtm.base.ui/src/org/eclipse/statet/rtm/base/ui/rexpr/ColorType.java
index c854f7f..e6368ad 100644
--- a/rtm/org.eclipse.statet.rtm.base.ui/src/org/eclipse/statet/rtm/base/ui/rexpr/ColorType.java
+++ b/rtm/org.eclipse.statet.rtm.base.ui/src/org/eclipse/statet/rtm/base/ui/rexpr/ColorType.java
@@ -116,13 +116,13 @@
if (this.currentValue != null) {
if (this.currentValue instanceof ColorAlphaDef) {
if (this.currentSWTColor == null) {
- this.currentSWTColor= RAlphaChooser.createPreviewColor(this.detail.getDisplay(), (ColorAlphaDef) this.currentValue);
+ this.currentSWTColor= RAlphaChooser.createPreviewColor((ColorAlphaDef) this.currentValue);
}
RAlphaChooser.drawPreview(gc, 5, 5, size.x - 10, size.y - 10, this.currentSWTColor);
}
else {
if (this.currentSWTColor == null) {
- this.currentSWTColor= RColorChooser.createPreviewColor(this.detail.getDisplay(), this.currentValue);
+ this.currentSWTColor= RColorChooser.createPreviewColor(this.currentValue);
}
RColorChooser.drawPreview(gc, 5, 5, size.x - 11, size.y - 11, this.currentSWTColor);
}
@@ -139,10 +139,6 @@
if (this.colorChooser != null) {
this.colorChooser.dispose();
}
- if (this.currentSWTColor != null) {
- this.currentSWTColor.dispose();
- this.currentSWTColor= null;
- }
return;
default:
break;
@@ -246,7 +242,6 @@
private void doSetValue(final ColorDef value) {
if (this.currentSWTColor != null && !this.currentValue.equals(value)) {
- this.currentSWTColor.dispose();
this.currentSWTColor= null;
}
this.currentValue= value;