Bug 163360 [Field Assist] - API - Provide ControlDecoration constructor without specifying decoration
Currently you can only create a ControlDecoration by specifying the control and the decoration in the constructor. This works nicely when the decoration is static (ie, always content assist). But there are use cases where the decoration changes depending on the state of the field, and at creation time, it's not clear which decoration will be set. Having a constructor that doesn't require a decoration would be nice.
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.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 decoration and a position for the decoration
 * relative to the control. Decorations may be assigned descriptions, which can
 * optionally be shown when the user hovers over the decoration. Clients can
 * decorate any kind of control.
 * <p>
 * Decorations 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}
 * ensures adequate space is allocated for any field decorations by creating a