Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 418420
Collapse All | Expand All

(-)a/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ControlDecoration.java (+7 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     RĂ¼diger Herrmann - fix for bug 418420
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jface.fieldassist;
12
package org.eclipse.jface.fieldassist;
12
13
Lines 1075-1080 public class ControlDecoration { Link Here
1075
		if (!visible) {
1076
		if (!visible) {
1076
			return;
1077
			return;
1077
		}
1078
		}
1079
		
1080
		// If the decoration is hidden, don't show the hover.
1081
		if (showOnlyOnFocus && !control.isFocusControl()) {
1082
			return;
1083
		}
1084
		
1078
		// If there is no text, any existing hover should be hidden, and
1085
		// If there is no text, any existing hover should be hidden, and
1079
		// there is nothing more to do.
1086
		// there is nothing more to do.
1080
		if (text == null || text.length() == 0) {
1087
		if (text == null || text.length() == 0) {
(-)a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/fieldassist/ControlDecorationTests.java (-1 / +13 lines)
Lines 75-80 public class ControlDecorationTests extends AbstractFieldAssistTestCase { Link Here
75
		assertTwoShellsUp();
75
		assertTwoShellsUp();
76
	}
76
	}
77
	
77
	
78
	public void testBug418420() {
79
		AbstractFieldAssistWindow window = getFieldAssistWindow();
80
		window.open();
81
		ControlDecoration decoration = new ControlDecoration(window.getFieldAssistControl(), SWT.RIGHT);
82
		decoration.setImage(FieldDecorationRegistry.getDefault()             
83
		    .getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage());   
84
		decoration.setDescriptionText("foo");   
85
		decoration.setShowOnlyOnFocus(true);
86
		anotherControl.forceFocus();
87
		decoration.showHoverText("Show me");
88
		assertOneShellUp();
89
	}
90
	
78
	/* (non-Javadoc)
91
	/* (non-Javadoc)
79
	 * @see org.eclipse.jface.tests.fieldassist.AbstractFieldAssistTestCase#createFieldAssistWindow()
92
	 * @see org.eclipse.jface.tests.fieldassist.AbstractFieldAssistTestCase#createFieldAssistWindow()
80
	 */
93
	 */
81
- 

Return to bug 418420