Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 24983 - [Coolbar] tab order not maintained properly
Summary: [Coolbar] tab order not maintained properly
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 98
: P2 normal (vote)
Target Milestone: 2.1 M3   Edit
Assignee: Lynne Kues CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 25146
Blocks:
  Show dependency tree
 
Reported: 2002-10-17 10:34 EDT by Lynne Kues CLA
Modified: 2003-03-20 15:01 EST (History)
1 user (show)

See Also:


Attachments
test case (5.70 KB, application/octet-stream)
2002-10-17 10:36 EDT, Lynne Kues CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lynne Kues CLA 2002-10-17 10:34:17 EDT
Build 20021016

Run the attached test case.
Press the Add button, which adds a new coolitem at position 2.
Tab through the cool items.

Notice that the tab order is Item 1, Item 3, Item 4, Item 2.
Comment 1 Lynne Kues CLA 2002-10-17 10:36:37 EDT
Created attachment 2204 [details]
test case
Comment 2 Steve Northover CLA 2002-10-18 09:47:48 EDT
I thought that we had fixed this?  FH to investigate and advise.
Comment 3 Felipe Heidrich CLA 2002-10-18 10:08:33 EDT
I would say that is the order which is supposed to happen since the last 
control to be added was the control in the item #2.

I have to check with SN/SSQ if SWT should reset the tab order when a item is 
inserted.

Comment 4 Felipe Heidrich CLA 2002-10-18 15:18:56 EDT
I've just confirmed, SWT should not change the tab order in this case. The 
default tab order is order which the controls are created.
But, SWT provides API to do what you need.

Try change the method addItem() in your test case as follow:

static void addItem() {
        ToolBar toolBar = createToolBar(toolNames[3]);
        createCoolItem(toolBar, 1);
        CoolItem[] items = coolBar.getItems();
        Control[] children = new Control[items.length];
        for (int i = 0; i < children.length; i++) {
		children[i] = items[i].getControl();
	}
	coolBar.setTabList(children);
}

If you fix this PR in UI level please close or move it for me. thanks
Comment 5 Lynne Kues CLA 2002-10-21 14:40:04 EDT
Nick, what are your feelings about this?  Currently, the cool item tab order is 
the order that coolitems are created - not the visual order.  So if you open a 
Java Perspective, for example, and attempt to tab through the coolitems, the 
order is random.

I could slam the tab order everytime a coolitem is created, but this would not 
address when one physically moves coolitems.  In this case, the tab order would 
also get out of sync visually.  If I slammed the tab order everytime a coolitem 
is created, the "moved" tab order would get cleaned up - but this is a somewhat 
esoteric side effect.  

Currently there is no way to track movement of items on the coolbar and I 
looked at some other apps and the coolitem tab order is not maintained visually.
Comment 6 Nick Edgar CLA 2002-10-21 14:54:12 EDT
Let's keep it as creation order for now, as long as the initial order is 
reasonable.  In build 20021018, I don't see this now.  If I open a Java 
perspective or reset perspective on one, the tab order in the cool items still 
seems random.  Is it possible to make it left to right for the initial or reset 
case?

Also, we need to do something to reduce the number of cool items.  I'm thinking 
of something similar to how multiple action sets can contribute to the same 
menu.  This will help reduce the tabbing problem as well.  I need to figure out 
where this lies in the overall priorities for M3 and M4 though.

Comment 7 Lynne Kues CLA 2002-10-21 16:02:50 EDT
Opened related SWT PR 

[Bug 25146] New: [Coolbar] - Problem with setTabList and new cool items.
Comment 8 Lynne Kues CLA 2002-10-21 18:13:34 EDT
Some notes about this:

The tab order of the coolbar is currently in creation order.  We have no 
control over where plugins decide to put their coolitems or what order plugins 
are processed, so the visual order of the coolbar is almost never the creation 
order.

The coolbar is shared among perspectives.  This means that coolitems are 
added/removed as perspectives are switched - which will affect the coolbar tab 
order.

Given this, I think the best way to handle the tab order will be to always set 
the tab list to the visual order whenever an item is added to the coolbar.  I 
will have to adjust the tab order everytime an item is added (see SWT response 
to 25146), so why not just set it to the visual order?  I think this approach 
will lead to a more predictable tab order (vs. setting the tab order initially 
but then letting it get out of whack whenever an item is added, perspective 
switched, etc).
Comment 9 Nick Edgar CLA 2002-10-22 09:10:53 EDT
Sounds reasonable to me.
Comment 10 Lynne Kues CLA 2002-10-22 15:08:04 EDT
Fixed as indicated. 
Comment 11 Lynne Kues CLA 2003-03-20 15:01:50 EST
Verified for RC3 (200303192032).