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

Link Eclipse file object with RTC one

Hello, I'm trying to find a way to map eclipse IFile resource with RTC IFileItem. Simply I want to receive from eclipse command selection a RTC IFileItem object. I was able to establish how to get IFile but it's not what I need. Currently implementation is following:

ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
    IStructuredSelection ssel = (IStructuredSelection) selection;
    Object obj = ssel.getFirstElement();
    IFile selectedFile = (IFile) Platform.getAdapterManager().getAdapter(obj, IFile.class);
    if (selectedFile == null) {
        if (obj instanceof IAdaptable) {
            selectedFile = (IFile) ((IAdaptable) obj).getAdapter(IFile.class);
        }
    }
    if (selectedFile != null) {
        //do sth
    }
}

Moreover is there a way to check file path relying on LoadRule? Let's say that I need to get path of particular file from one LoadRule in other LoadRule.   

0 votes



One answer

Permanent link

I found following topic:
https://jazz.net/forum/questions/241349/what-is-the-java-api-to-check-the-loaded-project-in-sandbox-belong-to-which-rtc-component

It seems that it could help, but I'm not able to found IShareable class in documentation, looks like it was deleted. But what is replacement for it?

0 votes

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,927

Question asked: Oct 10 '17, 4:39 a.m.

Question was seen: 1,846 times

Last updated: Oct 11 '17, 5:17 a.m.

Confirmation Cancel Confirm