Bug 132093 - [TabbedProperties] Tab selection sometimes flickers
Summary: [TabbedProperties] Tab selection sometimes flickers
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Anthony Hunter CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 131855
Blocks:
  Show dependency tree
 
Reported: 2006-03-16 00:47 EST by Mihoko Aoki CLA
Modified: 2008-06-05 23:15 EDT (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 Mihoko Aoki CLA 2006-03-16 00:47:17 EST
When the tabbed properties view displays dynamic tabs, tab selection sometimes flickers.

To get the latest tab selection in TabbedPropertySheetPage#setInput method, getLastTabSelection method is called.

Refering to the attached source codes, TabDescriptors are used to get the latest selection, but it seems that those TabDescriptors are STATIC.
So, when getting the latest tab selection, I think that IDynamicTabListSection and IDynamicTabListContentProvider should be used as the same as overrideTabs method for dynamic tab support.

Anthony has already known this problem.


TabbedPropertySheetPage --------------------------------------------------------

private int getLastTabSelection(IWorkbenchPart part, ISelection input) {
	TabDescriptor[] descriptors = registry.getTabDescriptors(part, input);
	if (descriptors.length != 0) {
		for (Iterator iter = selectionQueue.iterator(); iter.hasNext();) {
			String text = (String) iter.next();
			for (int i = 0; i < descriptors.length; i++) {
				if (text.equals(descriptors[i].getLabel())) {
					return i;
				}
			}
		}
	}
	return 0;
}


TabbedPropertyRegistry ---------------------------------------------------------

public TabDescriptor[] getTabDescriptors(IWorkbenchPart part,
		ISelection selection) {
	if (selection == null || selection.isEmpty())
		return EMPTY_DESCRIPTOR_ARRAY;

	TabDescriptor[] allDescriptors = getAllTabDescriptors();
	TabDescriptor[] result = filterTabDescriptors(allDescriptors, part,
		selection);
	return result;
}

protected TabDescriptor[] getAllTabDescriptors() {
	if (tabDescriptors == null) {
		List temp = readTabDescriptors();
		populateWithSectionDescriptors(temp);
		temp = sortTabDescriptorsByCategory(temp);
		temp = sortTabDescriptorsByAfterTab(temp);
		tabDescriptors = (TabDescriptor[]) temp
			.toArray(new TabDescriptor[temp.size()]);
	}
	return tabDescriptors;
}
Comment 1 Anthony Hunter CLA 2006-11-09 10:35:00 EST
This issue occurs for users of the WTP tabbed properties view.
These users need to move to the view in Eclipse core, but are blocked by Bug 131855
Comment 2 Anthony Hunter CLA 2008-06-05 23:15:17 EDT
(In reply to comment #1)
> This issue occurs for users of the WTP tabbed properties view.
> These users need to move to the view in Eclipse core, but are blocked by Bug
> 131855
> 

Bug 131855 was resolved in 3.4 M1 and the attrview framework at IBM also moved to the dynamic support in the eclipse core tabbed properties view. So we can safely resolve this issue.