Given an IProject can I determine if it is shared in RTC
Hi,
I am writing a eclipse plugin that will be passed an IFile and IProject. I would like to determine if the project is shared in RTC SCM, if so, what is the ITeamRepository, the workspace repository, the component.
From this information I will be able to retrieve related files that may not be loaded into the eclipse workspace.
Once I know the relevant ITeamRepository, the workspace repo and the component, I can take it from there, so just the start bit would be appreciated please.
Cheers,
Michael Baylis
IBM CICS TS System Tester
Hursley
I am writing a eclipse plugin that will be passed an IFile and IProject. I would like to determine if the project is shared in RTC SCM, if so, what is the ITeamRepository, the workspace repository, the component.
From this information I will be able to retrieve related files that may not be loaded into the eclipse workspace.
Once I know the relevant ITeamRepository, the workspace repo and the component, I can take it from there, so just the start bit would be appreciated please.
Cheers,
Michael Baylis
IBM CICS TS System Tester
Hursley
2 answers
Found it:-
IShare contains the information I require
I'm a happy bunny. :D
IShareable shareable = (IShareable)modelFile.getAdapter(IShareable.class);
if (shareable == null) {
return;
}
IProject project = modelFile.getProject();
RepositoryProvider provider = RepositoryProvider.getProvider(project);
if (provider == null) {
return;
}
try {
IShare share = shareable.getShare(new NullProgressMonitor());
System.out.println("Boo");
} catch (FileSystemException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
IShare contains the information I require
I'm a happy bunny. :D