Bug 176873 [Preferences] ColorFieldEditor should not set button size to IDialogConstants.BUTTON_WIDTH
The ColorFieldEditor shouldn't adjust the size of the button that is created by ColorSelector. ColorFieldEditor#doFillIntoGrid(...) creates a ColorSelector and then increases the size of the button using IDialogConstants.BUTTON_WIDTH. This creates buttons that are oversized and unattractive. Worse, this means that Eclipse preference pages don't present a color selector with a consistent size. Pages which use the JFace API to create a ColorSelector directly get a button that's one size, while pages which use the ColorFieldEditor get something else. The current workaround allows us to use ColorFieldEditor without the undesirable missizing: new ColorFieldEditor(preference, label, parent) { protected void doFillIntoGrid(Composite parent, int numColumns) { super.doFillInfoGrid(parent, numColumns); getChangeControl(parent).setLayoutData(new GridData()); } }
bundles/org.eclipse.jface/src/org/eclipse/jface/preference/ColorFieldEditor.java
*/
	protected void adjustForNumColumns(int numColumns) {
		((GridData) colorSelector.getButton().getLayoutData()).horizontalSpan = numColumns - 1;
	}
	/**
	 * Computes the size of the color image displayed on the button.
	 * <p>
	 * This is an internal method and should not be called by clients.
	 * </p>
	 * 
	 * @param window
	 *            the window to create a GC on for calculation.
	 * @return Point The image size
	 *  
	 */
	protected Point computeImageSize(Control window) {
		
		
		
		GC gc = new GC(window);
		Font f = JFaceResources.getFontRegistry().get(
				JFaceResources.DEFAULT_FONT);
		gc.setFont(f);
		int height = gc.getFontMetrics().getHeight();
		gc.dispose();
		Point p = new Point(height * 3 - 6, height);
		return p;
	}
	/*
	 * (non-Javadoc) Method declared on FieldEditor.