Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 46162 - [Dialogs] ARROW_DOWN in TwoPaneElementSelector should navigate through all choices
Summary: [Dialogs] ARROW_DOWN in TwoPaneElementSelector should navigate through all ch...
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P4 enhancement (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Nick Edgar CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-05 21:14 EST by Randy Hudson CLA
Modified: 2006-01-04 13:06 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2003-11-05 21:14:16 EST
Pressing down arrow in the type dialog throw focus from the Text control to 
the "Matching Types" list, which makes it unnecessary to press TAB.  Pretty 
cool, so let's take it one step further.  When I type "Keystr", DOWN will 
select "javax.swing.Keystroke".  The next DOWN_ARROW should 
select "org.eclipse.ui.Keystroke", thereby allowing all matches to be 
enumerated with just one key.

Alternatively, collapse the two lists into a single list or table.
Comment 1 Dirk Baeumer CLA 2003-11-10 11:27:21 EST
The dialog we are using is provided by Platform/UI. 
Comment 2 Tod Creasey CLA 2003-11-19 13:30:21 EST
Deb has looked into this one in the past
Comment 3 Tod Creasey CLA 2004-04-15 16:08:44 EDT
Post 3.0
Comment 4 Tod Creasey CLA 2004-06-28 11:28:04 EDT
Reopening now that 3.0 has shipped
Comment 5 Randy Hudson CLA 2004-09-03 12:07:44 EDT
This took 5 minutes to do :-).  In TwoPaneElementSelector#createDialogArea:

Composite contents = (Composite) super.createDialogArea(parent);
createMessageArea(contents);
createFilterText(contents);

createLabel(contents, fUpperListLabel);
~ FilteredList list = createFilteredList(contents);
createLabel(contents, fLowerListLabel);
~ final Table table = createLowerList(contents);

+list.addKeyListener(new KeyAdapter() {
+	public void keyPressed(KeyEvent e) {
+		if (e.keyCode == 16777217) {
+			if (table.getSelectionIndex() > 0) {
+				table.setSelection(table.getSelectionIndex() - 
1);
+				e.doit = false;
+			}				
+		}
+		if (e.keyCode == 16777218) {
+			if (table.getSelectionIndex() < table.getItemCount() - 
1) {
+				table.setSelection(table.getSelectionIndex() + 
1);
+				e.doit = false;
+			}
+		}
+	}


And in FilteredList, you need to override addKeyListener and removeKeyListener 
so that they are forwarded to the fList.
Comment 6 Randy Hudson CLA 2004-09-03 12:09:33 EDT
replace magic numbers with:
SWT.ARROW_UP
SWT.ARROW_DOWN
Comment 7 Randy Hudson CLA 2004-09-21 10:32:26 EDT
Please increase the priority since I have provided the actual fix itself.  You 
just need to review and commit the changes.

In case it wasn't obvious, in FilteredList, add:

/**
 * Adds a key listener from the list
 */
public void addKeyListener(KeyListener listener) {
	fList.addKeyListener(listener);
}
/**
 * Removes a key listener from the list
 */
public void removeKeyListener(KeyListener listener) {
	fList.removeKeyListener(listener);
}
Comment 8 Randy Hudson CLA 2005-03-30 16:36:14 EST
Billy has moved teams.
Comment 9 Nick Edgar CLA 2005-05-04 16:52:29 EDT
The Open Type dialog has been changed to use a single list.
Comment 10 Randy Hudson CLA 2005-05-04 17:29:08 EDT
TwoPaneElementSelector is API so I'm sure it still exists, no?
Comment 11 Randy Hudson CLA 2005-05-04 17:30:42 EDT
Anyway, who cares. Thanks (JDT?) for the improved dialog.
Comment 12 Nick Edgar CLA 2005-05-04 17:42:45 EDT
It is still API, but I was also concerned about the change.  When there's more
than one item in the middle pane, you don't want up/down affecting the lower pane.
Comment 13 Randy Hudson CLA 2005-12-29 11:44:54 EST
This problem is still annoying me when trying to open a plugin.xml file.
Comment 14 Nick Edgar CLA 2006-01-04 13:06:16 EST
Sorry, I disagree with having a different mode for the behaviour of up/down arrow based on the number of items in the list.

Note that there is also work going on to make Open Resource work more like Open Type (i.e. using a single pane), which may address the problem.