Bug 3669 - Wrapping code assist list (1GDTV4S)
Summary: Wrapping code assist list (1GDTV4S)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Kai-Uwe Maetzel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:58 EDT by Jed Anderson CLA
Modified: 2002-09-12 12:22 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jed Anderson CLA 2001-10-10 22:58:55 EDT
jkca (5/16/2001 11:38:55 AM)
	jre-sdk 107

It would be helpful if the code assist list wrapped so that hitting the
up arrow when the first element is selected moved the selection 
to the last element and hitting the down arrow when the last element is
selected moved the selection to the first element in the list.

EG (24.07.2001 21:41:49)
	wrapping would be consistent with context menus.
Comment 1 Martin Aeschlimann CLA 2001-10-16 11:13:04 EDT
moved to 'active'
Comment 2 Jed Anderson CLA 2002-02-08 15:53:22 EST
This is a super easy fix that greatly improves the usability of the code assist.

Change the following method in
org.eclipse.jface.text.contentassist.CompletionProposalPopup.java

( the only changes are to the SWT.ARROW_UP and SWT.ARROW_DOWN cases )

	private boolean proposalKeyPressed(VerifyEvent e) {

		char key= e.character;
		if (key == 0) {
			int newSelection= fProposalTable.getSelectionIndex();
			int visibleRows= (fProposalTable.getSize().y / fProposalTable.getItemHeight()) - 1;
			switch (e.keyCode) {

				case SWT.ARROW_LEFT :
				case SWT.ARROW_RIGHT :
					filterProposal();
					return true;

				case SWT.ARROW_UP :
					newSelection -= 1;
					if (newSelection < 0) {
						newSelection= fProposalTable.getItemCount() - 1;
					}
					break;

				case SWT.ARROW_DOWN :
					newSelection += 1;
					if (newSelection > fProposalTable.getItemCount() - 1) {
						newSelection= 0;
					}
					break;
					
				case SWT.PAGE_DOWN :
					newSelection += visibleRows;
					if (newSelection >= fProposalTable.getItemCount())
						newSelection= fProposalTable.getItemCount() - 1;
					break;
					
				case SWT.PAGE_UP :
					newSelection -= visibleRows;
					if (newSelection < 0)
						newSelection= 0;
					break;
					
				case SWT.HOME :
					newSelection= 0;
					break;
					
				case SWT.END :
					newSelection= fProposalTable.getItemCount() - 1;
					break;
					
				case SWT.CTRL :
				case SWT.SHIFT :
					return true;

				default :
					hide();
					return true;
			}
			
			selectProposal(newSelection);
			
			e.doit= false;
			return false;

		} else if (key == 0x1B) {
			hide(); // Terminate on Esc
		}
		
		return true;
	}
Comment 3 Kai-Uwe Maetzel CLA 2002-09-12 12:22:40 EDT
Build > 20020911.