Community
Participate
Working Groups
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.
moved to 'active'
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; }
Build > 20020911.