Move away of deprecated FontMetrics.getAverageCharWidth

Change-Id: Ie134f4898762fcf97a8d477fffb5ec5f89690afd
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/sources/inlined/ColorAnnotation.java b/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/sources/inlined/ColorAnnotation.java
index 9ff5dbd..deb7b5e 100644
--- a/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/sources/inlined/ColorAnnotation.java
+++ b/org.eclipse.jface.text.examples/src/org/eclipse/jface/text/examples/sources/inlined/ColorAnnotation.java
@@ -1,5 +1,4 @@
-/**s
- *  Copyright (c) 2017 Angelo ZERR.
+/** Copyright (c) 2017, 2019 Angelo ZERR and others.
  *
  *  This program and the accompanying materials
  *  are made available under the terms of the Eclipse Public License 2.0
@@ -119,7 +118,7 @@
 	 */
 	private static int getSquareWidth(FontMetrics fontMetrics) {
 		// width = 2 spaces + size width of square
-		int width = 2 * fontMetrics.getAverageCharWidth() + getSquareSize(fontMetrics);
+		int width = (int) (2 * fontMetrics.getAverageCharacterWidth() + getSquareSize(fontMetrics));
 		return width;
 	}