Bug 55827 [Contributions] Need to remove refs to Platform.getDebugOption from JFace
build I20040323 Standalone JFace applications are currently broken due to several refs to Platform.getDebugOption in JFace, which is only available if Eclipse is running. Should have static flags for the various debug options in JFace, and initialize them from the Workbench.
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/Dialog.java
*/
	public static int convertWidthInCharsToPixels(
		FontMetrics fontMetrics,
		int chars) {
		return fontMetrics.getAverageCharWidth() * chars;
	}
	
	/**
	 * Shortens the given text <code>textValue</code> so that its width in pixels
	 * does not exceed the width of the given control. 
	 * Overrides characters in the center of the original string with an ellipsis ("...")
	 * if necessary.
	 * If a <code>null</code> value is given, <code>null</code> is returned.
	 *  
	 * @param textValue the original string or <code>null</code>
	 * @param control the control the string will be displayed on
	 * @return the string to display, or <code>null</code> if null was passed in
	 * 
	 * @since 3.0
	 */
	public static String shortenText(String textValue, Control control) {
		if (textValue == null)
			return null;
		GC gc = new GC(control);
		int maxWidth = control.getBounds().width - 5;
		if (gc.textExtent(textValue).x < maxWidth) {
			gc.dispose();
			return textValue;
		}
		int length = textValue.length();