Bug 124882 - [Model Sync] Support third party action contributions to a model sync
Summary: [Model Sync] Support third party action contributions to a model sync
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M1   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatbug
: 142275 (view as bug list)
Depends on:
Blocks: 138303
  Show dependency tree
 
Reported: 2006-01-23 12:05 EST by Michael Valenta CLA
Modified: 2006-06-22 22:20 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2006-01-23 12:05:57 EST
Currently, we allow only a single association between a model provider and content extension. It would be good to also support the contribution of actions from third parties. Use of object contributions is dangerous as existing contributions may assume that the target elements (IResource or otherwise) exist and this is not the case in a model sync. 

The best approach appears to support the declaration of an actionProvider that is team aware (without an association to a modelProvider). We would need to work out the interation between these independant acitons and the active buffer.
Comment 1 Michael Valenta CLA 2006-02-10 15:29:40 EST
Not for 3.2
Comment 2 Michael Valenta CLA 2006-05-24 14:14:47 EDT
*** Bug 142275 has been marked as a duplicate of this bug. ***
Comment 3 Mik Kersten CLA 2006-06-13 23:32:48 EDT
Great to see this on for 3.3 M1.  I think that this is important item for 3.3 because it is bad for the Platform to be removing extensibility (e.g. Mylar bug 138303).  A custom actionProvider seems fine, and I assume that we will be able to add contributions per object type via specifying an enablement?
Comment 4 Michael Valenta CLA 2006-06-14 09:03:55 EDT
The way I see it working is that you would define a Common Navigator action provider and use another exension point to associate it with Team synchronizations. The CN action provider extension point supports the use of enablement rules so you could specify which objct types your actions apply to.
Comment 5 Mik Kersten CLA 2006-06-14 12:05:07 EDT
Sounds very good to me (I've been using the CN actionProvider extension point for custom navigatorContent).  
Comment 6 Michael Valenta CLA 2006-06-22 14:29:27 EDT
Actually, I have determined that you can add third party actions without any modifications to the 3.2 code base. First you need to define an action provider.

<extension point="org.eclipse.ui.navigator.navigatorContent">
   <actionProvider           class="org.eclipse.team.examples.model.ui.mapping.ThirdPartyActionProvider"
     id="org.eclipse.team.examples.model.ThirdPartyActionProvider">
     <enablement>
       <adapt type="org.eclipse.core.resources.mapping.ResourceMapping"/>
     </enablement>
   </actionProvider>
</extension>

Then you ned to bind it to a particular synchronization type. Here's how to bind it to the CVS workspace synchronization.

<extension point="org.eclipse.ui.navigator.viewer">
   <viewerActionBinding
      viewerId="org.eclipse.team.cvs.ui.workspaceSynchronization">
        <includes>
           <actionExtension
       pattern="org.eclipse.team.examples.model.ThirdPartyActionProvider"/>
        </includes>
   </viewerActionBinding>
</extension>

I have released to HEAD an example action provider in the org.eclipse.team.examples.filesystem plugin.
Comment 7 Mik Kersten CLA 2006-06-22 22:20:58 EDT
Beautiful.  Thanks for the clear pointers Michael, I added the actionProvider as above and Mylar bug 124882 is now resolved. 

This has turned from a concern about Platform foregoing extensibility into a very nice story about how the consistency of Team using the Common Navigator framework means that third parties can make use of the extensibility of that framework.  So I'm tagging it as greatbug (wouldn't it be nice if more greatbugs resolved themselves...).  Feel free to remove the tag if you disagree, but thanks to the pains I have gone through extending the 'extensible' NetBeans, JBuilder, and VS, I have come to put great value on Eclipse's *ease* of extensibility and see it as key to a platform that drives innovation.