Bug 15813 - [Team FAQ] how to add Team support
Summary: [Team FAQ] how to add Team support
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Platform-VCM-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: faq
Depends on:
Blocks:
 
Reported: 2002-05-11 13:06 EDT by Kevin McGuire CLA
Modified: 2004-03-15 21:51 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin McGuire CLA 2002-05-11 13:06:08 EDT
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
>
Comment 1 Kevin McGuire CLA 2002-05-15 01:13:03 EDT
(for FAQ'ing)
Comment 2 Jean-Michel Lemieux CLA 2004-03-15 21:51:31 EST
All of this is actually doc'd in the Team ISV section.