Bug 170827 ControlDecoration uses the wrong GC method to render text
The constructor of the Hover in ControlDecoration: hoverShell.addPaintListener(new PaintListener() { public void paintControl(PaintEvent pe) { pe.gc.drawString(text, hm, hm); if (!CARBON) { pe.gc.drawPolygon(getPolygon(true)); } } }); The size of the hover is correctly performed when there are carriage returns in the text. However, the text is painted as String. This causes only the first line to be painted and the rest of the hover is empty. The fix is to use GC.drawText' instead.
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ControlDecoration.java
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseTrackListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.graphics.Region;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Widget;
/**
 * ControlDecoration renders an image decoration near a control. It allows
 * clients to specify an image and a position for the image relative to the
 * control. A ControlDecoration may be assigned description text, which can
 * optionally be shown when the user hovers over the image. Clients can decorate
 * any kind of control.
 * <p>
 * Decoration images always appear on the left or right side of the field, never
 * above or below it. Decorations can be positioned at the top, center, or
 * bottom of either side of the control. Future implementations may provide
 * additional positioning options for decorations.
 * <p>
 * ControlDecoration is used in a manner similar to {@link DecoratedField}. The
 * primary difference between these mechanisms is that {@link DecoratedField}