private static void disposeColors(Display display) {
		List toBeRemoved = new ArrayList(1);

		if (DEBUG) {
			System.out.println("Display map is " + displays.toString()); //$NON-NLS-1$
			System.out
					.println("Color map is " + requiredFieldColorMap.toString()); //$NON-NLS-1$
		}

		// Look for any stored colors that were created on this display
		for (Iterator i = displays.keySet().iterator(); i.hasNext();) {
			Color color = (Color) i.next();
			if (((Display) displays.get(color)).equals(display)) {
				// The color is on this display. Mark it for removal.
				toBeRemoved.add(color);

				// Now look for any references to it in the required field color
				// map
				List toBeRemovedFromRequiredMap = new ArrayList(1);
				for (Iterator iter = requiredFieldColorMap.keySet().iterator(); iter
						.hasNext();) {
					Color bgColor = (Color) iter.next();
					if (((Color) requiredFieldColorMap.get(bgColor))
							.equals(color)) {
						// mark it for removal from the required field color map
						toBeRemovedFromRequiredMap.add(bgColor);
					}
				}
				// Remove references in the required field map now that
				// we are done iterating.
				for (int j = 0; j < toBeRemovedFromRequiredMap.size(); j++) {
					requiredFieldColorMap.remove(toBeRemovedFromRequiredMap
							.get(j));
				}
			}
		}
		// Remove references in the display map now that we are
		// done iterating
		for (int i = 0; i < toBeRemoved.size(); i++) {
			Color color = (Color) toBeRemoved.get(i);
			// Removing from the display map must be done before disposing the
			// color or else the comparison between this color and the one
			// in the map will fail.
			displays.remove(color);
			// Dispose it
			if (DEBUG) {
				System.out.println("Disposing color " + color.toString()); //$NON-NLS-1$
			}
			color.dispose();
		}
		if (DEBUG) {
			System.out.println("Display map is " + displays.toString()); //$NON-NLS-1$
			System.out
					.println("Color map is " + requiredFieldColorMap.toString()); //$NON-NLS-1$
		}
	}