Bug 236324 [Forms] Eclipse 3.4 crashes / failes to repaint when "Close Others" is used with SharedHeaderFormEditor
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/FormImages.java
private Image createGradient(Display display, Color[] colors, int[] percents,
			int length, boolean vertical, Color bg) {
		int width = vertical ? 1 : length;
		int height = vertical ? length : 1;
		Image gradient = new Image(display, Math.max(width, 1), Math
				.max(height, 1));
		GC gc = new GC(gradient);
		drawTextGradient(gc, width, height, colors, percents, vertical, bg);
		gc.dispose();
		return gradient;
	}
	private void drawTextGradient(GC gc, int width, int height, Color[] colors,
			int[] percents, boolean vertical, Color bg) {
		final Color oldBackground = gc.getBackground();
		if (colors.length == 1) {
			if (colors[0] != null)
				gc.setBackground(colors[0]);
			gc.fillRectangle(0, 0, width, height);
		} else {
			final Color oldForeground = gc.getForeground();
			Color lastColor = colors[0];
			if (lastColor == null)
				lastColor = oldBackground;
			int pos = 0;
			for (int i = 0; i < percents.length; ++i) {
				gc.setForeground(lastColor);
				lastColor = colors[i + 1];
				if (lastColor == null)
					lastColor = oldBackground;