A nature is created by implementing the IProjectNature
interface. This will be used to create a MinimarkNature
, which will allow projects to be associated with the MinimarkBuilder
. Perform the following steps:
Create a class called
MinimarkNature
in thecom.packtpub.e4.minimark.ui
package:public class MinimarkNature implements IProjectNature { public static final String ID ="com.packtpub.e4.minimark.ui.MinimarkNature"; private IProject project; public IProject getProject() { return project; } public void setProject(IProject project) { this.project = project; } public void configure() throws CoreException { } public void deconfigure() throws CoreException { } }
The purpose of a nature is to assist by adding (or configuring) the builders, which are associated by an ID. To make cross-referencing possible, define a constant in the
MinimarkBuilder
which can be used to refer to it by the nature:public class MinimarkBuilder extends IncrementalProjectBuilder...