Example usage for org.eclipse.jdt.apt.core.util AptPreferenceConstants APT_PROCESSANNOTATIONS

List of usage examples for org.eclipse.jdt.apt.core.util AptPreferenceConstants APT_PROCESSANNOTATIONS

Introduction

In this page you can find the example usage for org.eclipse.jdt.apt.core.util AptPreferenceConstants APT_PROCESSANNOTATIONS.

Prototype

String APT_PROCESSANNOTATIONS

To view the source code for org.eclipse.jdt.apt.core.util AptPreferenceConstants APT_PROCESSANNOTATIONS.

Click Source Link

Usage

From source file:org.eclipse.gmt.mod.infra.common.core.internal.utils.ProjectUtils.java

License:Open Source License

public static void enableAPT(final IProject project) {
    IJavaProject javaProject = JavaCore.create(project);
    if (javaProject != null) {
        try {//from   w  w w. j a va 2 s  . c o m
            IScopeContext context = new ProjectScope(project);
            IEclipsePreferences node = context.getNode(AptPreferenceConstants.APT_STRING_BASE + ".core"); //$NON-NLS-1$
            node.put(AptPreferenceConstants.APT_ENABLED, "true"); //$NON-NLS-1$
            node.sync();
            IEclipsePreferences javaNode = context.getNode(JavaCore.PLUGIN_ID);
            javaNode.put(AptPreferenceConstants.APT_PROCESSANNOTATIONS, "enabled"); //$NON-NLS-1$
            javaNode.sync();
        } catch (Exception e) {
            log.error(e.getMessage() + "  --  Error enabling apt processing");
        }
    }
}