Community
Participate
Working Groups
From newsgroup. (Reporting to bugzilla since can't see the FAQ from here) "James Moody" <James_Moody@oti.com> wrote in message news:3CDAD780.7010003@oti.com... > Marcelo Paternostro wrote: > > Hi, > > > > I would like to add team support on my navigation view. Instead of digging > > the Java IDE or the Navigator code by myself I decided to post this note so > > (1) probably I will get a answer from some one who already did it and (2) > > the information can be shared with others. > > > > I manage to figure out how we can add the icon decorator. Here the code to > > create the Viewer label provider > > > > CombinedDecoratingLabelProvider labelProvider = new > > CombinedDecoratingLabelProvider(new MyLabelProvider(true), > > PlatformUI.getWorkbench().getDecoratorManager()); > > > > Now my questions are: > > > > (1) How do I know if the decorator preference is changed? And, maybe more > > important, how to I get a notification on this change? > > > > (2) I found out that team operations on IContainers are notified to > > ResourceChangeListeners as a (getKind()==change), but I not able to identify > > any special information on the "flag" attribute of the delta. What I am > > trying to accomplish here is refreshing my navigator only when there was a > > team operation. > > > > (3) Is the team menu a "global" and "non-internal" facility that we can just > > instanciate and add to our view? > > > > TIA > > > > > > Regarding getting Team actions on items in your view: > > Look at the definition of the CVS actions in > org.eclipse.team.ccvs.ui/plugin.xml and you will see that many of the > actions you want are contributed to objects of type IResource, IFile, > IContainer, etc. Also note that they have the adaptable="true" flag set. > This means that any view that asks for object menu contributions will > get these actions IF the selected object is an IResource, or if it > adapts to an IResource (for example). > > To make your view actually get object contributions, see > IWorkbenchPartSite.registerContextMenu(). As an example, the class > RepositoriesView essentially does what you want to do. > > Note that this will also give you tons of other actions that apply to > files/resources/containers as well; not just the team actions. > > Hope this helps, > > james >
(for FAQ'ing)
All of this is actually doc'd in the Team ISV section.