Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java')
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java
index a90490e5e30..b6479ab0b1f 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 IBM Corporation and others.
+ * Copyright (c) 2010, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -319,8 +319,9 @@ public class PerspectiveSwitcher {
toolParent.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent e) {
- if (borderColor == null)
+ if (borderColor == null || borderColor.isDisposed()) {
borderColor = e.display.getSystemColor(SWT.COLOR_BLACK);
+ }
e.gc.setForeground(borderColor);
Rectangle bounds = ((Control) e.widget).getBounds();
e.gc.drawLine(0, bounds.height - 1, bounds.width, bounds.height - 1);
@@ -824,8 +825,9 @@ public class PerspectiveSwitcher {
void paint(PaintEvent e) {
GC gc = e.gc;
Point size = comp.getSize();
- if (curveColor == null)
+ if (curveColor == null || curveColor.isDisposed()) {
curveColor = e.display.getSystemColor(SWT.COLOR_BLACK);
+ }
int h = size.y;
int[] simpleCurve = new int[] { 0, h - 1, 1, h - 1, 2, h - 2, 2, 1, 3, 0 };
// draw border

Back to the top