It's all about the answers!

Ask a question

Link Eclipse file object with RTC one


Michael Ron (307) | asked Oct 10 '17, 4:39 a.m.
edited Oct 10 '17, 6:26 a.m.

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.   

One answer



permanent link
Michael Ron (307) | answered Oct 11 '17, 5:17 a.m.

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?

Your answer


Register or 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.