Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RepositoryFilesView - API ?

Hello to the forum members,

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

0 votes

Comments

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?

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.


Accepted answer

Permanent link
'com.ibm.team.internal.filesystem.ui.views.repositoryfiles.RepositoryFilesView' is internal and there is no method to get the tree viewer that is used in this class. In fact, even the Pending Changes view code should have bee put in a package that has 'internal' in it (however it looks like this was missed). In general though, all UI code should be treated as internal as it can and will change in future releases. As a rule of thumb, unless the code is included in the downloadable "Plain Java Client Libraries API documentation" zip (ex: https://jazz.net/downloads/rational-team-concert/releases/6.0.2/RTC-Client-plainJavaLib-API-javadoc-6.0.2.zip) it should be treated as internal (Note: the SCM UI code does not exist in that download). However you could always take a slightly hacky approach, and use Java reflection to pull out the tree viewer (which is stored as a Java field of the class) (but always remember that all UI code might change in the future).
Michael Valenta selected this answer as the correct answer

0 votes

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)

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,935
× 1,202

Question asked: Jul 18 '16, 11:08 a.m.

Question was seen: 2,590 times

Last updated: Aug 05 '16, 3:15 p.m.

Confirmation Cancel Confirm