Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 156928

Summary: [CommonNavigator] Make Common Navigator Framework commonWizard extension capabilities-aware
Product: [Eclipse Project] Platform Reporter: Jay Cagle <jcagle>
Component: UIAssignee: Michael D. Elder <mdelder>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, david_williams, for.work.things, mdelder, Michael.Valenta, Mike_Wilson
Version: 3.2   
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
org.eclipse.ui.navigator.patch
none
Patches CommonWizardDescriptorManager.isVisible() to check the Eclipse Capabilities activation
none
Adds wizard extensions to test the patch none

Description Jay Cagle CLA 2006-09-11 15:44:37 EDT
The commonWizard extension point of the Common Navigator Framework is not capabilities-aware.  Capabilities are a base Eclipse feature and the lack of support by the Common Navigator dimishes their usefulness.  For products building on top of Eclipse, this represents a regression since previous navigator views supported capabilities.
Comment 1 Amy Wu CLA 2006-09-11 16:39:30 EDT
Created attachment 49876 [details]
org.eclipse.ui.navigator.patch

I took a quick glance at the code and come up with this patch which seems to make the common navigator commonwizard capabilities-aware.  I'll admit this was just a quick guess though.  All I basically did was in:
CommonWizardDescriptorManager#getEnabledCommonWizardDescriptors, I added the following check:
   !WorkbenchActivityHelper.filterItem(descriptor)
This will do an extra check when getting all enabled common wizard descriptors so that if a capability is currently filtering out a wizard, the wizard descriptor will not be returned.

And then I made CommonWizardDescriptor implement IPluginContribution.  This interface is needed to make the filterItem method work correctly.  Plus, lots of other existing eclipse descriptors implement this interface.  It's just 2 methods, getLocalId() & getPluginId().  Both of which can already implemented based on the existing info in CommonWizardDescriptor.
Comment 2 Michael D. Elder CLA 2006-09-11 16:51:16 EDT
Amy,

   The patch looks good. This is the correct approach. The only change I would suggest is that the check "!WorkbenchActivityHelper.filterItem(descriptor)" be moved to be the first check in the if statement, since it should be faster than the Core Expression check. 

We should also update the documentation to reflect this.

Boris and Mike W/V -- can you review this as well? 

+1
Comment 3 Boris Bokowski CLA 2006-09-11 22:55:06 EDT
Please attach the final patch to be released into the R3_2_maintenance stream. From a first look at CommonWizardDescriptorManager, it seems that getEnabledCommonWizardDescriptorIds should be changed as well.  Although this method is internal to the common navigator and not currently called, there might be clients who call it anyway, or the common navigator might be changed to call it in the future.
Comment 4 Michael D. Elder CLA 2006-09-12 09:40:37 EDT
Created attachment 49931 [details]
Patches CommonWizardDescriptorManager.isVisible() to check the Eclipse Capabilities activation
Comment 5 Michael D. Elder CLA 2006-09-12 09:46:51 EDT
Created attachment 49932 [details]
Adds wizard extensions to test the patch

Adds tests to o.e.ui.tests.navigator to verify the patch.
Comment 6 Michael Valenta CLA 2006-09-12 09:59:12 EDT
The patch looks good. It doesn't work for the Team Synchronization case but that is due to a problem in Team and is not critical for 3.2.1 since we have another mechanism to minimize the number of content providers involved. I have entered bug 157034 to request that Team respect capabilities when performing a model based synchronization.
Comment 7 Boris Bokowski CLA 2006-09-12 13:35:59 EDT
The updated patch looks good.  Michael, please release this into HEAD as well.
Comment 8 Mike Wilson CLA 2006-09-12 14:03:25 EDT
+1
Comment 9 Michael D. Elder CLA 2006-09-12 14:16:33 EDT
Fixed and released to R_3_2_maintenance. 
Comment 10 Mike Wilson CLA 2006-09-27 10:32:53 EDT
Q: Why is this bug still open?
Comment 11 Michael D. Elder CLA 2006-09-27 13:13:44 EDT
I left it open to keep track porting it to 3.3, but that has been done. 

Closing.