Community
Participate
Working Groups
To add CDT Mylyn support, interfaces are required to store a String handle for a model element which can be used later to retrieve the model element. The handle is stable across Workspace sessions. For Java, the IJavaElement interface provides getHandleIdentifier() and the JavaCore class provides a create(String handle) method. It is proposed that corresponding CDT interfaces be added. Thus, org.eclipse.cdt.core.model.ICElement interface needs to add: public String getHandleIdentifier(); and org.eclipse.cdt.core.model.CoreModel needs to add: public ICElement create(String handle);
Cool. I have no problem with that.
(In reply to comment #0) > It is proposed that corresponding CDT interfaces be added. Thus, > org.eclipse.cdt.core.model.ICElement interface needs to add: > public String getHandleIdentifier(); > and org.eclipse.cdt.core.model.CoreModel needs to add: > public ICElement create(String handle); Are you going to provide a patch for that or are you expecting us to provide API and implementation?
Created attachment 91253 [details] Sample CDT handle/model element code example
(In reply to comment #2) > (In reply to comment #0) > > It is proposed that corresponding CDT interfaces be added. Thus, > > org.eclipse.cdt.core.model.ICElement interface needs to add: > > public String getHandleIdentifier(); > > and org.eclipse.cdt.core.model.CoreModel needs to add: > > public ICElement create(String handle); > > Are you going to provide a patch for that or are you expecting us to provide > API and implementation? > I am expecting you to provide implementation if you are ok with the proposed API (which matches the JDT support). I personally hacked together a working implementation that has a single static routine for creating the handles and one for deciphering them. I have included my hacks as an attachment if that is of any help.
I am going to add the API + implementation.
The API is in place. I added a JUnit test to verify basic functionality. Note that binary elements (i.e. the Binaries and Archives containers and everythin below) are not supported. The identifier created for those elements will be that of the project. I did some tests with the plug-in attached to bug 162558, but due to exceptions I am not quite sure how well it all plays together.