I am currently working on a little Eclipse plugin and I have to deal with the classic 'plugin.xml' stuff, such as the creation of a nature:
<extension
id="aplugin.natures.MyNature.NATURE_ID.id"
name="Sample Project Nature"
point="org.eclipse.core.resources.natures">
Now in this particular example, I must, somewhere in my plugin code, give this 'id' as a String to some Eclipse function. So I need to create a specific class like:
package aplugin.natures;
public class MyNature implements IProjectNature {
public static final String NATURE_ID = "aplugin.natures.MyNature.NATURE_ID.id"; //$NON-NLS-1$
}
And here comes my problem, I got some copy and paste of my 'id'. I must admit that I am not very proud of it.
So my question is, does someone know a way to use the 'NATURE_ID' field in the 'MyNature' class directly in the 'plugin.xml' file ?.
In the end I wish to write something like:
<extension id="${aplugin.natures.MyNature.NATURE_ID}" ... >