RepositoryFilesView - API ?
I want to write code that will display specific file in repository files view, based on its local path.
I found out that the view com.ibm.team.internal.filesystem.ui.views.repositoryfiles.RepositoryFilesView does not provide method to get the tree viewer of the view, so it seems that I'm unable to implement the requested behavior.
Is this correct ? Is there a way to get access to the tree viewer ?
Thanks,
Gidi
Accepted answer
Comments
Hi David,
Thanks for your reply.
Is there a public way to select an element (IVersionable, I guess) in the repository files view ? When I try to do so with reflections through the tree viewer I face lots of issues.
Thanks,
Gidi
There is no public way to select an element in the Repository Files view. Also keep in mind that initially the Repository Files view is collapsed. It uses a lazy fetching approach, where a query is run against the server only when the user expands a particular node (folder or component), so not all 'nodes' are known upfront.
The TreeViewer that this view uses is in this field:
private SimpleTreeViewer viewer;
If the node that you want to select is known somehow, then I see there is a method
SimpleTreeviewer.selectAndReveal(ITreeSelection ss)
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jul 19 '16, 2:43 a.m.Gidi, that are internal API's that very few people will have ever looked at. As it is internal API why should it provide the internals?
Gidi Gal
Jul 19 '16, 3:39 a.m.Hi Ralph,
Thanks for your reply. I wanted to add automation that will receive file path and will focus on the related element in repository files' view. Such functionality does not exists in RTC UI: for example, if you are looking at a file in the pending changes view and you want to find the related file in the repository files, you have to click on a component, show it in repository files and then manually find it inside. I understand that the repository files view is internal, I hoped there's still a way to get access to its tree. I added a similar capability to the pending changes view. Luckily, this view is not internal and does supply access to its tree viewer.