Bug 279553 [FieldAssist] ControlDecoration strange behavior when description text is empty string
Build ID: 3.5RC3 With the following simple code, when I hover over the control decoration, a huge yellow box quickly flashes on the screen and then disappears. I also tried on 3.4.2 and observed the same behavior. Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(1, false)); Text t = new Text(shell, SWT.BORDER); t.setText("hover on decoration ->"); ControlDecoration decoration = new ControlDecoration(t, SWT.RIGHT); decoration.setImage(FieldDecorationRegistry.getDefault() .getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage()); decoration.setDescriptionText(""); shell.pack(); shell.open(); while (!isInterrupted() && !shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose();
bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ControlDecoration.java
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.MenuDetectEvent;
import org.eclipse.swt.events.MenuDetectListener;
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.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
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.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
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