### Eclipse Workspace Patch 1.0 #P org.eclipse.jface Index: src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java,v retrieving revision 1.65 diff -u -r1.65 ContentProposalAdapter.java --- src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java 7 May 2009 23:10:53 -0000 1.65 +++ src/org/eclipse/jface/fieldassist/ContentProposalAdapter.java 9 May 2009 12:52:17 -0000 @@ -702,6 +702,20 @@ getShell().pack(); popupSize = getShell().getSize(); } + + int controlHeight = control.getBounds().height; + int popupTotalOffset = initialY + popupSize.y; + // check if the popup's total exceeds the display's height after compensating + // for the height of the control, the height of the control needs to + // be considered because while the popup may not exceed the display's + // height, it may be overlapped halfway on top of the control + if (popupTotalOffset > control.getDisplay().getBounds().height - controlHeight) { + // if it is, we want to render the list above the control, retrieve + // the control's location based on the display, and then move it + // up vertically by deducting the popup's size, see bug 256651 + initialY = location.y - popupSize.y; + } + getShell().setBounds(initialX, initialY, popupSize.x, popupSize.y); // Now set up a listener to monitor any changes in size.