Community
Participate
Working Groups
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.
Created attachment 2204 [details] test case
I thought that we had fixed this? FH to investigate and advise.
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.
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
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.
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.
Opened related SWT PR [Bug 25146] New: [Coolbar] - Problem with setTabList and new cool items.
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).
Sounds reasonable to me.
Fixed as indicated.
Verified for RC3 (200303192032).